Skip to content

Commit 04c59a9

Browse files
committed
add: implement sr2.5_ir model files
1 parent d7e93b8 commit 04c59a9

File tree

6 files changed

+31
-2
lines changed

6 files changed

+31
-2
lines changed

projects/app_thermal_tiny1c/app.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ files:
1414
- main_espcn.py
1515
- main_x3c.py
1616
- main.py
17+
- sr2.5_ir32_int8.axmodel
18+
- sr2.5_ir32.mud
19+
- sr2.5_ir48_int8.axmodel
20+
- sr2.5_ir48.mud
1721
- sr3_ir_32_int8.axmodel
1822
- sr3_ir_32.mud
1923
- x3c_192x256.axmodel

projects/app_thermal_tiny1c/main_x3c.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def scale_to_range(arr, target_min, target_max):
280280
gray = np.array([])
281281
a0 = time.perf_counter()
282282
if spi_frame_get(image_frame, width*height*2, 0) == 0: #src picture
283-
# print(f"{inspect.currentframe().f_lineno}: 耗时: {time.perf_counter() - a0:.6f} 秒")
283+
print(f"{inspect.currentframe().f_lineno}: 耗时: {time.perf_counter() - a0:.6f} 秒")
284284

285285
# if FRAME_NUM % 50 == 0:
286286
# d = [0x0d, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
@@ -305,6 +305,8 @@ def scale_to_range(arr, target_min, target_max):
305305
x3grayimg_np = tensor.tensor_to_numpy_uint8(x3graytensor, copy = False).reshape((576, 768))
306306
elif x3model_name[2:5] == './sr3_ir.mud'[2:5]:
307307
x3grayimg_np = tensor.tensor_to_numpy_uint8(x3graytensor, copy = False).reshape((576, 768))
308+
elif x3model_name[2:7] == './sr2.5_ir.mud'[2:7]:
309+
x3grayimg_np = tensor.tensor_to_numpy_uint8(x3graytensor, copy = False).reshape((480, 640))
308310
else:
309311
raise RuntimeError("Unsupported x3 model")
310312
x3grayimg_np = x3grayimg_np.astype(np.uint8)
@@ -318,6 +320,12 @@ def scale_to_range(arr, target_min, target_max):
318320
x3model_name = './sr3_ir_32.mud'
319321
output_layer_name = 'output'
320322
elif x3model_name == './sr3_ir_32.mud':
323+
x3model_name = './sr2.5_ir32.mud'
324+
output_layer_name = 'output'
325+
elif x3model_name == './sr2.5_ir32.mud':
326+
x3model_name = './sr2.5_ir48.mud'
327+
output_layer_name = 'output'
328+
elif x3model_name == './sr2.5_ir48.mud':
321329
x3model_name = './espcn_x3.mud'
322330
output_layer_name = '19'
323331
else:
@@ -330,9 +338,10 @@ def scale_to_range(arr, target_min, target_max):
330338
img_8bit = scale_to_range(img_8bit, img_8bit_raw_min_max[0], img_8bit_raw_min_max[1]).astype(np.uint8)
331339
else:
332340
img_8bit = cv2.resize(img_8bit, (disp.width(), disp.height()))
333-
341+
print(f"{inspect.currentframe().f_lineno}: 耗时: {time.perf_counter() - a0:.6f} 秒")
334342
# 伪彩色映射(热力图)
335343
color_img = cv2.applyColorMap(img_8bit, cv2.COLORMAP_MAGMA) # BGR格式 COLORMAP_HOT COLORMAP_TURBO
344+
print(f"{inspect.currentframe().f_lineno}: 耗时: {time.perf_counter() - a0:.6f} 秒")
336345
color_img = image.cv2image(color_img)
337346

338347
center_pos = (height//2, width//2)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[basic]
2+
type = axmodel
3+
model_npu = sr2.5_ir32_int8.axmodel
4+
model_vnpu = sr2.5_ir32_int8.axmodel
5+
6+
[extra]
7+
mean = 0
8+
scale = 0
344 KB
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[basic]
2+
type = axmodel
3+
model_npu = sr2.5_ir48_int8.axmodel
4+
model_vnpu = sr2.5_ir48_int8.axmodel
5+
6+
[extra]
7+
mean = 0
8+
scale = 0
821 KB
Binary file not shown.

0 commit comments

Comments
 (0)