kinemotion 0.14.3__py3-none-any.whl → 0.15.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kinemotion might be problematic. Click here for more details.
- kinemotion/__init__.py +8 -8
- kinemotion/api.py +27 -27
- {kinemotion-0.14.3.dist-info → kinemotion-0.15.0.dist-info}/METADATA +3 -3
- {kinemotion-0.14.3.dist-info → kinemotion-0.15.0.dist-info}/RECORD +7 -7
- {kinemotion-0.14.3.dist-info → kinemotion-0.15.0.dist-info}/WHEEL +0 -0
- {kinemotion-0.14.3.dist-info → kinemotion-0.15.0.dist-info}/entry_points.txt +0 -0
- {kinemotion-0.14.3.dist-info → kinemotion-0.15.0.dist-info}/licenses/LICENSE +0 -0
kinemotion/__init__.py
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
from .api import (
|
|
4
4
|
CMJVideoConfig,
|
|
5
5
|
CMJVideoResult,
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
DropJumpVideoConfig,
|
|
7
|
+
DropJumpVideoResult,
|
|
8
8
|
process_cmj_video,
|
|
9
9
|
process_cmj_videos_bulk,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
process_dropjump_video,
|
|
11
|
+
process_dropjump_videos_bulk,
|
|
12
12
|
)
|
|
13
13
|
from .cmj.kinematics import CMJMetrics
|
|
14
14
|
from .dropjump.kinematics import DropJumpMetrics
|
|
@@ -17,10 +17,10 @@ __version__ = "0.1.0"
|
|
|
17
17
|
|
|
18
18
|
__all__ = [
|
|
19
19
|
# Drop jump API
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
20
|
+
"process_dropjump_video",
|
|
21
|
+
"process_dropjump_videos_bulk",
|
|
22
|
+
"DropJumpVideoConfig",
|
|
23
|
+
"DropJumpVideoResult",
|
|
24
24
|
"DropJumpMetrics",
|
|
25
25
|
# CMJ API
|
|
26
26
|
"process_cmj_video",
|
kinemotion/api.py
CHANGED
|
@@ -322,8 +322,8 @@ def _generate_outputs(
|
|
|
322
322
|
|
|
323
323
|
|
|
324
324
|
@dataclass
|
|
325
|
-
class
|
|
326
|
-
"""Result of processing a single video."""
|
|
325
|
+
class DropJumpVideoResult:
|
|
326
|
+
"""Result of processing a single drop jump video."""
|
|
327
327
|
|
|
328
328
|
video_path: str
|
|
329
329
|
success: bool
|
|
@@ -333,8 +333,8 @@ class VideoResult:
|
|
|
333
333
|
|
|
334
334
|
|
|
335
335
|
@dataclass
|
|
336
|
-
class
|
|
337
|
-
"""Configuration for processing a single video."""
|
|
336
|
+
class DropJumpVideoConfig:
|
|
337
|
+
"""Configuration for processing a single drop jump video."""
|
|
338
338
|
|
|
339
339
|
video_path: str
|
|
340
340
|
quality: str = "balanced"
|
|
@@ -349,7 +349,7 @@ class VideoConfig:
|
|
|
349
349
|
tracking_confidence: float | None = None
|
|
350
350
|
|
|
351
351
|
|
|
352
|
-
def
|
|
352
|
+
def process_dropjump_video(
|
|
353
353
|
video_path: str,
|
|
354
354
|
quality: str = "balanced",
|
|
355
355
|
output_video: str | None = None,
|
|
@@ -488,56 +488,56 @@ def process_video(
|
|
|
488
488
|
return metrics
|
|
489
489
|
|
|
490
490
|
|
|
491
|
-
def
|
|
492
|
-
configs: list[
|
|
491
|
+
def process_dropjump_videos_bulk(
|
|
492
|
+
configs: list[DropJumpVideoConfig],
|
|
493
493
|
max_workers: int = 4,
|
|
494
|
-
progress_callback: Callable[[
|
|
495
|
-
) -> list[
|
|
494
|
+
progress_callback: Callable[[DropJumpVideoResult], None] | None = None,
|
|
495
|
+
) -> list[DropJumpVideoResult]:
|
|
496
496
|
"""
|
|
497
|
-
Process multiple videos in parallel using ProcessPoolExecutor.
|
|
497
|
+
Process multiple drop jump videos in parallel using ProcessPoolExecutor.
|
|
498
498
|
|
|
499
499
|
Args:
|
|
500
|
-
configs: List of
|
|
500
|
+
configs: List of DropJumpVideoConfig objects specifying video paths and parameters
|
|
501
501
|
max_workers: Maximum number of parallel workers (default: 4)
|
|
502
502
|
progress_callback: Optional callback function called after each video completes.
|
|
503
|
-
Receives
|
|
503
|
+
Receives DropJumpVideoResult object.
|
|
504
504
|
|
|
505
505
|
Returns:
|
|
506
|
-
List of
|
|
506
|
+
List of DropJumpVideoResult objects, one per input video, in completion order
|
|
507
507
|
|
|
508
508
|
Example:
|
|
509
509
|
>>> configs = [
|
|
510
|
-
...
|
|
511
|
-
...
|
|
512
|
-
...
|
|
510
|
+
... DropJumpVideoConfig("video1.mp4"),
|
|
511
|
+
... DropJumpVideoConfig("video2.mp4", quality="accurate"),
|
|
512
|
+
... DropJumpVideoConfig("video3.mp4", output_video="debug3.mp4"),
|
|
513
513
|
... ]
|
|
514
|
-
>>> results =
|
|
514
|
+
>>> results = process_dropjump_videos_bulk(configs, max_workers=4)
|
|
515
515
|
>>> for result in results:
|
|
516
516
|
... if result.success:
|
|
517
517
|
... print(f"{result.video_path}: {result.metrics.jump_height_m:.3f}m")
|
|
518
518
|
... else:
|
|
519
519
|
... print(f"{result.video_path}: FAILED - {result.error}")
|
|
520
520
|
"""
|
|
521
|
-
results: list[
|
|
521
|
+
results: list[DropJumpVideoResult] = []
|
|
522
522
|
|
|
523
523
|
# Use ProcessPoolExecutor for CPU-bound video processing
|
|
524
524
|
with ProcessPoolExecutor(max_workers=max_workers) as executor:
|
|
525
525
|
# Submit all jobs
|
|
526
526
|
future_to_config = {
|
|
527
|
-
executor.submit(
|
|
527
|
+
executor.submit(_process_dropjump_video_wrapper, config): config
|
|
528
528
|
for config in configs
|
|
529
529
|
}
|
|
530
530
|
|
|
531
531
|
# Process results as they complete
|
|
532
532
|
for future in as_completed(future_to_config):
|
|
533
533
|
config = future_to_config[future]
|
|
534
|
-
result:
|
|
534
|
+
result: DropJumpVideoResult
|
|
535
535
|
|
|
536
536
|
try:
|
|
537
537
|
result = future.result()
|
|
538
538
|
except Exception as exc:
|
|
539
539
|
# Handle unexpected errors
|
|
540
|
-
result =
|
|
540
|
+
result = DropJumpVideoResult(
|
|
541
541
|
video_path=config.video_path,
|
|
542
542
|
success=False,
|
|
543
543
|
error=f"Unexpected error: {str(exc)}",
|
|
@@ -552,20 +552,20 @@ def process_videos_bulk(
|
|
|
552
552
|
return results
|
|
553
553
|
|
|
554
554
|
|
|
555
|
-
def
|
|
555
|
+
def _process_dropjump_video_wrapper(config: DropJumpVideoConfig) -> DropJumpVideoResult:
|
|
556
556
|
"""
|
|
557
557
|
Wrapper function for parallel processing. Must be picklable (top-level function).
|
|
558
558
|
|
|
559
559
|
Args:
|
|
560
|
-
config:
|
|
560
|
+
config: DropJumpVideoConfig object with processing parameters
|
|
561
561
|
|
|
562
562
|
Returns:
|
|
563
|
-
|
|
563
|
+
DropJumpVideoResult object with metrics or error information
|
|
564
564
|
"""
|
|
565
565
|
start_time = time.time()
|
|
566
566
|
|
|
567
567
|
try:
|
|
568
|
-
metrics =
|
|
568
|
+
metrics = process_dropjump_video(
|
|
569
569
|
video_path=config.video_path,
|
|
570
570
|
quality=config.quality,
|
|
571
571
|
output_video=config.output_video,
|
|
@@ -582,7 +582,7 @@ def _process_video_wrapper(config: VideoConfig) -> VideoResult:
|
|
|
582
582
|
|
|
583
583
|
processing_time = time.time() - start_time
|
|
584
584
|
|
|
585
|
-
return
|
|
585
|
+
return DropJumpVideoResult(
|
|
586
586
|
video_path=config.video_path,
|
|
587
587
|
success=True,
|
|
588
588
|
metrics=metrics,
|
|
@@ -592,7 +592,7 @@ def _process_video_wrapper(config: VideoConfig) -> VideoResult:
|
|
|
592
592
|
except Exception as e:
|
|
593
593
|
processing_time = time.time() - start_time
|
|
594
594
|
|
|
595
|
-
return
|
|
595
|
+
return DropJumpVideoResult(
|
|
596
596
|
video_path=config.video_path,
|
|
597
597
|
success=False,
|
|
598
598
|
error=str(e),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kinemotion
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.15.0
|
|
4
4
|
Summary: Video-based kinematic analysis for athletic performance
|
|
5
5
|
Project-URL: Homepage, https://github.com/feniix/kinemotion
|
|
6
6
|
Project-URL: Repository, https://github.com/feniix/kinemotion
|
|
@@ -191,7 +191,7 @@ Use kinemotion as a library for automated pipelines and custom analysis.
|
|
|
191
191
|
### Drop Jump API
|
|
192
192
|
|
|
193
193
|
```python
|
|
194
|
-
from kinemotion import
|
|
194
|
+
from kinemotion import process_dropjump_video
|
|
195
195
|
|
|
196
196
|
# Process a single video
|
|
197
197
|
metrics = process_video(
|
|
@@ -211,7 +211,7 @@ print(f"Flight time: {metrics.flight_time * 1000:.1f} ms")
|
|
|
211
211
|
|
|
212
212
|
```python
|
|
213
213
|
# Drop jump bulk processing
|
|
214
|
-
from kinemotion import
|
|
214
|
+
from kinemotion import DropJumpVideoConfig, process_dropjump_videos_bulk
|
|
215
215
|
|
|
216
216
|
configs = [
|
|
217
217
|
VideoConfig("video1.mp4", drop_height=0.40),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
kinemotion/__init__.py,sha256=
|
|
2
|
-
kinemotion/api.py,sha256=
|
|
1
|
+
kinemotion/__init__.py,sha256=vAEIg-oDX1ZkQMnWgXd__tekaA5KUcEvdJSAGWS8VUY,722
|
|
2
|
+
kinemotion/api.py,sha256=T9oqDxelyrVPhWifxUV8BVm8lu9sTREBLkEbT9fr678,31360
|
|
3
3
|
kinemotion/cli.py,sha256=cqYV_7URH0JUDy1VQ_EDLv63FmNO4Ns20m6s1XAjiP4,464
|
|
4
4
|
kinemotion/cmj/__init__.py,sha256=Ynv0-Oco4I3Y1Ubj25m3h9h2XFqeNwpAewXmAYOmwfU,127
|
|
5
5
|
kinemotion/cmj/analysis.py,sha256=4HYGn4VDIB6oExAees-VcPfpNgWOltpgwjyNTU7YAb4,18263
|
|
@@ -21,8 +21,8 @@ kinemotion/dropjump/cli.py,sha256=Oni7gntysA6Zwb_ehsAnk6Ytd2ofUhN0yXVCsCsiris,21
|
|
|
21
21
|
kinemotion/dropjump/debug_overlay.py,sha256=LkPw6ucb7beoYWS4L-Lvjs1KLCm5wAWDAfiznUeV2IQ,5668
|
|
22
22
|
kinemotion/dropjump/kinematics.py,sha256=txDxpDti3VJVctWGbe3aIrlIx83UY8-ynzlX01TOvTA,15577
|
|
23
23
|
kinemotion/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
|
-
kinemotion-0.
|
|
25
|
-
kinemotion-0.
|
|
26
|
-
kinemotion-0.
|
|
27
|
-
kinemotion-0.
|
|
28
|
-
kinemotion-0.
|
|
24
|
+
kinemotion-0.15.0.dist-info/METADATA,sha256=IIkd1kZxf_Enam5KcY2dEAoIf0r5_ykJFUhfRuOn8KE,19036
|
|
25
|
+
kinemotion-0.15.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
26
|
+
kinemotion-0.15.0.dist-info/entry_points.txt,sha256=zaqnAnjLvcdrk1Qvj5nvXZCZ2gp0prS7it1zTJygcIY,50
|
|
27
|
+
kinemotion-0.15.0.dist-info/licenses/LICENSE,sha256=KZajvqsHw0NoOHOi2q0FZ4NBe9HdV6oey-IPYAtHXfg,1088
|
|
28
|
+
kinemotion-0.15.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|