diff --git a/README.md b/README.md index 07d09d92..4a236222 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ To request an Enterprise License please complete the form at [Ultralytics Licens -## Documentation +##
Documentation
See below for a quickstart installation and usage example, and see the [YOLOv8 Docs](https://docs.ultralytics.com) for full documentation on training, validation, prediction and deployment. @@ -98,7 +98,7 @@ See YOLOv8 [Python Docs](https://docs.ultralytics.com/usage/python) for more exa -## Models +##
Models
YOLOv8 [Detect](https://docs.ultralytics.com/tasks/detect), [Segment](https://docs.ultralytics.com/tasks/segment) and [Pose](https://docs.ultralytics.com/tasks/pose) models pretrained on the [COCO](https://docs.ultralytics.com/datasets/detect/coco) dataset are available here, as well as YOLOv8 [Classify](https://docs.ultralytics.com/tasks/classify) models pretrained on the [ImageNet](https://docs.ultralytics.com/datasets/classify/imagenet) dataset. [Track](https://docs.ultralytics.com/modes/track) mode is available for all Detect, Segment and Pose models. @@ -203,7 +203,7 @@ See [Classification Docs](https://docs.ultralytics.com/tasks/classify/) for usag -## Integrations +##
Integrations
Our key integrations with leading AI platforms extend the functionality of Ultralytics' offerings, enhancing tasks like dataset labeling, training, visualization, and model management. Discover how Ultralytics, in collaboration with [Roboflow](https://roboflow.com/?ref=ultralytics), ClearML, [Comet](https://bit.ly/yolov8-readme-comet), Neural Magic and [OpenVINO](https://docs.ultralytics.com/integrations/openvino), can optimize your AI workflow. @@ -231,14 +231,14 @@ Our key integrations with leading AI platforms extend the functionality of Ultra | :--------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------: | | Label and export your custom datasets directly to YOLOv8 for training with [Roboflow](https://roboflow.com/?ref=ultralytics) | Automatically track, visualize and even remotely train YOLOv8 using [ClearML](https://cutt.ly/yolov5-readme-clearml) (open-source!) | Free forever, [Comet](https://bit.ly/yolov8-readme-comet) lets you save YOLOv8 models, resume training, and interactively visualize and debug predictions | Run YOLOv8 inference up to 6x faster with [Neural Magic DeepSparse](https://bit.ly/yolov5-neuralmagic) | -## Ultralytics HUB +##
Ultralytics HUB
Experience seamless AI with [Ultralytics HUB](https://bit.ly/ultralytics_hub) ⭐, the all-in-one solution for data visualization, YOLOv5 and YOLOv8 🚀 model training and deployment, without any coding. Transform images into actionable insights and bring your AI visions to life with ease using our cutting-edge platform and user-friendly [Ultralytics App](https://ultralytics.com/app_install). Start your journey for **Free** now! Ultralytics HUB preview image -## Contribute +##
Contribute
We love your input! YOLOv5 and YOLOv8 would not be possible without help from our community. Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing) to get started, and fill out our [Survey](https://ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey) to send us feedback on your experience. Thank you 🙏 to all our contributors! @@ -247,14 +247,14 @@ We love your input! YOLOv5 and YOLOv8 would not be possible without help from ou -## License +##
License
Ultralytics offers two licensing options to accommodate diverse use cases: - **AGPL-3.0 License**: This [OSI-approved](https://opensource.org/licenses/) open-source license is ideal for students and enthusiasts, promoting open collaboration and knowledge sharing. See the [LICENSE](https://github.com/ultralytics/ultralytics/blob/main/LICENSE) file for more details. - **Enterprise License**: Designed for commercial use, this license permits seamless integration of Ultralytics software and AI models into commercial goods and services, bypassing the open-source requirements of AGPL-3.0. If your scenario involves embedding our solutions into a commercial offering, reach out through [Ultralytics Licensing](https://ultralytics.com/license). -## Contact +##
Contact
For Ultralytics bug reports and feature requests please visit [GitHub Issues](https://github.com/ultralytics/ultralytics/issues), and join our [Discord](https://ultralytics.com/discord) community for questions and discussions! diff --git a/README.zh-CN.md b/README.zh-CN.md index a63be9d8..9c0ab805 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -44,7 +44,7 @@ -## 文档 +##
文档
请参阅下面的快速安装和使用示例,以及 [YOLOv8 文档](https://docs.ultralytics.com) 上有关训练、验证、预测和部署的完整文档。 @@ -98,7 +98,7 @@ success = model.export(format="onnx") # 将模型导出为 ONNX 格式 -## 模型 +##
模型
在[COCO](https://docs.ultralytics.com/datasets/detect/coco)数据集上预训练的YOLOv8 [检测](https://docs.ultralytics.com/tasks/detect),[分割](https://docs.ultralytics.com/tasks/segment)和[姿态](https://docs.ultralytics.com/tasks/pose)模型可以在这里找到,以及在[ImageNet](https://docs.ultralytics.com/datasets/classify/imagenet)数据集上预训练的YOLOv8 [分类](https://docs.ultralytics.com/tasks/classify)模型。所有的检测,分割和姿态模型都支持[追踪](https://docs.ultralytics.com/modes/track)模式。 @@ -202,7 +202,7 @@ success = model.export(format="onnx") # 将模型导出为 ONNX 格式 -## 集成 +##
集成
我们与领先的AI平台的关键整合扩展了Ultralytics产品的功能,增强了数据集标签化、训练、可视化和模型管理等任务。探索Ultralytics如何与[Roboflow](https://roboflow.com/?ref=ultralytics)、ClearML、[Comet](https://bit.ly/yolov8-readme-comet)、Neural Magic以及[OpenVINO](https://docs.ultralytics.com/integrations/openvino)合作,优化您的AI工作流程。 @@ -230,14 +230,14 @@ success = model.export(format="onnx") # 将模型导出为 ONNX 格式 | :--------------------------------------------------------------------------------: | :----------------------------------------------------------------------------: | :----------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------: | | 使用 [Roboflow](https://roboflow.com/?ref=ultralytics) 将您的自定义数据集直接标记并导出至 YOLOv8 进行训练 | 使用 [ClearML](https://cutt.ly/yolov5-readme-clearml)(开源!)自动跟踪、可视化,甚至远程训练 YOLOv8 | 免费且永久,[Comet](https://bit.ly/yolov8-readme-comet) 让您保存 YOLOv8 模型、恢复训练,并以交互式方式查看和调试预测 | 使用 [Neural Magic DeepSparse](https://bit.ly/yolov5-neuralmagic) 使 YOLOv8 推理速度提高多达 6 倍 | -## Ultralytics HUB +##
Ultralytics HUB
体验 [Ultralytics HUB](https://bit.ly/ultralytics_hub) ⭐ 带来的无缝 AI,这是一个一体化解决方案,用于数据可视化、YOLOv5 和即将推出的 YOLOv8 🚀 模型训练和部署,无需任何编码。通过我们先进的平台和用户友好的 [Ultralytics 应用程序](https://ultralytics.com/app_install),轻松将图像转化为可操作的见解,并实现您的 AI 愿景。现在就开始您的**免费**之旅! Ultralytics HUB preview image -## 贡献 +##
贡献
我们喜欢您的参与!没有社区的帮助,YOLOv5 和 YOLOv8 将无法实现。请参阅我们的[贡献指南](https://docs.ultralytics.com/help/contributing)以开始使用,并填写我们的[调查问卷](https://ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey)向我们提供您的使用体验反馈。感谢所有贡献者的支持!🙏 @@ -246,14 +246,14 @@ success = model.export(format="onnx") # 将模型导出为 ONNX 格式 -## 许可证 +##
许可证
Ultralytics 提供两种许可证选项以适应各种使用场景: - **AGPL-3.0 许可证**:这个[OSI 批准](https://opensource.org/licenses/)的开源许可证非常适合学生和爱好者,可以推动开放的协作和知识分享。请查看[LICENSE](https://github.com/ultralytics/ultralytics/blob/main/LICENSE) 文件以了解更多细节。 - **企业许可证**:专为商业用途设计,该许可证允许将 Ultralytics 的软件和 AI 模型无缝集成到商业产品和服务中,从而绕过 AGPL-3.0 的开源要求。如果您的场景涉及将我们的解决方案嵌入到商业产品中,请通过 [Ultralytics Licensing](https://ultralytics.com/license)与我们联系。 -## 联系方式 +##
联系方式
对于 Ultralytics 的错误报告和功能请求,请访问 [GitHub Issues](https://github.com/ultralytics/ultralytics/issues),并加入我们的 [Discord](https://ultralytics.com/discord) 社区进行问题和讨论! diff --git a/docs/en/guides/model-deployment-options.md b/docs/en/guides/model-deployment-options.md index 45698c61..6a4adbaa 100644 --- a/docs/en/guides/model-deployment-options.md +++ b/docs/en/guides/model-deployment-options.md @@ -1,6 +1,6 @@ --- comments: true -Description: A guide to help determine which deployment option to choose for your YOLOv8 model, including essential considerations. +description: A guide to help determine which deployment option to choose for your YOLOv8 model, including essential considerations. keywords: YOLOv8, Deployment, PyTorch, TorchScript, ONNX, OpenVINO, TensorRT, CoreML, TensorFlow, Export --- diff --git a/docs/en/guides/yolo-performance-metrics.md b/docs/en/guides/yolo-performance-metrics.md index d46b5545..6a7a5e68 100644 --- a/docs/en/guides/yolo-performance-metrics.md +++ b/docs/en/guides/yolo-performance-metrics.md @@ -1,6 +1,6 @@ --- comments: true -Description: A comprehensive guide on various performance metrics related to YOLOv8, their significance, and how to interpret them. +description: A comprehensive guide on various performance metrics related to YOLOv8, their significance, and how to interpret them. keywords: YOLOv8, Performance metrics, Object detection, Intersection over Union (IoU), Average Precision (AP), Mean Average Precision (mAP), Precision, Recall, Validation mode, Ultralytics --- diff --git a/docs/en/integrations/comet.md b/docs/en/integrations/comet.md index f5a1bf3a..f2a1e480 100644 --- a/docs/en/integrations/comet.md +++ b/docs/en/integrations/comet.md @@ -133,7 +133,7 @@ You can control the number of image predictions that Comet ML logs during your e ```python import os os.environ["COMET_MAX_IMAGE_PREDICTIONS"] = "200" - ``` +``` ### Batch Logging Interval diff --git a/docs/en/models/rtdetr.md b/docs/en/models/rtdetr.md index 63d53237..779da94b 100644 --- a/docs/en/models/rtdetr.md +++ b/docs/en/models/rtdetr.md @@ -71,11 +71,11 @@ You can use RT-DETR for object detection tasks using the `ultralytics` pip packa ### Supported Modes -| Mode | Supported | -|------------|--------------------| -| Inference | :heavy_check_mark: | -| Validation | :heavy_check_mark: | -| Training | :heavy_check_mark: | +| Mode | Supported | +|------------|-----------| +| Inference | ✅ | +| Validation | ✅ | +| Training | ✅ | ## Citations and Acknowledgements diff --git a/docs/en/models/sam.md b/docs/en/models/sam.md index 45b5c58b..ee5fc935 100644 --- a/docs/en/models/sam.md +++ b/docs/en/models/sam.md @@ -131,11 +131,11 @@ The Segment Anything Model can be employed for a multitude of downstream tasks t ## Operating Modes -| Mode | Supported | -|------------|--------------------| -| Inference | :heavy_check_mark: | -| Validation | :x: | -| Training | :x: | +| Mode | Supported | +|------------|-----------| +| Inference | ✅ | +| Validation | ❌ | +| Training | ❌ | ## SAM comparison vs YOLOv8 diff --git a/docs/en/models/yolo-nas.md b/docs/en/models/yolo-nas.md index e589884f..4b7b1613 100644 --- a/docs/en/models/yolo-nas.md +++ b/docs/en/models/yolo-nas.md @@ -94,11 +94,11 @@ The YOLO-NAS models are primarily designed for object detection tasks. You can d The YOLO-NAS models support both inference and validation modes, allowing you to predict and validate results with ease. Training mode, however, is currently not supported. -| Mode | Supported | -|------------|--------------------| -| Inference | :heavy_check_mark: | -| Validation | :heavy_check_mark: | -| Training | :x: | +| Mode | Supported | +|------------|-----------| +| Inference | ✅ | +| Validation | ✅ | +| Training | ❌ | Harness the power of the YOLO-NAS models to drive your object detection tasks to new heights of performance and speed. diff --git a/docs/en/models/yolov5.md b/docs/en/models/yolov5.md index 96954e6a..f4062e4e 100644 --- a/docs/en/models/yolov5.md +++ b/docs/en/models/yolov5.md @@ -28,11 +28,11 @@ YOLOv5u represents an advancement in object detection methodologies. Originating ## Supported Modes -| Mode | Supported | -|------------|--------------------| -| Inference | :heavy_check_mark: | -| Validation | :heavy_check_mark: | -| Training | :heavy_check_mark: | +| Mode | Supported | +|------------|-----------| +| Inference | ✅ | +| Validation | ✅ | +| Training | ✅ | !!! Performance diff --git a/docs/en/models/yolov6.md b/docs/en/models/yolov6.md index 5edf7453..2eb1196d 100644 --- a/docs/en/models/yolov6.md +++ b/docs/en/models/yolov6.md @@ -85,11 +85,11 @@ You can use YOLOv6 for object detection tasks using the Ultralytics pip package. ## Supported Modes -| Mode | Supported | -|------------|--------------------| -| Inference | :heavy_check_mark: | -| Validation | :heavy_check_mark: | -| Training | :heavy_check_mark: | +| Mode | Supported | +|------------|-----------| +| Inference | ✅ | +| Validation | ✅ | +| Training | ✅ | ## Citations and Acknowledgements diff --git a/docs/en/models/yolov8.md b/docs/en/models/yolov8.md index a05656f4..7f9d0c98 100644 --- a/docs/en/models/yolov8.md +++ b/docs/en/models/yolov8.md @@ -30,11 +30,11 @@ YOLOv8 is the latest iteration in the YOLO series of real-time object detectors, ## Supported Modes -| Mode | Supported | -|------------|--------------------| -| Inference | :heavy_check_mark: | -| Validation | :heavy_check_mark: | -| Training | :heavy_check_mark: | +| Mode | Supported | +|------------|-----------| +| Inference | ✅ | +| Validation | ✅ | +| Training | ✅ | !!! Performance diff --git a/docs/en/quickstart.md b/docs/en/quickstart.md index 8b05aec9..2363a636 100644 --- a/docs/en/quickstart.md +++ b/docs/en/quickstart.md @@ -148,12 +148,13 @@ The Ultralytics command line interface (CLI) allows for simple single-line comma Ultralytics `yolo` commands use the following syntax: ```bash yolo TASK MODE ARGS - - Where TASK (optional) is one of [detect, segment, classify] - MODE (required) is one of [train, val, predict, export, track] - ARGS (optional) are any number of custom 'arg=value' pairs like 'imgsz=320' that override defaults. ``` - See all ARGS in the full [Configuration Guide](usage/cfg.md) or with `yolo cfg` + + - `TASK` (optional) is one of ([detect](tasks/detect.md), [segment](tasks/segment.md), [classify](tasks/classify.md), [pose](tasks/pose.md)) + - `MODE` (required) is one of ([train](modes/train.md), [val](modes/val.md), [predict](modes/predict.md), [export](modes/export.md), [track](modes/track.md)) + - `ARGS` (optional) are `arg=value` pairs like `imgsz=640` that override defaults. + + See all `ARGS` in the full [Configuration Guide](usage/cfg.md) or with the `yolo cfg` CLI command. === "Train" @@ -197,11 +198,12 @@ The Ultralytics command line interface (CLI) allows for simple single-line comma !!! warning "Warning" - Arguments must be passed as `arg=val` pairs, split by an equals `=` sign and delimited by spaces ` ` between pairs. Do not use `--` argument prefixes or commas `,` between arguments. + Arguments must be passed as `arg=val` pairs, split by an equals `=` sign and delimited by spaces between pairs. Do not use `--` argument prefixes or commas `,` between arguments. - - `yolo predict model=yolov8n.pt imgsz=640 conf=0.25`   ✅ - - `yolo predict model yolov8n.pt imgsz 640 conf 0.25`   ❌ - - `yolo predict --model yolov8n.pt --imgsz 640 --conf 0.25`   ❌ + - `yolo predict model=yolov8n.pt imgsz=640 conf=0.25` ✅ + - `yolo predict model yolov8n.pt imgsz 640 conf 0.25` ❌ (missing `=`) + - `yolo predict model=yolov8n.pt, imgsz=640, conf=0.25` ❌ (do not use `,`) + - `yolo predict --model yolov8n.pt --imgsz 640 --conf 0.25` ❌ (do not use `--`) [CLI Guide](usage/cli.md){ .md-button .md-button--primary} diff --git a/docs/en/reference/nn/tasks.md b/docs/en/reference/nn/tasks.md index dcabffdf..d404da55 100644 --- a/docs/en/reference/nn/tasks.md +++ b/docs/en/reference/nn/tasks.md @@ -1,3 +1,8 @@ +--- +description: Dive into the intricacies of YOLO tasks.py. Learn about DetectionModel, PoseModel and more for powerful AI development. +keywords: Ultralytics, YOLO, nn tasks, DetectionModel, PoseModel, RTDETRDetectionModel, model weights, parse model, AI development +--- + # Reference for `ultralytics/nn/tasks.py` !!! note diff --git a/docs/en/reference/utils/__init__.md b/docs/en/reference/utils/__init__.md index 96485bbc..811631e6 100644 --- a/docs/en/reference/utils/__init__.md +++ b/docs/en/reference/utils/__init__.md @@ -21,10 +21,6 @@ keywords: Ultralytics, Utils, utilitarian functions, colorstr, yaml_save, set_lo ## ::: ultralytics.utils.IterableSimpleNamespace

---- -## ::: ultralytics.utils.EmojiFilter -

- --- ## ::: ultralytics.utils.ThreadingLocked

diff --git a/docs/en/reference/utils/triton.md b/docs/en/reference/utils/triton.md index 36bbfbe6..d133f976 100644 --- a/docs/en/reference/utils/triton.md +++ b/docs/en/reference/utils/triton.md @@ -1,3 +1,8 @@ +--- +description: Deploy ML models effortlessly with Ultralytics TritonRemoteModel. Simplify serving with our comprehensive utils guide. +keywords: Ultralytics, YOLO, TritonRemoteModel, machine learning, model serving, deployment, utils, documentation +--- + # Reference for `ultralytics/utils/triton.py` !!! note diff --git a/docs/update_translations.py b/docs/update_translations.py index 5be4b2e7..33b9b598 100644 --- a/docs/update_translations.py +++ b/docs/update_translations.py @@ -23,10 +23,9 @@ class MarkdownLinkFixer: self.update_links = update_links self.update_frontmatter = update_frontmatter self.update_iframes = update_iframes - self.md_link_regex = re.compile(r'\[([^\]]+)\]\(([^:\)]+)\.md\)') - self.front_matter_regex = re.compile(r'^(comments|description|keywords):.*$', re.MULTILINE) + self.md_link_regex = re.compile(r'\[([^]]+)]\(([^:)]+)\.md\)') self.translations = { - 'zh': ['评论', '描述', '关键词'], # Mandarin Chinese (Simplified) + 'zh': ['评论', '描述', '关键词'], # Mandarin Chinese (Simplified) warning, sometimes translates as 关键字 'es': ['comentarios', 'descripción', 'palabras clave'], # Spanish 'ru': ['комментарии', 'описание', 'ключевые слова'], # Russian 'pt': ['comentários', 'descrição', 'palavras-chave'], # Portuguese @@ -44,15 +43,17 @@ class MarkdownLinkFixer: for term, eng_key in zip(terms, english_keys): if eng_key == 'comments': # Replace comments key and set its value to 'true' - content = re.sub(rf'{term} *:.*', f'{eng_key}: true', content) + content = re.sub(rf'{term} *[::].*', f'{eng_key}: true', content) else: - content = re.sub(rf'{term} *:', f'{eng_key}:', content) + content = re.sub(rf'{term} *[::] *', f'{eng_key}: ', content) return content - def update_iframe(self, content): + @staticmethod + def update_iframe(content): """Update the 'allow' attribute of iframe if it does not contain the specific English permissions.""" - english_permissions = 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' + english_permissions = \ + 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' pattern = re.compile(f'allow="(?!{re.escape(english_permissions)}).+?"') return pattern.sub(f'allow="{english_permissions}"', content) diff --git a/docs/zh/quickstart.md b/docs/zh/quickstart.md index 16657c2d..abc53377 100644 --- a/docs/zh/quickstart.md +++ b/docs/zh/quickstart.md @@ -1,7 +1,7 @@ --- -评论:真 -描述:探索使用pip、conda、git和Docker安装Ultralytics的各种方法。了解如何在命令行界面或Python项目中使用Ultralytics。 -关键字:Ultralytics安装,pip安装Ultralytics,Docker安装Ultralytics,Ultralytics命令行界面,Ultralytics Python接口 +comments: true +description: 探索使用pip、conda、git和Docker安装Ultralytics的各种方法。了解如何在命令行界面或Python项目中使用Ultralytics。 +keywords: Ultralytics安装,pip安装Ultralytics,Docker安装Ultralytics,Ultralytics命令行界面,Ultralytics Python接口 --- ## 安装Ultralytics diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index e8d35546..f02bcdf4 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = '8.0.211' +__version__ = '8.0.212' from ultralytics.models import RTDETR, SAM, YOLO from ultralytics.models.fastsam import FastSAM diff --git a/ultralytics/utils/__init__.py b/ultralytics/utils/__init__.py index 1050da94..0f02736c 100644 --- a/ultralytics/utils/__init__.py +++ b/ultralytics/utils/__init__.py @@ -225,25 +225,29 @@ def plt_settings(rcparams=None, backend='Agg'): def set_logging(name=LOGGING_NAME, verbose=True): - """Sets up logging for the given name.""" - rank = int(os.getenv('RANK', -1)) # rank in world for Multi-GPU trainings - level = logging.INFO if verbose and rank in {-1, 0} else logging.ERROR - logging.config.dictConfig({ - 'version': 1, - 'disable_existing_loggers': False, - 'formatters': { - name: { - 'format': '%(message)s'}}, - 'handlers': { - name: { - 'class': 'logging.StreamHandler', - 'formatter': name, - 'level': level}}, - 'loggers': { - name: { - 'level': level, - 'handlers': [name], - 'propagate': False}}}) + """Sets up logging for the given name with UTF-8 encoding support.""" + level = logging.INFO if verbose and RANK in {-1, 0} else logging.ERROR # rank in world for Multi-GPU trainings + + # Configure the console (stdout) encoding to UTF-8 + if WINDOWS: # for Windows + sys.stdout.reconfigure(encoding='utf-8') + + # Create and configure the StreamHandler + stream_handler = logging.StreamHandler(sys.stdout) + stream_handler.setFormatter(logging.Formatter('%(message)s')) + stream_handler.setLevel(level) + + logger = logging.getLogger(name) + logger.setLevel(level) + logger.addHandler(stream_handler) + logger.propagate = False + return logger + + +# Set logger +LOGGER = set_logging(LOGGING_NAME, verbose=VERBOSE) # define globally (used in train.py, val.py, predict.py, etc.) +for logger in 'sentry_sdk', 'urllib3.connectionpool': + logging.getLogger(logger).setLevel(logging.CRITICAL) def emojis(string=''): @@ -251,29 +255,6 @@ def emojis(string=''): return string.encode().decode('ascii', 'ignore') if WINDOWS else string -class EmojiFilter(logging.Filter): - """ - A custom logging filter class for removing emojis in log messages. - - This filter is particularly useful for ensuring compatibility with Windows terminals that may not support the - display of emojis in log messages. - """ - - def filter(self, record): - """Filter logs by emoji unicode characters on windows.""" - record.msg = emojis(record.msg) - return super().filter(record) - - -# Set logger -set_logging(LOGGING_NAME, verbose=VERBOSE) # run before defining LOGGER -LOGGER = logging.getLogger(LOGGING_NAME) # define globally (used in train.py, val.py, detect.py, etc.) -if WINDOWS: # emoji-safe logging - LOGGER.addFilter(EmojiFilter()) -for logger in 'sentry_sdk', 'urllib3.connectionpool': - logging.getLogger(logger).setLevel(logging.CRITICAL) - - class ThreadingLocked: """ A decorator class for ensuring thread-safe execution of a function or method. This class can be used as a decorator