上传文件至 /

This commit is contained in:
2026-04-16 15:34:06 +08:00
parent b9819e0616
commit dcc22886f3
3 changed files with 31 additions and 0 deletions

11
test.py Normal file
View File

@@ -0,0 +1,11 @@
import numpy as np
image = np.array([
[100, 150, 200],
[80, 120, 180],
[60, 90, 140]
], dtype=np.uint8)
print("原图:")
print(image)

8
test2.py Normal file
View File

@@ -0,0 +1,8 @@
import numpy as np
img = np.array([
[255, 255, 0, 0 ],
[255, 255, 0, 0 ],
[0, 0, 255, 255],
[0, 0, 255, 255]
], dtype=np.uint8)

12
test3.py Normal file
View File

@@ -0,0 +1,12 @@
import numpy as np
# 假设这是从图像中提取的2个特征图
feature_map1 = np.array([[1, 0, 1], [0, 1, 0], [1, 0, 1]])
feature_map2 = np.array([[1, 1, 1], [1, 0, 0], [1, 0, 0]])
# 补全代码:将特征图展平为向量
vector1 = feature_map1.flatten() # 展平
vector2 = feature_map2.flatten() # 展平
print("vector1:", vector1)
print("vector2:", vector2)