diff --git a/Demo/vhh_stc_run_on_single_video.py b/Demo/vhh_stc_run_on_single_video.py index bfb1aba..ba696d4 100644 --- a/Demo/vhh_stc_run_on_single_video.py +++ b/Demo/vhh_stc_run_on_single_video.py @@ -1,5 +1,5 @@ -from stc.STC import STC +from vhh_stc.STC import STC import numpy as np import os diff --git a/README.md b/README.md index 7cf6946..5aaba54 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,19 @@ The following instructions have to be done to used this library in your own appl **Install the stc package and all dependencies:** + * Update pip and setuptools (tested using pip\==20.2.3 and setuptools==50.3.0) + * Install the Wheel package: ```pip install wheel``` * change to the root directory of the repository (includes setup.py) - * python setup.py install + * ```python setup.py bdist_wheel``` + * The aforementioned command should create a /dist directory containing a wheel. Install the package using ```python -m pip install dist/xxx.whl``` + +> **_NOTE:_** +You can check the success of the installation by using the commend *pip list*. This command should give you a list +with all installed python packages and it should include *vhh-stc*. + +**Install PyTorch :** + +Install a Version of PyTorch depending on your setup. Consult the [PyTorch website](https://pytorch.org/get-started/locally/) for detailed instructions. **Setup environment variables:** @@ -45,17 +56,6 @@ The following instructions have to be done to used this library in your own appl * export CUDA_VISIBLE_DEVICES=1 * export PYTHONPATH=$PYTHONPATH:/XXX/vhh_stc/:/XXX/vhh_stc/Develop/:/XXX/vhh_stc/Demo/ - -> **_NOTE:_** - You can check the success of the installation by using the commend *pip list*. This command should give you a list -> with all installed python packages and it should include *vhh_stc* -> - -> **_NOTE:_** - Currently there is an issue in the *setup.py* script. Therefore the pytorch libraries have to be installed manually -> by running the following command: -> *pip install torch==1.5.0+cu101 torchvision==0.6.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html* - **Run demo script** * change to root directory of the repository diff --git a/setup.py b/setup.py index 6542a10..0cd3df9 100644 --- a/setup.py +++ b/setup.py @@ -1,46 +1,31 @@ -try: # for pip >= 10 - from pip._internal.req import parse_requirements - from pip._internal.download import PipSession -except ImportError: # for pip <= 9.0.3 - from pip.req import parse_requirements - from pip.download import PipSession import logging import os - -try: - from setuptools import setup -except ImportError: - from distutils.core import setup +from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() -command = ""; -try: - install_reqs = parse_requirements("requirements.txt", session=PipSession()) -except Exception: - logging.warning('Fail load requirements file, so using default ones.') - install_reqs = [] - -# prepare pip command to install dependencies -tmp_str = ""; -for requirement in install_reqs: - tmp_str = tmp_str + " " + str(requirement.req) -command = "pip install " + tmp_str + " " - -# execute dependendcies -os.system(command) -print("all dependencies installed!") +# read requirements +install_requires=[] +with open("requirements.txt", "r") as f: + reqs = f.readlines() + for i in range(len(reqs)): + req = reqs[i] + if i < len(reqs)-1: + req = req[:-1] + if req[0] is not '#': + install_requires.append(req) -# install sbd package +# install vhh_sbd package setup( name='vhh_stc', version='1.0.0', author="Daniel Helm", author_email="daniel.helm@tuwien.ac.at", - description="Shot Type Classification Package", + description="Shot Boundary Detection Package", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/dahe-cvl/vhh_stc", - packages=["stc"] + url="https://github.com/dahe-cvl/vhh_tc", + packages=find_packages(), + install_requires=install_requires ) diff --git a/stc/Configuration.py b/vhh_stc/Configuration.py similarity index 99% rename from stc/Configuration.py rename to vhh_stc/Configuration.py index b3db21d..1f0b77e 100644 --- a/stc/Configuration.py +++ b/vhh_stc/Configuration.py @@ -1,4 +1,4 @@ -from stc.utils import * +from vhh_stc.utils import * import yaml diff --git a/stc/CustomTransforms.py b/vhh_stc/CustomTransforms.py similarity index 100% rename from stc/CustomTransforms.py rename to vhh_stc/CustomTransforms.py diff --git a/stc/Datasets.py b/vhh_stc/Datasets.py similarity index 98% rename from stc/Datasets.py rename to vhh_stc/Datasets.py index c42cb3d..6302c17 100644 --- a/stc/Datasets.py +++ b/vhh_stc/Datasets.py @@ -11,7 +11,7 @@ from torch.utils.data import DataLoader from torchvision import models import cv2 -from stc.CustomTransforms import * +from vhh_stc.CustomTransforms import * def loadDatasetFromFolder(path="", batch_size=64): diff --git a/stc/Models.py b/vhh_stc/Models.py similarity index 100% rename from stc/Models.py rename to vhh_stc/Models.py diff --git a/stc/STC.py b/vhh_stc/STC.py similarity index 98% rename from stc/STC.py rename to vhh_stc/STC.py index 055a31a..420403f 100644 --- a/stc/STC.py +++ b/vhh_stc/STC.py @@ -1,15 +1,15 @@ import numpy as np -from stc.Video import Video +from vhh_stc.Video import Video import os -from stc.Models import loadModel -from stc.CustomTransforms import ToGrayScale +from vhh_stc.Models import loadModel +from vhh_stc.CustomTransforms import ToGrayScale import torch from PIL import Image from torch.autograd import Variable from torch.utils import data from torchvision import transforms -from stc.utils import * -from stc.Configuration import Configuration +from vhh_stc.utils import * +from vhh_stc.Configuration import Configuration import cv2 import json diff --git a/stc/Shot.py b/vhh_stc/Shot.py similarity index 100% rename from stc/Shot.py rename to vhh_stc/Shot.py diff --git a/stc/Video.py b/vhh_stc/Video.py similarity index 99% rename from stc/Video.py rename to vhh_stc/Video.py index c76c598..ea161ee 100644 --- a/stc/Video.py +++ b/vhh_stc/Video.py @@ -1,7 +1,7 @@ import numpy as np import cv2 import datetime -from stc.utils import * +from vhh_stc.utils import * from PIL import Image diff --git a/stc/__init__.py b/vhh_stc/__init__.py similarity index 100% rename from stc/__init__.py rename to vhh_stc/__init__.py diff --git a/stc/utils.py b/vhh_stc/utils.py similarity index 100% rename from stc/utils.py rename to vhh_stc/utils.py