(s)
| 25 | |
| 26 | # point (str) -> point |
| 27 | def pred_2_point(s): |
| 28 | floats = re.findall(r'-?\d+\.?\d*', s) |
| 29 | floats = [float(num) for num in floats] |
| 30 | if len(floats) == 2: |
| 31 | click_point = floats |
| 32 | elif len(floats) == 4: |
| 33 | click_point = [(floats[0]+floats[2])/2, (floats[1]+floats[3])/2] |
| 34 | return click_point |
| 35 | |
| 36 | # bbox (qwen str) -> bbox |
| 37 | def extract_bbox(s): |