Skip to content

Commit

Permalink
Merge pull request #26 from freemocap/philip/patch_entrypoint
Browse files Browse the repository at this point in the history
Patch: entrypoint arguments
  • Loading branch information
philipqueen authored Mar 18, 2024
2 parents 62f31c8 + 6043727 commit 8cd9b5d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ cython_debug/
# ML models
*.pt

# Data
*.npy

#image outputs
*.jpg
*.jpeg
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ Installation: `pip install skellytracker``
Then it can be run with `skellytracker`.

Running the basic `skellytracker` will open the first webcam port on your computer and run pose estimaiton in realtime with mediapipe holistic as a tracker. You can specify the tracker with `skellytracker TRACKER_NAME`, where `TRACKER_NAME` is the name of an available tracker. To view the names of all available trackers, see `RUN_ME.py`.

It will take some time to initialize the tracker the first time you run it, as it will likely need to download the model.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ push = true
"skellytracker/__init__.py" = ["{version}"]

[project.scripts]
skellytracker = "skellytracker.__main__:main"
skellytracker = "skellytracker.__main__:cli_main"

[tool.setuptools]
py-modules = ["skellytracker"]
2 changes: 1 addition & 1 deletion RUN_ME.py → skellytracker/RUN_ME.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def main(demo_tracker: str = "mediapipe_holistic_tracker"):
).demo()

elif demo_tracker == "yolo_tracker":
YOLOPoseTracker(model_size="high_res").demo()
YOLOPoseTracker(model_size="nano").demo()
elif demo_tracker == "SAM_tracker":
SAMTracker().demo()
elif demo_tracker == "yolo_object_tracker":
Expand Down
File renamed without changes.
9 changes: 6 additions & 3 deletions skellytracker/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@

logger = logging.getLogger(__name__)

from RUN_ME import main
from skellytracker.RUN_ME import main


if __name__ == "__main__":
def cli_main():
logger.info(f"Running as a script")
if len(sys.argv) > 1:
demo_tracker = sys.argv[1]
demo_tracker = str(sys.argv[1])
else:
demo_tracker = "mediapipe_holistic_tracker"
main(demo_tracker=demo_tracker)

if __name__ == "__main__":
cli_main()

0 comments on commit 8cd9b5d

Please sign in to comment.