https://github.com/ultralytics/yolov5
GitHub - ultralytics/yolov5: YOLOv5 ๐ in PyTorch > ONNX > CoreML > TFLite
YOLOv5 ๐ in PyTorch > ONNX > CoreML > TFLite. Contribute to ultralytics/yolov5 development by creating an account on GitHub.
github.com
GitHub - ultralytics/yolov5: YOLOv5 ๐ in PyTorch > ONNX > CoreML > TFLite
YOLOv5 ๐ in PyTorch > ONNX > CoreML > TFLite. Contribute to ultralytics/yolov5 development by creating an account on GitHub.
github.com
์๋๋ ๋ชจ๋ธ์ ํ์ต์ํค๊ธฐ ์ํด ์ง์ ๋๋ฆฐ ์ฝ๋์ด๋ค
- (๋ชจ๋ธ ํ์ต์ ์ํ ์ค๋น) ๋ฐ์ดํฐ์ ๊ฒฝ๋ก ์ค์
cd aiffel
mkdir yolov5
cd yolov5
- ํด๋ผ์ฐ๋ ์๋ฒ์ yolov5 ํด๋์ ๋ค์ด๋ฐ์ zip ํ์ผ์ ์ฌ๋ฆฐ๋ค. (์ฃผํผํฐ ๋ ธํธ๋ถ)
unzip yolov5-master.zip
mkdir datasets
- git clone์ ํ๋ค. (๊ตฌ๊ธ ์ฝ๋ฉ)
!git clone https://github.com/ultralytics/yolov5
- ํ์ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ํจํค์ง๋ฅผ ์ค์นํ๋ค.
!cd yolov5;pip install -qr requirements.txt
- ๋ชจ๋ธ์ ๋๋ ค๋ณด์!
!cd /content/yolov5; python train.py --img 640 --batch 16 --epochs 70 --data /content/drive/MyDrive/aiffel_hackathon/trainNvalid/book_spine.yaml --weights yolov5m.pt \
--project=/content/drive/MyDrive/aiffel_hackathon/model --name epoch70_batch16 --exist-ok
-- data : yaml ํ์ผ ๊ฒฝ๋ก
-- project : ํ์ผ ์ ์ฅํ ๊ฒฝ๋ก
-- weights : ๊ฐ์ค์น ๊ฒฝ๋ก์ด๋, yolo์์ ๊ธฐ๋ณธ์ ์ผ๋ก ์ ๊ณตํ๋ ๊ฐ์ค์น ์ฌ์ฉ๊ฐ๋ฅ
-- projects : ๊ฒฐ๊ณผ๋ฅผ ์ ์ฅํ ํ๋ก์ ํธ ๊ฒฝ๋ก์ด๋ค.
-- name : ์ ์ฅํ ํ๋ก์ ํธ ์ด๋ฆ
def parse_opt():
parser = argparse.ArgumentParser()
parser.add_argument('--weights', nargs='+', type=str, default=ROOT / 'yolov5s.pt', help='model path(s)')
parser.add_argument('--source', type=str, default=ROOT / 'data/images', help='file/dir/URL/glob, 0 for webcam')
parser.add_argument('--data', type=str, default=ROOT / 'data/coco128.yaml', help='(optional) dataset.yaml path')
parser.add_argument('--imgsz', '--img', '--img-size', nargs='+', type=int, default=[640], help='inference size h,w')
parser.add_argument('--conf-thres', type=float, default=0.25, help='confidence threshold')
parser.add_argument('--iou-thres', type=float, default=0.45, help='NMS IoU threshold')
parser.add_argument('--max-det', type=int, default=1000, help='maximum detections per image')
parser.add_argument('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu')
parser.add_argument('--view-img', action='store_true', help='show results')
parser.add_argument('--save-txt', action='store_true', help='save results to *.txt')
parser.add_argument('--save-conf', action='store_true', help='save confidences in --save-txt labels')
parser.add_argument('--save-crop', action='store_true', help='save cropped prediction boxes')
parser.add_argument('--nosave', action='store_true', help='do not save images/videos')
parser.add_argument('--classes', nargs='+', type=int, help='filter by class: --classes 0, or --classes 0 2 3')
parser.add_argument('--agnostic-nms', action='store_true', help='class-agnostic NMS')
parser.add_argument('--augment', action='store_true', help='augmented inference')
parser.add_argument('--visualize', action='store_true', help='visualize features')
parser.add_argument('--update', action='store_true', help='update all models')
parser.add_argument('--project', default=ROOT / 'runs/detect', help='save results to project/name')
parser.add_argument('--name', default='exp', help='save results to project/name')
parser.add_argument('--exist-ok', action='store_true', help='existing project/name ok, do not increment')
parser.add_argument('--line-thickness', default=3, type=int, help='bounding box thickness (pixels)')
parser.add_argument('--hide-labels', default=False, action='store_true', help='hide labels')
parser.add_argument('--hide-conf', default=False, action='store_true', help='hide confidences')
parser.add_argument('--half', action='store_true', help='use FP16 half-precision inference')
parser.add_argument('--dnn', action='store_true', help='use OpenCV DNN for ONNX inference')
opt = parser.parse_args()
opt.imgsz *= 2 if len(opt.imgsz) == 1 else 1 # expand
print_args(FILE.stem, opt)
return opt
์์ ๊ฐ์ ๋ค์ํ ์ต์ ์ ์ ์ฉํ๋ฉด ์๋ณธ ์ฝ๋ ์์ ์์ด ํ์ฉ ๊ฐ๋ฅํ๋ค.
Object Detection์ ๋ค์ํ ํ๊ฐ์งํ :
Object Detection์ ํ๊ฐ์งํ
Object Detection์ ํ์ฉํ ํ๋ก์ ํธ๋ฅผ ์งํํ์์ต๋๋ค. ์ด ๊ณผ์ ์์ ๋ค์ํ ํ๊ฐ์งํ๋ค์ ์ฐพ์๋ณด์์ต๋๋ค. 1. IoU(Intersection over Union) ๋ชจ๋ธ์ด ์์ธกํ bbox์ ์ค์ bbox๊ฐ ์ผ๋ง๋ ๊ฒน์น๋์ง ๋ํ๋ด๋ ์ง
fuxxy.tistory.com
'AIFEEL' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Object Detection์ ํ๊ฐ์งํ (0) | 2022.03.07 |
---|---|
์ ๋๊ฒฝ๋ก์ ์๋๊ฒฝ๋ก (0) | 2022.03.02 |
OpenCV ์ด๋ฏธ์ง & ๋์์ ์ถ๋ ฅ (0) | 2022.02.24 |
๊ตฌ๊ธ๋งํด๋ ์๋์ค๋ wandb ์ฌ์ฉ๊ฐ์ด๋ - wandb ๊ฒฐ๊ณผ ์๊ฐํ, ํ๋ก์ ํธ ์ด๋ (0) | 2022.02.23 |
[semantic Segmentation] ์๋งจํฑ ์ธ๊ทธ๋ฉํ ์ด์ ์ผ๋ก ๋๋ก ์์ญ ๊ฒ์ถํ๊ธฐ (0) | 2022.01.05 |