mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 21:56:31 +00:00
31 lines
849 B
Python
31 lines
849 B
Python
import inference
|
|
from ai_config import AIRecognitionConfig
|
|
from unittest.mock import Mock
|
|
import numpy as np
|
|
|
|
from loader_client import LoaderClient
|
|
|
|
|
|
def test_split_to_tiles():
|
|
loader_client = LoaderClient("test", 0)
|
|
ai_config = AIRecognitionConfig(
|
|
frame_period_recognition=4,
|
|
frame_recognition_seconds=2,
|
|
probability_threshold=0.2,
|
|
|
|
tracking_distance_confidence=0.15,
|
|
tracking_probability_increase=0.15,
|
|
tracking_intersection_threshold=0.6,
|
|
big_image_tile_overlap_percent=20,
|
|
|
|
file_data=None,
|
|
paths=[],
|
|
model_batch_size=4
|
|
)
|
|
inf = inference.Inference(loader_client, ai_config)
|
|
test_frame = np.zeros((6336, 8448, 3), dtype=np.uint8)
|
|
|
|
inf.init_ai()
|
|
inf.split_to_tiles(test_frame, 'test_image.jpg', ai_config.big_image_tile_overlap_percent)
|
|
|