Skip to content

supervisely-ecosystem/apply-florence-2-to-images-project

Repository files navigation

Apply Florence-2 to Images Project

Integration of the Microsoft Florence-2 model for prompt-based object detection.

OverviewHow to RunExamples

GitHub release (latest SemVer) views runs

Overview

Application allows you to label project images using the Florence-2 detection model with bounding boxes and utilizes the Segment Anything 2.1 model to generate object masks based on the bounding box annotations.

Application key points:

  • Select project or dataset to label

  • Serve models by Serve Florence-2 and Serve Segment Anything 2.1 apps. The Florence-2-large and SAM 2.1 Hiera small models will be deployed automatically. You can change it if needed.

  • If models were deployed before the application was launched, they will be connected automatically.

  • Set up model input data as text-prompt. If you left it empty - model will apply Detailed Caption task for every image to predict all known objects.

  • Preview detection results

  • Apply model to project images and save new annotations to new project or add to existed. If you only need annotations like mask, you can skip saving bbox.

How to Run

  1. Start the application from Ecosystem or context menu of an Images Project.

  2. Choose your input project / dataset.

  1. Select your served models and click Select model button if they have not been automatically selected.
  1. Write down the Text Prompt that will help Florence-2 detect objects you need.
  1. View predictions preview by clicking according buttons.
  1. Select the way you want to save the project and click Apply to Project.

Examples

Text Prompt: The image shows a room with tables and chairs.