You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'll describe the bug, and then talk about why I like this method over others. Describe the bug
I import data through custom curl commands and the annotations are off. I did this through python before and think I had the same issue. I copy your exact logic here, just in bash:
convert_yolo() {
local yolo_annotation="$1"
local image_width=1024
local image_height=1024
local class=$(echo $yolo_annotation | cut -d' ' -f1)
local x_center_norm=$(echo $yolo_annotation | cut -d' ' -f2)
local y_center_norm=$(echo $yolo_annotation | cut -d' ' -f3)
local width_norm=$(echo $yolo_annotation | cut -d' ' -f4)
local height_norm=$(echo $yolo_annotation | cut -d' ' -f5)
local x=$(echo "($x_center_norm - $width_norm / 2) * 100" | tr -d $'\r' | bc)
local y=$(echo "($y_center_norm - $height_norm / 2) * 100" | tr -d $'\r' | bc)
local width=$(echo "$width_norm * 100" | tr -d $'\r' | bc)
local height=$(echo "$height_norm * 100" | tr -d $'\r' | bc)
echo "$class $x $y $width $height"
}
There's other issues out there like this, but I'm pretty sure this is right. It's the same logic, and I hit this before with python too.
Everything is like off, but not even by the same margins. In this case I'm trying to import yolov9, but it should be the same as the rest.
So that's the bug. I do a lot with this stuff across many languages, and this one is weird. I'll dig more tomorrow, but I feel like yall do something different than everyone else on this. Why not use normalized or not?
Conversation and custom tooling:
You can say use the import tool, but I did not like that. It's clunky. Set these env vars and do all this other wonkey stuff. I know label studio handles a lot so it's more agnostic, but yolo is the most dead simple set up. You have a folder with some txt and image files. It does not get any easier. Then somehow this and cvat is like "what if we made it hard and inconvenient"
With the following script all I do is build a small base model and then save detection as images and txt files. All the yolo tooling across all repos are incestuous rip offs of each other and most have this feature. So crazy easy to make a nice feedback loop. Capture source material, set stride, detect and then clean and adjust here. It works well for me because my models are small number of classes <10. I know what all the numbers are off the top of my head
The idea of plugins and assisted annotations is great but I'm not interested in writing and swapping models and tool chains every time I try a new yolo version. The models do the txt and images and this imports them. I like the separation of responsibility.
This is a hack script and can stand to be cleaned up. No you cannot indent the EOFs. 2k images import in about 3 minutes.
Bash was doing integer math before getting to bc. I fixed the script above. I'll do a write up on it. I really think command, folder, import is very nice.
I'll describe the bug, and then talk about why I like this method over others.
Describe the bug
I import data through custom curl commands and the annotations are off. I did this through python before and think I had the same issue. I copy your exact logic here, just in bash:
There's other issues out there like this, but I'm pretty sure this is right. It's the same logic, and I hit this before with python too.
Everything is like off, but not even by the same margins. In this case I'm trying to import yolov9, but it should be the same as the rest.
So that's the bug. I do a lot with this stuff across many languages, and this one is weird. I'll dig more tomorrow, but I feel like yall do something different than everyone else on this. Why not use normalized or not?
Conversation and custom tooling:
You can say use the import tool, but I did not like that. It's clunky. Set these env vars and do all this other wonkey stuff. I know label studio handles a lot so it's more agnostic, but yolo is the most dead simple set up. You have a folder with some txt and image files. It does not get any easier. Then somehow this and cvat is like "what if we made it hard and inconvenient"
With the following script all I do is build a small base model and then save detection as images and txt files. All the yolo tooling across all repos are incestuous rip offs of each other and most have this feature. So crazy easy to make a nice feedback loop. Capture source material, set stride, detect and then clean and adjust here. It works well for me because my models are small number of classes <10. I know what all the numbers are off the top of my head
The idea of plugins and assisted annotations is great but I'm not interested in writing and swapping models and tool chains every time I try a new yolo version. The models do the txt and images and this imports them. I like the separation of responsibility.
This is a hack script and can stand to be cleaned up. No you cannot indent the EOFs. 2k images import in about 3 minutes.
usage: ./whateveryounameit.sh path/to/folder [jpg|png|etc]
search for 1024 and swap out your image size
The text was updated successfully, but these errors were encountered: