Skip to content

samuelebortolotti/prnu-python

 
 

Repository files navigation

Python porting of PRNU extractor and helper functions

The original work is based on

DOI

Original Travis build

TRAVIS

About

Python package which provides several functions to compute and test cameras PRNU.

We have added, to the original work, the possibility to carry out noise extraction using a PyTorch model which accepts normalized images whose values are between 0 and 1.

Since the project has been adapted to deal with the following FFDNet implementation, the input of such model should be an image with size [1, channels, heigth, width] and the standard deviation (sigma) of the noise.

Authors

Original authors

Later authors

Usage

Set up

Clone this repository

git clone https://github.com/samuelebortolotti/prnu-python

Move to the project folder

cd prnu-python

Install the package locally on your machine:

The installation with pip can be performed as follows

pip install .

Or directly from GitHub

pip install git+git://github.com/samuelebortolotti/prnu-python@v[version]

Where [version] is the version of the

pip install git+git://github.com/samuelebortolotti/[email protected]

Or you can add the package in your requirements.txt file, and install it later, by including the following line

git+git://github.com/samuelebortolotti/prnu-python@v[version]

For example:

git+git://github.com/samuelebortolotti/[email protected]

Now you can import the prnu package whenever and wherever you want.

Install the package in the virtual environment

You can use the GNU Makefile to generate the virtual environment by typing

make env

Activate the virtual environment

source venv/prnu/bin/activate

Install the requirements

make install

Documentation

The documentation is generated using Sphinx.

First, install the development requirements

make install-dev

Then generate the Sphinx layout

make doc-layout

Generate the documentation content; the documentation will be generated in the docs folder.

make doc

Then, you can open the documentation through xdg-open by typing

make open-doc

Test

You can run the tests by typing

cd test
python -m unittest test_prnu.TestPrnu

Tested with Python >= 3.6

Credits

Reference MATLAB implementation by Binghamton university: http://dde.binghamton.edu/download/camera_fingerprint/

Packages

 
 
 

Languages

  • Python 89.7%
  • Makefile 10.3%