Registry / ai-ml / flow-vis

flow-vis

JSON →
library0.1pypypi✓ verified 81d ago

A Python package for easy visualization of optical flow fields, providing utilities to convert flow vectors into color-coded images for quick inspection. Current version 0.1, released as an initial alpha with simple generation and display functions; maintenance is sporadic.

pip install flow-vis
INSTALL
IMPORT
SIG · FLOW-VIS
F
flow-vis
ai-mlpythonv0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

flow_to_color
from flow_vis import flow_to_color
from flow_vis import flow_viz
flow_uv_to_colors
from flow_vis import flow_uv_to_colors
make_colorwheel
from flow_vis import make_colorwheel

Generate a color-coded visualization from a flow array.

import numpy as np from flow_vis import flow_viz # Create a dummy flow field (height, width, 2) flow = np.random.uniform(-10, 10, (100, 200, 2)).astype(np.float32) # Visualize rgb = flow_viz(flow) # Optionally display using OpenCV import cv2 cv2.imshow('Optical Flow', rgb) cv2.waitKey(0) cv2.destroyAllWindows()
Debug
Known issues
gotchaThe input flow array must be of shape (H, W, 2) with the last dimension containing (dx, dy). The values are not normalized; the function will clip to a default range [-20, 20] pixels.
fix
Normalize your flow values to a sensible range (e.g., clip to [-20,20]) or adjust the function's internal parameters.
affects: all
deprecatedThe package uses 'cv2' (OpenCV) internally but does not declare it as a hard dependency, causing import errors if OpenCV is missing.
fix
Install opencv-python separately: pip install opencv-python.
affects: all
gotchaThe function 'flow_viz' returns an RGB image in uint8 format with values in [0,255]. Do not expect normalized float output.
fix
Use the resulting image directly with OpenCV or matplotlib; for float display, convert to float32 and divide by 255.
affects: all
Upgrade
Version history
0.1latest on PyPI · released Apr 2, 2020
Audit
Dependencies
numpyrequiredFor array operations on flow fields
opencv-pythonoptionalUsed for visualization and color mapping
Agent activity
19 hits · last 30 days
node
14
OpenAI (training)
1
Resources
flow-vis — pip install flow-vis · libregistry