Heuristic to detect format of the prediction text.
(text)
| 127 | |
| 128 | @staticmethod |
| 129 | def detect_format(text) -> str: |
| 130 | """ Heuristic to detect format of the prediction text.""" |
| 131 | if re.search(r'time\s+\d+\.?\d*', text): |
| 132 | return 'video_track' |
| 133 | elif re.search(r'\d+:\s*\(\s*\[.*?\]\s*,\s*\[.*?\]\s*\)', text): |
| 134 | return 'video_ground' |
| 135 | elif re.search(r'\[\s*[\d.-]+\s*,\s*[\d.-]+\s*,\s*[\d.-]+\s*\]', text): |
| 136 | return 'video_single_point_track' |
| 137 | else: |
| 138 | raise ValueError("Could not detect format of prediction text.") |
| 139 | |
| 140 | def extract_video_point_track_per_frame(text, width, height) -> List[Dict]: |
| 141 | """ |
no test coverage detected