projet-long/README.md

51 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2023-04-05 18:16:45 +00:00
# Neural sphere detection in images for lighting calibration
2023-04-05 18:16:45 +00:00
# Installation
Clone the repository:
```bash
2023-04-05 18:16:45 +00:00
git clone https://github.com/Laurent2916/REVA-DETR.git
cd REVA-DETR/
```
Install and activate the environment:
```bash
micromamba install -f environment.yml
micromamba activate qcav
```
2023-04-05 18:16:45 +00:00
## Usage
2023-04-05 18:16:45 +00:00
Everything is managed thanks to [Lightning CLI](https://lightning.ai/docs/pytorch/latest/api/lightning.pytorch.cli.LightningCLI.html#lightning.pytorch.cli.LightningCLI) !
2023-04-05 18:16:45 +00:00
Start a training:
```bash
2023-04-05 18:16:45 +00:00
python src/main.py fit
```
2023-04-05 18:16:45 +00:00
Start inference on images:
```bash
2023-04-05 19:06:23 +00:00
python src/main.py predict --ckpt_path <path_to_checkpoint>
```
Quick and dirty way to export to `.onnx`:
```python
>>> from src.module import DETR
>>> checkpoint = "<path_to_checkpoint>"
>>> model = DETR.load_from_checkpoint(checkpoint)
>>> model.net.save_pretrained("hugginface_checkpoint")
```
```bash
python -m transformers.onnx --model=hugginface_checkpoint onnx_export/
```
## License
Distributed under the [MIT](https://choosealicense.com/licenses/mit/) license. \
2023-04-05 18:16:45 +00:00
See [`LICENSE`](https://github.com/Laurent2916/REVA-DETR/blob/master/LICENSE) for more information.
## Contact
Laurent Fainsin _[loʁɑ̃ fɛ̃zɛ̃]_ \
\<[laurent@fainsin.bzh](mailto:laurent@fainsin.bzh)\>