Update block.py

#1
by YiYiXu HF Staff - opened
Files changed (1) hide show
  1. block.py +6 -0
block.py CHANGED
@@ -37,11 +37,13 @@ class Florence2ImageAnnotatorBlock(ModularPipelineBlocks):
37
  type_hint=Union[Image.Image, List[Image.Image]],
38
  required=True,
39
  description="Image(s) to annotate",
 
40
  ),
41
  InputParam(
42
  "annotation_task",
43
  type_hint=Union[str, List[str]],
44
  default="<REFERRING_EXPRESSION_SEGMENTATION>",
 
45
  description="""Annotation Task to perform on the image.
46
  Supported Tasks:
47
 
@@ -63,6 +65,7 @@ class Florence2ImageAnnotatorBlock(ModularPipelineBlocks):
63
  "annotation_prompt",
64
  type_hint=Union[str, List[str]],
65
  required=True,
 
66
  description="""Annotation Prompt to provide more context to the task.
67
  Can be used to detect or segment out specific elements in the image
68
  """,
@@ -71,6 +74,7 @@ class Florence2ImageAnnotatorBlock(ModularPipelineBlocks):
71
  "annotation_output_type",
72
  type_hint=str,
73
  default="mask_image",
 
74
  description="""Output type from annotation predictions. Availabe options are
75
  annotation:
76
  - raw annotation predictions from the model based on task type.
@@ -88,6 +92,7 @@ class Florence2ImageAnnotatorBlock(ModularPipelineBlocks):
88
  required=True,
89
  default=False,
90
  description="",
 
91
  ),
92
  InputParam(
93
  "fill",
@@ -109,6 +114,7 @@ class Florence2ImageAnnotatorBlock(ModularPipelineBlocks):
109
  "images",
110
  type_hint=Image,
111
  description="Annotated input Image(s)",
 
112
  ),
113
  ]
114
 
 
37
  type_hint=Union[Image.Image, List[Image.Image]],
38
  required=True,
39
  description="Image(s) to annotate",
40
+ metadata={"mellon":"image"},
41
  ),
42
  InputParam(
43
  "annotation_task",
44
  type_hint=Union[str, List[str]],
45
  default="<REFERRING_EXPRESSION_SEGMENTATION>",
46
+ metadata={"mellon":"dropdown"},
47
  description="""Annotation Task to perform on the image.
48
  Supported Tasks:
49
 
 
65
  "annotation_prompt",
66
  type_hint=Union[str, List[str]],
67
  required=True,
68
+ metadata={"mellon":"textbox"},
69
  description="""Annotation Prompt to provide more context to the task.
70
  Can be used to detect or segment out specific elements in the image
71
  """,
 
74
  "annotation_output_type",
75
  type_hint=str,
76
  default="mask_image",
77
+ metadata={"mellon":"dropbox"},
78
  description="""Output type from annotation predictions. Availabe options are
79
  annotation:
80
  - raw annotation predictions from the model based on task type.
 
92
  required=True,
93
  default=False,
94
  description="",
95
+ metadata={"mellon":"checkbox"},
96
  ),
97
  InputParam(
98
  "fill",
 
114
  "images",
115
  type_hint=Image,
116
  description="Annotated input Image(s)",
117
+ metadata={"mellon":"image"},
118
  ),
119
  ]
120