File size: 2,936 Bytes
21137de
 
 
2b5e37f
 
0e10177
311bf78
0e10177
 
ef99481
 
 
21137de
 
 
 
 
311bf78
0e10177
 
3cf49ea
 
 
 
 
 
 
 
 
 
 
 
 
12d3194
0e10177
 
21137de
2b5e37f
21137de
 
 
 
12d3194
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21137de
12d3194
21137de
0e10177
21137de
0e10177
 
 
 
 
 
 
 
 
 
 
 
21137de
c57cce6
 
 
 
 
 
21137de
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0e10177
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
license: apache-2.0
tags:
- image-classification
- vision
- cinematography
- film
datasets:
- szymonrucinski/types-of-film-shots
metrics:
- accuracy
base_model: microsoft/beit-large-patch16-512
---

<!-- 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](https://cdn-uploads.huggingface.co/production/uploads/60bccec062080d33f875cd0c/9YqYvv188ZccCMSzuv0KW.png)



![image/png](https://cdn-uploads.huggingface.co/production/uploads/60bccec062080d33f875cd0c/N255KgVTEorFT59oMzqVL.png)




![image/png](https://cdn-uploads.huggingface.co/production/uploads/60bccec062080d33f875cd0c/uiricD6EMnyrkyh_7yHdv.png)


## Model description


This model is a fine-tuned version of [microsoft/beit-large-patch16-512](https://huggingface.co/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
- train_batch_size: 2
- eval_batch_size: 4
- seed: 24414
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_ratio: 0.05
- num_epochs: 6.0
- mixed_precision_training: Native AMP

### Training results

| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|:-------------:|:-----:|:----:|:---------------:|:--------:|
| 1.0435        | 1.0   | 393  | 1.4799          | 0.4892   |
| 1.1554        | 2.0   | 786  | 1.4938          | 0.4892   |
| 1.5041        | 3.0   | 1179 | 2.1702          | 0.3597   |
| 1.0457        | 4.0   | 1572 | 1.5413          | 0.5683   |
| 0.3315        | 5.0   | 1965 | 1.0769          | 0.6978   |
| 0.2178        | 6.0   | 2358 | 1.2335          | 0.6763   |


### Framework versions

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