-
-
Notifications
You must be signed in to change notification settings - Fork 16.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cutout bug #9452
Fix cutout bug #9452
Conversation
Signed-off-by: Junjie Zhang <[email protected]>
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 Hello @Oswells, thank you for submitting a YOLOv5 🚀 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:
- ✅ Verify your PR is up-to-date with
ultralytics/yolov5
master
branch. If your PR is behind you can update your code by clicking the 'Update branch' button or by runninggit pull
andgit merge master
locally. - ✅ Verify all YOLOv5 Continuous Integration (CI) checks are passing.
- ✅ Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee
@Oswells thanks for the PR! It looks like you are saying that the current box inputs are in the wrong format. Are you sure this is the case? |
Yes, I think the current box inputs are in the wrong format. from utils.datasets import create_dataloader
from utils.general import colorstr,init_seeds
from utils.plots import plot_images
import yaml
init_seeds(429)
hyp='data/hyps/hyp.scratch-low.yaml'
with open(hyp, errors='ignore') as f:
hyp = yaml.safe_load(f)
dataloader, dataset = create_dataloader( "test.txt",
480,
22 // 2,
32,
False,
hyp=hyp,
augment=True,
cache="ram",
rect=False,
rank=-1,
workers=4,
image_weights=False,
quad=False,
prefix=colorstr('train: '),
shuffle=False)
for imgs, targets, paths, _ in dataloader:
plot_images(imgs,targets) |
@Oswells I reviewed. You are absolutely right, the labels are in xywhn so the IoA computation is flawed. Your fix looks good! |
@Oswells PR is merged. Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐ |
Signed-off-by: Junjie Zhang [email protected]
When I use cutout, I find that even if the object is completely covered, its gt_label is still retained on the image.
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Refinement of cutout augmentation in data preprocessing to enhance object detection.
📊 Key Changes
xywhn2xyxy
function withinaugmentations.py
.cutout
function by ensuring it considers the IOA (Intersection over Area) of bounding boxes in the image coordinate space.🎯 Purpose & Impact
cutout
data augmentation technique used during training.