https://github.com/akashad98/yolov7_custom_data_trainig
yolov7 train on custom data
https://github.com/akashad98/yolov7_custom_data_trainig
deep-learning object-detection yolov7
Last synced: 5 months ago
JSON representation
yolov7 train on custom data
- Host: GitHub
- URL: https://github.com/akashad98/yolov7_custom_data_trainig
- Owner: akashAD98
- Created: 2022-07-11T06:21:41.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-01T08:29:30.000Z (about 3 years ago)
- Last Synced: 2025-05-01T12:13:18.936Z (5 months ago)
- Topics: deep-learning, object-detection, yolov7
- Language: Jupyter Notebook
- Homepage:
- Size: 59.6 KB
- Stars: 23
- Watchers: 1
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## yolov7 architecture
#### clone repo
1.``` git clone https://github.com/WongKinYiu/yolov7.git```2. ```cd yolov7/```
3. ```!pip install requirements.txt```4. script for dividing data into train,test & validation
```python yolov_train_test_split.py```create customdata folder inside yolov7
data set download link :[customdata](https://drive.google.com/drive/folders/1u4IL2sGy2Hh84Xp3YyLENsd1SH437lea?usp=sharing)
-inside images paste all train & valid images
-inside labels all labels of train & valid image
. go insiode data folder & create custom_data.yaml
& add path of image & labels (i.e .txt)```
# train and val data as 1) directory: path/images/, 2) file: path/images.txt, or 3) list: [path1/images/, path2/images/]
train: ./customdata/train.txt
val: ./customdata/valid.txt# number of classes
nc: 3# class names
names: ['pistol','rifle','revolver']
```for creating train.txt & val.txt use
(it contains the path of images )!python [genrate_test.py]()
5. go inside cfg/training & select any .yaml file
do changes such as no classes6. start training using
```!python train.py --workers 8 --device 0 --batch-size 16 --data data/custom_data.yaml --img 640 640 --cfg cfg/training/yolov7_custom_3.yaml --weights '' --name yolov7xcustom3 --hyp data/hyp.scratch.p5.yaml --epochs 200```
7. inference on video/image
```python yolov7_inference.py ``` # add alll file path inside this file```python detect.py --weights yolov7.pt --conf 0.25 --img-size 640 --source inference/images/horses.jpg```