v6.2 - YOLOv5 Classification Models, Apple M1, Reproducibility, ClearML and Deci.ai integrations #8996
Replies: 3 comments 10 replies
-
|
will you add keypoint task in this project later? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
These release notes refer to 6.3:
It is now late November. Is there any chance of a new tag/release coming soon? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This release incorporates 401 PRs from 41 contributors since our last release in February 2022. It adds Classification training, validation, prediction and export (to all 11 formats), and also provides ImageNet-pretrained YOLOv5m-cls, ResNet (18, 34, 50, 101) and EfficientNet (b0-b3) models.
My main goal with this release is to introduce super simple YOLOv5 classification workflows just like our existing object detection models. The new v6.2 YOLOv5-cls models below are just a start, we will continue to improve these going forward together with our existing detection models. We'd love your contributions on this effort!
Our next release, v6.3 is scheduled for September and will bring official instance segmentation support to YOLOv5, with a major v7.0 release later this year updating architectures across all 3 tasks - classification, detection and segmentation.
Important Updates
pip install clearmlwill enable the integration and allow users to track every training run in ClearML. This in turn allows users to track and compare runs and even schedule runs remotely. (ClearML experiment tracking integration #8620 by @thepycoder)python utils/benchmarks.py --weights yolov5s.pt --device 0for GPU benchmarks or--device cpufor CPU benchmarks (YOLOv5 Export Benchmarks for GPU #6963 by @glenn-jocher).torch>=1.12.0is now fully reproducible, and a new--seedargument can be used (default seed=0) (Training reproducibility improvements #8213 by @AyushExel).--device mps(full functionality is pending torch updates in General MPS op coverage tracking issue pytorch/pytorch#77764) (YOLOv5 Apple Metal Performance Shader (MPS) support #7878 by @glenn-jocher)New Classification Checkpoints
We trained YOLOv5-cls classification models on ImageNet for 90 epochs using a 4xA100 instance, and we trained ResNet and EfficientNet models alongside with the same default training settings to compare. We exported all models to ONNX FP32 for CPU speed tests and to TensorRT FP16 for GPU speed tests. We ran all speed tests on Google Colab Pro for easy reproducibility.
(pixels)
top1
top5
90 epochs
4x A100 (hours)
ONNX-CPU
(ms)
TensorRT-V100
(ms)
(M)
@224 (B)
lr0=0.001andweight_decay=5e-5at image size 224 and all default settings.Runs logged to https://wandb.ai/glenn-jocher/YOLOv5-Classifier-v6-2
Reproduce by
python classify/val.py --data ../datasets/imagenet --img 224Reproduce by
python classify/val.py --data ../datasets/imagenet --img 224 --batch 1export.py.Reproduce by
python export.py --weights yolov5s-cls.pt --include engine onnx --imgsz 224New Classification Model Usage Examples
Train
YOLOv5 classification training supports auto-download of MNIST, Fashion-MNIST, CIFAR10, CIFAR100, Imagenette, Imagewoof, and ImageNet datasets with the
--dataargument. To start training on MNIST for example use--data mnist.Val
Validate YOLOv5m-cls accuracy on ImageNet-1k dataset:
Predict
Use pretrained YOLOv5s-cls.pt to predict bus.jpg:
Export
Export a group of trained YOLOv5s-cls, ResNet and EfficientNet models to ONNX and TensorRT:
Changelog
🛠️ New Features and Bug Fixes (401)
OMP_NUM_THREADS=8by @glenn-jocher in DefaultOMP_NUM_THREADS=8#6770tauby @glenn-jocher in Update EMA decaytau#6769*.tstoVID_FORMATSby @glenn-jocher in Add*.tstoVID_FORMATS#6859--cache diskdeprecate*_npy/dirs by @glenn-jocher in Update--cache diskdeprecate*_npy/dirs #6876max_workspace_sizedeprecation notice by @glenn-jocher in Fix TRTmax_workspace_sizedeprecation notice #6856git_describe()to general.py by @glenn-jocher in Movegit_describe()to general.py #6918--halfhandling by @glenn-jocher in DetectMultiBackend()--halfhandling #6945torch==1.11.0+cu113by @glenn-jocher in Update Dockerfiletorch==1.11.0+cu113#6954cudavariable by @glenn-jocher in New val.pycudavariable #6957deviceupdate by @glenn-jocher in DetectMultiBackend() returndeviceupdate #6958emakey backward compatibility fix by @glenn-jocher in Modelemakey backward compatibility fix #6972Timeout()by OS (disable on Windows) by @glenn-jocher in ConditionalTimeout()by OS (disable on Windows) #7013ComputeLoss()indexing/speed improvements by @glenn-jocher inComputeLoss()indexing/speed improvements #7048git cloneinstead ofCOPYby @glenn-jocher in Update Dockerfile togit cloneinstead ofCOPY#7053check_anchor_order()in pixel-space not grid-space by @glenn-jocher in Fixcheck_anchor_order()in pixel-space not grid-space #7060y.tensor_split()by @glenn-jocher in Update detect.py non-inplace withy.tensor_split()#7062LOGGER.info()by @glenn-jocher in Update W&B message toLOGGER.info()#7064dacheck_anchor_order()condition by @glenn-jocher in Add non-zerodacheck_anchor_order()condition #7066check_anchor_order()in pixel-space not grid-space by @glenn-jocher in Fix2check_anchor_order()in pixel-space not grid-space #7067y.tensor_split()" by @glenn-jocher in Revert "Update detect.py non-inplace withy.tensor_split()" #7074if self.gr < 1:by @glenn-jocher in Update loss.py withif self.gr < 1:#7087tobjby @glenn-jocher in Update loss for FP16tobj#7088torch.split()1.7.0 compatibility fix by @glenn-jocher intorch.split()1.7.0 compatibility fix #7102pathlibfix by @glenn-jocher in Model summarypathlibfix #7104np.fromfile()Chinese image paths fix by @yeshanliu innp.fromfile()Chinese image paths fix #6979results.save(labels=False)option by @glenn-jocher in Add PyTorch Hubresults.save(labels=False)option #7129cv2.imwriteon non-ASCII paths by @CCRcmcpe in Fixcv2.imwriteon non-ASCII paths #7139detect.py --view-imgfor non-ASCII paths by @Zengyf-CVer in Fixdetect.py --view-imgfor non-ASCII paths #7093os.path.relpath()Windows bug by @glenn-jocher in Sidestepos.path.relpath()Windows bug #7158yolo.py --profileupdates by @glenn-jocher inyolo.py --profileupdates #7170C3()change by @glenn-jocher in RevertC3()change #7172ENV OMP_NUM_THREADS=8by @glenn-jocher inENV OMP_NUM_THREADS=8#7215--name cfgoption by @glenn-jocher in Add train.py--name cfgoption #7202fireprep updates by @glenn-jocher in CLIfireprep updates #7229www.youtube.comhostname by @glenn-jocher in Fixwww.youtube.comhostname #7242description_filefield by @glenn-jocher in Update setup.cfg todescription_filefield #7248nn.SiLU()by @glenn-jocher in Export with officialnn.SiLU()#7256Detect()for reduced ops by @glenn-jocher in Refactor out-of-placeDetect()for reduced ops #7257torch.split()replace slicing on out-of-place inference by @glenn-jocher intorch.split()replace slicing on out-of-place inference #7258--nmsand--agnostic-nmsby @leeflix in Enable TensorFlow ops for--nmsand--agnostic-nms#7281cv2.imread()patch with flags argument by @glenn-jocher in Updatecv2.imread()patch with flags argument #7287open(file) as ffixes by @glenn-jocher in Context manageropen(file) as ffixes #7289--weightsand--datacompatibility check by @glenn-jocher in val.py--weightsand--datacompatibility check #7292check_requirements(('pycocotools>=2.0',))by @glenn-jocher in Addcheck_requirements(('pycocotools>=2.0',))#7295tqdm.autoby @glenn-jocher in Usetqdm.auto#7311retry=3todownload()by @glenn-jocher in Addretry=3todownload()#7313if RANK in (-1, 0)by @glenn-jocher in Print dataset scan onlyif RANK in (-1, 0)#7337_make_grid()to modeldtypeby @glenn-jocher in Update_make_grid()to modeldtype#7346python benchmarks.py --testfor export-only by @glenn-jocher in Addpython benchmarks.py --testfor export-only #7350stride=32by @rglkt in DetectMultiBackend() defaultstride=32#7342unsafe_chunk()forchunk()by @glenn-jocher in Swapunsafe_chunk()forchunk()#7362opset<=12check by @glenn-jocher in Remove OpenVINO ONNXopset<=12check #7398git_describe()by @glenn-jocher in Updategit_describe()#7402tensorrtpip install check by @glenn-jocher in Removetensorrtpip install check #7439pbarfor DDP ranks > 0 by @glenn-jocher in Disablepbarfor DDP ranks > 0 #7440--halfsupport for FP16 CoreML exports with by @Cedric-Perauer in Add--halfsupport for FP16 CoreML exports with #7446Annotator()plotting by @glenn-jocher in Improved non-latinAnnotator()plotting #7488check_fonts()download toCONFIG_DIRfix by @glenn-jocher incheck_fonts()download toCONFIG_DIRfix #7489YOLOv5_AUTOINSTALLenvironment variable by @jkocherhans in AddedYOLOv5_AUTOINSTALLenvironment variable #7505utils/dockerby @glenn-jocher in Refactor Dockerfiles toutils/docker#7510plots=plotsby @glenn-jocher in Fix valplots=plots#7524--fileargument to build by @glenn-jocher in Add Docker--fileargument to build #7527cmds=()argument by @glenn-jocher in Update check_requirements() withcmds=()argument #7543--noplotsflag to suppress figures and images logging by @AyushExel in Add--noplotsflag to suppress figures and images logging #7534_verbose=Falsefix2 by @glenn-jocher in PyTorch Hub_verbose=Falsefix2 #7550results.print()when_verbose=Falseby @glenn-jocher in Enableresults.print()when_verbose=False#7558print(results)override for PyTorch Hub results by @glenn-jocher in Addprint(results)override for PyTorch Hub results #7559from yolov5 import utilsstatement by @Jack24658735 in Fixfrom yolov5 import utilsstatement #7578tqdm.autoby @glenn-jocher in Removetqdm.auto#7599--halfsupport for OpenVINO exports by @djmmoss in Add--halfsupport for OpenVINO exports #7615increment_path()robustness improvements by @glenn-jocher inincrement_path()robustness improvements #7628opencv-python>=4.1.1for Jetson Nano by @glenn-jocher in Reduceopencv-python>=4.1.1for Jetson Nano #7645scipy>=1.5to meet numpy constraints by @glenn-jocher in Bumpscipy>=1.5to meet numpy constraints #7646--dynamicwhen--halfis passed by @dmatos2012 in Disallow--dynamicwhen--halfis passed #7669FROM ubuntu:20.04by @glenn-jocher in Pin Docker-cpuFROM ubuntu:20.04#7677on_train_endcallback by @glenn-jocher in Updateon_train_endcallback #7716static_graph=Trueby @glenn-jocher in Implement DDPstatic_graph=True#6940utils/datasets.py->utils/dataloaders.pyby @glenn-jocher in Renameutils/datasets.py->utils/dataloaders.py#7799@threadeddecorator by @glenn-jocher in Add@threadeddecorator #7813TFDWConv()module by @glenn-jocher in New TensorFlowTFDWConv()module #7824TFCrossConv()module by @glenn-jocher in New TensorFlowTFCrossConv()module #7827c1 == c2check by @glenn-jocher in Fix TFDWConv()c1 == c2check #7842openvino-devwith OpenVINO Runtime inference by @GabrielDornelles in Replaceopenvino-devwith OpenVINO Runtime inference #7843depthwise_initializerfix by @glenn-jocher in TFDWConv()depthwise_initializerfix #7845--no-install-recommendsby @glenn-jocher in Update Dockerfile--no-install-recommends#7846libpython3.8-devby @glenn-jocher in Update Dockerfile-cpu installlibpython3.8-dev#7857depth_multiplierarg by @glenn-jocher in Add TFDWConv()depth_multiplierarg #7858cv2.resizeinterpolation fix by @glenn-jocher incv2.resizeinterpolation fix #7903DWConvTranspose2d()module by @glenn-jocher in AddDWConvTranspose2d()module #7881check_yaml()to benchmarks.py by @glenn-jocher in Addcheck_yaml()to benchmarks.py #7916--kerasargument for TF exports by @glenn-jocher in Add--kerasargument for TF exports #7921check_file()fix by @glenn-jocher in Windowscheck_file()fix #7938formatsvariable to avoidpdconflict by @glenn-jocher in Removeformatsvariable to avoidpdconflict #7993check_requirements()Windows fix by @glenn-jocher incheck_requirements()Windows fix #7997psutilandipythonto requirements.txt by @glenn-jocher in Addpsutilandipythonto requirements.txt #7998--conf > 0.001by @glenn-jocher in Add warning emoji ⚠️ on--conf > 0.001#8005protobuf==3.20.1by @glenn-jocher in Pin CIprotobuf==3.20.1#8015check_requirements()"" Windows double quote by @glenn-jocher incheck_requirements()"" Windows double quote #8016protobuf<=3.20.1by @glenn-jocher in Add requirements.txtprotobuf<=3.20.1#8017--save-periodepoch 0 by @glenn-jocher in Simplify and fix--save-periodepoch 0 #8042.detach()on bias init by @tcmyxc in.detach()on bias init #8044attempt_load()deserialize fix by @glenn-jocher inattempt_load()deserialize fix #8051ultralytics/yolov5repo by @glenn-jocher in Make Docker actions conditional onultralytics/yolov5repo #8060longtofloattensor on HUB macOS by @glenn-jocher in Fix torchlongtofloattensor on HUB macOS #8067opencv-python<4.6.0.66by @glenn-jocher in Docker GPU pip installopencv-python<4.6.0.66#8164dataset_stats()YAML checks by @glenn-jocher in Improveddataset_stats()YAML checks #8125process_batch()as numpy arrays by @glenn-jocher inprocess_batch()as numpy arrays #8254logging.ERRORonRANKnot in (0, 1) by @glenn-jocher inlogging.ERRORonRANKnot in (0, 1) #8284device_name="MYRIAD" for Intel NCS2comment by @glenn-jocher indevice_name="MYRIAD" for Intel NCS2comment #8327--dynamicexport on GPU by @glenn-jocher in Fix ONNX--dynamicexport on GPU #8378--local_rankarg comment by @pourmand1376 in Improve--local_rankarg comment #8409--halffix autocast images to FP16 by @glenn-jocher in TRT--halffix autocast images to FP16 #8435batch_sizesimilarly to TensorRT by @democat3457 in Expose OpenVINObatch_sizesimilarly to TensorRT #8437torch==1.12on Multi-GPU systems #8395) by @mjun0812 in Exclude torch==1.12.0, torchvision==0.13.0 (Fix #8395) #8497batch_sizesimilarly to TensorRT" by @glenn-jocher in Revert "Expose OpenVINObatch_sizesimilarly to TensorRT" #8510--hard-failargument to benchmarks for CI errors by @glenn-jocher in Add--hard-failargument to benchmarks for CI errors #8513batch_sizefrom OpenVINO similarly to TensorRT by @democat3457 in Properly exposebatch_sizefrom OpenVINO similarly to TensorRT #8514--halfarguments to export.py Usage examples by @glenn-jocher in Add--halfarguments to export.py Usage examples #8516--halffix by @glenn-jocher in XML export--halffix #8522LoadImages()with dataset YAML lists by @democat3457 in FixLoadImages()with dataset YAML lists #8517assert ncm == ncfix by @glenn-jocher in val.pyassert ncm == ncfix #8545thop>=0.1.0by @glenn-jocher in Addthop>=0.1.0#8558--optimizenot used with cuda device by @democat3457 in Assert--optimizenot used with cuda device #8569weight_decayvalue by @developer0hye in Explicitly setweight_decayvalue #8592scipy>=1.7.3by @glenn-jocher in Updatescipy>=1.7.3#8595tqdm>=4.64.0andthop>=0.1.1by @glenn-jocher in Updatetqdm>=4.64.0andthop>=0.1.1#8596pip install wheelto avoid legacysetup.py installby @glenn-jocher in Addpip install wheelto avoid legacysetup.py install#8597OMP_NUM_THREADS=1for macOS by @glenn-jocher in FixOMP_NUM_THREADS=1for macOS #8624torch.cuda.manual_seed_all()for DDP by @glenn-jocher in Settorch.cuda.manual_seed_all()for DDP #8688else:from load_image() by @glenn-jocher in Removeelse:from load_image() #8692HUBDatasetStats()class by @glenn-jocher in NewHUBDatasetStats()class #8716is_dockercheck by @maxstrobel in fix: brokenis_dockercheck #8711detect.py --updatelist bug by @glenn-jocher in Fixdetect.py --updatelist bug #8783compat _non_persistent_buffers_setby @glenn-jocher in Deprecate torch 1.6.0compat _non_persistent_buffers_set#8797Detect.inplace=Falsefor multithread-safe inference by @glenn-jocher inDetect.inplace=Falsefor multithread-safe inference #8801val.run(half=amp)by @glenn-jocher in Update train.py forval.run(half=amp)#8804ultralyticsororigindynamically by @pourmand1376 in Check git status on upstreamultralyticsororigindynamically #8694assert not is_docker()from GitHub checks by @glenn-jocher in Removeassert not is_docker()from GitHub checks #8813torch.nan_to_num(x)by @glenn-jocher in Remove hooktorch.nan_to_num(x)#8826/usr/src/appby @glenn-jocher in RUN git clone instead of COPY to/usr/src/app#8827smart_resume()by @glenn-jocher in Newsmart_resume()#8838--resumeby @glenn-jocher in Self-contained checkpoint--resume#8839--data coco128.yamlby @glenn-jocher in Add check_file(data) i.e.--data coco128.yaml#8851check_file->check_yamlby @glenn-jocher in export.py replacecheck_file->check_yaml#8852float64shapes by @glenn-jocher in Update dataloaders.py removefloat64shapes #8865--resumetraining from URL weights by @glenn-jocher in--resumetraining from URL weights #8882--resumetraining from URL weights fix by @glenn-jocher in--resumetraining from URL weights fix #8884smart_optimizer()improved reporting by @glenn-jocher insmart_optimizer()improved reporting #8887--search_delegatefix by @glenn-jocher in Edge TPU add--search_delegatefix #8902torchvision.utils.draw_bounding_boxesimport by @glenn-jocher in Scopetorchvision.utils.draw_bounding_boxesimport #8915torch==1.7.0to CI tests by @glenn-jocher in Addtorch==1.7.0to CI tests #8916--source 'path/*.jpg'glob example by @glenn-jocher in Fix--source 'path/*.jpg'glob example #8927destroy_process_group()on train end by @glenn-jocher in Remove DDPdestroy_process_group()on train end #8935smart_inference_mode()conditional decorator by @glenn-jocher in Newsmart_inference_mode()conditional decorator #8957.tarsupport for datasets by @glenn-jocher in Add.tarsupport for datasets #8963😃 New Contributors (41)
np.fromfile()Chinese image paths fix #6979cv2.imwriteon non-ASCII paths #7139--nmsand--agnostic-nms#7281stride=32#7342--halfsupport for FP16 CoreML exports with #7446YOLOv5_AUTOINSTALLenvironment variable #7505from yolov5 import utilsstatement #7578--halfsupport for OpenVINO exports #7615--dynamicwhen--halfis passed #7669openvino-devwith OpenVINO Runtime inference #7843.detach()on bias init #8044--local_rankarg comment #8409batch_sizesimilarly to TensorRT #8437Beta Was this translation helpful? Give feedback.
All reactions