Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 questions #340

Open
SylvainArd opened this issue Apr 9, 2024 · 3 comments
Open

2 questions #340

SylvainArd opened this issue Apr 9, 2024 · 3 comments

Comments

@SylvainArd
Copy link

Hello,
is yolov9 able to do instance segmentation, I doubt of it !
the format of TXT for instance segmentation is :

  • a file per image with same name but TXT extension
  • a line per polygon with first number the class and others the X and Y coordinates of each point of the polygon, the Xs divided by the width of the image, the Ys divided by the height of the image
    In other website I see that after the class number and before the polygon coordinates we must put the bbox coordinates normalized is it true ?

isn't it ?
Thank you
Best regards

@SylvainArd
Copy link
Author

I found the solution

@Youho99
Copy link

Youho99 commented Apr 10, 2024

I found the solution

Can you give the solution, for those who might have the same question

And you can close the issue

@SylvainArd
Copy link
Author

yes ! for the prediction I made this change :
pred, proto = model(im, augment=augment, visualize=visualize)[:2]
proto = proto[2]#added by SA
unless I had a bug "list has not attribute shape"
and for the TXT file it is :

a file per image with same name but TXT extension
a line per polygon with first number the class and others the X and Y coordinates of each point of the polygon, the Xs divided by the width of the image, the Ys divided by the height of the image
In other website I see that after the class number and before the polygon coordinates we must put the bbox coordinates normalized is it true ? >> FALSE

I made a train.bat with :
call conda activate yolov9
python segment/train.py --workers 8 --device 0 --batch 6 --data coco.yaml --img 640 --cfg models/segment/gelan-c-seg.yaml --weights '' --name gelan-c-seg --hyp hyp.scratch-high.yaml --no-overlap --epochs 300000 --close-mosaic 10
pause

and a predict.bat with :
call conda activate yolov9
python segment/predict.py --weights "C:\Users\Sylvain\Desktop\yolov9-main\best.pt" --source "data/images" --conf-thres 0.6 --max-det 1000
pause

I putted all my TXT and JPG files in yolov9-main/datasets/yolo_polygons in the same directory
finally I changed the data/coco.yaml according to my dataset
For predicting I put the best.pt from yolov9-main\runs\train-seg\gelan-c-seg12\weights to root yolov9 directory, NB change 12 to your training try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants