Giter Site home page Giter Site logo

kpsarakis / image-forgery-detection-cnn Goto Github PK

View Code? Open in Web Editor NEW
141.0 6.0 36.0 336.39 MB

Image forgery detection using convolutional neural networks. Group 10's final project for TU Delft's course CS4180 Deep Learning 2019.

Python 100.00%
pytorch image-forgery-detection cnn deep-learning

image-forgery-detection-cnn's People

Contributors

achilleasvlogiaris avatar arkajitb avatar kpsarakis avatar psoilis avatar rafailskoulos17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

image-forgery-detection-cnn's Issues

Demo example?

Hi,

cool project :)
Would it be possible to provide a demo example of how to run your application with a single tampered image that is neither in CASIA2 nor NC2016 with your pretrained weights?

Best
Karol

Where can I find the masks in the data ?

I'm trying to find the mask used in patch extractor but I'm not able to. Can you please let me know where can I find the same. Thanks in advance!

mask = io.imread(self.input_path + '/masks/' + im_name + '_gt.png')

Error in feature_extraction.py script

When running feature_extraction.py script, I am encountering the following error :

Traceback (most recent call last):
File "C:/Users/chinm/Desktop/Image-Forgery-Detection-CNN-master/Image-Forgery-Detection-CNN-master/src/feature_extraction.py", line 16, in
create_feature_vectors(model, tampered_path, authentic_path, output_filename)
File "C:\Users\chinm\Desktop\Image-Forgery-Detection-CNN-master\Image-Forgery-Detection-CNN-master\src\feature_fusion\feature_vector_generation.py", line 31, in create_feature_vectors
pd.DataFrame(get_patch_yi(model, image))])], axis=1, sort=False)
File "C:\Users\chinm\Desktop\Image-Forgery-Detection-CNN-master\Image-Forgery-Detection-CNN-master\src\feature_fusion\feature_vector_generation.py", line 77, in get_patch_yi
patches = get_patches(image, stride=128)
File "C:\Users\chinm\Desktop\Image-Forgery-Detection-CNN-master\Image-Forgery-Detection-CNN-master\src\feature_fusion\patch_extraction.py", line 17, in get_patches
windows = view_as_windows(image_mat, window_shape, step=stride)
File "C:\Users\chinm\Desktop\Image-Forgery-Detection-CNN-master\Image-Forgery-Detection-CNN-master\venv\lib\site-packages\skimage\util\shape.py", line 209, in view_as_windows
raise TypeError("arr_in must be a numpy ndarray")
TypeError: arr_in must be a numpy ndarray

I am not able to find any solution to this error. Hope you can help me with this.

New to python programming

Hi Sir. I am not understanding the first step of your pipeline:

  1. Extract CNN training patches: as shown in extract_patches.py

Can you kindly elaborate here what you want me to do by extracting?

Problem with feature_extraction with the NC2016 dataset

I ran the script with the CASIA2 dataset and it went well, but with the NC2016 dataset and the pretrained model it shows this kind of error.

After changing the code for the NC2016 dataset:
input_path = '../data/NC2016/'
output_filename = 'NC2016_WithRot_LR001_b128_nodrop.csv'
create_feature_vectors_nc(model, input_path, output_filename)

I keep encountering this kind of errors:
DtypeWarning: Columns (3,6,10,15,16,18,19) have mixed types.Specify dtype option on import or set low_memory=False.
create_feature_vectors_nc(model, input_path, output_filename)

ValueError: At least one stride in the given numpy array is negative, and tensors with negative strides are not currently supported. (You can probably work around this by making a copy of your array with array.copy().)

How to test on a single image?

Hi - awesome project - thanks!

I'd like to test the pretrained model/s on a single image file.

What is the best route to doing this?

Any chance of a v short demo script?

Thanks again!

Issue loading dataset-CASIA2

Screenshot from 2021-06-15 02-29-19

This is a snippet of patch_extractor_casia.py from line number-93.

os.listdir(tp_dir) gives only filenames and not absolute paths.
" f " contains just the file name, so the .split(os.sep)[-1] is not required in - im_name = f.split(os.sep)[-1].split('.')[0]

Demo request.

Getting errors running this application on my local machine. Some of the errors:

Traceback (most recent call last):
File ".\extract_patches.py", line 9, in
pe.extract_patches()
File "C:\Users\toddy\OneDrive\Documents\Project\Tendai NUST\Tendai\Image-Forgery-Detection-CNN-master_2\Image-Forgery-Detection-CNN-master\src\patch_extraction\patch_extractor_casia.py", line 89, in extract_patches
for f in os.listdir(tp_dir):
FileNotFoundError: [WinError 3] The system cannot find the path specified: '../data/CASIA2/Tp/'

Clear Readme

Can the Readme be more clear and have a step-wise process on how we can use this model?
Engineers around can write API's for the same.

Problem when running extract_patches.py

"C:\Program Files\Python39\python.exe" C:\Users\ikhwa\PycharmProjects\IFDCNN\src\extract_patches.py
Traceback (most recent call last):
File "C:\Users\ikhwa\PycharmProjects\IFDCNN\src\extract_patches.py", line 9, in
pe.extract_patches()
File "C:\Users\ikhwa\PycharmProjects\IFDCNN\src\patch_extraction\patch_extractor_casia.py", line 92, in extract_patches
image = io.imread(tp_dir + f)
File "C:\Program Files\Python39\lib\site-packages\skimage\io_io.py", line 48, in imread
img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
File "C:\Program Files\Python39\lib\site-packages\skimage\io\manage_plugins.py", line 207, in call_plugin
return func(*args, **kwargs)
File "C:\Program Files\Python39\lib\site-packages\skimage\io_plugins\imageio_plugin.py", line 10, in imread
return np.asarray(imageio_imread(*args, **kwargs))
File "C:\Program Files\Python39\lib\site-packages\imageio_init_.py", line 97, in imread
return imread_v2(uri, format=format, **kwargs)
File "C:\Program Files\Python39\lib\site-packages\imageio\v2.py", line 226, in imread
with imopen(uri, "ri", **imopen_args) as file:
File "C:\Program Files\Python39\lib\site-packages\imageio\core\imopen.py", line 298, in imopen
raise err_type(err_msg)
ValueError: Could not find a backend to open C:/Users/ikhwa/PycharmProjects/IFDCNN/data/CASIA2/Tp/Thumbs.db`` with iomode ri`.

Process finished with exit code 1

Im not sure about this since im still learning python

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.