v7.0 - YOLOv5 SOTA Realtime Instance Segmentation #10258
Replies: 4 comments 10 replies
-
@glenn-jocher very nice work! Can I ask what's the insseg head design in this yolov5 version? Is it using sort of dense prediction for mask or just like YOLACT style? |
Beta Was this translation helpful? Give feedback.
-
Hello, very nice the segmentation function in yolov5. I would like to keep this without a commandline. If someone already has an example, I (and I'm sure others) would be happy if it were posted here. Peter |
Beta Was this translation helpful? Give feedback.
-
I have a doubt.
|
Beta Was this translation helpful? Give feedback.
-
预训练模型下载不下来 |
Beta Was this translation helpful? Give feedback.
-
Our new YOLOv5 v7.0 instance segmentation models are the fastest and most accurate in the world, beating all current SOTA benchmarks. We've made them super simple to train, validate and deploy. See full details in our Release Notes and visit our YOLOv5 Segmentation Colab Notebook for quickstart tutorials.
Our primary goal with this release is to introduce super simple YOLOv5 segmentation workflows just like our existing object detection models. The new v7.0 YOLOv5-seg models below are just a start, we will continue to improve these going forward together with our existing detection and classification models. We'd love your feedback and contributions on this effort!
This release incorporates 280 PRs from 41 contributors since our last release in August 2022.
Important Updates
python train.py --cache ram
will now scan available memory and compare against predicted dataset RAM usage. This reduces risk in caching and should help improve adoption of the dataset caching feature, which can significantly speed up training. (YOLOv5 AutoCache Update #10027 by @glenn-jocher)New Segmentation Checkpoints
We trained YOLOv5 segmentations models on COCO for 300 epochs at image size 640 using A100 GPUs. 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 notebooks for easy reproducibility.
(pixels)
50-95
50-95
300 epochs
A100 (hours)
ONNX CPU
(ms)
TRT A100
(ms)
(M)
@640 (B)
lr0=0.01
andweight_decay=5e-5
at image size 640 and all default settings.Runs logged to https://wandb.ai/glenn-jocher/YOLOv5_v70_official
Reproduce by
python segment/val.py --data coco.yaml --weights yolov5s-seg.pt
Reproduce by
python segment/val.py --data coco.yaml --weights yolov5s-seg.pt --batch 1
export.py
.Reproduce by
python export.py --weights yolov5s-seg.pt --include engine --device 0 --half
New Segmentation Usage Examples
Train
YOLOv5 segmentation training supports auto-download COCO128-seg segmentation dataset with
--data coco128-seg.yaml
argument and manual download of COCO-segments dataset withbash data/scripts/get_coco.sh --train --val --segments
and thenpython train.py --data coco.yaml
.Val
Validate YOLOv5m-seg accuracy on ImageNet-1k dataset:
Predict
Use pretrained YOLOv5m-seg to predict bus.jpg:
Export
Export YOLOv5s-seg model to ONNX and TensorRT:
Changelog
🛠️ New Features and Bug Fixes (280)
* Improve classification comments by @glenn-jocher in https://github.com//pull/8997 * Update `attempt_download(release='v6.2')` by @glenn-jocher in https://github.com//pull/8998 * Update README_cn.md by @KieraMengru0907 in https://github.com//pull/9001 * Update dataset `names` from array to dictionary by @glenn-jocher in https://github.com//pull/9000 * [segment]: Allow inference on dirs and videos by @AyushExel in https://github.com//pull/9003 * DockerHub tag update Usage example by @glenn-jocher in https://github.com//pull/9005 * Add weight `decay` to argparser by @glenn-jocher in https://github.com//pull/9006 * Add glob quotes to detect.py usage example by @glenn-jocher in https://github.com//pull/9007 * Fix TorchScript JSON string key bug by @glenn-jocher in https://github.com//pull/9015 * EMA FP32 assert classification bug fix by @glenn-jocher in https://github.com//pull/9016 * Faster pre-processing for gray image input by @cher-liang in https://github.com//pull/9009 * Improved `Profile()` inference timing by @glenn-jocher in https://github.com//pull/9024 * `torch.empty()` for speed improvements by @glenn-jocher in https://github.com//pull/9025 * Remove unused `time_sync` import by @glenn-jocher in https://github.com//pull/9026 * Add PyTorch Hub classification CI checks by @glenn-jocher in https://github.com//pull/9027 * Attach transforms to model by @glenn-jocher in https://github.com//pull/9028 * Default --data `imagenette160` training (fastest) by @glenn-jocher in https://github.com//pull/9033 * VOC `names` dictionary fix by @glenn-jocher in https://github.com//pull/9034 * Update train.py `import val as validate` by @glenn-jocher in https://github.com//pull/9037 * AutoBatch protect from negative batch sizes by @glenn-jocher in https://github.com//pull/9048 * Temporarily remove `macos-latest` from CI by @glenn-jocher in https://github.com//pull/9049 * Add `--save-hybrid` mAP warning by @glenn-jocher in https://github.com//pull/9050 * Refactor for simplification by @glenn-jocher in https://github.com//pull/9054 * Refactor for simplification 2 by @glenn-jocher in https://github.com//pull/9055 * zero-mAP fix return `.detach()` to EMA by @glenn-jocher in https://github.com//pull/9056 * zero-mAP fix 3 by @glenn-jocher in https://github.com//pull/9058 * Daemon `plot_labels()` for faster start by @glenn-jocher in https://github.com//pull/9057 * TensorBoard fix in tutorial.ipynb by @glenn-jocher in https://github.com//pull/9064 * zero-mAP fix remove `torch.empty()` forward pass in `.train()` mode by @0zppd in https://github.com//pull/9068 * Rename 'labels' to 'instances' by @glenn-jocher in https://github.com//pull/9066 * Threaded TensorBoard graph logging by @glenn-jocher in https://github.com//pull/9070 * De-thread TensorBoard graph logging by @glenn-jocher in https://github.com//pull/9071 * Two dimensional `size=(h,w)` AutoShape support by @glenn-jocher in https://github.com//pull/9072 * Remove unused Timeout import by @glenn-jocher in https://github.com//pull/9073 * Improved Usage example docstrings by @glenn-jocher in https://github.com//pull/9075 * Install `torch` latest stable by @glenn-jocher in https://github.com//pull/9092 * New `@try_export` decorator by @glenn-jocher in https://github.com//pull/9096 * Add optional `transforms` argument to LoadStreams() by @glenn-jocher in https://github.com//pull/9105 * Streaming Classification support by @glenn-jocher in https://github.com//pull/9106 * Fix numpy to torch cls streaming bug by @glenn-jocher in https://github.com//pull/9112 * Infer Loggers project name by @AyushExel in https://github.com//pull/9117 * Add CSV logging to GenericLogger by @glenn-jocher in https://github.com//pull/9128 * New TryExcept decorator by @glenn-jocher in https://github.com//pull/9154 * Fixed segment offsets by @glenn-jocher in https://github.com//pull/9155 * New YOLOv5 v6.2 splash images by @glenn-jocher in https://github.com//pull/9142 * Rename onnx_dynamic -> dynamic by @glenn-jocher in https://github.com//pull/9168 * Inline `_make_grid()` meshgrid by @glenn-jocher in https://github.com//pull/9170 * Comment EMA assert by @glenn-jocher in https://github.com//pull/9173 * Fix confidence threshold for ClearML debug images by @HighMans in https://github.com//pull/9174 * Update Dockerfile-cpu by @glenn-jocher in https://github.com//pull/9184 * Update Dockerfile-cpu to libpython3-dev by @glenn-jocher in https://github.com//pull/9185 * Update Dockerfile-arm64 to libpython3-dev by @glenn-jocher in https://github.com//pull/9187 * Fix AutoAnchor MPS bug by @glenn-jocher in https://github.com//pull/9188 * Skip AMP check on MPS by @glenn-jocher in https://github.com//pull/9189 * ClearML's set_report_period's time is defined in minutes not seconds. by @HighMans in https://github.com//pull/9186 * Add `check_git_status(..., branch='master')` argument by @glenn-jocher in https://github.com//pull/9199 * `check_font()` on notebook init by @glenn-jocher in https://github.com//pull/9200 * Comment `protobuf` in requirements.txt by @glenn-jocher in https://github.com//pull/9207 * `check_font()` fstring update by @glenn-jocher in https://github.com//pull/9208 * AutoBatch protect from extreme batch sizes by @glenn-jocher in https://github.com//pull/9209 * Default AutoBatch 0.8 fraction by @glenn-jocher in https://github.com//pull/9212 * Delete rebase.yml by @glenn-jocher in https://github.com//pull/9202 * Duplicate segment verification fix by @glenn-jocher in https://github.com//pull/9225 * New `LetterBox(size)` `CenterCrop(size)`, `ToTensor()` transforms (#9213) by @glenn-jocher in https://github.com//pull/9213 * Add ClassificationModel TF export assert by @glenn-jocher in https://github.com//pull/9226 * Remove usage of `pathlib.Path.unlink(missing_ok=...)` by @ymerkli in https://github.com//pull/9227 * Add support for `*.pfm` images by @spacewalk01 in https://github.com//pull/9230 * Python check warning emoji by @glenn-jocher in https://github.com//pull/9238 * Add `url_getsize()` function by @glenn-jocher in https://github.com//pull/9247 * Update dataloaders.py by @glenn-jocher in https://github.com//pull/9250 * Refactor Loggers : Move code outside train.py by @AyushExel in https://github.com//pull/9241 * Update general.py by @glenn-jocher in https://github.com//pull/9252 * Add LoadImages._cv2_rotate() by @glenn-jocher in https://github.com//pull/9249 * Move `cudnn.benchmarks(True)` to LoadStreams by @glenn-jocher in https://github.com//pull/9258 * `cudnn.benchmark = True` on Seed 0 by @glenn-jocher in https://github.com//pull/9259 * Update `TryExcept(msg='...')`` by @glenn-jocher in https://github.com//pull/9261 * Make sure best.pt model file is preserved ClearML by @thepycoder in https://github.com//pull/9265 * DetectMultiBackend improvements by @glenn-jocher in https://github.com//pull/9269 * Update DetectMultiBackend for tuple outputs by @glenn-jocher in https://github.com//pull/9274 * Update DetectMultiBackend for tuple outputs 2 by @glenn-jocher in https://github.com//pull/9275 * Update benchmarks CI with `--hard-fail` min metric floor by @glenn-jocher in https://github.com//pull/9276 * Add new `--vid-stride` inference parameter for videos by @VELCpro in https://github.com//pull/9256 * [pre-commit.ci] pre-commit suggestions by @pre-commit-ci in https://github.com//pull/9295 * Replace deprecated `np.int` with `int` by @glenn-jocher in https://github.com//pull/9307 * Comet Logging and Visualization Integration by @DN6 in https://github.com//pull/9232 * Comet changes by @DN6 in https://github.com//pull/9328 * Train.py line 486 typo fix by @robinned in https://github.com//pull/9330 * Add dilated conv support by @YellowAndGreen in https://github.com//pull/9347 * Update `check_requirements()` single install by @glenn-jocher in https://github.com//pull/9353 * Update `check_requirements(args, cmds='')` by @glenn-jocher in https://github.com//pull/9355 * Update `check_requirements()` multiple string by @glenn-jocher in https://github.com//pull/9356 * Add PaddlePaddle export and inference by @kisaragychihaya in https://github.com//pull/9240 * PaddlePaddle Usage examples by @glenn-jocher in https://github.com//pull/9358 * labels.jpg names fix by @glenn-jocher in https://github.com//pull/9361 * Exclude `ipython` from hubconf.py `check_requirements()` by @glenn-jocher in https://github.com//pull/9362 * `torch.jit.trace()` fix by @glenn-jocher in https://github.com//pull/9363 * AMP Check fix by @glenn-jocher in https://github.com//pull/9367 * Remove duplicate line in setup.cfg by @zldrobit in https://github.com//pull/9380 * Remove `.train()` mode exports by @glenn-jocher in https://github.com//pull/9429 * Continue on Docker arm64 failure by @glenn-jocher in https://github.com//pull/9430 * Continue on Docker failure (all backends) by @glenn-jocher in https://github.com//pull/9432 * Continue on Docker fail (all backends) fix by @glenn-jocher in https://github.com//pull/9433 * YOLOv5 segmentation model support by @AyushExel in https://github.com//pull/9052 * Fix val.py zero-TP bug by @glenn-jocher in https://github.com//pull/9431 * New model.yaml `activation:` field by @glenn-jocher in https://github.com//pull/9371 * Fix tick labels for background FN/FP by @hotohoto in https://github.com//pull/9414 * Fix TensorRT exports to ONNX opset 12 by @glenn-jocher in https://github.com//pull/9441 * AutoShape explicit arguments fix by @glenn-jocher in https://github.com//pull/9443 * Update Detections() instance printing by @glenn-jocher in https://github.com//pull/9445 * AutoUpdate TensorFlow in export.py by @glenn-jocher in https://github.com//pull/9447 * AutoBatch `cudnn.benchmark=True` fix by @glenn-jocher in https://github.com//pull/9448 * Do not move downloaded zips by @glenn-jocher in https://github.com//pull/9455 * Update general.py by @glenn-jocher in https://github.com//pull/9454 * `Detect()` and `Segment()` fixes for CoreML and Paddle by @glenn-jocher in https://github.com//pull/9458 * Add Paddle exports to benchmarks by @glenn-jocher in https://github.com//pull/9459 * Add `macos-latest` runner for CoreML benchmarks by @glenn-jocher in https://github.com//pull/9453 * Fix cutout bug by @Oswells in https://github.com//pull/9452 * Optimize imports by @glenn-jocher in https://github.com//pull/9464 * TensorRT SegmentationModel fix by @glenn-jocher in https://github.com//pull/9465 * `Conv()` dilation argument fix by @glenn-jocher in https://github.com//pull/9466 * Update ClassificationModel default training `imgsz=224` by @glenn-jocher in https://github.com//pull/9469 * Standardize warnings with `WARNING😃 New Contributors (30)
* @KieraMengru0907 made their first contribution in https://github.com//pull/9001 * @cher-liang made their first contribution in https://github.com//pull/9009 * @0zppd made their first contribution in https://github.com//pull/9068 * @HighMans made their first contribution in https://github.com//pull/9174 * @ymerkli made their first contribution in https://github.com//pull/9227 * @spacewalk01 made their first contribution in https://github.com//pull/9230 * @VELCpro made their first contribution in https://github.com//pull/9256 * @DN6 made their first contribution in https://github.com//pull/9232 * @robinned made their first contribution in https://github.com//pull/9330 * @kisaragychihaya made their first contribution in https://github.com//pull/9240 * @hotohoto made their first contribution in https://github.com//pull/9414 * @Oswells made their first contribution in https://github.com//pull/9452 * @mucunwuxian made their first contribution in https://github.com//pull/9487 * @FeiGeChuanShu made their first contribution in https://github.com//pull/9512 * @zombob made their first contribution in https://github.com//pull/9542 * @gaziqbal made their first contribution in https://github.com//pull/9228 * @Forever518 made their first contribution in https://github.com//pull/9545 * @davidamacey made their first contribution in https://github.com//pull/9576 * @soumik12345 made their first contribution in https://github.com//pull/9652 * @senhorinfinito made their first contribution in https://github.com//pull/9668 * @KristenKehrer made their first contribution in https://github.com//pull/9654 * @paulguerrie made their first contribution in https://github.com//pull/9724 * @vladoossss made their first contribution in https://github.com//pull/9785 * @SSTato made their first contribution in https://github.com//pull/9879 * @janus-zheng made their first contribution in https://github.com//pull/10090 * @rusamentiaga made their first contribution in https://github.com//pull/10131 * @adumrewal made their first contribution in https://github.com//pull/10163 * @rkechols made their first contribution in https://github.com//pull/10133 * @triple-Mu made their first contribution in https://github.com//pull/10166This discussion was created from the release v7.0 - YOLOv5 SOTA Realtime Instance Segmentation.
Beta Was this translation helpful? Give feedback.
All reactions