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
File size: 931 Bytes
17124c2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 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,
}
|