mirror of
https://github.com/clearml/clearml-docs
synced 2025-06-26 18:17:44 +00:00
54 lines
2.1 KiB
Markdown
54 lines
2.1 KiB
Markdown
---
|
|
title: Previews
|
|
---
|
|
|
|
Previews are optional images or videos that can be used in the ClearML Enterprise
|
|
WebApp (UI) to help visualize selected content in a Hyper-Dataset.
|
|
|
|
They are useful for displaying images with formats that cannot be rendered in a web browser
|
|
(such as TIFF and 3D formats), or to provide an alternative visual representation of the data.
|
|
|
|
In a Hyper-Dataset frame, the `source` typically points to the original raw data used for training or experimentation,
|
|
while the `preview_uri` is intended for display in the UI.
|
|
|
|
Previews appear in the following WebApp pages:
|
|
* [Dataset version page](webapp/webapp_datasets_versioning.md): As thumbnails representing each frame in the dataset version.
|
|
If a `preview_uri` is provided, it will be used for the thumbnail. Otherwise, the frame's source is shown.
|
|
|
|

|
|

|
|
|
|
If the `preview_uri` points to a video, the thumbnail includes video controls:
|
|
|
|

|
|

|
|
|
|
* [Frame viewer](webapp/webapp_datasets_frames.md): When inspecting a single frame, the frame viewer lets you toggle between the
|
|
`source` and the `preview_uri` if both are provided and differ. If no `preview_uri` is provided, the frame's source is
|
|
shown.
|
|
|
|

|
|

|
|
|
|
## Usage
|
|
|
|
### Register Frames with a Preview
|
|
|
|
To register frames with a preview,set the `preview_uri` when creating the frame:
|
|
|
|
```python
|
|
# create dataset version
|
|
version = DatasetVersion.create_version(
|
|
dataset_name="Example",
|
|
version_name="Registering frame with preview"
|
|
)
|
|
|
|
frame = SingleFrame(
|
|
source='https://acme-datasets.s3.amazonaws.com/tutorials/000012.jpg',
|
|
width=512, height=512,
|
|
preview_uri='https://acme-datasets.s3.amazonaws.com/images/000012.jpg'
|
|
)
|
|
|
|
# add frame to version
|
|
version.add_frames([frame])
|
|
``` |