Best practice for keeping a YOLO training dataset with my code on GitHub? #213074
Replies: 2 comments 1 reply
|
Hi, Short answer: keep the code in Git, keep the big data out of normal Git history, and put trained weights in Releases or a model hub. Your options, in order of how I'd pick them: 1. Dataset: DVC or a plain download script (my recommendation for a few GB)
pip install dvc
dvc init
dvc add data/images data/labels
git add data/images.dvc data/labels.dvc .gitignore
git commit -m "Track dataset with DVC"
dvc remote add -d storage <your-remote-url>
dvc push
2. Git LFS: works, but watch the limits
git lfs install
git lfs track "*.jpg" "*.png"
git add .gitattributes
3. Commit only a small sample set Yes, do this regardless of which option you choose. Keep 10 to 50 images and labels in the repo (for example 4. Trained weights (
5. Fix what you already have Since the images are already in the repo, you'll want to remove them from history, not only delete them: pip install git-filter-repo
git filter-repo --path data/ --invert-pathsBack up the repo first. This rewrites history and needs a force-push, which is fine for a solo project. Then add a (Adjust paths to your layout, and keep Suggested setup
|
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Question
Body
Hey, I'm a solo dev working on a small YOLO object detection project. Right now my images and labels are just sitting in the repo next to the code, and it's getting big (a few GB).
What's the best practice here?
Also, should trained weights (
.ptfiles) go in the repo, or in Releases?Just want to set it up properly before it gets messy. Thanks!
All reactions