imc=im0.copy()ifsave_cropelseim0 #forsave_crop annotator=Annotator(im0,line_width=3,example=str(names))iflen(det):# Rescale boxes from img_size to im0 size det[:,:4]=scale_coords(img.shape[2:],det[:,:4],im0.shape).round()# Print resultsforcindet[:,-1].unique():n=(det[...
因为项目中用到的是YOLOv5-5.0版本,save_crop是6.0版本才开始有的接口,因此需要将6.0版本做一个迁移。 此篇博文主要用作代码备份,自用为主。 增加save_crop 增加save_crop需要复制很多类别,这里复制整理完毕,主要涉及以下三个文件,直接复制覆盖原文件就行。 detect.py importargparse importtime frompathlibimportPath...
prediction class coordinatesAlexeyAB/darknet#1411 Open Updated: May 07, 2020 I added the function of exporting the bounding box coordinates and classes names, confidence for each image in an input folder. Now it supports: Detect objects for multiple images in an input folder. ...