> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/api-sdk-cli/ko/sdks/lidar-scene-uploads.md).

# LiDAR 씬 업로드

Python SDK로 LiDAR 포인트 클라우드, 씬 폴더, zip 파일, nuScenes 데이터셋을 씬 단위로 업로드하고 처리 상태 확인, 실패한 씬 재시도, 라이브러리 업로드를 하는 방법을 설명합니다.

LiDAR 씬은 구성과 관계없이 하나의 작업 항목입니다. 포인트 클라우드 하나일 수도, 프레임 시퀀스일 수도, 여러 센서와 카메라의 조합일 수도 있습니다. 씬은 `pointcloud` 유형을 지정한 경우에만 업로드되며, 그렇지 않으면 `.pcd`, `.ply`, `.bin` 파일은 건너뜁니다.

{% hint style="info" %}
워크스페이스에서 LiDAR 씬 기능이 켜져 있어야 합니다. 업로드가 거부되면 Unitlab 담당자에게 문의하세요.
{% endhint %}

## 미리 보기 후 업로드 <a href="#preview-then-upload" id="preview-then-upload"></a>

```python
from unitlab import detect_scenes

for scene in detect_scenes("./recordings").scenes:
    print(scene.name, scene.frame_count, scene.point_sensors, scene.cameras)

batch = project.upload("./recordings", generic_type="pointcloud")
batch.wait()

for item_id in batch.data_item_ids:
    status = project.scene_status(item_id)
    print(status.status, status.frame_count, status.error)
```

`detect_scenes()`는 아무것도 전송하지 않습니다. CLI에서는 `unitlab project upload ... --type pointcloud`에 `--dry-run`을 추가하세요.

## 소스 유형 <a href="#what-a-source-can-be" id="what-a-source-can-be"></a>

| 소스                                                             | 결과                                                                      |
| -------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `.pcd`, `.ply`, `.bin` 파일 하나                                   | 1프레임 씬                                                                  |
| 프레임 또는 `scene.json`이 들어 있는 `.zip`                              | 씬 하나. 그 외 `.zip` 파일은 거부됩니다.                                             |
| `scene.json`이 있는 폴더 또는 센서 하나의 프레임 폴더(`drive_01/lidar/000.pcd`) | 씬 하나. 파일 이름이 일치하는 이미지 폴더는 해당 씬의 카메라가 됩니다(`drive_01/cam_front/000.jpg`). |
| 센서별 하위 폴더가 같은 파일 이름을 공유하는 폴더                                   | 여러 센서를 가진 씬 하나. 폴더마다 별개의 녹화라면 `split_sensor_folders=True`를 전달하세요.       |
| 위 항목 여러 개가 들어 있는 폴더                                            | 각각 씬 하나                                                                 |
| nuScenes 데이터셋(`samples/`와 `v1.0-*/`)                           | 녹화마다 씬 하나. 키 프레임만 포함하며, 테이블의 캘리브레이션을 사용합니다                              |

폴더의 다른 파일은 이 호출로 업로드되지 않습니다. 일반 미디어는 유형을 지정하지 않고 폴더를 다시 업로드하세요.

## 제한 <a href="#limits" id="limits"></a>

| 항목       | 값                 |
| -------- | ----------------- |
| 씬 크기     | 20 GiB            |
| 씬당 프레임 수 | 1,000             |
| 사용량      | 프레임당 Data Unit 1개 |

`UploadBatch`의 카운트는 씬 단위입니다.

## 실패한 씬 <a href="#failed-scenes" id="failed-scenes"></a>

실패한 씬은 `project.data_units()`에 나타나지 않습니다. `project.batch_queue(id).data()`로 Batch Queue에서 찾고, `project.scene_status(item_id)`로 원인을 확인한 뒤, 실패하고 약 1분 후에 재시도하세요.

```python
project.retry_scene(item_id)
```

## 라이브러리 업로드 <a href="#library-uploads" id="library-uploads"></a>

```python
result = client.assets.upload("./recordings", generic_type="pointcloud", folder="Lidar")
asset = result.assets[0]
status = asset.wait()        # status.frame_count, status.error
asset.retry()                # a failed scene
```

## 라벨 <a href="#labels" id="labels"></a>

씬 라벨은 [작업 어노테이션과 Agent 웹훅](https://docs.unitlab.ai/api-sdk-cli/ko/sdks/task-annotations-and-agent-webhooks.md)으로 읽고 저장합니다. `release.download_files()`는 폴더로 업로드한 씬을 원래 경로 그대로 `<file name>/` 아래에 씁니다.

## 관련 문서 <a href="#related" id="related"></a>

[프로젝트 업로드](https://docs.unitlab.ai/api-sdk-cli/ko/sdks/project-uploads.md) · [CLI: 프로젝트와 Data Unit](https://docs.unitlab.ai/api-sdk-cli/ko/clis/cli-projects-and-data-units.md)
