yesidcanoc commited on
Commit
3bc3692
1 Parent(s): dbb868d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +16 -1
README.md CHANGED
@@ -17,7 +17,21 @@ Distilgpt2
17
  The model is fine-tuned and evaluated on the COCO 2017 dataset.
18
 
19
 
20
- ## How To use this model.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  Adapt the code below to your needs.
23
  ```
@@ -106,5 +120,6 @@ print(captions)
106
 
107
  ```
108
 
 
109
  ## References
110
  - Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., & Guo, B. (2021). Swin Transformer: Hierarchical Vision Transformer using Shifted Windows. ArXiv. /abs/2103.14030
 
17
  The model is fine-tuned and evaluated on the COCO 2017 dataset.
18
 
19
 
20
+ ## How to use this model using Transformer's pipeline
21
+
22
+ ```
23
+ from transformers import pipeline
24
+
25
+ image_to_text = pipeline("image-to-text", model="yesidcanoc/image-captioning-swin-tiny-distilgpt2")
26
+
27
+ # Provide path the image file
28
+ caption = image_to_text("./COCO_val2014_000000457986.jpg")
29
+ print(caption)
30
+
31
+ ```
32
+
33
+
34
+ ## How To use this model using `GenerateCaptions` utility class.
35
 
36
  Adapt the code below to your needs.
37
  ```
 
120
 
121
  ```
122
 
123
+
124
  ## References
125
  - Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., & Guo, B. (2021). Swin Transformer: Hierarchical Vision Transformer using Shifted Windows. ArXiv. /abs/2103.14030