Metadata-Version: 2.1
Name: yogo
Version: 1.0.0
Summary: The "you only glance once" object detection model
Author-email: Axel Jacobsen <axelnj44@gmail.com>, Paul Lebel <paul.lebel@czbiohub.org>, Ilakkiyan Jeyakumar <ilakkiyan.jeyakumar@czbiohub.org>
License: BSD 3-Clause License
        
        Copyright (c) 2023, Chan-Zuckerberg Biohub
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        * Redistributions of source code must retain the above copyright notice, this
          list of conditions and the following disclaimer.
        
        * Redistributions in binary form must reproduce the above copyright notice,
          this list of conditions and the following disclaimer in the documentation
          and/or other materials provided with the distribution.
        
        * Neither the name of the copyright holder nor the names of its
          contributors may be used to endorse or promote products derived from
          this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: repository, https://github.com/czbiohub-sf/yogo
Keywords: object detection,YOGO,YOLO,deep learning,PyTorch
Requires-Python: <3.11,>=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: zarr==2.17
Requires-Dist: torch<=2.1.0,>=1.13.1
Requires-Dist: torchmetrics[detection]>=0.11.4
Requires-Dist: torchvision>=0.14.1
Requires-Dist: ruamel.yaml==0.17.21
Requires-Dist: tqdm<5.0.0,>=4.61.2
Requires-Dist: wandb>=0.14.2
Requires-Dist: matplotlib<4.0.0,>=3.4.2
Requires-Dist: MonkeyType==23.3.0
Requires-Dist: onnx>=1.14.0
Requires-Dist: onnxruntime>=1.14.1
Requires-Dist: onnx-simplifier>=0.4.17
Requires-Dist: openvino-dev==2023.0.2
Provides-Extra: dev
Requires-Dist: pytest<8.0.0,>=7.4.3; extra == "dev"
Requires-Dist: ruff>=0.4.4; extra == "dev"
Requires-Dist: black>=24.4.2; extra == "dev"
Requires-Dist: mypy>=1.10.0; extra == "dev"

# you only glance once

A version of the [YOLO architecture (versions 1 through 3)](https://pjreddie.com/darknet/yolo/), optimized for inference speed on simple object detection problems. Designed for the [remoscope project](https://www.czbiohub.org/life-science/seeing-malaria-in-a-new-light/) by the bioengineering team at the [Chan-Zuckerberg Biohub SF](https://www.czbiohub.org/sf/).

Our yogo manuscript is currently in preparation - stay tuned!

## Install

With Python versions >= 3.9 and < 3.11, you can install yogo with `pip`

```console
python3 -m pip install -e .
```


## Basic usage

```console
$ yogo train path/to/dataset-definition-file.yml  # train your model!
$ yogo infer path/to/model.pth  # use your model!
$ yogo export path/to/model.pth  # use your model somewhere else!
$ yogo test path/to/model.pth path/to/dataset-definition-file. # test your model!
$ yogo --help  # all the other details are here :)
```

We're using [Weights and Biases](http://wandb.ai) for run tracking. But, note that you do not need a W&B account to run anything! Runs that are started without an account are logged to an anonymous page. If you do decide to start with W&B, look [here](https://docs.wandb.ai/quickstart). Anonymous runs can be [claimed later](https://docs.wandb.ai/guides/app/features/anon).

Further, we currently only support GPU training, since we use Torch's Distributed Data Parallel.

> [!NOTE]
> Installing Openvino on Apple Silicon is a little involved. [Here is Openvino's guide to installation](https://github.com/openvinotoolkit/openvino/blob/master/docs/dev/build_mac_arm.md). You can also use a Linux VM or Docker.


## Docs

Documentation for YOGO. If you want documentation in a specific area, [let us know](https://github.com/czbiohub-sf/yogo/issues/new)!

- [recipes.md](docs/recipes.md) has the basics of using YOGO in your own code
- [cli.md](docs/cli.md) is a short guide on how to use YOGO from the command line (via `yogo`)
- [yogo-high-level.md](docs/yogo-high-level.md) is a high level guide of the YOGO architecture
- [dataset-definition.md](docs/dataset-definition.md) defines the dataset description files, the files YOGO uses to define datasets for training


## Contributing Guidelines

Please run `./prepush.sh` before pushing. It runs [`mypy`](https://mypy-lang.org/), [`ruff`](https://docs.astral.sh/ruff/), [`black`](https://github.com/psf/black) and [`pytest`](https://docs.pytest.org/en/8.2.x/).

When creating issues or pull requests, please be detailed. What exact commands were you running on what computer to get your issue? What exactly does your PR contribute and why is it necessary?
