File size: 2,705 Bytes
bc9465f
 
 
b6103c6
b5bb4ab
 
 
 
bc9465f
5fd1d4e
 
 
 
 
 
 
c76c872
bc9465f
5fd1d4e
 
 
 
 
 
 
 
 
 
 
 
bc9465f
5fd1d4e
bbf48c6
5fd1d4e
bbf48c6
5fd1d4e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bbf48c6
ff215fd
 
bbf48c6
bc9465f
 
5fd1d4e
bc9465f
 
 
 
5fd1d4e
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
license: apple-ascl
pipeline_tag: depth-estimation
library_name: pytorch
base_model:
- apple/DepthPro
tags:
- safetensors
---

<img src="https://takara.ai/images/logo-24/TakaraAi.svg" width="200" alt="Takara.ai Logo" />

From the Frontier Research Team at **Takara.ai** we present **DepthPro-Safetensors**, a memory-efficient and optimized implementation of Apple's high-precision depth estimation model.

---

# DepthPro-Safetensors

This repository contains Apple's [DepthPro](https://huggingface.co/apple/DepthPro) depth estimation model converted to the SafeTensors format for improved memory efficiency, security, and faster loading times.

## Model Overview

DepthPro is a state-of-the-art monocular depth estimation model developed by Apple that produces sharp and accurate metric depth maps from a single image in less than a second. This converted version preserves all the capabilities of the original model while providing the benefits of the SafeTensors format.

## Technical Specifications

- **Total Parameters**: 951,991,330
- **Memory Usage**: 1815.78 MB
- **Precision**: torch.float16
- **Estimated FLOPs**: 3,501,896,768

_Details calculated with [TensorKIKO](https://github.com/takara-ai/TensorKiko)_

## Usage

```python
from transformers import AutoModelForDepthEstimation, AutoImageProcessor
import torch
from PIL import Image

# Load model and processor
model = AutoModelForDepthEstimation.from_pretrained("takara-ai/DepthPro-Safetensors")
processor = AutoImageProcessor.from_pretrained("takara-ai/DepthPro-Safetensors")

# Prepare image
image = Image.open("your_image.jpg")
inputs = processor(images=image, return_tensors="pt")

# Inference
with torch.no_grad():
    outputs = model(**inputs)
    predicted_depth = outputs.predicted_depth

# Post-process for visualization
depth_map = processor.post_process_depth_estimation(outputs, target_size=image.size[::-1])
```

## Benefits of SafeTensors Format

- **Improved Security**: Resistant to code execution vulnerabilities
- **Faster Loading Times**: Optimized memory mapping for quicker model initialization
- **Memory Efficiency**: Better handling of tensor storage for reduced memory footprint
- **Parallel Loading**: Support for efficient parallel tensor loading

## Citation

```bibtex
@article{Bochkovskii2024:arxiv,
  author     = {Aleksei Bochkovskii and Ama\"{e}l Delaunoy and Hugo Germain and Marcel Santos and
               Yichao Zhou and Stephan R. Richter and Vladlen Koltun},
  title      = {Depth Pro: Sharp Monocular Metric Depth in Less Than a Second},
  journal    = {arXiv},
  year       = {2024},
}
```

---
For research inquiries and press, please reach out to [email protected]

> 人類を変革する