TGrote11 commited on
Commit
37fdea4
1 Parent(s): 9628663

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -32
README.md CHANGED
@@ -11,7 +11,6 @@ tags: []
11
 
12
  ## Model Details
13
 
14
- ### Model Description
15
 
16
  <!-- Provide a longer summary of what this model is. -->
17
 
@@ -21,45 +20,32 @@ This is the model card of a 🤗 transformers model that has been pushed on the
21
  - **Funded by [optional]:** [More Information Needed]
22
  - **Shared by [optional]:** [More Information Needed]
23
  - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
  - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
 
28
- ### Model Sources [optional]
29
-
30
- <!-- Provide the basic links for the model. -->
31
-
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
 
36
  ## Uses
37
 
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
-
40
- ### Direct Use
41
-
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
-
44
- [More Information Needed]
45
-
46
- ### Downstream Use [optional]
47
-
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
-
50
- [More Information Needed]
51
-
52
- ### Out-of-Scope Use
53
-
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
-
56
- [More Information Needed]
57
 
58
  ## Bias, Risks, and Limitations
59
 
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
-
62
- [More Information Needed]
63
 
64
  ### Recommendations
65
 
 
11
 
12
  ## Model Details
13
 
 
14
 
15
  <!-- Provide a longer summary of what this model is. -->
16
 
 
20
  - **Funded by [optional]:** [More Information Needed]
21
  - **Shared by [optional]:** [More Information Needed]
22
  - **Model type:** [More Information Needed]
23
+ - **Language(s) (NLP):** German
24
  - **License:** [More Information Needed]
25
+ - **Finetuned from model [optional]:** [TrOCR_large_handwritten](https://huggingface.co/microsoft/trocr-large-handwritten)
26
 
 
 
 
 
 
 
 
27
 
28
  ## Uses
29
 
30
+ Here is how to use this model in PyTorch:
31
+
32
+ ```python
33
+ from transformers import TrOCRProcessor, VisionEncoderDecoderModel
34
+ from PIL import Image
35
+ import requests
36
+ # load image from the IAM database
37
+ url = 'https://fki.tic.heia-fr.ch/static/img/a01-122-02-00.jpg'
38
+ image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
39
+ processor = TrOCRProcessor.from_pretrained('TGrote11/testModel')
40
+ model = VisionEncoderDecoderModel.from_pretrained('TGrote11/testModel')
41
+ pixel_values = processor(images=image, return_tensors="pt").pixel_values
42
+ generated_ids = model.generate(pixel_values)
43
+ generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
44
+ ```
 
 
 
 
45
 
46
  ## Bias, Risks, and Limitations
47
 
48
+ You can use the raw model for optical character recognition (OCR) on single text-line images of german handwriting.
 
 
49
 
50
  ### Recommendations
51