Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct image transforms for Yolo-NAS #2006

Open
VadimShabashov opened this issue May 28, 2024 · 0 comments
Open

Correct image transforms for Yolo-NAS #2006

VadimShabashov opened this issue May 28, 2024 · 0 comments

Comments

@VadimShabashov
Copy link

VadimShabashov commented May 28, 2024

馃挕 Your Question

It seems there are several places in the code where image transforms are defined for Yolo-NAS:

  • Predict method on pretrained model:
    yolo_nas = super_gradients.training.models.get("yolo_nas_s", pretrained_weights="coco").cuda()
    model_predictions = yolo_nas.predict(
        "https://deci-pretrained-models.s3.amazonaws.com/sample_images/beatles-abbeyroad.jpg"
    )
    In this case, transforms are defined in default_yolo_nas_coco_processing_params function in processing.py
    There are StandardizeImage and DetectionCenterPadding. No RGB to BGR transform.
  • Training with coco_detection_yolo_nas_dataset_params.yaml.
    Validation transforms include StandardizeImage, DetectionPadToSize (which is center padding), and RGB to BGR transform.
  • Also, there is a popular notebook for fine-tuning Yolo-NAS on the custom dataset: https://github.com/roboflow/notebooks/blob/main/notebooks/train-yolo-nas-on-custom-dataset.ipynb
    In this notebook coco_detection_yolo_format_train is used for dataset and dataloader creation. Transforms are defined in coco_detection_yolo_format_base_dataset_params.yaml. And there is DetectionPaddedRescale, which includes bottom right padding. No StandardizeImage or RGB to BGR transforms.

So, my question is which transforms should be used for training, validation, and prediction with Yolo-NAS?
Specifically, I'm interested in whether Yolo-NAS accepts RGB or BGR images, whether should images be normalized or not, and what is the proper way of padding (bottom right or center)?
I want to fine-tune the model with the same transforms that were used during training/validation to minimize differences in input data.

Versions

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant