nielstenboom / recurring-content-detector Goto Github PK
View Code? Open in Web Editor NEWUnsupervised detection of opening / closing credits, recaps, and previews in video files π₯πΏπ¬
License: MIT License
Unsupervised detection of opening / closing credits, recaps, and previews in video files π₯πΏπ¬
License: MIT License
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:
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
Not sure how to use this project but I'm always falling into: ValueError: need at least one array to concatenate.
Where does this come from?
I'm using the docker implementation
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.
For example
When 10 episodes were present, the script was executed and we get all the timestamp for 10 episodes but when a new episode is downloaded, is it possible to match it against the previous 10 episode without repeating the process for first 10 episodes.
recurring-content-detector/recurring_content_detector/detector.py
Lines 113 to 121 in 1ed2d0f
What does s
and e
mean in your script?? Please use better naming convention
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.
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```
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
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.
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.
Does the script work with linux ? Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.