mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 14:46:31 +00:00
splitting python complete
This commit is contained in:
@@ -1,8 +1,30 @@
|
||||
import inference
|
||||
from ai_config import AIRecognitionConfig
|
||||
from remote_command_inf import RemoteCommand
|
||||
from unittest.mock import Mock
|
||||
import numpy as np
|
||||
|
||||
from loader_client import LoaderClient
|
||||
|
||||
|
||||
def test_process_images():
|
||||
inf = inference.Inference(None, None)
|
||||
inf._process_images(RemoteCommand(30), AIRecognitionConfig(4, 2, 15, 0.15, 15, 0.8, 20, b'test', [], 4), ['test_img01.JPG', 'test_img02.jpg'])
|
||||
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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user