This project is about the fundamentals of super-resolution artificial intelligence, specifically centered on the Enhanced Deep Super-Resolution (EDSR) technique. EDSR is used to improve image quality and resolution. The project includes a practical example demonstrating how a basic EDSR model works in enhancing images.
1: Python 3.8 or later
2: Compatible with Windows, MacOS, Linux
3: midrange to powerful computer
If you have an RTX graphics card, you can use the CUDA system to significantly speed up artificial intelligence training. Instructions for setting up the CUDA system:
1: Please go to the website https://pytorch.org/, scroll down a bit, and retrieve the download command for a PyTorch version compatible with CUDA as per your requirements. Then, execute it in your Python environment's console.
2: Please go to the link https://developer.nvidia.com/cuda-toolkit-archive, find and download the version of CUDA you chose while installing the PyTorch library. For example, as shown in the photo above, I opted for version 11.8 and downloaded it from this archive.
3: If you've completed all the steps correctly, run the Trainmodel code. If everything is as it should be, after running the code, it should say "Device: cuda". If it says "Device: cpu", something went wrong. In this case, uninstall the torch and torchvision libraries using pip: pip uninstall torch torchvision; if you're using conda: conda remove pytorch, conda remove torchvision. Then, reinstall them using the code from this link: https://pytorch.org/.
1 pip:
pip install torch torchvision
2 conda:
conda install pytorch torchvision -c pytorch
This code randomly selects a specified total number of frames from videos in the video_datas folder, then creates two different images with those frames at two different qualities: low quality at 720p and high quality at 1080p. It saves these images in the 720p_frames and 1080p_frames folders for the purpose of training artificial intelligence.
This code gathers high-quality and low-quality images from the 720p_frames and 1080p_frames folders. It uses these images to train a super-resolution artificial intelligence model that enhances image quality, leveraging the torch library. Specifically, it employs the Enhanced Deep Super-Resolution (EDSR) system, which is renowned for its effectiveness in improving resolution and detail without introducing artifacts. Once trained, the model is saved and tested on a photograph to demonstrate its capabilities in image enhancement.
This code loads a trained and saved model, and attempts to enhance the quality and resolution of a given photograph using this model, then saves the enhanced photograph.
mucithasankaan@gmail.com
https://instagram.com/mucithasankaan