MobileNetV3 Custom Model

Model Description

This is a custom MobileNetV3-based model trained for image classification using TensorFlow/Keras.

Model Details

  • Architecture: MobileNetV3 (Custom)
  • Number of Classes: 10
  • Input Size: 224x224
  • Framework: TensorFlow/Keras 2.20.0
  • Model Layers: 4 layers (custom architecture)

Usage

Quick Start

import tensorflow as tf
from huggingface_hub import hf_hub_download
import numpy as np
from PIL import Image

# Download the model
model_path = hf_hub_download(
    repo_id="shifaazzz/mobilenet-v2-custom",
    filename="model.h5"
)

# Load the model
model = tf.keras.models.load_model(model_path, compile=False)

# Recompile if needed
model.compile(
    optimizer='adam',
    loss='categorical_crossentropy',
    metrics=['accuracy']
)

# Load and preprocess an image
img = Image.open("your_image.jpg").resize((224, 224))
img_array = np.array(img) / 255.0  # Normalize
img_array = np.expand_dims(img_array, axis=0)  # Add batch dimension

# Make prediction
predictions = model.predict(img_array)
predicted_class = np.argmax(predictions[0])
confidence = predictions[0][predicted_class]

print(f"Predicted Class: {predicted_class}")
print(f"Confidence: {confidence:.2%}")

Troubleshooting

If you encounter loading errors, try:

# Load without compilation
model = tf.keras.models.load_model(model_path, compile=False)

Or check the LOADING_INSTRUCTIONS.md file in this repository for more details.

Files in this Repository

  • model.h5 - The trained model (recommended)
  • saved_model/ - TensorFlow SavedModel format (if available)
  • model_weights.h5 - Model weights only (if available)
  • model_architecture.json - Model architecture in JSON format (if available)
  • config.json - Model configuration
  • requirements.txt - Python dependencies

Training Information

[Add details about your training process, dataset, epochs, etc.]

Performance Metrics

[Add your model's accuracy, loss, validation metrics, etc.]

Class Labels

[List your class names here, e.g.:]

0: Class_Name_0
1: Class_Name_1
2: Class_Name_2
...

Citation

If you use this model, please cite appropriately.

Downloads last month
12
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support