| import cv2 |
| import numpy as np |
| import os |
|
|
| def create_inference_test_data(num_images=50): |
| base_dir = 'inference_test' |
| |
| |
| |
| |
| |
| target_sizes = { |
| 'x2': (640, 360), |
| 'x3': (427, 240), |
| 'x4': (320, 180) |
| } |
|
|
| print("Inference ํ
์คํธ์ฉ ๋ฐ์ดํฐ ์์ฑ ์ค...") |
|
|
| for scale, (w, h) in target_sizes.items(): |
| save_path = os.path.join(base_dir, scale) |
| os.makedirs(save_path, exist_ok=True) |
| |
| for i in range(1, num_images + 1): |
| |
| img = np.random.randint(0, 256, (h, w, 3), dtype=np.uint8) |
| |
| |
| cv2.imwrite(os.path.join(save_path, f'test_{i:03d}.png'), img) |
| |
| print(f"[{scale}] {w}x{h} ์ด๋ฏธ์ง {num_images}์ฅ ์์ฑ ์๋ฃ.") |
|
|
| print(f"\n๋ชจ๋ ๋ฐ์ดํฐ๊ฐ '{base_dir}' ํด๋์ ์ค๋น๋์์ต๋๋ค.") |
|
|
| if __name__ == "__main__": |
| create_inference_test_data(50) |