plcedoz38 commited on
Commit
9a8ee80
·
verified ·
1 Parent(s): 40de8a6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -2
README.md CHANGED
@@ -94,9 +94,7 @@ import json
94
  import os
95
  from typing import Any, Literal
96
 
97
- from PIL import Image
98
  from transformers import AutoModelForImageTextToText, AutoProcessor
99
- from transformers.models.qwen2_vl.image_processing_qwen2_vl import smart_resize
100
 
101
  # default: Load the model on the available device(s)
102
  # We recommend enabling flash_attention_2 for better acceleration and memory saving.
@@ -133,7 +131,12 @@ def run_inference(messages: list[dict[str, Any]]) -> str:
133
 
134
  ### Prepare image and instruction
135
 
 
 
136
  ```python
 
 
 
137
  # Prepare image and instruction
138
  image_url = "https://huggingface.co/Hcompany/Holo1-3B/resolve/main/calendar_example.jpg"
139
  image = Image.open(requests.get(image_url, stream=True).raw)
 
94
  import os
95
  from typing import Any, Literal
96
 
 
97
  from transformers import AutoModelForImageTextToText, AutoProcessor
 
98
 
99
  # default: Load the model on the available device(s)
100
  # We recommend enabling flash_attention_2 for better acceleration and memory saving.
 
131
 
132
  ### Prepare image and instruction
133
 
134
+ WARNING: Holo1 is using absolute coordinates (number of pixels) and HuggingFace processor is doing image resize. To have matching coordinates, one needs to smart_resize the image.
135
+
136
  ```python
137
+ from PIL import Image
138
+ from transformers.models.qwen2_vl.image_processing_qwen2_vl import smart_resize
139
+
140
  # Prepare image and instruction
141
  image_url = "https://huggingface.co/Hcompany/Holo1-3B/resolve/main/calendar_example.jpg"
142
  image = Image.open(requests.get(image_url, stream=True).raw)