优化去扭曲模型的声明

This commit is contained in:
2024-08-29 11:02:11 +08:00
parent 4581da996d
commit 5a0b6cc72f
3 changed files with 13 additions and 11 deletions

View File

@@ -0,0 +1,10 @@
import paddle
from doc_dewarp.GeoTr import GeoTr
model_path = "model/dewarp_model/best.ckpt"
checkpoint = paddle.load(model_path)
state_dict = checkpoint["model"]
DEWARP = GeoTr()
DEWARP.set_state_dict(state_dict)
DEWARP.eval()