Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
refactor: split drumpy in the app and the measurements
Browse files Browse the repository at this point in the history
  • Loading branch information
Mouwrice committed Mar 5, 2024
1 parent 893fb1c commit cd2a99e
Show file tree
Hide file tree
Showing 35 changed files with 35 additions and 62,296 deletions.
61,557 changes: 0 additions & 61,557 deletions data/multicam_asil_01/qtm_multicam_asil_01.csv

This file was deleted.

14 changes: 8 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[tool.poetry]
name = "src"
name = "drumpy"
version = "0.1.0"
description = ""
authors = ["mouwrice <mauricevanwassenhove@gmail.com>"]
readme = "README.md"
authors = ["mouwrice <mauricevanwassenhove@fastmail.com>"]
packages = [ { include = "drumpy", from = "src" } ]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.dependencies]
python = "~3.11"
Expand All @@ -22,6 +26,4 @@ scikit-image = "^0.22.0"
pre-commit = "^3.6.1"
line-profiler-pycharm = "^1.1.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import pygame.time
from pygame import Surface

from app.video_source import VideoSource, Source
from tracker.mediapipe_pose import MediaPipePose
from drumpy.app.video_source import VideoSource, Source
from drumpy.mediapipe_pose import MediaPipePose


class VideoDisplay:
Expand Down
2 changes: 1 addition & 1 deletion src/app/fps_display.py → src/drumpy/app/fps_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pygame_gui import UIManager
from pygame_gui.elements import UILabel

from tracker.mediapipe_pose import MediaPipePose
from drumpy.mediapipe_pose import MediaPipePose


class FPSDisplay(UILabel):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import pygame
from pygame_gui.elements import UIImage

from app.graphs.ui_constants import GRAPH_FRAME_RANGE
from tracker.mediapipe_pose import MediaPipePose
from drumpy.app.graphs.ui_constants import GRAPH_FRAME_RANGE
from drumpy.mediapipe_pose import MediaPipePose


def plot_latency_graph(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from numpy import ndarray, dtype
from pygame_gui.elements import UIImage

from app.graphs.ui_constants import GRAPH_FRAME_RANGE
from tracker.mediapipe_pose import MediaPipePose
from drumpy.app.graphs.ui_constants import GRAPH_FRAME_RANGE
from drumpy.mediapipe_pose import MediaPipePose


def plot_marker_location_graph(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import pygame

from app.graphs.marker_location_graph import MarkerLocationGraph
from drum_tracking.mediapipe_markers import Marker
from tracker.mediapipe_pose import MediaPipePose
from drumpy.app.graphs.marker_location_graph import MarkerLocationGraph
from drumpy.drum.mediapipe_markers import Marker
from drumpy.mediapipe_pose import MediaPipePose


class MarkerLocationGraphs:
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions src/app/main.py → src/drumpy/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import pygame.camera
from pygame_gui import UIManager

from app.camera_display import VideoDisplay
from app.fps_display import FPSDisplay
from app.graphs.latency_graph import LatencyGraph
from app.graphs.marker_location_graphs import MarkerLocationGraphs
from app.video_source import CameraSource, VideoFileSource, Source
from tracker.mediapipe_pose import MediaPipePose, LandmarkerModel
from drumpy.app.camera_display import VideoDisplay
from drumpy.app.fps_display import FPSDisplay
from drumpy.app.graphs.latency_graph import LatencyGraph
from drumpy.app.graphs.marker_location_graphs import MarkerLocationGraphs
from drumpy.app.video_source import CameraSource, VideoFileSource, Source
from drumpy.mediapipe_pose import MediaPipePose, LandmarkerModel


class App:
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/drum_tracking/drum.py → src/drumpy/drum/drum.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import numpy as np
import numpy.typing as npt

from src.sound import Sound, SoundState
from src.util import print_float_array
from drumpy.drum.sound import Sound, SoundState
from drumpy.util import print_float_array


class DrumPresets:
Expand Down
4 changes: 2 additions & 2 deletions src/drum_tracking/foot.py → src/drumpy/drum/foot.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np

from src.tracker.marker import Marker
from src.tracker.marker_tracker import MarkerTracker
from drumpy.drum.marker import Marker
from drumpy.drum.marker_tracker import MarkerTracker


class Foot:
Expand Down
4 changes: 2 additions & 2 deletions src/drum_tracking/hand.py → src/drumpy/drum/hand.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np

from src.tracker.marker import Marker
from src.tracker.marker_tracker import MarkerTracker
from drumpy.drum.marker import Marker
from drumpy.drum.marker_tracker import MarkerTracker


class Hand:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
import numpy.typing as npt

from src.drum import Drum
from drumpy.drum.drum import Drum


class MarkerTracker:
Expand Down
2 changes: 1 addition & 1 deletion src/drum_tracking/sound.py → src/drumpy/drum/sound.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pygame
from termcolor import cprint

from src.util import print_float_array
from drumpy.util import print_float_array


class SoundState(Enum):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
)
from numpy import ndarray, dtype

from measure.csv_utils.csv_object import CSVWriter
from drumpy.trajectory_file import TrajectoryFile


class LandmarkerModel(Enum):
Expand Down Expand Up @@ -98,7 +98,7 @@ def __init__(
if log_file is not None
else f"./data/mediapipe_{self.model.name}_{time.strftime('%Y-%m-%d_%H-%M-%S')}.csv"
)
self.csv_writer = CSVWriter(self.log_file)
self.csv_writer = TrajectoryFile(self.log_file)

def result_callback(
self, result: PoseLandmarkerResult, image: Image, timestamp_ms: int
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import csv


class CSVWriter:
class TrajectoryFile:
"""
Class to read and write the captured data to a CSV file.
"""
Expand Down
File renamed without changes.
Empty file removed src/measure/__init__.py
Empty file.
Empty file removed src/measure/csv_utils/__init__.py
Empty file.
217 changes: 0 additions & 217 deletions src/measure/csv_utils/csv_comparison.py

This file was deleted.

Loading

0 comments on commit cd2a99e

Please sign in to comment.