webcam script update

This commit is contained in:
13339479676 2021-12-29 17:44:09 +08:00
parent 9011644ae7
commit 4eee91379d
2 changed files with 5 additions and 3 deletions

View File

@ -4,7 +4,7 @@
### :zap: 安装教程
#### :white_check_mark: 方法一
#### :white_check_mark: 方法一Linux Shell版
```shell
# 创建conda虚拟环境以python 3.8为例

View File

@ -59,8 +59,8 @@ def webcam_opencv(device_index, quit_key, is_autoSaveFrame, frame_saveDir, frame
if is_autoSaveFrame or is_headSaveFrame:
# 帧保存路径管理
frame_samePath = increment_path(Path(f"{frame_saveDir}") / "frames", exist_ok=False) # increment run
frame_samePath.mkdir(parents=True, exist_ok=True) # make dir
frame_samePath = increment_path(Path(f"{frame_saveDir}") / "frames", exist_ok=False) # 增量运行
frame_samePath.mkdir(parents=True, exist_ok=True) # 创建目录
frame_num = 0 # 帧数
while(1):
@ -99,6 +99,7 @@ def webcam_opencv(device_index, quit_key, is_autoSaveFrame, frame_saveDir, frame
if __name__ == '__main__':
# 参数
parse_args()
device_index = args.device
quit_key = args.quit
@ -115,6 +116,7 @@ if __name__ == '__main__':
if (quit_key == frame_capKey):
print(f'快捷键冲突!')
else:
# 调用webcam opencv
webcam_opencv(device_index, quit_key, is_autoSaveFrame, frame_saveDir, frame_nSave, is_headSaveFrame, frame_capKey, is_resizeFrame, resize_frame, resizeRatio_frame)
print(f'程序结束!')