- Create a fresh directory
- In that fresh directory create the following files
- setup.py
- README.md
- MANIFEST.in
- .gitignore
- _init_.py (empty file)
- my_package/ directory
- bin/ directory
- In the my_package/ directory
- src/ directory
- _init_.py
- demo.py
- In the bin/ directory
- my_package
- You may need to run dos2unix on this if you code in Windows and run in Unix
- my_package
Last active
August 29, 2020 16:32
-
-
Save prerakmody/dd610a4ddc5d3fe457dfe0ca3171d945 to your computer and use it in GitHub Desktop.
Python Command Line Tool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Local | |
.idea | |
.vscode/ | |
# Media | |
.mp4 | |
.png | |
.db | |
# Python | |
.pyc | |
__pycache__ | |
# Others | |
_models | |
_data | |
models | |
data | |
# Installation | |
bin | |
build | |
dist | |
.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .demo import demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from pathlib import Path | |
MAIN_DIR = Path(__file__).parent.absolute() | |
sys.path.append(str(MAIN_DIR)) | |
import src.<> as <> | |
def demo(): | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import argparse | |
from pathlib import Path | |
MAIN_DIR = Path(__file__).parent.absolute().parent.absolute() | |
sys.path.append(str(MAIN_DIR)) | |
def main(): | |
parser = argparse.ArgumentParser(description='Bla Bla Bla') | |
parser.add_argument('indir', type=str, help='Input dir containing images') | |
parser.add_argument('model', type=str, help='3D CNN model path') | |
parser.add_argument('--outdir', type=str, help='Output dir for image results') | |
parser.add_argument('--conf', type=float, help='Some threshold (default=0.6)', default=0.6) | |
print ('') | |
print (' ----------------------------------------------------------------------- ') | |
args = parser.parse_args() | |
print ('') | |
args = vars(args) | |
indir = args['indir'] | |
model = args['model'] | |
outdir = args['outdir'] | |
conf = args['conf'] | |
import my_package as myp | |
myp.demo() | |
if __name__ == "__main__": | |
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from setuptools import setup | |
def readme(): | |
with open('README.md') as f: | |
return f.read() | |
setup(name='my_package', | |
version='0.2', | |
description='Estimation of 3D human pose using inputs from a Microsoft Kinect v2 camera', | |
long_description=readme(), | |
# long_description='Uses a 3D CNN which takes as input a 3D Point Cloud and outputs 3D locations and body-part associations for various body-joints', | |
classifiers=[ | |
'Programming Language :: Python :: 3.6', # https://pypi.org/classifiers/ | |
], | |
keywords="sample package, test package", | |
url='https://gist.github.com/prerakmody', | |
author='Prerak Mody', | |
author_email='prerakmody@mindyourbusiness.com', | |
license='', | |
packages=['my_package', 'my_package.src'], # rom setuptools import find_packages; packages=find_packages() | |
install_requires=[], | |
scripts=['bin/my_package'], | |
include_package_data=True, | |
zip_safe=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment