- 사이트
1. RoboFlow Universe
Roboflow에서 제공하는 오픈 소스 플랫폼으로, annotation을 가지고 있습니다.
Roboflow Universe: Open Source Computer Vision Community
Download free, open source datasets and pre-trained computer vision machine learning models.
universe.roboflow.com
Face Detection Object Detection Dataset and Pre-Trained Model by Mohamed Traore
1369 open source faces images plus a pre-trained Face Detection model and API. Created by Mohamed Traore
universe.roboflow.com
2. RoboFlow Project
데이터셋을 만들고 훈련해볼 수 있는 플랫폼으로 annotaion작업과 augmentation 작업을 진행할 수 있습니다.
이미 annotation작업을 진행했다면 txt파일을 사진과 함께 업로드하면 자동으로 인식할 수 있습니다.
Roboflow: Computer vision tools for developers and enterprises
Everything you need to build and deploy computer vision models, from automated annotation tools to high-performance deployment solutions.
roboflow.com
- Universe의 데이터 가져오기
Dataset > YOLOv11 > Show download > Continue
1. 라이브러리 설치 및 데이터셋 설치하기
!pip install roboflow
from roboflow import Roboflow
##########################################################
## 사용자마다 API 키가 다릅니다
rf = Roboflow(api_key="API키 입력하기")
##########################################################
project = rf.workspace("mohamed-traore-2ekkp").project("face-detection-mik1i")
version = project.version(24)
dataset = version.download("yolov11")
2. 모델링 라이브러리, 데이터셋 수정
from ultralytics import YOLO, settings
settings['datasets_dir'] = '/content/'
settings.update()
settings
3. 학습하기
- 기본 .yaml 파일
train: ../train/images
val: ../valid/images
test: ../test/images
nc: 1
names: ['face']
roboflow:
workspace: mohamed-traore-2ekkp
project: face-detection-mik1i
version: 24
license: CC BY 4.0
url: https://universe.roboflow.com/mohamed-traore-2ekkp/face-detection-mik1i/dataset/24
- 수정한 .yaml 파일
train: ../train/images
val: ../test/images
# test:
nc: 1
names: ['face']
roboflow:
workspace: mohamed-traore-2ekkp
project: face-detection-mik1i
version: 24
license: CC BY 4.0
url: https://universe.roboflow.com/mohamed-traore-2ekkp/face-detection-mik1i/dataset/24
- 모델 구조 및 사전 학습 가중치 선택 후 학습
model = YOLO(model='yolo11n.pt', task='detect')
model.train(model ='/content/yolo11n.pt',
data='/content/Face-Detection-24/data.yaml', # yaml파일 위치로
epochs=1,
)
4. 예측하기
result = model.predict(source = '파일위치',
conf=0.5, # 기본값
iou=0.5, # 기본값이 0.7
save=True,
line_width=2,
)
- Project로 데이터 만들기
1. 데이터 업데이트 하기
2. Annotation 작업 진행하기
- 단축키
D : 움직이기
B : 바운딩 박스치기
3. Train, Validation, Test data로 나누기
4. Versions 만들기
좌측 Generate항목 선택
증강 작업 가능
5. 완료 후 다운로드
'KT AIVLE School > 시각지능 딥러닝' 카테고리의 다른 글
YOLO (0) | 2024.10.25 |
---|---|
Object Detection (객체 탐지) (0) | 2024.10.25 |
Pretrained CNN - VGG16, InceptionV3 (0) | 2024.10.24 |
100중 분류 (1) | 2024.10.24 |
Transfer Learning (3) | 2024.10.23 |