Firoj112 commited on
Commit
e82b198
·
verified ·
1 Parent(s): 0c5cccf

Update tools/detect_elements.py

Browse files
Files changed (1) hide show
  1. tools/detect_elements.py +4 -6
tools/detect_elements.py CHANGED
@@ -8,14 +8,12 @@ class DetectElementsTool(Tool):
8
  name = "detect_elements"
9
  description = "Detects table-like structures or text boxes in a screenshot using OpenCV."
10
  inputs = {
11
- "screenshot_path": {"type": "str", "description": "Path to the screenshot"},
12
- "element_type": {"type": "str", "default": "table", "description": "Type: 'table' or 'textbox'"}
13
  }
14
- output_type = "str"
15
 
16
- def forward(self, **kwargs):
17
- screenshot_path = kwargs.get("screenshot_path")
18
- element_type = kwargs.get("element_type", "table")
19
  try:
20
  if not os.path.exists(screenshot_path):
21
  return f"Screenshot not found: {screenshot_path}"
 
8
  name = "detect_elements"
9
  description = "Detects table-like structures or text boxes in a screenshot using OpenCV."
10
  inputs = {
11
+ "screenshot_path": {"type": "string", "description": "Path to the screenshot"},
12
+ "element_type": {"type": "string", "default": "table", "description": "Type: 'table' or 'textbox'"}
13
  }
14
+ output_type = "string"
15
 
16
+ def forward(self, screenshot_path, element_type="table"):
 
 
17
  try:
18
  if not os.path.exists(screenshot_path):
19
  return f"Screenshot not found: {screenshot_path}"