🚀 YOLOv8手写文本检测
本项目基于YOLOv8算法,专注于手写文本检测。YOLOv8以其出色的速度和准确性,成为实时应用的理想选择。此模型在多样化的手写文本数据集上进行了微调,使其在检测手写内容方面表现卓越,能有效区分手写与打印文本。
🚀 快速开始
安装依赖
pip install ultralytics
使用示例
from ultralytics import YOLO
from huggingface_hub import hf_hub_download
from matplotlib import pyplot as plt
model_path = hf_hub_download(local_dir=".",
repo_id="armvectores/yolov8n_handwritten_text_detection",
filename="best.pt")
model = YOLO(model_path)
test_blank_path = hf_hub_download(local_dir=".",
repo_id="armvectores/yolov8n_handwritten_text_detection",
filename="test_blank.png")
res = model.predict(source=test_blank_path, project='.',name='detected', exist_ok=True, save=True, show=False, show_labels=False, show_conf=False, conf=0.5, )
plt.figure(figsize=(15,10))
plt.imshow(plt.imread('detected/test_blank.png'))
plt.show()
📦 安装指南
使用以下命令安装ultralytics
库:
pip install ultralytics
💻 使用示例
基础用法
from ultralytics import YOLO
from huggingface_hub import hf_hub_download
from matplotlib import pyplot as plt
model_path = hf_hub_download(local_dir=".",
repo_id="armvectores/yolov8n_handwritten_text_detection",
filename="best.pt")
model = YOLO(model_path)
test_blank_path = hf_hub_download(local_dir=".",
repo_id="armvectores/yolov8n_handwritten_text_detection",
filename="test_blank.png")
res = model.predict(source=test_blank_path, project='.',name='detected', exist_ok=True, save=True, show=False, show_labels=False, show_conf=False, conf=0.5, )
plt.figure(figsize=(15,10))
plt.imshow(plt.imread('detected/test_blank.png'))
plt.show()
📚 详细文档
测试结果展示
指标
最终交并比(IoU)达到0.98。
训练期间的IoU变化:
属性 |
详情 |
模型类型 |
YOLOv8手写文本检测模型 |
训练数据 |
armvectores/handwritten_text_detection |