Instructions to use floflo2148/Screenshot_detector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use floflo2148/Screenshot_detector 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://floflo2148/Screenshot_detector") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from floflo2148/Screenshot_detector: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/floflo2148/Screenshot_detector/resolve/main/README.md
- Command line
-
hf download hf://floflo2148/Screenshot_detector/README.md
-
curl -L -o README.md https://huggingface.co/floflo2148/Screenshot_detector/resolve/main/README.md
1.1 kB
metadata
license: apache-2.0
pipeline_tag: image-classification
Screenshot classifier
A lightweight binary classifier for screenshot detection.
Model
mobilenetv3_small_screenshot.keras— trained Keras model for screenshot / not_screenshot classification
Usage
import tensorflow as tf
from tensorflow import keras
model = keras.models.load_model("mobilenetv3_small_screenshot.keras")
# Example inference
img = keras.utils.load_img("image.png", target_size=(224, 224))
arr = keras.utils.img_to_array(img)
arr = tf.keras.applications.mobilenet_v3.preprocess_input(arr)
arr = arr[None, ...]
pred = model.predict(arr)
score = float(pred[0, 0])
label = "screenshot" if score >= 0.5 else "not_screenshot"
print(label, score)
Input format
- RGB images
- resized to
224x224 - model expects a single sigmoid score
Prediction threshold
score >= 0.5→screenshotscore < 0.5→not_screenshot
Notes
- Model backbone:
MobileNetV3Smallpretrained on ImageNet - Output activation:
sigmoid - Loss used during training:
binary_crossentropy