Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pyside code #25

Merged
merged 4 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
# skelly_tracker
# skellytracker

Currently, the bare bones of a tracking backend for freemocap.
The tracking backend for freemocap. Collects different pose estimation tools and aggregates them using a consistent API. Can run pose estimation on images, webcams, and videos.

## Run skelly_tracker

Currently, it is not pip installable. Download it by running `git clone https://github.com/freemocap/skelly_tracker`.
Installation: `pip install skellytracker``
Then it can be run with `skellytracker`.

Change directories to skelly_tracker with `cd skelly_tracker`, and install the requirements with `pip install .`.

Then it can be run with `skelly_tracker`.

## Using skelly_tracker

A GUI should pop up that looks like this:

<img width="591" alt="Image of skelly_tracker GUI" src="https://github.com/freemocap/skelly_tracker/assets/24758117/8767a7fb-2535-407c-99fb-40295ee5af93">


Choose your image in the file dialog and click run to see the image annotated with the tracking information.
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`.
43 changes: 28 additions & 15 deletions RUN_ME.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,48 @@
import cv2

from skellytracker.trackers.bright_point_tracker.brightest_point_tracker import BrightestPointTracker
from skellytracker.trackers.bright_point_tracker.brightest_point_tracker import (
BrightestPointTracker,
)
from skellytracker.trackers.charuco_tracker.charuco_tracker import CharucoTracker
from skellytracker.trackers.mediapipe_tracker.mediapipe_holistic_tracker import MediapipeHolisticTracker
from skellytracker.trackers.segment_anything_tracker.segment_anything_tracker import SAMTracker
from skellytracker.trackers.mediapipe_tracker.mediapipe_holistic_tracker import (
MediapipeHolisticTracker,
)
from skellytracker.trackers.segment_anything_tracker.segment_anything_tracker import (
SAMTracker,
)
from skellytracker.trackers.yolo_tracker.yolo_tracker import YOLOPoseTracker
from skellytracker.trackers.yolo_object_tracker.yolo_object_tracker import YOLOObjectTracker
from skellytracker.trackers.yolo_object_tracker.yolo_object_tracker import (
YOLOObjectTracker,
)

if __name__ == "__main__":

demo_tracker = "yolo_object_tracker"

def main(demo_tracker: str = "mediapipe_holistic_tracker"):

if demo_tracker == "brightest_point_tracker":
BrightestPointTracker().demo()

elif demo_tracker == "charuco_tracker":
CharucoTracker(squaresX=7,
squaresY=5,
dictionary=cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_4X4_250)).demo()
CharucoTracker(
squaresX=7,
squaresY=5,
dictionary=cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_4X4_250),
).demo()

elif demo_tracker == "mediapipe_holistic_tracker":
MediapipeHolisticTracker(model_complexity=2,
min_detection_confidence=0.5,
min_tracking_confidence=0.5,
static_image_mode=False,
smooth_landmarks=True).demo()
MediapipeHolisticTracker(
model_complexity=2,
min_detection_confidence=0.5,
min_tracking_confidence=0.5,
static_image_mode=False,
smooth_landmarks=True,
).demo()

elif demo_tracker == "yolo_tracker":
YOLOPoseTracker(model_size="high_res").demo()
elif demo_tracker == "SAM_tracker":
SAMTracker().demo()
elif demo_tracker == "yolo_object_tracker":
YOLOObjectTracker(model_size="medium").demo()

if __name__ == "__main__":
main(demo_tracker="mediapipe_holistic_tracker")
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ keywords = [
#dynamic = ["dependencies"]
dependencies = [
"opencv-contrib-python==4.8.*",
"pyside6~=6.6.0",
"pydantic==1.*",
"mediapipe~=0.10.0",
"mediapipe==0.10.9",
"ultralytics~=8.0.202",
]
requires-python = ">=3.9,<3.12"
Expand Down
12 changes: 7 additions & 5 deletions skellytracker/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@

logger = logging.getLogger(__name__)

from gui.gui import run_gui_window
from RUN_ME import main

def main():
run_gui_window()

if __name__ == '__main__':
if __name__ == "__main__":
logger.info(f"Running as a script")
main()
if len(sys.argv) > 1:
demo_tracker = sys.argv[1]
else:
demo_tracker = "mediapipe_holistic_tracker"
main(demo_tracker=demo_tracker)
62 changes: 0 additions & 62 deletions skellytracker/gui/gui.py

This file was deleted.

19 changes: 0 additions & 19 deletions skellytracker/gui/widgets/run_button_widget.py

This file was deleted.