Views
No views yet
| 域 / Domain | mAP50 |
|---|---|
| 甲骨文 Oracle Bone Inscriptions | 89.92% |
| 简牍 Bamboo Slips | 94.22% |
| 项目 | 值 |
|---|---|
| 架构 | YOLO26m |
| 参数量 | 20.4M |
| 模型大小 | 126 MB |
| 输入尺寸 | 640×640 |
| 检测类别 | character(单类别) |
1from ultralytics import YOLO
2from huggingface_hub import hf_hub_download
3
4# 下载模型
5model_path = hf_hub_download(
6 repo_id="cszhangai/ancient-chinese-character-detection",
7 filename="General_Ancient_Character_Detection.pt"
8)
9
10# 加载模型
11model = YOLO(model_path)
12
13# 单张检测
14results = model.predict(
15 source="your_image.jpg",
16 imgsz=640,
17 conf=0.25, # 甲骨文建议 0.20,简牍建议 0.25
18 iou=0.45,
19 device=0, # GPU;改为 'cpu' 使用 CPU
20 save=True,
21)
22
23# 获取检测框坐标
24for result in results:
25 for box in result.boxes:
26 x1, y1, x2, y2 = box.xyxy[0].tolist()
27 conf = box.conf[0].item()
28 print(f"box: ({x1:.0f},{y1:.0f}) → ({x2:.0f},{y2:.0f}) conf={conf:.3f}")conf=0.20(字符变异大,阈值过高易漏检)conf=0.25