Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: move away from conda + version upgrades #35

Merged
merged 3 commits into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ jobs:
- uses: FedericoCarboni/setup-ffmpeg@v1
id: setup-ffmpeg

- uses: conda-incubator/setup-miniconda@v2
- uses: actions/setup-python@v4
with:
python-version: "3.8"
- run: |
pip install .
python-version: '3.9'

- name: System dependencies
run: |
sudo apt-get update
sudo apt-get install libglib2.0-0 -y
sudo apt-get install libsm6 libxext6 libxrender-dev -y
conda install faiss-cpu=1.7.2 -c pytorch
pip uninstall recurring_content_detector -y

- run: |
pip install .
python -m pytest -s
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM continuumio/miniconda3:4.7.12
FROM python:3.9

WORKDIR /opt

Expand All @@ -7,12 +7,8 @@ COPY setup.py /opt/recurring-content-detector/setup.py

WORKDIR /opt/recurring-content-detector

RUN conda install python=3.8 -y && \
pip install . && \
RUN pip install . && \
apt-get update --allow-releaseinfo-change && \
apt-get install libglib2.0-0 -y && \
apt-get install -y libsm6 libxext6 libxrender-dev -y && \
apt-get install ffmpeg -y && \
conda install faiss-cpu=1.7.2 -c pytorch


apt-get install ffmpeg -y
15 changes: 4 additions & 11 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Recurring content detector (credits, recaps and previews detection)

**Update 05-09-2021: The CNN vectors were removed as they do not work on the Apple M1.**

This repository contains the code that was used to conduct experiments for a [master's thesis](https://github.com/nielstenboom/masterthesis/raw/master/main.pdf). The goal was to detect recaps, opening credits, closing credits and previews from video files in an unsupervised manner. This can be used to automate the labeling for the skip functionality of a VOD streaming service.

The experiments done in the master's thesis were done in jupyter notebooks, but as the code in these got quite messy. I packed the used code in a python package so that it can be re-used more easily.
This repository contains the code that was used to conduct experiments for a [master's thesis](https://github.com/nielstenboom/masterthesis/raw/master/main.pdf). The goal was to detect recaps, opening credits, closing credits and previews from video files in an unsupervised manner. This can be used to automate the labeling for the skip functionality of a VOD streaming service for example.

## Quickstart with Docker

Expand All @@ -25,19 +21,16 @@ It'll first downsize the videos using ffmpeg, then it will convert the videos to

## Local Installation

To install the package, do the following steps (assuming you have an anaconda setup with python 3.8):
To install the package, do the following steps:

```bash
git clone https://github.com/nielstenboom/recurring-content-detector.git
cd recurring-content-detector
conda install faiss-cpu=1.7.2 -c pytorch
pip install mkl
pip install .
pip install git+https://github.com/nielstenboom/[email protected]
```

It is also possible to build a docker container that does all the steps for you with the [Dockerfile](Dockerfile) in the directory.

Make sure [ffmpeg](https://ffmpeg.org/) is in the PATH variable and that [tensorflow](https://www.tensorflow.org/install/pip) (GPU version preferably) is installed.
Make sure [ffmpeg](https://ffmpeg.org/) is in the PATH variable.

Run `pip uninstall recurring-content-detector` to uninstall the package.

Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
packages=find_packages(),
include_package_data = True,
install_requires=[
'Pillow==6.*',
'Pillow==9.*',
'ffmpeg_python==0.*',
'matplotlib==3.*',
'opencv_python==4.*',
'pandas==0.*',
'pandas==1.*',
'scipy==1.*',
'tqdm==4.*',
'natsort==6.*',
'numpy==1.*',
'pytest==6.*'
'pytest==6.*',
'faiss-cpu==1.7.*'
],
zip_safe=False)