mathminakshi commited on
Commit
b302157
·
verified ·
1 Parent(s): c14b474

Update app.py

Browse files

changed relative path

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -16,7 +16,7 @@ from model.model import ResNet50
16
  @st.cache_data
17
  def load_class_names():
18
  try:
19
- with open("D:\TSAI\Full_Stack_AI\Assignment9\CLS-LOC\imagenet_classes.json", 'r', encoding='utf-8') as f:
20
  # Read the file content first
21
  content = f.read()
22
  # Try to clean the content of any control characters
@@ -39,7 +39,7 @@ def load_class_names():
39
  def load_model():
40
  try:
41
  model = ResNet50(num_classes=1000)
42
- checkpoint = torch.load("D:\TSAI\Full_Stack_AI\Assignment9\checkpoints\model_best.pth", map_location=torch.device("cpu"))
43
  # Extract just the model state dict from the checkpoint
44
  if "model_state_dict" in checkpoint:
45
  model.load_state_dict(checkpoint["model_state_dict"])
 
16
  @st.cache_data
17
  def load_class_names():
18
  try:
19
+ with open("imagenet_classes.json", 'r', encoding='utf-8') as f:
20
  # Read the file content first
21
  content = f.read()
22
  # Try to clean the content of any control characters
 
39
  def load_model():
40
  try:
41
  model = ResNet50(num_classes=1000)
42
+ checkpoint = torch.load("checkpoints\model_best.pth", map_location=torch.device("cpu"))
43
  # Extract just the model state dict from the checkpoint
44
  if "model_state_dict" in checkpoint:
45
  model.load_state_dict(checkpoint["model_state_dict"])