CoolFace
Modelpublic

pszemraj/beit-large-patch16-512-film-shot-classifier

sourceHugging Faceapache-2.0updated 9mo agoView on Hugging Face
1likes165downloads
Model Card

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

beit-large-patch16-512: types of film shots

image/png

image/png

image/png

Model description

This model is a fine-tuned version of microsoft/beit-large-patch16-512 on the szymonrucinski/types-of-film-shots dataset. It achieves the following results on the evaluation set:

  • —Loss: 1.2335
  • —Accuracy: 0.6763

usage

py
from transformers import pipeline
from PIL import Image
import requests

pipe = pipeline(
    "image-classification",
    model="pszemraj/beit-large-patch16-512-film-shot-classifier",
)

url = "https://cdn-uploads.huggingface.co/production/uploads/60bccec062080d33f875cd0c/9YqYvv188ZccCMSzuv0KW.png"
image = Image.open(requests.get(url, stream=True).raw)
result = pipe(image)[0]
print(result)

try some of these:

class labels

The dataset contains the following labels:

json
"id2label": {
    "0": "ambiguous",
    "1": "closeUp",
    "2": "detail",
    "3": "extremeLongShot",
    "4": "fullShot",
    "5": "longShot",
    "6": "mediumCloseUp",
    "7": "mediumShot"
  },

as plaintext:

txt
ambiguous, close up, detail, extreme long shot, full shot, long shot, medium close up, medium shot

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • —learning_rate: 2e-05
  • —trainbatchsize: 2
  • —evalbatchsize: 4
  • —seed: 24414
  • —optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • —lrschedulertype: cosine
  • —lrschedulerwarmup_ratio: 0.05
  • —num_epochs: 6.0
  • —mixedprecisiontraining: Native AMP

Training results

Training LossEpochStepValidation LossAccuracy
1.04351.03931.47990.4892
1.15542.07861.49380.4892
1.50413.011792.17020.3597
1.04574.015721.54130.5683
0.33155.019651.07690.6978
0.21786.023581.23350.6763

Framework versions

  • —Transformers 4.38.0.dev0
  • —Pytorch 2.2.0+cu121
  • —Datasets 2.17.1
  • —Tokenizers 0.15.2