2023-04-05 18:16:45 +00:00
# Neural sphere detection in images for lighting calibration
2022-09-12 10:19:19 +00:00
2023-04-05 18:16:45 +00:00
# Installation
2022-09-12 10:19:19 +00:00
Clone the repository:
```bash
2023-04-05 18:16:45 +00:00
git clone https://github.com/Laurent2916/REVA-DETR.git
cd REVA-DETR/
2022-09-12 10:19:19 +00:00
```
2023-04-05 18:20:59 +00:00
Install and activate the environment:
```bash
micromamba install -f environment.yml
micromamba activate qcav
```
2023-04-05 18:16:45 +00:00
## Usage
2022-09-12 10:19:19 +00:00
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 ) !
2022-09-12 10:19:19 +00:00
2023-04-05 18:16:45 +00:00
Start a training:
2022-09-12 10:19:19 +00:00
```bash
2023-04-05 18:16:45 +00:00
python src/main.py fit
2022-09-12 10:19:19 +00:00
```
2023-04-05 18:16:45 +00:00
Start inference on images:
2022-09-12 10:19:19 +00:00
```bash
2023-04-05 19:06:23 +00:00
python src/main.py predict --ckpt_path < path_to_checkpoint >
2022-09-12 10:19:19 +00:00
```
2023-04-05 20:10:29 +00:00
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/
```
2022-09-12 10:19:19 +00:00
## 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.
2022-09-12 10:19:19 +00:00
## Contact
2022-09-12 12:52:28 +00:00
Laurent Fainsin _[loʁɑ ̃ fɛ̃zɛ̃]_ \
2022-09-12 10:19:19 +00:00
\<[laurent@fainsin.bzh ](mailto:laurent@fainsin.bzh )\>