Downloads · 30 days
7
3% of all-time downloads
hadilq/dragon-notdragon
dragon-notdragon is a image classification model from hadilq. Use it when you need a label for an image. It is set up for keras. The card lists the license as mit.
This is a simple tensorflow model to detect dragon in images. If you just want to test the trained model, make sure you have the following packages:
Downloads · 30 days
7
3% of all-time downloads
All-time downloads
208
Public
Repo size
4.8 GB
Likes
0
Public
Click a slice to open those files.
.data-00000-of-00001537 MB · 100%
From the Hugging Face model README
This is a simple tensorflow model to detect dragon in images.
If you just want to test the trained model, make sure you have the following packages:
tensorflow keras sklearn-deap datasets transformers[torch] sentencepiece
To run prediction you need to run below code:
from huggingface_hub import from_pretrained_keras
model = from_pretrained_keras("hadilq/dragon-notdragon")
img = keras.preprocessing.image.load_img(filename, target_size=(224, 224))
x = keras.preprocessing.image.img_to_array(img)
x = np.expand_dims(x, axis=0)
x = keras.applications.vgg16.preprocess_input(x)
prediction = model.predict(x)
print("model:", filename, "dragon" if prediction[0][0] >= 0.99 else "notdragon")
Additionally, you can check https://replicate.com/hadilq/dragon-notdragon to play around.
I trained it in Google colab, where you can find the original code in training directory.
The following hyperparameters were used during training:
| Hyperparameters | Value |
|---|---|
| name | Adam |
| weight_decay | None |
| clipnorm | None |
| global_clipnorm | None |
| clipvalue | None |
| use_ema | False |
| ema_momentum | 0.99 |
| ema_overwrite_frequency | None |
| jit_compile | True |
| is_legacy_optimizer | False |
| learning_rate | 9.999999747378752e-05 |
| beta_1 | 0.9 |
| beta_2 | 0.999 |
| epsilon | 1e-07 |
| amsgrad | False |
| training_precision | float32 |
