PIL `.get_size()` deprecation fix (#302)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
pull/305/head
Glenn Jocher 2 years ago committed by GitHub
parent c42e44a021
commit 6e9645a603
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/ISSUE_TEMPLATE/bug-report.yml
  2. 2
      .github/ISSUE_TEMPLATE/feature-request.yml
  3. 8
      CONTRIBUTING.md
  4. 2
      README.zh-CN.md
  5. 2
      examples/tutorial.ipynb
  6. 2
      ultralytics/__init__.py
  7. 2
      ultralytics/yolo/utils/plotting.py

@ -80,6 +80,6 @@ body:
label: Are you willing to submit a PR?
description: >
(Optional) We encourage you to submit a [Pull Request](https://github.com/ultralytics/ultralytics/pulls) (PR) to help improve YOLOv8 for everyone, especially if you have a good understanding of how to implement a fix or feature.
See the YOLOv8 [Contributing Guide](https://github.com/ultralytics/ultralytics/blob/master/CONTRIBUTING.md) to get started.
See the YOLOv8 [Contributing Guide](https://github.com/ultralytics/ultralytics/blob/main/CONTRIBUTING.md) to get started.
options:
- label: Yes I'd like to help by submitting a PR!

@ -45,6 +45,6 @@ body:
label: Are you willing to submit a PR?
description: >
(Optional) We encourage you to submit a [Pull Request](https://github.com/ultralytics/ultralytics/pulls) (PR) to help improve YOLOv8 for everyone, especially if you have a good understanding of how to implement a fix or feature.
See the YOLOv8 [Contributing Guide](https://github.com/ultralytics/ultralytics/blob/master/CONTRIBUTING.md) to get started.
See the YOLOv8 [Contributing Guide](https://github.com/ultralytics/ultralytics/blob/main/CONTRIBUTING.md) to get started.
options:
- label: Yes I'd like to help by submitting a PR!

@ -45,8 +45,8 @@ changes** button. All done, your PR is now submitted to YOLOv8 for review and ap
To allow your work to be integrated as seamlessly as possible, we advise you to:
- ✅ Verify your PR is **up-to-date** with `ultralytics/ultralytics` `master` branch. If your PR is behind you can update
your code by clicking the 'Update branch' button or by running `git pull` and `git merge master` locally.
- ✅ Verify your PR is **up-to-date** with `ultralytics/ultralytics` `main` branch. If your PR is behind you can update
your code by clicking the 'Update branch' button or by running `git pull` and `git merge main` locally.
<p align="center"><img width="751" alt="Screenshot 2022-08-29 at 22 47 15" src="https://user-images.githubusercontent.com/26833433/187295893-50ed9f44-b2c9-4138-a614-de69bd1753d7.png"></p>
@ -97,8 +97,8 @@ In addition to the above requirements, for [Ultralytics](https://ultralytics.com
should be:
- ✅ **Current** – Verify that your code is up-to-date with current
GitHub [master](https://github.com/ultralytics/ultralytics/tree/main), and if necessary `git pull` or `git clone` a new
copy to ensure your problem has not already been resolved by previous commits.
GitHub [main](https://github.com/ultralytics/ultralytics/tree/main) branch, and if necessary `git pull` or `git clone`
a new copy to ensure your problem has not already been resolved by previous commits.
- ✅ **Unmodified** – Your problem must be reproducible without any modifications to the codebase in this
repository. [Ultralytics](https://ultralytics.com/) does not provide support for custom code ⚠.

@ -208,7 +208,7 @@ success = model.export(format="onnx") # 将模型导出为 ONNX 格式
## <div align="center">License</div>
- YOLOv8 在两种不同的 License 下可用:
- **GPL-3.0 License**: 查看 [License](https://github.com/ultralytics/yolov5/blob/master/LICENSE) 文件的详细信息。
- **GPL-3.0 License**: 查看 [License](https://github.com/ultralytics/ultralytics/blob/main/LICENSE) 文件的详细信息。
- **企业License**:在没有 GPL-3.0 开源要求的情况下为商业产品开发提供更大的灵活性。典型用例是将 Ultralytics 软件和 AI 模型嵌入到商业产品和应用程序中。在以下位置申请企业许可证 [Ultralytics 许可](https://ultralytics.com/license) 。
## <div align="center">联系我们</div>

@ -49,7 +49,7 @@
"source": [
"# Setup\n",
"\n",
"Pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/master/requirements.txt) and check PyTorch and GPU."
"Pip install `ultralytics` and [dependencies](https://github.com/ultralytics/ultralytics/blob/main/requirements.txt) and check PyTorch and GPU."
]
},
{

@ -1,6 +1,6 @@
# Ultralytics YOLO 🚀, GPL-3.0 license
__version__ = "8.0.4"
__version__ = "8.0.5"
from ultralytics.hub import checks
from ultralytics.yolo.engine.model import YOLO

@ -60,7 +60,7 @@ class Annotator:
if self.pil or not is_ascii(label):
self.draw.rectangle(box, width=self.lw, outline=color) # box
if label:
w, h = self.font.getsize(label) # text width, height
_, _, w, h = self.font.getbbox(label) # text width, height
outside = box[1] - h >= 0 # label fits outside box
self.draw.rectangle(
(box[0], box[1] - h if outside else box[1], box[0] + w + 1,

Loading…
Cancel
Save