Views
No views yet
yolov8s_tattoo_manual_v3_best.ptyolov8s_tattoo_filtered_v2_best.ptyolov8s_tattoo_seg_v1_best.pt| 버전 | 학습 데이터 | Confidence | Mask mAP50 | 특징 |
|---|---|---|---|---|
| v3 (Fine-tuned) ⭐ | v2 + 24 manual | 0.862 | - | 최고 품질 |
| v2 (Filtered) | 2,697 images | 0.753 | 65.14% | 필터링됨 |
| v1 (Original) | 4,373 images | 0.658 | 54.2% | 노이즈 포함 |
pip install ultralytics opencv-python numpy torch1from huggingface_hub import hf_hub_download
2
3# v3 모델 다운로드 (최신, 추천) ⭐
4model_path = hf_hub_download(
5 repo_id="jun710/deep-tattoo-yolov8",
6 filename="yolov8s_tattoo_manual_v3_best.pt"
7)
8
9# 또는 v2 모델 (대안)
10# model_path = hf_hub_download(
11# repo_id="jun710/deep-tattoo-yolov8",
12# filename="yolov8s_tattoo_filtered_v2_best.pt"
13# )1from ultralytics import YOLO
2
3# 모델 로드
4model = YOLO(model_path)
5
6# 타투 검출
7results = model.predict("tattoo_image.jpg", conf=0.25, imgsz=640)
8
9# 결과 표시
10results[0].show()
11
12# 마스크 추출
13if results[0].masks is not None:
14 masks = results[0].masks.data.cpu().numpy()
15 print(f"{len(masks)}개 타투 검출됨")1import cv2
2import numpy as np
3
4# 예측
5results = model.predict("tattoo.jpg", conf=0.25)
6
7# 원본 이미지
8img = cv2.imread("tattoo.jpg")
9img_rgba = cv2.cvtColor(img, cv2.COLOR_BGR2BGRA)
10
11# 마스크 합치기
12combined_mask = np.zeros((img.shape[0], img.shape[1]), dtype=np.uint8)
13for mask in results[0].masks.data.cpu().numpy():
14 mask_resized = cv2.resize(mask, (img.shape[1], img.shape[0]))
15 combined_mask = cv2.bitwise_or(combined_mask, (mask_resized > 0.5).astype(np.uint8))
16
17# 투명 배경 적용
18img_rgba[:, :, 3] = combined_mask * 255
19
20# 저장
21cv2.imwrite("tattoo_extracted.png", img_rgba)1@misc{deep-tattoo-yolov8-2026,
2 title={Deep Tattoo: YOLOv8 Instance Segmentation for Tattoo Extraction},
3 author={jun710},
4 year={2026},
5 publisher={Hugging Face},
6 howpublished={\url{https://huggingface.co/jun710/deep-tattoo-yolov8}}
7}