Releases: fourMs/MGT-python
Releases · fourMs/MGT-python
v1.6.0
Highlights
Added
- Audio–movement analysis suite (compare a single performer's sound and motion):
tempo_similarity()— audio vs movement tempo (ratio, nearest harmonic, cross-correlation peak/lag)phase_synchrony()— phase-locking value (PLV) + polar phase-difference plotstructure_comparison()— audio SSM vs movement SSM + difference mapbody_audio_coupling()— per-marker correlation of speed with audio onset (body map + ranked bars)dynamics_coupling()— audio loudness (RMS) vs quantity of motion
pose_segments()— circular (polar rose) motion plots and per-segment circular statistics (mean angle, R, circular std, range of motion, mean angular speed) + CSVresample(fps=…, speed=…, skip=…)— retime an already-loaded video, returning a new MgVideo (duration-preserving fps change, speed factor with audio in sync, and/or frame decimation)pose_waterfall(style=…)gained'markers','skeleton','both'styles plusaxes=False(clean render) andcrop=True(trim to data);silhouette_waterfall()gained the sameaxes/cropoptions
Changed
pose(background='white')now also makes the trajectories image white (override withtrajectory_background)
Fixed
- Removed the white frame around the average-pose image
pose_waterfall(crop=True)no longer leaves a large empty margin
Documentation (with dance.avi illustrations) and the example notebook have been updated. See the CHANGELOG for full details.
v1.5.0
Highlights
Changed
- Motiongram/videogram output filenames now use direction-of-movement suffixes —
_mgh/_vgh(horizontal) and_mgv/_vgv(vertical) — replacing the axis-based_mgy/_vgyand_mgx/_vgx. Applied tomotion(),motiongrams(),videograms(),motion_mp(), and thessm()intermediates. Allshow(key=...)keys —'horizontal'/'vertical', the newmgh/mgv/vgh/vgvaliases, and the legacymgx/mgy/vgx/vgy— still resolve correctly.
Added
silhouette_waterfall()andpose_waterfall()acceptaxes=Falseto render without any axes, ticks, labels, panes, or title (a clean 3D image).
See the CHANGELOG for full details.
v1.4.9
Highlights
Added
pose_waterfall(style=...)— new'markers','skeleton', and'both'styles (drawing the pose atn_samplestime slices) alongside the default'trajectories'.pose(trajectory_background=...)—'black'(default),'white', or'transparent'background for the trajectories image (legacytransparent_trajectoriesstill honoured).- Orientation aliases for
show(key=...):mgh/vgh(horizontal) andmgv/vgv(vertical).
Changed
overwritenow defaults toTruefor all functions — outputs are overwritten in place instead of auto-incrementing the filename. Passoverwrite=Falsefor the old behaviour.MgVideo.beat_statistics()now defaults tosource='motion'(analyses the movement rhythm), so it differs fromvideo.audio.beat_statistics(). Usesource='audio'for the audio track.pose()container handling:convertdefaults toNone("auto") — MediaPipe reads the source directly (no intermediate AVI), OpenPose still converts for frame-accurate decoding. The result video is written in the original container (mp4 in → mp4 out; no avi→mp4 round-trip).- Decluttered pose images: removed titles from the trajectories and waterfall images and the average-pose image, and removed the average-pose colorbar. Trajectories omit marker-name labels by default (
trajectory_labels=Trueto re-enable).
Fixed
- The
show(key=...)orientation keys for motiongrams/videograms were swapped —'horizontal'now selects the horizontal-movement gram and'vertical'the vertical one, with correct titles (in bothMgVideo.showandMgList.show).
See the CHANGELOG for full details.
v1.4.8
Highlights
Added
pose_waterfall()— a 3D spatio-temporal waterfall where each marker's trajectory flows through (x, time, y) space, a pose-based counterpart tosilhouette_waterfall().pose(marker_history=N)— motion trails for each marker over the last N frames.pose(trajectory_labels=True)— opt back into per-marker name labels on the trajectories image.
Changed
pose()now defaults to the MediaPipe backend (fast on plain CPU, 33 landmarks with depth + visibility, no CUDA-enabled OpenCV build needed). OpenPose (body_25/coco/mpi) remains available for multi-person scenes.pose(overlay=False, background='white')now draws a black skeleton + markers (print-friendly inverted look).- The marker-trajectories image no longer shows name labels by default.
tempogram()gains a colorbar (matching the chromagram) and shows the estimated tempo rounded to one decimal with "BPM" in the title; the dotted tempo line was removed.videograms()/motiongrams()display keys are now'horizontal'/'vertical'.
Fixed
motionhistory():normalizedefaults toFalseand is guarded so it no longer over-brightens ("blows up") static clips.- Documentation refreshed across the docs site, wiki, and READMEs; the stale
releases.mdpage now tracks the changelog.
See the CHANGELOG for full details.
v1.4.7
What's new in 1.4.7
Fixed
- GPU detection —
_utils.pynever importedcv2, so CUDA was always reported absent. GPU acceleration now works on a CUDA-enabled OpenCV:pose(device='gpu')(OpenPose),flow.dense(use_gpu=True),flow.sparse(use_gpu=True). - GPU sparse optical flow path corrected (point shapes +
calc()returns). MgList.show(key='mgx'/'vgx'/…)on motiongrams/videograms no longer crashes — selects the right panel.- Audio methods inherited by
MgVideo(e.g.video.spectrogram()) no longer fail on a missing cache attribute. - CI on macOS/Windows: skip
.oggtests without libtheora; force the Matplotlib Agg backend.
Added
pose(use_cache=True)— re-render a differentstyle/overlay/backgroundfrom cached keypoints without re-running inference.pose(data_format='c3d')— export markers to a C3D motion-capture file (optionalc3ddependency).tempogram(onset_strength=False)— single-panel tempogram matching the chromagram size.beat_statistics(source='motion')onMgVideo— timing statistics from movement onsets.
Changed
- Average-pose labels: numbers only (normalised QoM 0–1 | dominant frequency), stronger de-overlap.
motiontempo(): QoM normalised 0–1, renamed "Motion spectrum", with average QoM and beat-frequency lines + numbers.
v1.4.6
What's new in 1.4.6
Added
- Space-time person visualisations:
stroboscope()(chronophotography),silhouette_waterfall(),motionhistory()(Motion History Image), andspacetime_volume()(3D x,y,t silhouette point cloud). Silhouettes use MediaPipe selfie segmentation when available, falling back to background subtraction (method='auto'|'mediapipe'|'bgsub'). ssm(features='motiongrams', combine=True)— a single self-similarity matrix combining horizontal + vertical motion in one display.pose()stylenow also applies to the average-pose image.
Changed
pose(): no-CUDA fallback uses the MediaPipe CPU (XNNPACK) delegate (reliable) instead of the fragile OpenGL-ES GPU delegate; newquiet=Truesuppresses MediaPipe's native C++/GL logs.
Fixed
- Orientation: portrait/phone videos with a rotation flag are normalised at load (rotation baked into pixels, flag removed), so cv2-based processes no longer come out rotated 90°.
v1.4.5
What's new in 1.4.5
Added
- Pose overhaul —
pose()now also exports an average-pose image (markers coloured/labelled by average quantity of motion in px/frame + dominant movement frequency in Hz, plus a per-marker stats CSV) and an all-trajectories image; labels are laid out to avoid overlap. New rendering controls:style(both/markers/skeleton),overlay(on video or plain background),background(black/white), andtransparent_trajectories(transparent PNG for overlaying). MediaPipe backend is GPU-capable on the standard pip OpenCV. convert=Falseonpose(),flow.dense()/flow.sparse(),directograms(),impacts(),motion_mp(),history_cv2()to skip AVI conversion and read mp4 directly.
Changed
- Display via
show()— analysis results (MgImage/MgFigure) no longer auto-render as a notebook cell's last expression; call.show(). HTML available viato_html().info('frame')now returns anMgImage. blur_faces()writes MP4/libx264 instead of MJPEG-AVI.
Performance
MgAudiocaches decoded audio (multiple audio analyses decode the file once).ffprobe()results cached per file (path+mtime+size) — metadata helpers share one subprocess call.
Fixed
- All "invalid escape sequence"
SyntaxWarnings on import. - Documented
MgVideo.length= frame count vsMgAudio.length= seconds. - Removed 30 unused imports.
v1.4.4
What's new in 1.4.4
Added
MgVideo.eulerian()— Eulerian Video Magnification (Wu et al., SIGGRAPH 2012) to reveal subtle changes.mode='color'amplifies subtle colour changes (pulse/breathing);mode='motion'amplifies subtle motion. Reads/writes via the FFmpeg pipe (any format) and is memory-conscious (two-pass color / streaming-IIR motion), addressing the format & memory limits of existing PyEVM ports. Closes #212.MgVideo.sonomotiongram()— sonifies the motiongram by treating it as a magnitude spectrogram and resynthesising audio via inverse STFT (Griffin–Lim). Returns anMgAudio. Closes #171.MgVideo.motionvectors()— visualises the motion vectors carried by inter-frame codecs (MPEG/H.264/H.265) via FFmpeg'scodecview. Closes #254.
Fixed
- EVM/sonomotiongram timing:
MgVideo.lengthis a frame count (not seconds), so audio duration is computed aslength/fpsand progress is tracked in frames.
v1.4.3
What's new in 1.4.3
Added
MgVideo.heatmap()— motion heatmap showing which parts of the video change the most (optionally overlaid on the average frame).MgVideo.motiontempo()— estimates dominant movement tempo (Hz + BPM) from the quantity of motion (addresses #158).descriptors(save_data=True)— save per-frame audio descriptors to csv/tsv/txt (closes #124).- MediaPipe GPU pose —
pose()uses MediaPipe's GPU delegate; whendevice='gpu'is requested but OpenCV lacks CUDA, it auto-switches to the MediaPipe backend so the GPU is actually used. cuda_build_available()/cuda_unavailable_reason()helpers.
Changed
- Display model:
MgImage/MgFigureno longer auto-render as a cell's last expression — display happens only viashow(). This removes the duplicate (small + large) outputs from the audio figure methods and makesaverage()display only whenshow()is called. HTML helper kept asto_html(). - GPU-fallback messages now explain the real cause (pip OpenCV is built without CUDA) rather than implying a missing GPU.
Fixed
spectrogram()/descriptors()time axis pinned to the actual data extent — no more trailing whitespace or mislabeled timeline when the container is longer than the decoded audio.
V1.4.2
Fixed
- Critical: repaired a
thresholdoldcorruption (from a botchedthresh→threshold
replace) that broke the FFmpegthresholdfilter, leavingmotion(),motiongrams()
and related functions producing no frames and crashing. Motion analysis works again. skipwith large values no longer crashes:atempofilters are chained for ratios
above FFmpeg's per-filter limit of 100, and colons are stripped from output filenames.- Restored consistent behaviour of the threshold/filtertype options in
motiongrams().
Added
info(type='summary')now reports video codec/profile, pixel format, color space,
and audio codec/sample-rate/bit-rate alongside resolution, frames, fps, and duration.audio.mfcc(),audio.tempo()(beat tracking with tempo, beat times, inter-beat
intervals and beat regularity), andaudio.beat_statistics()(circular timing analysis).musicalgestures/_analysis.py: general signal/statistics utilities (smooth,
bandpass,dominant_frequency,circular_stats,rayleigh_test,synchrony),
exported at package level.