Code Monkey home page Code Monkey logo

recurring-content-detector's People

Contributors

lcd1232 avatar nielstenboom 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

Watchers

 avatar  avatar

recurring-content-detector's Issues

Enhancement: Sample Size

I used your code to skip intros, had some great success with it.

However I realized that I didn't need to convert the whole video, just a sample of it.

A new argument, sample_percentage, would be great.

In my case I just grabbed the first 10 mins like this:

if framecount > 0:
        stream = ffmpeg.input(input).trim(start=0, end=600)
        if resize_width == 224:

Cool project

Thanks for a really cool project. I hope and can use this in my own project.

So far I tested CH and CNN (CNN is to slow to be usable and seems to be less precise then CH, can this be related to the fact that i only used 3 episodes?)

Previously i have tried to use opencv phash to extract the credits.
The idea was to check the the hashed frames against the video and if the hash was present in all the episodes of that is most likely a intro, but i never got it working properly because my lack of numpy skills

Fix supplying parameters

Currently the parameters are hardcoded in config.py, which is hard to change after you installed the package.

To implement:
Make it so that you can supply these parameters in the main detect() function.

Increase tolerance of non-video files

It's not uncommon to have other meta data in with a collection of videos.

If you encounter a file that ffmpeg doesn't like the whole processing loop ends. I'd prefer that it just skips over that file and moves on.

Shape Error

just running the defaults

import recurring_content_detector as rcd rcd.detect("<path/>")

and results with this error

Traceback (most recent call last):
  File "C:\Users\phi\PycharmProjects\pythonProject\main.py", line 2, in <module>
    rcd.detect("Z:\Video\TV Shows\Live Action\Shows\S\Supernatural\Season 6")
  File "C:\Users\phi\AppData\Local\Programs\Python\Python311\Lib\site-packages\recurring_content_detector\__init__.py", line 4, in detect
    return detector.detect(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\phi\AppData\Local\Programs\Python\Python311\Lib\site-packages\recurring_content_detector\detector.py", line 238, in detect
    featurevectors.construct_feature_vectors(   
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\phi\AppData\Local\Programs\Python\Python311\Lib\site-packages\recurring_content_detector\featurevectors.py", line 108, in construct_feature_vectors
    feature_vector = vector_function(img)
                     ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\phi\AppData\Local\Programs\Python\Python311\Lib\site-packages\recurring_content_detector\featurevectors.py", line 75, in color_hist
    result = get_img_color_hist(img, 100)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\phi\AppData\Local\Programs\Python\Python311\Lib\site-packages\recurring_content_detector\featurevectors.py", line 70, in get_img_color_hist
    main = main / (image.shape[0] * image.shape[1])
                   ^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'shape'

Process finished with exit code 1```

Make it a pypi package

Hi, I want to use this tool, on windows and linux, is it possible to have a package for windows where all the library are working, and same for linux ? I can't install faiss

The function fill_gaps doesn't work as described

Your fill_gaps function in detector.py doesn't work as decribed.
For instance :

>>> fill_gaps([0,0,1,0,0,0,0,0,0,1,0,0], 80)
[0,0,1,0,0,0,0,0,0,1,0,0]

Last lookahead rows aren't checked.
I suggest this instead (it looks terrible but does the job) :

def fill_gaps(sequence, lookahead):
    i = 0
    change_needed = False
    look_left = 0
    while i < len(sequence):
        look_left -= 1
        if change_needed and look_left < 1:
            change_needed = False
        if sequence[i]:
            if change_needed:
                for k in to_change:
                    sequence[k] = True
            else:
                change_needed = True
            look_left = lookahead
            to_change = []
        else:
            if change_needed:
                to_change.append(i)
        i+=1
    return sequence

Very nice project by the way, good job.

EDL generation for Kodi

Your project matches exactly what I have been hoping kodi upnext addon devs would implement. But they feel intro and outro detection is not good enough for them to implement those features. Would it be possible for your app to create edl timing files.

im85288/service.upnext#171

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.