- This repository is an easy toolkit to restore the underwater image/video using Deep Learning model!
- It uses the model from the paper Underwater Ranker: Learn Which is better and How to be better [AAAI 2023 Oral]
- Install python>=3.6
- Git clone this repository by typing this command in the command line:
git clone https://github.com/AllenEdgarPoe/UnderwaterImgRestore4Diver.git
- Create python virtual environment by using the below command line:
python -m venv venv
- Activate the virtual environment:
venv\Scripts\activate
- Install required libraries:
pip install -r requirements.txt
- Download models from models
- get
NU2Net_ckpt.pth
and put it in./checkpoints/NU2Net_ckpt.pth
- get
- Start the program!
python main.py
- Convert the single image/video file by clicking
Single file
tab - Convert the whole image/video files by clicking
Batch
tab. - You can set the save directory by designating it through
output_path
tab. If you don't, the default saving path is./results
- Comparison results will be saved in
[save_path]/compare
- Enjoy the beautiful comparison results in the below tab!
![image](https://private-user-images.githubusercontent.com/43398106/268231087-8e61b799-bf4e-4f1b-954c-9c8c5efe37da.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5MTA1NDIsIm5iZiI6MTczODkxMDI0MiwicGF0aCI6Ii80MzM5ODEwNi8yNjgyMzEwODctOGU2MWI3OTktYmY0ZS00ZjFiLTk1NGMtOWM4YzVlZmUzN2RhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDA2MzcyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcwODM2OTNjMTI2OWJlNWVkYTBjYmY2YTgxYjlmOTJkZjJiM2VkOWQxNDZmNWZlMGMyYzdjOWY0MWE5ZmMwNzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.OpSMkgDQtKT1NnCgdm_DZJ2hXYccl-vSUvqiD_XFCyE)
All of the pictures were taken by me @ Gili.T (Indonesia)
dive.mp4
- The code for model architecture is from UnderwaterRanker