Instructions to use Chuckame/deep-image-orientation-angle-detection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- TF-Keras
How to use Chuckame/deep-image-orientation-angle-detection with TF-Keras:
# Note: 'keras<3.x' or 'tf_keras' must be installed (legacy), and from_pretrained_keras was removed in huggingface_hub 1.0. # See https://github.com/keras-team/tf-keras for more details. # !pip install "huggingface_hub<1.0" tf_keras from huggingface_hub import from_pretrained_keras model = from_pretrained_keras("Chuckame/deep-image-orientation-angle-detection") - Notebooks
- Google Colab
- Kaggle
Update infer-rotation.py
Browse files- infer-rotation.py +1 -2
infer-rotation.py
CHANGED
|
@@ -5,7 +5,6 @@ from transformers import ViTImageProcessor, TFViTModel
|
|
| 5 |
import keras
|
| 6 |
import argparse
|
| 7 |
|
| 8 |
-
VIT_WEIGHTS_PATH = "model-vit-ang-loss.h5"
|
| 9 |
BASE_MODEL = "google/vit-base-patch16-224"
|
| 10 |
IMAGE_SIZE = 224
|
| 11 |
|
|
@@ -43,7 +42,7 @@ class Inference:
|
|
| 43 |
print(model.summary())
|
| 44 |
|
| 45 |
print("Loading Weights")
|
| 46 |
-
model.load_weights(
|
| 47 |
|
| 48 |
return model
|
| 49 |
|
|
|
|
| 5 |
import keras
|
| 6 |
import argparse
|
| 7 |
|
|
|
|
| 8 |
BASE_MODEL = "google/vit-base-patch16-224"
|
| 9 |
IMAGE_SIZE = 224
|
| 10 |
|
|
|
|
| 42 |
print(model.summary())
|
| 43 |
|
| 44 |
print("Loading Weights")
|
| 45 |
+
model.load_weights("weights.h5")
|
| 46 |
|
| 47 |
return model
|
| 48 |
|