Skip to content

Commit c3ac7a5

Browse files
authored
feat: add depth pro and paddle ocr (#436)
* Add depth pro and paddle ocr * Remove print * Check for divide by 0 * Lint * Lint * Type checking * Edit agentic activity recognition payload to include function name (useful for errors) * Lint * Change depth_pro to use float32 and not int * Change imag to image * Lint * Update tests
1 parent 0539e54 commit c3ac7a5

6 files changed

Lines changed: 1902 additions & 1913 deletions

File tree

tests/integ/test_tools.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
countgd_sam2_video_tracking,
1515
countgd_visual_object_detection,
1616
custom_object_detection,
17-
depth_anything_v2,
17+
depth_pro,
1818
detr_segmentation,
1919
document_qa,
2020
florence2_object_detection,
@@ -23,7 +23,7 @@
2323
florence2_sam2_video_tracking,
2424
gemini_image_generation,
2525
generate_pose_image,
26-
ocr,
26+
paddle_ocr,
2727
od_sam2_video_tracking,
2828
owlv2_object_detection,
2929
owlv2_sam2_instance_segmentation,
@@ -303,16 +303,16 @@ def test_agentic_activity_recognition_multiple_activities_low_specificity():
303303
assert result[1]["label"] == 1
304304

305305

306-
def test_ocr():
306+
def test_paddle_ocr():
307307
img = ski.data.page()
308-
result = ocr(
308+
result = paddle_ocr(
309309
image=img,
310310
)
311311
assert any("Region-based segmentation" in res["label"] for res in result)
312312

313313

314-
def test_ocr_empty():
315-
result = ocr(
314+
def test_paddle_ocr_empty():
315+
result = paddle_ocr(
316316
image=np.zeros((0, 0, 3)).astype(np.uint8),
317317
)
318318
assert result == []
@@ -354,7 +354,7 @@ def test_mask_distance():
354354

355355
def test_generate_depth():
356356
img = ski.data.coins()
357-
result = depth_anything_v2(
357+
result = depth_pro(
358358
image=img,
359359
)
360360

@@ -366,9 +366,7 @@ def test_generate_pose():
366366
result = generate_pose_image(
367367
image=img,
368368
)
369-
import cv2
370-
371-
cv2.imwrite("imag.png", result)
369+
372370
assert result.shape == img.shape + (3,)
373371

374372

0 commit comments

Comments
 (0)