-
-
Notifications
You must be signed in to change notification settings - Fork 16.1k
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
change bounding box label index to text #3578
Comments
👋 Hello @hjsg1010, 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://www.ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com. RequirementsPython 3.8 or later with all requirements.txt dependencies installed, including $ pip install -r requirements.txt EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf 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), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit. |
@hjsg1010 @kalenmike yes, your results are correct. The train mosaics only display the class index rather than the class name. You can see this in the Train Custom Data tutorial. We did this because the mosaics can get quite busy for high density datasets. The test dataset labels show the full name though, i.e. We're also developing dataset introspection tools as part of the new Ultralytics HUB. This should be ready sometime later on in summer 2021 at https://ultralytics.com |
oh, Thx for quick and kind reply. |
@glenn-jocher sorry for my poor English skills, and low knowledge on object detection code.. |
@hjsg1010 you can inline any Albumentations augmentations you want in the dataloader here: Lines 499 to 545 in 095197b
|
Thx for reply. Thankyou. |
@hjsg1010 good news 😃! Your original issue may now be fixed ✅ in PR #3882. This PR implements a YOLOv5 🚀 + Albumentations integration. The integration will automatically apply Albumentations transforms during YOLOv5 training if Get StartedTo use albumentations simply class Albumentations:
# YOLOv5 Albumentations class (optional, used if package is installed)
def __init__(self):
self.transform = None
try:
import albumentations as A
check_version(A.__version__, '1.0.0') # version requirement
self.transform = A.Compose([
A.Blur(p=0.1),
A.MedianBlur(p=0.1),
A.ToGray(p=0.01)],
bbox_params=A.BboxParams(format='yolo', label_fields=['class_labels']))
logging.info(colorstr('albumentations: ') + ', '.join(f'{x}' for x in self.transform.transforms))
except ImportError: # package not installed, skip
pass
except Exception as e:
logging.info(colorstr('albumentations: ') + f'{e}')
def __call__(self, im, labels, p=1.0):
if self.transform and random.random() < p:
new = self.transform(image=im, bboxes=labels[:, 1:], class_labels=labels[:, 0]) # transformed
im, labels = new['image'], np.array([[c, *b] for c, b in zip(new['class_labels'], new['bboxes'])])
return im, labels Example ResultExample UpdateTo receive this YOLOv5 update:
Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀! |
❔Question
Hi, thanks for your great research and sharing codes.
I am applying YOLOv5 to my custom dataset.
And during learning, the mosaic section on wandb.ai shows the figure below.
However, I want to change the bbox label index to text label, such as '118' changes to 'cheesecake'.
What should I fix in code? or do I have to change my annotation?
Currently the data folder are consists of
data_folder/
┣ images/
┃ ┣ train/
┃ ┣ valid/
┣ labels/
┃ ┣ train/
┃ ┣ valid/
┣ data_config.yaml
Additional context
The text was updated successfully, but these errors were encountered: