我在Google Colab中使用Google drive安装的自定义数据集训练了Yolo4模型。我训练过的模型yolov4-custom_best。权重文件已经在驱动器文件夹中准备好了,并且我已经输入了我的训练图像,我想使用下面的代码从输入图像生成输出:
我最后的训练模型:
!./darknet detector train data/obj.data cfg/yolov4-tiny-custom.cfg yolov4-tiny.conv.29 -dont_show -map
显示结果:
disp('./chart_yolov4-tiny-custom.png')
我的测试图像代码:但它显示错误
!python darknet_images.py --thresh 0.2 --input ../b076ad266891d7aa.jpg --output ../demo_out --weights ../training/yolov4-custom_best.weights --config_file ./cfg/yolov4-custom.cfg --data_file ./data/obj.data
生成错误:
usage: darknet_images.py [-h] [--input INPUT] [--batch_size BATCH_SIZE]
[--weights WEIGHTS] [--dont_show] [--ext_output]
[--save_labels] [--config_file CONFIG_FILE]
[--data_file DATA_FILE] [--thresh THRESH]
darknet_images.py: error: unrecognized arguments: --output ../demo_out
不要写为什么显示错误。请帮助…
!Python darknet_images.py——thresh 0.2——input ../b076ad266891d7aa.jpg——output ../demo_out——weights ./training/yolov4-custom_best./——config_file ./cfg/yolov4-custom.cfg——data_file ./data/obj.data .cfg在此代码中,您没有指定输出文件的类型,它是jpg,mp4等。我希望这对你有帮助:)