Welcome to epic-hand-object-detections’s documentation!¶
Installation¶
$ pip install git+https://github.com/epic-kitchens/epic-kitchens-100-hand-object-bboxes.git
Usage¶
Visualise the hand-object detections like so:
from pathlib import Path
import PIL.Image
from epic_kitchens.hoa.io import load_detections
from epic_kitchens.hoa.visualisation import DetectionRenderer
class LazyFrameLoader:
def __init__(self, path: Union[Path, str], frame_template: str = 'frame_{:010d}.jpg'):
self.path = Path(path)
self.frame_template = frame_template
def __getitem__(self, idx: int) -> PIL.Image.Image:
return PIL.Image.open(str(self.path / self.frame_template.format(idx + 1)))
detections = load_detections('detections/P01_101.pkl')
frames = LazyFrameLoader('frames/P01_101')
renderer = DetectionRenderer(hand_threshold=0.5, object_threshold=0.5)
frame_idx = 100
renderer.render_detections(frames[frame_idx], detections[frame_idx])
An Jupyter notebook example is included that demonstrates how to detections and visualise them.