Skip to content

Commit

Permalink
🦄 refactor(code update): code update and adjust dir
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce1408 committed Apr 23, 2024
1 parent dcd0c78 commit b820e5a
Show file tree
Hide file tree
Showing 33 changed files with 7 additions and 3 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion Tools/img_resize_crop_gridsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ def visualize_image_operations(image_path):
plt.subplot(2, 2, 4)
plt.imshow(rotated_image)
plt.title(f'Rotated Image by {angle} Degrees')
plt.savefig("./person.png")

plt.tight_layout()
plt.show()


# 替换以下路径为你的图片路径
image_path = "/Users/bruce/PycharmProjects/Pytorch_learning/Deploy/face_torch_3.png"
image_path = "/mnt/share_disk/bruce_cui/Pytorch_learning/Deploy/face_ort_3.png"
visualize_image_operations(image_path)
6 changes: 4 additions & 2 deletions Tools/onnx_model_convert_onnxSimplify.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ def onnx_simplify(path):
model_simp, check = simplify(onnx_model)
assert check, "Simplified ONNX model could not be validated"

output_path = path.split(".")[0] + "_onnxsim." + path.split(".")[-1]
# 插入 "_onnxsim" 在 ".onnx" 之前
index = path.rfind(".onnx")
output_path = path[:index] + "_onnxsim" + path[index:]

onnx.save(model_simp, output_path)

Expand Down Expand Up @@ -58,7 +60,7 @@ def print_onnx_input_output(model_path):
# model_path = "/Users/bruce/Downloads/8620_deploy/swin_tiny_patch4_window7_224_224_elementwise_affine.onnx"
# model_path = "/Users/bruce/Downloads/obstacle_v1.0.onnx"
# model_path = "/mnt/share_disk/bruce_cui/onnx_models/laneline_154w_20240320_fastbev.onnx"
model_path = "/mnt/share_disk/bruce_cui/onnx_models/laneline_20240330_fastbev_wo_argmax.onnx"
model_path = "/mnt/share_disk/bruce_cui/onnx_models/hm_hp370_bev_v2.6_op16_vt_obstacle.onnx"
# model_path = "/Users/bruce/Downloads/8620_deploy/Laneline/models/epoch_latest_0302.onnx"

onnx_simplify(model_path)
Expand Down
1 change: 1 addition & 0 deletions Torch_experiment/Train_Model.ipynb

Large diffs are not rendered by default.

0 comments on commit b820e5a

Please sign in to comment.