tmp_switch_model.py 574 B

1234567891011121314
  1. with open("/home/admin/dsh/dual_camera_system/config/detection.py") as f:
  2. c = f.read()
  3. c = c.replace("return '/home/admin/dsh/testrk3588/yolo26n_end2end.rknn', 'rknn'",
  4. "return '/home/admin/dsh/testrk3588/yolo26n.onnx', 'onnx'")
  5. with open("/home/admin/dsh/dual_camera_system/config/detection.py", "w") as f:
  6. f.write(c)
  7. # Verify
  8. with open("/home/admin/dsh/dual_camera_system/config/detection.py") as f:
  9. for i, line in enumerate(f.readlines()):
  10. if 'model' in line.lower() or 'return' in line:
  11. print(f"L{i+1}: {line.rstrip()}")