https://github.com/gwolf3/amerikana
☕tf.keras prediction decoder for simpler imagenet synset.
https://github.com/gwolf3/amerikana
imagenet-utils python tensorflow
Last synced: about 2 months ago
JSON representation
☕tf.keras prediction decoder for simpler imagenet synset.
- Host: GitHub
- URL: https://github.com/gwolf3/amerikana
- Owner: gWOLF3
- License: mit
- Created: 2020-03-21T04:47:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-14T01:56:15.000Z (about 6 years ago)
- Last Synced: 2025-08-28T06:14:58.907Z (10 months ago)
- Topics: imagenet-utils, python, tensorflow
- Language: Python
- Homepage:
- Size: 39.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
### ☕ amerikana: [tf.keras](https://www.tensorflow.org/guide/keras) prediction decoder for [imagenet-simple-labels](https://github.com/anishathalye/imagenet-simple-labels)
[](https://badge.fury.io/py/amerikana)
a simpler, more human readable imagenet synset for keras.
comparison:
| ID | ImageNet | Keras | Simple |
| --- | --- | --- | --- |
| 87 | African grey, African gray, Psittacus erithacus | African_grey | grey parrot |
| 97 | drake | drake | duck |
| 913 | wreck | wreck | shipwreck |
| 930 | French loaf | French_loaf | baguette |
#### quickstart:
should be used as a drop in replacement for [tf.keras.applications.imagenet_utils.decode_predictions](https://www.tensorflow.org/api_docs/python/tf/keras/applications/imagenet_utils/decode_predictions)
install with pip:
```
pip install amerikana
```
import:
```
from amerikana import decode_predictions
```
instead of:
```
from tensorflow.keras.applications.imagenet_utils import decode_predictions
```
example use:
```
predictions = model.predict(processed_image)
labels = decode_predictions(predictions)
print(labels)
```
#### credit:
- simplified labels list: [imagenet-simple-labels](https://github.com/anishathalye/imagenet-simple-labels). see information and comparison for simplified labels there.
- the module code used in this project is a derivative of tf.keras [imagenet_utils](https://github.com/tensorflow/tensorflow/blob/1a9dcb0b4844007f0943581f4fbeaa7fc8628bd6/tensorflow/python/keras/applications/imagenet_utils.py).
#### enjoy!