From ce737993dc60c578f9f4a484bb139577ece6ed56 Mon Sep 17 00:00:00 2001 From: Niels ten Boom Date: Fri, 6 Jan 2023 09:55:30 +0100 Subject: [PATCH] feat: move away from conda + version upgrades (#35) --- .github/workflows/test.yml | 15 ++++++++------- Dockerfile | 10 +++------- README.MD | 15 ++++----------- setup.py | 7 ++++--- 4 files changed, 19 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 55609a0..4904963 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index 7d7d8e8..ac73f4a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM continuumio/miniconda3:4.7.12 +FROM python:3.9 WORKDIR /opt @@ -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 diff --git a/README.MD b/README.MD index 1c72b45..58df7ac 100644 --- a/README.MD +++ b/README.MD @@ -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 @@ -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/recurring-content-detector.git@v1.1.0 ``` 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. diff --git a/setup.py b/setup.py index 76a6fc2..2f63412 100644 --- a/setup.py +++ b/setup.py @@ -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) \ No newline at end of file