Downloads · 30 days
0
yigagilbert/image-qaulity-model
image-qaulity-model is a image classification model from yigagilbert. Use it when you need a label for an image. It is set up for transformers. The card lists the license as apache-2.0.
This model is trained on the dataset yigagilbert/imagequalitydataset and performs regression tasks to predict image quality scores.
Downloads · 30 days
0
Access
Public
Updated Sep 29, 2024
Parameters
86.4M
1 GB on disk
Likes
1
Public
Click a slice to open those files.
.pt687 MB · 67%
From the Hugging Face model README
This model is trained on the dataset yigagilbert/image_quality_dataset and performs regression tasks to predict image quality scores.
This model fine-tunes the google/vit-base-patch16-224 Vision Transformer using PyTorch and Hugging Face's 🤗 Transformers library. It predicts a numerical score based on the quality of the input image.
This repository contains a model for image regression tasks, where the goal is to predict a numerical value from an input image. The model fine-tunes the google/vit-base-patch16-224 Vision Transformer using PyTorch and 🤗 Hugging Face tools. You can train the model, upload it to the 🤗 Model Hub, and perform inference using a simple API.
Install the required packages by running:
pip install -r requirements.txt
from ImageRegression import train_model, upload_model, predict
Train the model using the train_model() function. Below are the key parameters:
0.2 for 20% test data).train_model(dataset_id='yigagilbert/image_quality_dataset',
value_column_name='quality_score',
test_split=0.2,
output_dir='./model_output',
num_train_epochs=10,
learning_rate=1e-4)
Training progress will be logged, and checkpoints will be saved in output_dir. These checkpoints can be used for model inference and uploaded to the 🤗 Hub.
To upload your trained model to the 🤗 Hub, use the upload_model() function:
upload_model(model_id='yigagilbert/image-qaulity-model',
token='your_HF_token',
checkpoint_dir='./model_output/checkpoint-940')
Once uploaded, the model can be used for inference directly from the Hub.
You can perform inference using the predict() function.
predict(repo_id='yigagilbert/image-qaulity-model',
image_path='path_to_image.jpg')
The first time you run inference, the model will be downloaded from the Hugging Face Hub. Subsequent inferences will run faster as the model is cached locally.