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

ultralytics 8.0.56 PyTorch 2.0 support and minor fixes #1538

Merged
merged 19 commits into from Mar 23, 2023
Merged

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Mar 21, 2023

๐Ÿ› ๏ธ PR Summary

Made with โค๏ธ by Ultralytics Actions

๐ŸŒŸ Summary

Enhancements in CI workflows, package installation, new model addition, and environment setup.

๐Ÿ“Š Key Changes

  • ๐Ÿ” Expanded CI triggers to run on updates branch pushes.
  • ๐Ÿš€ Improved GitHub Actions benchmark summaries for better log visibility.
  • ๐Ÿ› ๏ธ Fixed package installations to be more consistent without using -e '.[export]'.
  • ๐Ÿ’ป Dropped unnecessary social platform logos and replaced others with new platform logos (e.g. TikTok).
  • ๐Ÿค– Incorporated a new YOLOv8 model configuration file for object detection (yolov8-p2.yaml).
  • ๐Ÿ”ข Introduced a static method to reset IDs in the tracking code.
  • ๐Ÿ“ Added support for custom configuration directories via the YOLO_CONFIG_DIR environment variable.
  • ๐Ÿ“‰ Addressed a potential performance bottleneck in dataset loading.
  • ๐Ÿ–ผ๏ธ Streamlined image result plotting to support optional confidence display and added ID to annotations.
  • ๐Ÿ—๏ธ Enhanced environment checks for display capabilities and added support for the new is_kaggle check.
  • โœ… Enabled the previously commented out functionality to save txt prediction results.
  • โš™๏ธ Solved an issue with incorrect tensor dtype during segmentation training.

๐ŸŽฏ Purpose & Impact

  • ๐Ÿš€ Improves the continuous integration workflow, making development and testing more robust.
  • ๐ŸŒ Changes to package installation ensure more uniform reproducibility across different user setups.
  • โœจ Addition of a new YOLO model configuration could lead to better or more efficient object detection for users.
  • โœ”๏ธ Tracking ID reset allows for more accurate and controlled tracking sessions when using object tracking features.
  • ๐Ÿ–ฅ๏ธ Users can now specify a custom directory for storing yolov8 configurations, which increases flexibility.
  • ๐Ÿงน General cleanup of the social links in readme files could make the repository appear more organized and updated.
  • ๐Ÿ“Š Enhanced plotting functions lead to better visualization of predictions, which is helpful for end users analyzing detection results.
  • ๐Ÿ”„ Additional checks ensure that image display functions will work correctly in various environments, avoiding crashes on platforms where display is not supported.
  • ๐Ÿ“ The ability to save txt prediction results provides users with a necessary tool for downstream tasks, such as benchmarking or further analysis.
  • ๐Ÿ Python environment optimizations and bug fixes improve the overall stability and performance of yolov8.

@glenn-jocher glenn-jocher self-assigned this Mar 21, 2023
@glenn-jocher glenn-jocher linked an issue Mar 21, 2023 that may be closed by this pull request
2 tasks
N-Friederich and others added 7 commits March 21, 2023 12:58
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
@nikbobo
Copy link

nikbobo commented Mar 22, 2023

Does it support using PyTorch 2.0 compiled model to speed up?

@glenn-jocher
Copy link
Member Author

glenn-jocher commented Mar 22, 2023

@N-Friederich I can confirm MPS inference is working in this PR! Initial result is slower, and NMS is slower, but for same image sizes like webcam/video, the speedup boost is significant.

yolo predict device=mps

WARNING โš ๏ธ 'model' is missing. Using default 'model=yolov8n.pt'.
WARNING โš ๏ธ 'source' is missing. Using default 'source=/Users/glennjocher/PycharmProjects/ultralytics/ultralytics/assets'.
Ultralytics YOLOv8.0.56 ๐Ÿš€ Python-3.10.6 torch-2.0.0 MPS
YOLOv8n summary (fused): 168 layers, 3151904 parameters, 0 gradients, 8.7 GFLOPs

image 1/4 /Users/glennjocher/PycharmProjects/ultralytics/ultralytics/assets/bus.jpg: 640x480 4 persons, 1 bus, 1 stop sign, 381.9ms
image 2/4 /Users/glennjocher/PycharmProjects/ultralytics/ultralytics/assets/bus_4ch.png: 640x480 4 persons, 1 bus, 1 stop sign, 19.6ms
image 3/4 /Users/glennjocher/PycharmProjects/ultralytics/ultralytics/assets/bus_greyscale.jpg: 640x480 3 persons, 1 bus, 16.7ms
image 4/4 /Users/glennjocher/PycharmProjects/ultralytics/ultralytics/assets/zidane.jpg: 384x640 2 persons, 1 tie, 367.9ms
Speed: 5.3ms preprocess, 196.5ms inference, 23.1ms postprocess per image at shape (1, 3, 640, 640)

ExtReMLapin and others added 2 commits March 22, 2023 13:09
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
@glenn-jocher
Copy link
Member Author

Does it support using PyTorch 2.0 compiled model to speed up?

@N-Friederich is working on this but it seems we are running into problems. On my Macbook M2 I'm unable to compile and train without errors (unrelated to the export errors).

@N-Friederich
Copy link
Contributor

Does it support using PyTorch 2.0 compiled model to speed up?

@N-Friederich is working on this but it seems we are running into problems. On my Macbook M2 I'm unable to compile and train without errors (unrelated to the export errors).

@nikbobo Unfortunately, this is not quite as simple as I thought. We discuss this problem (A).
@glenn-jocher On my M2 Pro it runs without problems (MacBook Pro)

@glenn-jocher
Copy link
Member Author

@N-Friederich got it. Maybe I just have some environment issues. This PR definitely works, but torch.compile() won't work for me. It looks like the compile PR is also having issues that I don't understand.

@glenn-jocher glenn-jocher changed the title ultralytics 8.0.56 PyTorch 2.0 support and fixes ultralytics 8.0.56 PyTorch 2.0 support and minor fixes Mar 23, 2023
@glenn-jocher glenn-jocher merged commit 28e48be into main Mar 23, 2023
9 checks passed
@glenn-jocher glenn-jocher deleted the updates branch March 23, 2023 23:22
NagatoYuki0943 added a commit to NagatoYuki0943/yolov8-ultralytics that referenced this pull request Mar 24, 2023
`ultralytics 8.0.56` PyTorch 2.0 support and minor fixes (ultralytics#1538)
geoffrey-g-delhomme pushed a commit to geoffrey-g-delhomme/ultralytics that referenced this pull request Apr 18, 2023
โ€ฆ#1538)

Co-authored-by: N-Friederich <127681326+N-Friederich@users.noreply.github.com>
Co-authored-by: Uhrendoktor <36703334+Uhrendoktor@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com>
Co-authored-by: Aman Agarwal <amanag.11@gmail.com>
Co-authored-by: ExtReMLapin <3909752+ExtReMLapin@users.noreply.github.com>
Co-authored-by: Nadav Eidelstein <30617226+nodeav@users.noreply.github.com>
geoffrey-g-delhomme pushed a commit to geoffrey-g-delhomme/ultralytics that referenced this pull request Apr 18, 2023
โ€ฆ#1538)

Co-authored-by: N-Friederich <127681326+N-Friederich@users.noreply.github.com>
Co-authored-by: Uhrendoktor <36703334+Uhrendoktor@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com>
Co-authored-by: Aman Agarwal <amanag.11@gmail.com>
Co-authored-by: ExtReMLapin <3909752+ExtReMLapin@users.noreply.github.com>
Co-authored-by: Nadav Eidelstein <30617226+nodeav@users.noreply.github.com>
0iui0 pushed a commit to 0iui0/ultralytics that referenced this pull request Jan 3, 2024
โ€ฆ#1538)

Co-authored-by: N-Friederich <127681326+N-Friederich@users.noreply.github.com>
Co-authored-by: Uhrendoktor <36703334+Uhrendoktor@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com>
Co-authored-by: Aman Agarwal <amanag.11@gmail.com>
Co-authored-by: ExtReMLapin <3909752+ExtReMLapin@users.noreply.github.com>
Co-authored-by: Nadav Eidelstein <30617226+nodeav@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

training on Apple M1 chip using Metal Performance Shaders (MPS) float64 issue
8 participants