Skip to content

Shyandram/EdgeAI_LLIE-Jetson-Nano

Repository files navigation

EdgeAI Jetson Nano LLIE

Introduction

This is a project for Low-light image enhancement with edge AI computations using Jetson Nano.
LLIE approach: CPGA-Net
Python == 3.6

Installation

ONNX

Follow this link Jetson Zoo

  1. 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

TensorRT Installation Guide
TensorRT Intro Notebooks

For installing TensorRT in a conda environment, you can refer to this forum post

  1. pycuda
  2. tensorrt

Usage

Pytorch to ONNX

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' )

ONNX

python3 demo_onnx.py

You can try different execution ways, see onnx doc

TRT

trtexec --onnx=OV_enhance_color-llie-ResCBAM_g.onnx --saveEngine=CPGANet_engine.trt --explicitBatch --workspace=128
python3 demo_trt.py

Runtime Performance

Image Resolution: 256x256

Pytorch ONNX (CUDA) ONNX (TRT) TensorRT
139.343681 ms 110.399661 ms 83.792326 ms 72.907643 ms

Efficient Version (DGF)

Pytorch ONNX (CUDA) ONNX (TRT) TensorRT
39.909654 ms 37.896626 ms 32.811749 ms ? ms

Results

Here are some example images enhanced using the LLIE approach:

Pytorch

Image Pytorch

ONNX

Image ONNX

ONNX (TRT)

Image ONNX(TRT)

TensorRT

Image TRT

Image From LIME

Issues

TensorRT doesn't perform normally with unknown issue,

Reference

  1. PyTorch Official Documentation
  2. ONNX Official Documentation
  3. TensorRT Official Documentation
  4. Jetson Nano Developer Kit
  5. EdgeAI LLIE NCS2 GitHub Repository
  6. CPGA-Net-Pytorch GitHub Repository

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages