Update README.md
Browse files
README.md
CHANGED
|
@@ -115,14 +115,14 @@ Returns top-5 most similar artists with confidence scores:
|
|
| 115 |
|
| 116 |
### Installation / Установка
|
| 117 |
```bash
|
| 118 |
-
pip install onnxruntime onnx pillow numpy
|
| 119 |
# or for GPU / или для GPU:
|
| 120 |
-
pip install onnxruntime-gpu onnx pillow numpy
|
| 121 |
```
|
| 122 |
|
| 123 |
### Inference / Инференс
|
| 124 |
|
| 125 |
-
|
| 126 |
import onnxruntime as ort
|
| 127 |
import onnx
|
| 128 |
import numpy as np
|
|
@@ -154,11 +154,9 @@ class AuthorID:
|
|
| 154 |
elif prop.key == "input_size":
|
| 155 |
self.input_size = int(prop.value)
|
| 156 |
|
| 157 |
-
# Create inference session
|
| 158 |
providers = ['CUDAExecutionProvider', 'CPUExecutionProvider']
|
| 159 |
self.session = ort.InferenceSession(onnx_path, providers=providers)
|
| 160 |
|
| 161 |
-
# ImageNet normalization
|
| 162 |
self.mean = np.array([0.485, 0.456, 0.406], dtype=np.float32).reshape(1, 3, 1, 1)
|
| 163 |
self.std = np.array([0.229, 0.224, 0.225], dtype=np.float32).reshape(1, 3, 1, 1)
|
| 164 |
|
|
|
|
| 115 |
|
| 116 |
### Installation / Установка
|
| 117 |
```bash
|
| 118 |
+
pip install onnxruntime onnx pillow numpy huggingface_hub
|
| 119 |
# or for GPU / или для GPU:
|
| 120 |
+
pip install onnxruntime-gpu onnx pillow numpy huggingface_hub
|
| 121 |
```
|
| 122 |
|
| 123 |
### Inference / Инференс
|
| 124 |
|
| 125 |
+
```python
|
| 126 |
import onnxruntime as ort
|
| 127 |
import onnx
|
| 128 |
import numpy as np
|
|
|
|
| 154 |
elif prop.key == "input_size":
|
| 155 |
self.input_size = int(prop.value)
|
| 156 |
|
|
|
|
| 157 |
providers = ['CUDAExecutionProvider', 'CPUExecutionProvider']
|
| 158 |
self.session = ort.InferenceSession(onnx_path, providers=providers)
|
| 159 |
|
|
|
|
| 160 |
self.mean = np.array([0.485, 0.456, 0.406], dtype=np.float32).reshape(1, 3, 1, 1)
|
| 161 |
self.std = np.array([0.229, 0.224, 0.225], dtype=np.float32).reshape(1, 3, 1, 1)
|
| 162 |
|