Hello,
i have problems to recognise lines in pictures of CAD drawings form my costum data set.
Is yolov9 the best tool for that, or should i use another?
my colab code:
#use GPU
!nvidia-smi
#mount google drive
from google.colab import drive
drive.mount(‘/content/gdrive’)
#drive.flush_and_unmount()
#Import the necessary libraries
import torch
if torch.cuda.is_available():
print(f"GPU Name: {torch.cuda.get_device_name(0)}“)
print(f"GPU is Available: {torch.cuda.is_available()}”)
else:
print(“GPU is not available”)
#create link
!ln -s /content/gdrive/My\ Drive/ /mydrive
#go to directory
%cd /mydrive/yolov9/
#colne a github
!git clone https–://–github-com/WongKinYiu/yolov9----git
#go to directory
%cd yolov9
#install requirements
!pip install -r requirements.txt
#get models
!wget -P /mydrive/yolov9/ https–:–//github----com/WongKinYiu/yolov9/releases/download/v0.1/yolov9-c.pt
!wget -P /mydrive/yolov9/ https–:–//github------com/WongKinYiu/yolov9/releases/download/v0.1/yolov9-e.pt
#get dataset
!pip install roboflow
from roboflow import Roboflow
rf = Roboflow(api_key=“8NQeSTnjAoLJRH77J9bg”)
project = rf.workspace(“solidworksaidrawingrecognation”).project(“drawingrecai”)
version = project.version(1)
dataset = version.download(“yolov9”)
#detect
!python detect.py --img 640 --conf 0.01 --device 0 --weights /mydrive/yolov9/yolov9/runs/train/exp5/weights/best.pt --source /mydrive/yolov9/3_Test.jpg
#show the result
from IPython.display import Image
Image(filename=f"/mydrive/yolov9/yolov9/runs/detect/exp22/3_Test.jpg", width=640)
#train the model
!python train_dual.py --workers 8 --batch 4 --img 640 --epochs 50 --data /content/DrawingRecAI-1/data.yaml --weights /mydrive/yolov9/yolov9-e.pt --device 0 --cfg /mydrive/yolov9/yolov9/models/detect/yolov9_custom.yaml --hyp /mydrive/yolov9/yolov9/data/hyps/hyp.scratch-high.yaml