Skip to content

Commit

Permalink
πŸ”€ [Merge] branch 'SETUP'
Browse files Browse the repository at this point in the history
  • Loading branch information
henrytsui000 committed Jun 4, 2024
2 parents 8ca39dc + 67ec59a commit b35b9ac
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 32 deletions.
24 changes: 24 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Description

[Please include a summary of the changes and the related issue. (Just overwrite this session directly)]

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## Checklist:

- [ ] The code follows the Python style guide.
- [ ] Code and files are well organized.
- [ ] All tests pass.
- [ ] New code is covered by tests.
- [ ] [Optional] We would be very happy if gitmoji :technologist: could be used to assist the commit message :speech_balloon:!

## Additional Information

Add any other information about the PR here.
72 changes: 41 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
>
> 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.
Welcome to the official implementation of the YOLOv7 and YOLOv9. This repository will contains the complete codebase, pre-trained models, and detailed instructions for training and deploying YOLOv9.
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.

## TL;DR
- Official YOLOv9 model implementation.
- Features real-time detection with state-of-the-art accuracy.
<!-- - Includes pre-trained models and training scripts. -->
- Quick train: `python examples/example_train.py`
- This is the official YOLO model implementation with an MIT License.
- For quick deployment: you can enter directly in the terminal:
```shell
$pip install git+https://github.com/WongKinYiu/yolov9mit.git
$yolo task=inference task.source=0 # source could be a single file, video, image folder, webcam ID
```

## Introduction
- [**YOLOv9**: Learning What You Want to Learn Using Programmable Gradient Information](https://arxiv.org/abs/2402.13616)
- [**YOLOv7**: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors](https://arxiv.org/abs/2207.02696)
- [**YOLOv7**: Trainable Bag-of-Freebies Sets New State-of-the-Art for Real-Time Object Detectors](https://arxiv.org/abs/2207.02696)

## Installation
To get started with YOLOv9, clone this repository and install the required dependencies:
Expand All @@ -26,43 +28,51 @@ cd yolov9mit
pip install -r requirements.txt
```

<!--
```
pip install git+https://github.com/WongKinYiu/yolov9mit.git
```
-->

<!-- ### Quick Start
Run YOLOv9 on a pre-trained model with:
```shell
python examples/example_train.py hyper.data.batch_size=8
``` -->

<!-- ## Model Zoo[WIP]
Find pre-trained models with benchmarks on various datasets in the [Model Zoo](docs/MODELS). -->
## Features
- [x] Autodownload weights/datasets
- [x] Pip installable
- [x] Support for devices:
- [x] CUDA
- [x] MPS (PyTorch 2.3+)
- [x] CPU
- [x] Task:
- [x] Training
- [x] Inference
- [ ] Validation

## Task
These are simple examples. For more customization details, please refer to [Notebooks](examples) and lower-level modifications **[HOWTO](docs/HOWTO)**.

## Training
For training YOLOv9 on your dataset:

Modify the configuration file data/config.yaml to point to your dataset.
Run the training script:
To train YOLOv9 on your dataset:

1. Modify the configuration file `data/config.yaml` to point to your dataset.
2. Run the training script:
```shell
python examples/example_train.py hyper.data.batch_size=8 model=v9-c
python lazy.py task=train task.batch_size=8 model=v9-c
```

More customization details, or ways to modify the model can be found [HOWTO](docs/HOWTO).
### Transfer Learning
To perform transfer learning with YOLOv9:
```shell
python lazy.py task=train task.batch_size=8 model=v9-c task.dataset={dataset_config}
```

## Evaluation [WIP]
Evaluate the model performance using:
### Inference
To evaluate the model performance, use:
```shell
python lazy.py weights=v9-c.pt # if cloned from GitHub
yolo task=inference task.source={Any} # if pip installed
```

### Validation [WIP]
To validate the model performance, use:
```shell
python examples/examples_evaluate.py weights=v9-c.pt
# Work In Progress...
```

## Contributing
Contributions to the YOLOv9 project are welcome! See [CONTRIBUTING](docs/CONTRIBUTING.md) for how to help out.
Contributions to the YOLOv9 project are welcome! See [CONTRIBUTING](docs/CONTRIBUTING.md) for guidelines on how to contribute.

## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=WongKinYiu/yolov9mit&type=Date)](https://star-history.com/#WongKinYiu/yolov9mit&Date)
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
name = "yolo"
version = "0.1.0"
dynamic = ["dependencies"]
description = "Official Implementation of YOLO"
authors = [
{ name = "Hao-Tang, Tsui", email = "[email protected]" },
]
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.6"
keywords = ["yolo", "object detection", "computer vision"]


[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
Expand Down
2 changes: 1 addition & 1 deletion yolo/utils/logging_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,5 @@ def validate_log_directory(cfg: Config, exp_name: str):

os.makedirs(save_path, exist_ok=True)
logger.opt(colors=True).info(f"πŸ“„ Created log folder: <u><fg #808080>{save_path}</></>")
logger.add(os.path.join(save_path, "output.log"), backtrace=True, diagnose=True)
logger.add(os.path.join(save_path, "output.log"), mode="w", backtrace=True, diagnose=True)
return save_path

0 comments on commit b35b9ac

Please sign in to comment.