Instructions to use shailgsits/pan-card-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use shailgsits/pan-card-classifier 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://shailgsits/pan-card-classifier") - Notebooks
- Google Colab
- Kaggle
File size: 311 Bytes
f0e10d7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | from PIL import Image
import numpy as np
IMAGE_SIZE = (224, 224)
def preprocess_image(image: Image.Image):
image = image.convert("RGB")
image = image.resize(IMAGE_SIZE)
image = np.asarray(image).astype("float32")
image /= 255.0
image = np.expand_dims(image, axis=0)
return image |