ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
49.49k stars 16.08k forks source link

Ignore anomaly #8512

Closed AchiadChenzi closed 2 years ago

AchiadChenzi commented 2 years ago

Search before asking

Description

I train Yolov5 in Google Colab and want to ignore anomaly. For instance, lets assume that anomaly is until 5 frames. So I need that the result will ignore those 5 frames and label them as the rest of the frames. for example: the program labels: 1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1. will ignore those '2' label and label them as '1'.

Use case

In my validation I've got only 80% and I want that the program will ignore those anomaly. I cant improve the training because those 2 labels in my train are very close to each other(look almost the same).

Additional

No response

Are you willing to submit a PR?

github-actions[bot] commented 2 years ago

👋 Hello @AchiadChenzi, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://ultralytics.com or email support@ultralytics.com.

Requirements

Python>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on macOS, Windows, and Ubuntu every 24 hours and on every commit.

glenn-jocher commented 2 years ago

@AchiadChenzi there's no official method to merge classes, but you could restructure your dataset to label those as a single class.

You can also train and validate in single class mode, which will merge all classes into one class. https://github.com/ultralytics/yolov5/blob/39d7a93619083cb8e37f5ef7708cf50b34e20ee1/val.py#L341

github-actions[bot] commented 2 years ago

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐!

AchiadChenzi commented 2 years ago

Export the labeling, go over the labels and ignore anomalies. I use high conf rate to get rid most of the wrong labels.

glenn-jocher commented 9 months ago

@AchiadChenzi understood! You can export labeled data from YOLOv5 to analyze and manually correct any anomalies. High confidence thresholds can also help filter out erroneous labels.

Feel free to refer to the Ultralytics Docs for specifics on exporting labels and adjusting confidence thresholds: https://docs.ultralytics.com/yolov5/

Let me know if you need further assistance!