Image Classification
Keras
LiteRT
English
computer-vision
satellite-imagery
tensorflow
remote-sensing
land-cover-classification
Instructions to use Mirutex/Celyrix-1.0-Vision with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use Mirutex/Celyrix-1.0-Vision with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://Mirutex/Celyrix-1.0-Vision") - Notebooks
- Google Colab
- Kaggle
Download src/common.py from Mirutex/Celyrix-1.0-Vision: direct link, hf CLI and curl.
- Browser
- Download file 931 Bytes
-
https://huggingface.co/Mirutex/Celyrix-1.0-Vision/resolve/main/src/common.py
- Command line
-
hf download hf://Mirutex/Celyrix-1.0-Vision/src/common.py
-
curl -L -o common.py https://huggingface.co/Mirutex/Celyrix-1.0-Vision/resolve/main/src/common.py
931 Bytes
| import os | |
| os.environ.setdefault("TF_CPP_MIN_LOG_LEVEL", "2") | |
| os.environ.setdefault("TF_NUM_INTRAOP_THREADS", "6") | |
| os.environ.setdefault("TF_NUM_INTEROP_THREADS", "2") | |
| import numpy as np | |
| from PIL import Image, ImageOps | |
| CLASSES = ["Forest", "River", "Residential", "Agriculture", "Industrial"] | |
| SOURCE_CLASSES = ["Forest", "River", "Residential", "AnnualCrop", "Industrial"] | |
| SIZE = 64 | |
| def preprocess(image): | |
| """Return RGB float32 pixels in [0,255]; the model contains normalization.""" | |
| image = ImageOps.exif_transpose(image).convert("RGB") | |
| return np.asarray( | |
| image.resize((SIZE, SIZE), Image.Resampling.BILINEAR), dtype=np.float32 | |
| ) | |
| def configure(seed=42): | |
| import tensorflow as tf | |
| tf.keras.utils.set_random_seed(seed) | |
| tf.config.experimental.enable_op_determinism() | |
| return { | |
| "devices": [str(d) for d in tf.config.list_physical_devices()], | |
| "deterministic_ops": True, | |
| } | |