shlok123 commited on
Commit
c22c563
·
1 Parent(s): 7e9943a

fixed path

Browse files
Files changed (3) hide show
  1. __pycache__/inference.cpython-312.pyc +0 -0
  2. app.py +1 -1
  3. inference.py +1 -1
__pycache__/inference.cpython-312.pyc CHANGED
Binary files a/__pycache__/inference.cpython-312.pyc and b/__pycache__/inference.cpython-312.pyc differ
 
app.py CHANGED
@@ -14,7 +14,7 @@ import inference as inf
14
  def colorize_image(image):
15
  # Load the model
16
  # file_path = 'ImageColorizationModel10.pth'
17
- file_path = r'model\model_final.pth'
18
  model_2 = inf.load_model(model_class=MainModel, file_path=file_path)
19
  output_img = inf.predict_color(model_2, image=image)
20
  return output_img
 
14
  def colorize_image(image):
15
  # Load the model
16
  # file_path = 'ImageColorizationModel10.pth'
17
+ file_path = './model/model_final.pth'
18
  model_2 = inf.load_model(model_class=MainModel, file_path=file_path)
19
  output_img = inf.predict_color(model_2, image=image)
20
  return output_img
inference.py CHANGED
@@ -98,7 +98,7 @@ def load_model(model_class, file_path):
98
  model.load_state_dict(torch.load(file_path, map_location=device))
99
 
100
  resnet_weights = torch.load(file_path)
101
- resnet_weights = torch.load(r"model\res18-unet.pt")
102
  resnet_state_dict = resnet_weights['state_dict'] if 'state_dict' in resnet_weights else resnet_weights
103
 
104
  model_dict = model.state_dict()
 
98
  model.load_state_dict(torch.load(file_path, map_location=device))
99
 
100
  resnet_weights = torch.load(file_path)
101
+ resnet_weights = torch.load("./model/res18-unet.pt")
102
  resnet_state_dict = resnet_weights['state_dict'] if 'state_dict' in resnet_weights else resnet_weights
103
 
104
  model_dict = model.state_dict()