Downloads · 30 days
0
tonyassi/tony__assi-ig-prediction
tony__assi-ig-prediction is a machine learning model from tonyassi. 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 apache-2.0.
This model was trained with IGPrediction. It predicts how many likes an image will get.
Downloads · 30 days
0
Access
Public
Updated Jun 4, 2024
Parameters
86.4M
1 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt687 MB · 67%
From the Hugging Face model README
This model was trained with IGPrediction. It predicts how many likes an image will get.
from IGPredict import predict_ig
predict_ig(repo_id='tonyassi/tony__assi-ig-prediction',image_path='image.jpg')
Dataset: tonyassi/tony__assi-ig-ds5
Value Column: 'likes'
Train Test Split: 0.2
Base Model: google/vit-base-patch16-224
Epochs: 20
Learning Rate: 0.0001
git clone https://github.com/TonyAssi/IGPrediction.git
cd IGPrediction
pip install -r requirements.txt
from IGPredict import ig_download, upload_dataset, train_ig_model, upload_ig_model, predict_ig
ig_download(username='instagarm_username', num_images=100)
Instagram images will be downloaded to './images' folder, each one named like so "index-likes.jpg". E.g. "3-17.jpg" is the third image and has 17 likes.
upload_dataset(dataset_name='tonyassi/tony__assi-ig-ds5', token='YOUR_HF_TOKEN')
Go to your 🤗 profile to find your uploaded dataset, it should look similar to tonyassi/tony__assi-ig-ds.
train_ig_model(dataset_id='tonyassi/tony__assi-ig-ds5',
test_split=0.2,
num_train_epochs=20,
learning_rate=0.0001)
The trainer will save the checkpoints in the 'results' folder. The model.safetensors are the trained weights you'll use for inference (predicton).
This function will upload your model to the 🤗 Hub.
upload_ig_model(model_id='tony__assi-ig-prediction',
token='YOUR_HF_TOKEN',
checkpoint_dir='./results/checkpoint-940')
predict_ig(repo_id='tonyassi/tony__assi-ig-prediction',
image_path='image.jpg')
The first time this function is called it'll download the safetensor model. Subsequent function calls will run faster.