bikram commited on
Commit
d08383c
·
1 Parent(s): 57db2f7

label encoded to string

Browse files
Files changed (2) hide show
  1. __pycache__/utils.cpython-310.pyc +0 -0
  2. utils.py +6 -1
__pycache__/utils.cpython-310.pyc CHANGED
Binary files a/__pycache__/utils.cpython-310.pyc and b/__pycache__/utils.cpython-310.pyc differ
 
utils.py CHANGED
@@ -389,4 +389,9 @@ def predict_ne(image_path, device="cpu"):
389
  output = model(image_tensor)
390
  _, predicted = torch.max(output, 1)
391
  print(predicted.item())
392
- return predicted.item()
 
 
 
 
 
 
389
  output = model(image_tensor)
390
  _, predicted = torch.max(output, 1)
391
  print(predicted.item())
392
+ if predicted.item() == 0:
393
+ return "Nepali"
394
+ elif predicted.item() == 1:
395
+ return "English"
396
+ else:
397
+ return predicted.item()