diff --git a/requirements.txt b/requirements.txt index a5894c9..79672fe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ numpy>=1.16.0 scipy>=1.1.0 torch>=1.1.0 torchvision>=0.3.0 -opencv-python>= 3.4.2 +opencv-python>=3.4.2 diff --git a/setup.py b/setup.py index 67bdfe2..baf3c65 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,8 @@ import os +import subprocess import sys import shutil -from setuptools import setup +from setuptools import find_namespace_packages, setup def clean_repo(): @@ -13,6 +14,18 @@ def clean_repo(): if os.path.isdir(build_folder): shutil.rmtree(build_folder, ignore_errors=True) +def pull_first(): + """This script is in a git directory that can be pulled.""" + cwd = os.getcwd() + gitdir = os.path.dirname(os.path.realpath(__file__)) + os.chdir(gitdir) + try: + subprocess.call(['git', 'lfs', 'pull']) + except subprocess.CalledProcessError: + raise RuntimeError("Make sure git-lfs is installed!") + os.chdir(cwd) + +pull_first() # Read version string _version = None @@ -33,7 +46,12 @@ def clean_repo(): 'description': 'A collection of pretrained face detectors including S3FD and RetinaFace.', 'author': 'Jie Shen', 'author_email': 'js1907@imperial.ac.uk', - 'packages': ['ibug.face_detection'], + 'packages': find_namespace_packages(), + 'package_data': { + 'ibug.face_detection.s3fd.weights': ['*.pth'], + 'ibug.face_detection.retina_face.weights': ['*.pth'], + 'ibug.face_detection.utils.data': ['*.npy'], + }, 'install_requires': ['numpy>=1.16.0', 'scipy>=1.1.0', 'torch>=1.1.0', 'torchvision>=0.3.0', 'opencv-python>= 3.4.2'], 'zip_safe': False