Downloads · 30 days
0
hashinikarunathilaka/gemstone-classifier-api
gemstone-classifier-api is a machine learning model from hashinikarunathilaka. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
A RESTful API for classifying gemstone images using a pre-trained deep learning model.
Downloads · 30 days
0
Access
Public
Updated Apr 2, 2025
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py6.7 KB · 60%
From the Hugging Face model README
A RESTful API for classifying gemstone images using a pre-trained deep learning model.
The API is versioned with a prefix: /api/v1
GET /
Returns basic information about the API and available endpoints.
GET /api/v1/health
Checks if the API is running and the model is loaded.
GET /api/v1/classes
Returns a list of all gemstone classes that the model can predict.
POST /api/v1/predict
Predicts the gemstone class from an uploaded image.
Request:
Response:
{
"prediction": "Ruby",
"confidence": 0.98,
"timestamp": "2023-04-01T12:34:56.789Z"
}
The API documentation is available at /docs when the server is running.
pip install -r requirements.txt
uvicorn app:app --reload
docker build -t gemstone-classifier-api .
docker run -p 7860:7860 gemstone-classifier-api
The following environment variables can be set to configure the API:
MODEL_PATH: Path to the model file (default: gemstone_classifier.h5)CLASS_NAMES_PATH: Path to the class names file (default: class_names.csv)The model is a convolutional neural network trained on a dataset of gemstone images. It can classify 85 different types of gemstones with high accuracy.
Input image requirements:
This project is licensed under the MIT License - see the LICENSE file for details.