Coder Social home page Coder Social logo

toxtli / deepiracy Goto Github PK

View Code? Open in Web Editor NEW
29.0 3.0 3.0 1.81 MB

Deepiracy - Video piracy detection by using neural networks and string algorithms.

Home Page: http://www.carlostoxtli.com/#repo-deepiracy

License: The Unlicense

Python 100.00%

deepiracy's Introduction

Deepiracy

Deepary is a tool that is able to find a source video on a taget video. It is capable to detect subsequences of the source video, even if it is highly distorted. You can read a complete explanation of how this work by reading this article.

Installation

Run

pip install -r requirements.txt

Quickstart

Parameters:

python app.py [from_frame_number] [to_frame_number] [how_many_frames] [video_path_1_or_url] [video_path_2_or_url]

Example how to run it with files

python app.py 1 1 -1 video1.mp4 video1.mp4

Example how to run it with youtube URLs

python app.py 1 1 -1 https://www.youtube.com/watch?v=E5K_Ug0Gq0Y https://www.youtube.com/watch?v=E5K_Ug0Gq0Y

Example how to run the real-time detection from webcam

python app.py 1 1 -1 video1.mp4 0

The required files can be downloaded from here:

https://drive.google.com/drive/folders/1BPR6j-3xc0NnlbmO96LD55tRV7e07Ynp?usp=sharing

The results can be found here:

https://drive.google.com/open?id=1iyquDYv1o48mA_ymI7AEjrlZZtqXOOz1

deepiracy's People

Contributors

toxtli 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

Watchers

 avatar  avatar  avatar

deepiracy's Issues

cv2 AssertionError when reaching the end of a video

I am very excited to experiment with the project's code, but am unable to make it run on my data.

When running the code like so (target.mp4 is the longer video containing a subsequence of the shorter query.mov):
python3 app.py 1 1 -1 data/query.mov data/target.mp4

I am shown the visualisation, but at some point an exception is thrown:

Traceback (most recent call last):
  File "/Users/jan.parzydlo/workspace/deepiracy/app.py", line 692, in <module>
    get_and_compare_videos(sys.argv[4], sys.argv[5])
  File "/Users/jan.parzydlo/workspace/deepiracy/app.py", line 470, in get_and_compare_videos
    compare_videos(video_path_1, video_path_2)
  File "/Users/jan.parzydlo/workspace/deepiracy/app.py", line 349, in compare_videos
    objects_2 =  detect_objects(area_2, thresh, detection_graph, sess, category_index, matched_area=matched_area, sequence_sorted=sequence_sorted, sequence_type=sequence_type)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jan.parzydlo/workspace/deepiracy/app.py", line 507, in detect_objects
    image_np = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cv2.error: OpenCV(4.8.0) /Users/jan.parzydlo/workspace/_clones/opencv-4.8.0/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

This seems to happen the moment the visualisation hits the end of query video. I am unsure whether this is caused by improper invocation of the program, my data or different versions of dependencies such as openCV. Help will be much appreciated.

SURF no longer available in opencv-contrib-python

When I try to run the tests for deepiracy SURF is not available. The error I get is as follows.

error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function 'cv::xfeatures2d::SURF::create'

The requirements.txt file should be updated to reference an older version of openCV where SURF is available.

cv2 error when running app.py

Hi, I tried running this program and ran into the following error. Any ideas what is happening? Thanks!

OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /io/opencv/modules/imgproc/src/color.cpp, line 10606
Traceback (most recent call last):
File "app.py", line 692, in
get_and_compare_videos(sys.argv[4], sys.argv[5])
File "app.py", line 470, in get_and_compare_videos
compare_videos(video_path_1, video_path_2)
File "app.py", line 119, in compare_videos
objects_1 = detect_objects(frame_1, thresh, detection_graph, sess, category_index, sequence_sorted=sequence_sorted, sequence_type=sequence_type)
File "app.py", line 507, in detect_objects
image_np = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
cv2.error: /io/opencv/modules/imgproc/src/color.cpp:10606: error: (-215) scn == 3 || scn == 4 in function cvtColor

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.