Update README.md
Browse filesAdded usage instructions to load the model from the Hub.
README.md
CHANGED
@@ -36,6 +36,10 @@ Link to the run: https://wandb.ai/jorgvt/PerceptNet/runs/28m2cnzj?workspace=user
|
|
36 |
|
37 |
# Usage
|
38 |
|
|
|
|
|
|
|
|
|
39 |
As of now to use the model you have to install the [PerceptNet repo](https://github.com/Jorgvt/perceptnet) to get access to the `PerceptNet` class where you will load the weights available here like this:
|
40 |
|
41 |
```python
|
@@ -49,4 +53,15 @@ model.build(input_shape=(None, 384, 512, 3))
|
|
49 |
model.load_weights(weights_path)
|
50 |
```
|
51 |
|
52 |
-
> PerceptNet requires `wandb` to be installed. It's something we're looking into.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
# Usage
|
38 |
|
39 |
+
There are two alternatives to use the model: install our development repo and load the pretrained weights manually, and load the model using `from_pretrained_keras`:
|
40 |
+
|
41 |
+
## Loading weights manually
|
42 |
+
|
43 |
As of now to use the model you have to install the [PerceptNet repo](https://github.com/Jorgvt/perceptnet) to get access to the `PerceptNet` class where you will load the weights available here like this:
|
44 |
|
45 |
```python
|
|
|
53 |
model.load_weights(weights_path)
|
54 |
```
|
55 |
|
56 |
+
> PerceptNet requires `wandb` to be installed. It's something we're looking into.
|
57 |
+
|
58 |
+
## Directly from the Hub
|
59 |
+
|
60 |
+
As every other *Keras* model in the Hub, it can be loaded as follows:
|
61 |
+
|
62 |
+
```python
|
63 |
+
from huggingface_hub import from_pretrained_keras
|
64 |
+
model = from_pretrained_keras("Jorgvt/PerceptNet", compile=False)
|
65 |
+
```
|
66 |
+
|
67 |
+
> Keep in mind that the model uses grouped convolutions and, at least in Colab, `Unimplemented Errors` may arise when using it in CPU.
|