Instructions to use nvidia/Flora-TempSeg with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use nvidia/Flora-TempSeg with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-9B") model = PeftModel.from_pretrained(base_model, "nvidia/Flora-TempSeg") - Notebooks
- Google Colab
- Kaggle
Download batch_utils/vendor/support/composers.py from nvidia/Flora-TempSeg: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/nvidia/Flora-TempSeg/resolve/main/batch_utils/vendor/support/composers.py
- Command line
-
hf download hf://nvidia/Flora-TempSeg/batch_utils/vendor/support/composers.py
-
curl -L -o composers.py https://huggingface.co/nvidia/Flora-TempSeg/resolve/main/batch_utils/vendor/support/composers.py
1.26 kB
| from PIL import Image, ImageOps | |
| from typing import Any | |
| VIEWS = ('ego', 'left_wrist', 'right_wrist') | |
| CAPTION_TOP_SIZE = (768, 432) | |
| CAPTION_WRIST_SIZE = (384, 216) | |
| CAPTION_MOSAIC_WIDTH = 768 | |
| CAPTION_MOSAIC_HEIGHT = 648 | |
| def compose_frame(frames, views): | |
| canvas = Image.new('RGB', (640, 720)) | |
| for view, (x, y, w, h) in zip(VIEWS, [(0, 0, 640, 480), (0, 480, 320, 240), (320, 480, 320, 240)]): | |
| if view in views: | |
| panel = ImageOps.contain(frames[view].convert('RGB'), (w, h), Image.Resampling.BICUBIC) | |
| canvas.paste(panel, (x + (w - panel.width) // 2, y + (h - panel.height) // 2)) | |
| return canvas | |
| def compose_top_dominant_mosaic(top: Any, left: Any, right: Any) -> Any: | |
| from PIL import Image | |
| top_panel = top.convert('RGB').resize(CAPTION_TOP_SIZE, Image.Resampling.BICUBIC) | |
| left_panel = left.convert('RGB').resize(CAPTION_WRIST_SIZE, Image.Resampling.BICUBIC) | |
| right_panel = right.convert('RGB').resize(CAPTION_WRIST_SIZE, Image.Resampling.BICUBIC) | |
| output = Image.new('RGB', (CAPTION_MOSAIC_WIDTH, CAPTION_MOSAIC_HEIGHT)) | |
| output.paste(top_panel, (0, 0)) | |
| output.paste(left_panel, (0, CAPTION_TOP_SIZE[1])) | |
| output.paste(right_panel, (CAPTION_WRIST_SIZE[0], CAPTION_TOP_SIZE[1])) | |
| return output | |