diff --git a/README.md b/README.md index 5c823f37..1cf61e09 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,18 @@ Environment Run ------- -$ python main.py + +``` +python main.py +``` + +Or install the command-line tool. + +``` +python ./setup.py install + +BBox-Label-Tool +``` Usage ----- diff --git a/main.py b/main.py index e19a0888..f7e6fb27 100644 --- a/main.py +++ b/main.py @@ -286,8 +286,11 @@ def gotoImage(self): ## self.mainPanel.config(height = self.tkimg.height()) ## self.mainPanel.create_image(0, 0, image = self.tkimg, anchor=NW) -if __name__ == '__main__': +def main(): root = Tk() tool = LabelTool(root) root.resizable(width = True, height = True) root.mainloop() + +if __name__ == '__main__': + main() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..7e2fba5e --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +Pillow diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..3ab2bd71 --- /dev/null +++ b/setup.py @@ -0,0 +1,19 @@ +try: + from setuptools import setup + setup() +except ImportError: + from distutils.core import setup + +setup( + name="BBox-Label-Tool", + version="1.0.0", + author="puzzledqs", + url="https://github.com/puzzledqs/BBox-Label-Tool", + description="A simple tool for labeling object bounding boxes in images", + packages=["."], + zip_safe=False, + entry_points={ + "console_scripts": [ + "BBox-Label-Tool=main:main", + ], + })