Instructions to use andito/Florence-2-large-ft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use andito/Florence-2-large-ft with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="andito/Florence-2-large-ft", trust_remote_code=True)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("andito/Florence-2-large-ft", trust_remote_code=True) model = AutoModelForImageTextToText.from_pretrained("andito/Florence-2-large-ft", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
Purpose of special tokens
#3
by tdeboissiere - opened
Hello !
Thanks for the detailed blog post, very helpful.
I was curious about the special tokens (e.g. ['<od>', '</od>', '<ocr>', '</ocr>']) in the Florence2Processor
- These tokens don't seem to be used anywhere, so what is their purpose ?
- Related: how was Florence-2 initially trained, say, for object detection ? (Were the inputs to the model the image + a text prompt such as "Locate the objects with category name in the image." + the category + the actual location of the objects in the image ?