Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
pipeline_tag: object-detection
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
# Detection Perceiver Model
|
| 7 |
+
|
| 8 |
+
<img src="https://raw.githubusercontent.com/maxploter/DePerceiver/refs/heads/main/de_perceiver_r50/de_perceiver.png" alt="DePerceiver R50 Image"/>
|
| 9 |
+
|
| 10 |
+
[GH repository DePerceiver](https://github.com/maxploter/DePerceiver)
|
| 11 |
+
|
| 12 |
+
## Usage
|
| 13 |
+
|
| 14 |
+
```python
|
| 15 |
+
from huggingface_hub import snapshot_download
|
| 16 |
+
import torch
|
| 17 |
+
import json
|
| 18 |
+
import sys
|
| 19 |
+
|
| 20 |
+
# Download model
|
| 21 |
+
repo_path = snapshot_download(repo_id="Max-Ploter/DePerceiver")
|
| 22 |
+
|
| 23 |
+
# Add to Python path to access modeling_detection_perceiver.py
|
| 24 |
+
sys.path.append(repo_path)
|
| 25 |
+
from modeling_detection_perceiver import build_model
|
| 26 |
+
|
| 27 |
+
# Load config
|
| 28 |
+
with open(f"{repo_path}/config.json") as f:
|
| 29 |
+
config = json.load(f)
|
| 30 |
+
|
| 31 |
+
# Build and load model
|
| 32 |
+
model = build_model(config)
|
| 33 |
+
model.load_state_dict(torch.load(f"{repo_path}/detection_perceiver_model_weights_pytorch.bin"))
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
## Dependencies
|
| 37 |
+
|
| 38 |
+
```shell
|
| 39 |
+
pip install torch torchvision perceiver-pytorch
|
| 40 |
+
```
|