4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

yolov9 を導入してみました。

Last updated at Posted at 2024-02-23

以下手順

git clone  https://github.com/WongKinYiu/yolov9.git
cd yolov9

ダウンロード

公式GitHub → https://github.com/WongKinYiu/ にも乗っていますが、一応yolov9-eのリンクをここにも置きます。ダウンロードのリンク →
https://github.com/WongKinYiu/yolov9/releases/download/v0.1/yolov9-e.pt

bug 修正

vscode 等のエディターで修正
utils/general.py 903行元々prediction = prediction[0] 正しいは prediction = prediction[0][0]

source 0 カメラ

python detect.py --device 0 --source 0 --weights './yolov9-e.pt'

動作動画です

入力画像

000000006939.jpg
source file(画像) はこのような感じで保存されます

python detect.py --device 0 --source "D:\python_learning\datasets\coco\images\test2017\000000006939.jpg" --weights './yolov9-e.pt'

detect: weights=['./yolov9-e.pt'], source=D:\python_learning\datasets\coco\images\test2017\000000006939.jpg, data=data\coco128.yaml, imgsz=[640, 640], conf_thres=0.25, iou_thres=0.45, max_det=1000, device=0, view_img=False, save_txt=False, save_conf=False, save_crop=False, nosave=False, classes=None, agnostic_nms=False, augment=False, visualize=False, update=False, project=runs\detect, name=exp, exist_ok=False, line_thickness=3, hide_labels=False, hide_conf=False, half=False, dnn=False, vid_stride=1
YOLOv5 v0.1-3-g6e49803 Python-3.10.10 torch-2.2.1+cu118 CUDA:0 (NVIDIA GeForce RTX 3080 Laptop GPU, 8192MiB)

Fusing layers...
Model summary: 1119 layers, 69470144 parameters, 0 gradients, 244.0 GFLOPs
image 1/1 D:\python_learning\datasets\coco\images\test2017\000000006939.jpg: 512x640 1 person, 1 truck, 1 handbag, 206.5ms
Speed: 1.0ms pre-process, 206.5ms inference, 53.8ms NMS per image at shape (1, 3, 640, 640)
Results saved to runs\detect\exp9

結果

000000006939.jpg

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?