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

Automatic Chinese fonts plotting #4951

Merged
merged 2 commits into from
Sep 27, 2021
Merged

Automatic Chinese fonts plotting #4951

merged 2 commits into from
Sep 27, 2021

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Sep 27, 2021

PR enables automatic Chinese character plotting with YOLOv5 now. No action is required from users to plot Chinese characters now.

detect: weights=yolov5s.pt, source=data/images, imgsz=[640, 640], conf_thres=0.25, iou_thres=0.45, max_det=1000, device=, view_img=False, save_txt=False, save_conf=False, save_crop=False, nosave=False, classes=None, agnostic_nms=False, augment=False, visualize=False, update=False, project=runs/detect, name=exp, exist_ok=False, line_thickness=3, hide_labels=False, hide_conf=False, half=False
YOLOv5 🚀 v5.0-467-g7aaa5b5 torch 1.9.1 CPU

Fusing layers... 
Model Summary: 224 layers, 7266973 parameters, 0 gradients
image 1/2 /Users/glennjocher/PycharmProjects/yolov5/data/images/bus.jpg: 640x480 4 欧洲和西班牙s, 1 bus, 1 fire hydrant, Done. (0.188s)
image 2/2 /Users/glennjocher/PycharmProjects/yolov5/data/images/zidane.jpg: 384x640 2 欧洲和西班牙s, 2 ties, Done. (0.148s)
Speed: 1.1ms pre-process, 168.1ms inference, 1.2ms NMS per image at shape (1, 3, 640, 640)
Results saved to runs/detect/exp4

zidane

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Refactoring image annotation by removing specific ASCII checks and improving international character support. 🌍✨

📊 Key Changes

  • Removed the is_ascii function and associated ASCII checks in various parts of the code. 🚮
  • Adjusted the Annotator class to more flexibly support international (non-ASCII) characters, including Chinese. 🈳
  • Simplified string handling by removing unnecessary variable reassignments and comments. 🛠️

🎯 Purpose & Impact

  • Enhanced Internationalization: By accommodating non-ASCII characters, YOLOv5 becomes more amenable to a global user base. 🌐
  • Improved Code Clarity: The refactoring clarifies the code and removes redundant functions, providing a cleaner codebase. 🧹
  • Flexible Image Annotation: The updates help ensure that annotations on images can include a broader range of characters, useful for labels with international text. 👁️‍🗨️

@glenn-jocher glenn-jocher linked an issue Sep 27, 2021 that may be closed by this pull request
@glenn-jocher glenn-jocher merged commit a820b43 into master Sep 27, 2021
@glenn-jocher glenn-jocher deleted the update/chinese_plots branch September 27, 2021 20:48
CesarBazanAV pushed a commit to CesarBazanAV/yolov5 that referenced this pull request Sep 29, 2021
* Automatic Chinese fonts plotting

* Default PIL=False
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* Automatic Chinese fonts plotting

* Default PIL=False
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.

How to display the Chinese label on th detetion box?
1 participant