Skip to content

aegroto/nif25

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NIF25: Reducing the Gap in INR-Based Image Compression

[Pre-print] [Project Page (Coming soon)]

This repository contains the source code used in experimental evaluations for the paper "NIF25: Reducing the Gap in INR-Based Image Compression".

Environment setup

The Python environment can be handled using conda:

conda env create -f environment.yaml 

The command above will create an environment named nif25, activated by:

conda activate nif25

Reproducing experiments

Single image

To encode a single image run the encode.py scripts:

python3 encode.py <CONFIGURATION_PATH> <INPUT_IMAGE> <COMPRESSED_IMAGE>

For example, to encode the image #3 from the Kodak dataset located at "test_images/kodak/3.png" and save it at "kodim03.nif" run:

python3 encode.py configurations/nif/kodak/120.yaml test_images/kodak/3.png kodim03.nif

Analogously, you can decode a compressed image using the decode.py script:

python3 decode.py <CONFIGURATION_PATH> <COMPRESSED_IMAGE> <DECOMPRESSED_IMAGE> 

To decompress the image encoded in the example above, use:

python3 decode.py configurations/nif/kodak/120.yaml kodim03.nif kodim03_decoded.png

Input files should be encoded in lossless PNG format. Output file names end with ".nif" by convention, but this is not forced by code.

Dataset encoding

To reproduce the experiments discussed in the paper, run the corresponding script in the folder "scripts/datasets/". These scripts will generate a bash file named "schedule.sh", filled with the sequence of commands that will encode a whole dataset. Logs will be saved under "logs/" and compressed files, along decompressed images and statistics will be saved under "results/".

For instance, to generate a "schedule.sh" to reproduce experiments on Kodak use:

./scripts/datasets/kodak.sh

Then execute it with ./schedule.sh.

If you want to perform a full encode-decode experiment on a single image and to export stats, on Linux/MacOS systems you can use the "scripts/run/full_experiment.sh" script as follows:

./scripts/run/experiment.sh <CONFIGURATION_PATH> <INPUT_IMAGE> <OUTPUT_FOLDER>

The compressed and then decoded images, along with stats saved in JSON, will be exported in the indicated output folder.

Downloading datasets

Kodak

The kodak dataset is included in this repository, along with compressed ".nif" files that can be decoded using this software.

CLIC2020

The uncompressed CLIC2020 validation images used in the experiments can be download at this link.

About

Code for the INR-based codec presented in the paper "NIF25: Reducing the Gap in INR-Based Image Compression"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published