In my workflow I have a tracker that track objects and I want to dipslay the velocity of the the object.
After the Byte_tracker I placed a Velocity block but I dont find any way to display the calculated velocity on the video.
When I connect a Label_Visualization block I get only the standard text like class and so on (I connected the predictions to be the ones from the previous Velocity block
@lightov you can also replace class name with velocity/speed using custom python block
def run(self, detections) -> BlockResult:
detections.data["class_name"] = np.array([f"{s:.2f}" for s in detections.data["speed"]])
return {"detections": detections}
You can then use label visualization and show class_name
If you search for “custom python” you will find the block where you can drop the code, you will need to add input called “detections” of type “object detections” to match the code from example