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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

training width and height support non-square? #16388

Open
1 task done
XiangMichael opened this issue Sep 20, 2024 · 3 comments
Open
1 task done

training width and height support non-square? #16388

XiangMichael opened this issue Sep 20, 2024 · 3 comments
Labels
question Further information is requested Stale Stale and schedule for closing soon

Comments

@XiangMichael
Copy link

Search before asking

  • I have searched the Ultralytics YOLO issues and discussions and found no similar questions.

Question

Now does training width and height support non-square?

Additional

No response

@XiangMichael XiangMichael added the question Further information is requested label Sep 20, 2024
@UltralyticsAssistant
Copy link
Member

UltralyticsAssistant commented Sep 20, 2024

👋 Hello @XiangMichael, thank you for your interest in Ultralytics 🚀! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.

If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Join the Ultralytics community where it suits you best. For real-time chat, head to Discord 🎧. Prefer in-depth discussions? Check out Discourse. Or dive into threads on our Subreddit to share knowledge with the community.

Upgrade

Upgrade to the latest ultralytics package including all requirements in a Python>=3.8 environment with PyTorch>=1.8 to verify your issue is not already resolved in the latest version:

pip install -U ultralytics

Environments

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

Status

Ultralytics CI

If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

This is an automated response, but don't worry—an Ultralytics engineer will also assist you soon! 😊

Copy link
Collaborator

You can use rect=True. It will train on rectangular images. But it won't use a specific rectangular size. It would depend on your dataset. If all the images in your dataset has the same aspect ratio, then it will resize the longest side to imgsz and then pad to make the shorter side divisible by 32.

So if all the images in your dataset is 1280x720, it will resize them to 640x384 (360 + 24 pixels padded to make it divisible by 32).

But the images in your dataset are of different aspect ratios, it will calculate the shape of each batch based on the aspect ratios of the images in that particular batch.

Copy link

github-actions bot commented Dec 9, 2024

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

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 YOLO 🚀 and Vision AI ⭐

@github-actions github-actions bot added the Stale Stale and schedule for closing soon label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Stale Stale and schedule for closing soon
Projects
None yet
Development

No branches or pull requests

3 participants