This is a project for Low-light image enhancement with edge AI computations using Jetson Nano.
LLIE approach: CPGA-Net
Python == 3.6
Follow this link Jetson Zoo
- onnxruntime
# Download pip wheel from location above for your version of JetPack
wget https://nvidia.box.com/shared/static/pmsqsiaw4pg9qrbeckcbymho6c01jj4z.whl -O onnxruntime_gpu-1.11.0-cp36-cp36-linux_aarch64.whl
pip3 install onnxruntime_gpu-1.11.0-cp36-cp36-linux_aarch64.whl
TensorRT Installation Guide
TensorRT Intro Notebooks
For installing TensorRT in a conda environment, you can refer to this forum post
- pycuda
- tensorrt
PyTorch tutorial on exporting a simple model to ONNX
Exporting a Model from PyTorch to ONNX and Running it using ONNX Runtime
dummy_input = torch.randn(1, 3, 256, 256)
torch.onnx.export(network, dummy_input, MODEL_NAME+'.onnx' )
python3 demo_onnx.py
You can try different execution ways, see onnx doc
trtexec --onnx=OV_enhance_color-llie-ResCBAM_g.onnx --saveEngine=CPGANet_engine.trt --explicitBatch --workspace=128
python3 demo_trt.py
Image Resolution: 256x256
Pytorch | ONNX (CUDA) | ONNX (TRT) | TensorRT |
---|---|---|---|
139.343681 ms | 110.399661 ms | 83.792326 ms | 72.907643 ms |
Pytorch | ONNX (CUDA) | ONNX (TRT) | TensorRT |
---|---|---|---|
39.909654 ms | 37.896626 ms | 32.811749 ms | ? ms |
Here are some example images enhanced using the LLIE approach:
Image From LIME
TensorRT doesn't perform normally with unknown issue,