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
Download api/preprocess.py from shailgsits/pan-card-classifier: direct link, hf CLI and curl.
- Browser
- Download file 311 Bytes
-
https://huggingface.co/shailgsits/pan-card-classifier/resolve/main/api/preprocess.py
- Command line
-
hf download hf://shailgsits/pan-card-classifier/api/preprocess.py
-
curl -L -o preprocess.py https://huggingface.co/shailgsits/pan-card-classifier/resolve/main/api/preprocess.py
311 Bytes
| 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 |