k23064919 commited on
Commit
534bade
·
1 Parent(s): 0791b11

quickfix variable name mixup

Browse files
Files changed (2) hide show
  1. ui/app.py +1 -1
  2. ui/model_loader.py +2 -3
ui/app.py CHANGED
@@ -19,7 +19,7 @@ from model_loader import ModelLoader
19
  class PlantDiseaseApp:
20
  def __init__(self):
21
  self.model_loader = ModelLoader()
22
- self.current_modelName = "model_one.pt"
23
  self.model = self.model_loader.loadModel(self.current_modelName)
24
  self.flagged_predictions = []
25
 
 
19
  class PlantDiseaseApp:
20
  def __init__(self):
21
  self.model_loader = ModelLoader()
22
+ self.current_modelName = "CNN from Scratch"
23
  self.model = self.model_loader.loadModel(self.current_modelName)
24
  self.flagged_predictions = []
25
 
ui/model_loader.py CHANGED
@@ -20,7 +20,6 @@ class ModelLoader:
20
  raise ValueError(f"ClearML configuration not found for model: {modelName}")
21
 
22
  taskID = modelConfig['clearml_task_id']
23
- modelType = modelConfig['model_type']
24
 
25
  try:
26
  print(f"attemtping to fetch '{modelName}' from clearML task: {taskID}")
@@ -29,10 +28,10 @@ class ModelLoader:
29
  modelPath = modelObject.get_local_copy()
30
  print(f"Weights downloaded to local path: {modelPath}")
31
 
32
- model = modelOne()
33
 
34
  stateDict = torch.load(modelPath, map_location=self.device)
35
- modelObject.load_state_dict(stateDict)
36
 
37
  model.to(self.device)
38
  model.eval()
 
20
  raise ValueError(f"ClearML configuration not found for model: {modelName}")
21
 
22
  taskID = modelConfig['clearml_task_id']
 
23
 
24
  try:
25
  print(f"attemtping to fetch '{modelName}' from clearML task: {taskID}")
 
28
  modelPath = modelObject.get_local_copy()
29
  print(f"Weights downloaded to local path: {modelPath}")
30
 
31
+ model = modelOne(noOfClasses=39)
32
 
33
  stateDict = torch.load(modelPath, map_location=self.device)
34
+ model.load_state_dict(stateDict)
35
 
36
  model.to(self.device)
37
  model.eval()