henry000 commited on
Commit
631540a
·
1 Parent(s): b038f54

✅ [Pass] test and change README& default task!

Browse files
README.md CHANGED
@@ -2,20 +2,20 @@
2
 
3
  ![GitHub License](https://img.shields.io/github/license/WongKinYiu/YOLO)
4
  [![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/henry000/YOLO)
5
- <!-- ![WIP](https://img.shields.io/badge/status-WIP-orange) -->
6
  <!-- > [!IMPORTANT]
7
  > This project is currently a Work In Progress and may undergo significant changes. It is not recommended for use in production environments until further notice. Please check back regularly for updates.
8
  >
9
- > Use of this code is at your own risk and discretion. It is advisable to consult with the project owner before deploying or integrating into any critical systems.
10
 
11
- Welcome to the official implementation of YOLOv7 and YOLOv9. This repository will contains the complete codebase, pre-trained models, and detailed instructions for training and deploying YOLOv9. -->
12
 
13
  ## TL;DR
14
  - This is the official YOLO model implementation with an MIT License.
15
- - For quick deployment: you can enter directly in the terminal:
16
  ```shell
17
  pip install [email protected]:WongKinYiu/YOLO.git
18
- yolo task=inference task.source=0 # source could be a single file, video, image folder, webcam ID
19
  ```
20
 
21
  ## Introduction
@@ -23,7 +23,7 @@ yolo task=inference task.source=0 # source could be a single file, video, image
23
  - [**YOLOv7**: Trainable Bag-of-Freebies Sets New State-of-the-Art for Real-Time Object Detectors](https://arxiv.org/abs/2207.02696)
24
 
25
  ## Installation
26
- To get started with YOLOv9, clone this repository and install the required dependencies:
27
  ```shell
28
  git clone [email protected]:WongKinYiu/YOLO.git
29
  cd YOLO
@@ -60,13 +60,13 @@ pip install -r requirements.txt
60
  These are simple examples. For more customization details, please refer to [Notebooks](examples) and lower-level modifications **[HOWTO](docs/HOWTO.md)**.
61
 
62
  ## Training
63
- To train YOLO on your dataset:
64
 
65
- 1. Modify the configuration file `data/config.yaml` to point to your dataset.
66
  2. Run the training script:
67
  ```shell
68
- python yolo/lazy.py dataset=dev use_wandb=True
69
- python yolo/lazy.py task.data.batch_size=8 model=v9-c # or more args
70
  ```
71
 
72
  ### Transfer Learning
@@ -76,36 +76,44 @@ python yolo/lazy.py task=train task.data.batch_size=8 model=v9-c dataset={datase
76
  ```
77
 
78
  ### Inference
79
- To evaluate the model performance, use:
80
  ```shell
81
- python yolo/lazy.py task=inference # if cloned from GitHub
82
- python yolo/lazy.py task=inference \
83
  name=AnyNameYouWant \ # AnyNameYouWant
84
  device=cpu \ # hardware cuda, cpu, mps
85
  model=v9-s \ # model version: v9-c, m, s
86
  task.nms.min_confidence=0.1 \ # nms config
87
  task.fast_inference=onnx \ # onnx, trt, deploy
88
- task.data.source=data/toy/images/train \ # path to file, dir, webcam
89
  +quite=True \ # Quite Output
90
- yolo task=inference task.data.source={Any} # if pip installed
 
91
  ```
92
 
93
  ### Validation
94
- To validate the model performance, use:
95
  ```shell
96
  python yolo/lazy.py task=validation
97
- # or
98
  python yolo/lazy.py task=validation dataset=toy
99
  ```
100
 
101
  ## Contributing
102
- Contributions to the YOLOv9 project are welcome! See [CONTRIBUTING](docs/CONTRIBUTING.md) for guidelines on how to contribute.
103
 
104
  ## Star History
105
  [![Star History Chart](https://api.star-history.com/svg?repos=WongKinYiu/YOLO&type=Date)](https://star-history.com/#WongKinYiu/YOLO&Date)
106
 
107
  ## Citations
108
  ```
 
 
 
 
 
 
 
 
109
  @misc{wang2024yolov9,
110
  title={YOLOv9: Learning What You Want to Learn Using Programmable Gradient Information},
111
  author={Chien-Yao Wang and I-Hau Yeh and Hong-Yuan Mark Liao},
 
2
 
3
  ![GitHub License](https://img.shields.io/github/license/WongKinYiu/YOLO)
4
  [![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/henry000/YOLO)
5
+ ![WIP](https://img.shields.io/badge/status-WIP-orange)
6
  <!-- > [!IMPORTANT]
7
  > This project is currently a Work In Progress and may undergo significant changes. It is not recommended for use in production environments until further notice. Please check back regularly for updates.
8
  >
9
+ > Use of this code is at your own risk and discretion. It is advisable to consult with the project owner before deploying or integrating into any critical systems. -->
10
 
11
+ Welcome to the official implementation of YOLOv7 and YOLOv9. This repository will contains the complete codebase, pre-trained models, and detailed instructions for training and deploying YOLOv9.
12
 
13
  ## TL;DR
14
  - This is the official YOLO model implementation with an MIT License.
15
+ - For quick deployment: you can directly install by pip+git:
16
  ```shell
17
  pip install [email protected]:WongKinYiu/YOLO.git
18
+ yolo task.data.source=0 # source could be a single file, video, image folder, webcam ID
19
  ```
20
 
21
  ## Introduction
 
23
  - [**YOLOv7**: Trainable Bag-of-Freebies Sets New State-of-the-Art for Real-Time Object Detectors](https://arxiv.org/abs/2207.02696)
24
 
25
  ## Installation
26
+ To get started using YOLOv9's developer mode, we recommand you clone this repository and install the required dependencies:
27
  ```shell
28
  git clone [email protected]:WongKinYiu/YOLO.git
29
  cd YOLO
 
60
  These are simple examples. For more customization details, please refer to [Notebooks](examples) and lower-level modifications **[HOWTO](docs/HOWTO.md)**.
61
 
62
  ## Training
63
+ To train YOLO on your machine/dataset:
64
 
65
+ 1. Modify the configuration file `yolo/config/dataset/**.yaml` to point to your dataset.
66
  2. Run the training script:
67
  ```shell
68
+ python yolo/lazy.py task=train dataset=** use_wandb=True
69
+ python yolo/lazy.py task=train task.data.batch_size=8 model=v9-c weight=False # or more args
70
  ```
71
 
72
  ### Transfer Learning
 
76
  ```
77
 
78
  ### Inference
79
+ To use a model for object detection, use:
80
  ```shell
81
+ python yolo/lazy.py # if cloned from GitHub
82
+ python yolo/lazy.py task=inference \ # default is inference
83
  name=AnyNameYouWant \ # AnyNameYouWant
84
  device=cpu \ # hardware cuda, cpu, mps
85
  model=v9-s \ # model version: v9-c, m, s
86
  task.nms.min_confidence=0.1 \ # nms config
87
  task.fast_inference=onnx \ # onnx, trt, deploy
88
+ task.data.source=data/toy/images/train \ # file, dir, webcam
89
  +quite=True \ # Quite Output
90
+ yolo task.data.source={Any Source} # if pip installed
91
+ yolo task=inference task.data.source={Any}
92
  ```
93
 
94
  ### Validation
95
+ To validate model performance, or generate a json file in COCO format:
96
  ```shell
97
  python yolo/lazy.py task=validation
 
98
  python yolo/lazy.py task=validation dataset=toy
99
  ```
100
 
101
  ## Contributing
102
+ Contributions to the YOLO project are welcome! See [CONTRIBUTING](docs/CONTRIBUTING.md) for guidelines on how to contribute.
103
 
104
  ## Star History
105
  [![Star History Chart](https://api.star-history.com/svg?repos=WongKinYiu/YOLO&type=Date)](https://star-history.com/#WongKinYiu/YOLO&Date)
106
 
107
  ## Citations
108
  ```
109
+ @misc{wang2022yolov7,
110
+ title={YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors},
111
+ author={Chien-Yao Wang and Alexey Bochkovskiy and Hong-Yuan Mark Liao},
112
+ year={2022},
113
+ eprint={2207.02696},
114
+ archivePrefix={arXiv},
115
+ primaryClass={id='cs.CV' full_name='Computer Vision and Pattern Recognition' is_active=True alt_name=None in_archive='cs' is_general=False description='Covers image processing, computer vision, pattern recognition, and scene understanding. Roughly includes material in ACM Subject Classes I.2.10, I.4, and I.5.'}
116
+ }
117
  @misc{wang2024yolov9,
118
  title={YOLOv9: Learning What You Want to Learn Using Programmable Gradient Information},
119
  author={Chien-Yao Wang and I-Hau Yeh and Hong-Yuan Mark Liao},
docs/HOWTO.md CHANGED
@@ -6,7 +6,7 @@ To facilitate easy customization of the YOLO model, we've structured the codebas
6
 
7
  ```shell
8
  # Train
9
- python yolo/lazy.py dataset=dev use_wandb=True
10
 
11
  # Validate
12
  python yolo/lazy.py task=validation
 
6
 
7
  ```shell
8
  # Train
9
+ python yolo/lazy.py task=train dataset=dev use_wandb=True
10
 
11
  # Validate
12
  python yolo/lazy.py task=validation
tests/test_tools/test_loss_functions.py CHANGED
@@ -17,7 +17,7 @@ from yolo.utils.bounding_box_utils import Vec2Box
17
  @pytest.fixture
18
  def cfg() -> Config:
19
  with initialize(config_path="../../yolo/config", version_base=None):
20
- cfg = compose(config_name="config")
21
  return cfg
22
 
23
 
 
17
  @pytest.fixture
18
  def cfg() -> Config:
19
  with initialize(config_path="../../yolo/config", version_base=None):
20
+ cfg = compose(config_name="config", overrides=["task=train"])
21
  return cfg
22
 
23
 
yolo/config/config.yaml CHANGED
@@ -6,7 +6,7 @@ name: v9-dev
6
 
7
  defaults:
8
  - _self_
9
- - task: train
10
  - dataset: coco
11
  - model: v9-c
12
  - general
 
6
 
7
  defaults:
8
  - _self_
9
+ - task: inference
10
  - dataset: coco
11
  - model: v9-c
12
  - general