我正在尝试在Pycharm终端中使用face_recognition识别面部时剪切文件名,如下所示:
>face_recognition ./face_recognition/traversy_media/img/known ./face_recognition/traversy_media/img/unknown | cut -d ',' -f2
就像该视频(6:00)所示: “ Python人脸识别教程” 创建人:遍历媒体 https://www.youtube.com/watch?v=QSTnwsZj2yc&t=126s
但是当我运行代码时,它告诉我:
'cut' is not recognized as an internal or external command,
operable program or batch file.
我想问题出在'|'将“剪切”与我的代码分开 但我不知道该怎么办。
当我不使用'|'时它告诉我:
Usage: face_recognition [OPTIONS] KNOWN_PEOPLE_FOLDER IMAGE_TO_CHECK
Try "face_recognition --help" for help.
Error: no such option: -d
或者当我删除“ |”时和'-d':
Usage: face_recognition [OPTIONS] KNOWN_PEOPLE_FOLDER IMAGE_TO_CHECK
Try "face_recognition --help" for help.
Error: no such option: -f
答案 0 :(得分:0)
cut
在Windows上不可用,但是您有两种可能的解决方案。
for /f "tokens=2 delims=," %i in ("face_recognition ./face_recognition/traversy_media/img/known ./face_recognition/traversy_media/img/unknown") DO echo %i