Orpheous1 commited on
Commit
56ec0e7
1 Parent(s): 8fd2935

fix imagenet

Browse files
app.py CHANGED
@@ -50,7 +50,7 @@ def get_mask(image, model_name: str):
50
  diffmask_model = diffmask_imagenet
51
  image = torch.from_numpy(image).permute(2, 0, 1).float() / 255
52
  dm_image = feature_extractor(image).unsqueeze(0)
53
- dm_out = model.get_mask(dm_image)
54
  mask = dm_out["mask"][0].detach()
55
  pred = dm_out["pred_class"][0].detach()
56
  pred = diffmask_model.model.config.id2label[pred.item()]
 
50
  diffmask_model = diffmask_imagenet
51
  image = torch.from_numpy(image).permute(2, 0, 1).float() / 255
52
  dm_image = feature_extractor(image).unsqueeze(0)
53
+ dm_out = diffmask_model.get_mask(dm_image)
54
  mask = dm_out["mask"][0].detach()
55
  pred = dm_out["pred_class"][0].detach()
56
  pred = diffmask_model.model.config.id2label[pred.item()]
code/datamodules/__pycache__/image_classification.cpython-39.pyc ADDED
Binary file (1.83 kB). View file
 
code/datamodules/__pycache__/visual_qa.cpython-39.pyc ADDED
Binary file (7.22 kB). View file
 
code/models/__pycache__/__init__.cpython-39.pyc ADDED
Binary file (294 Bytes). View file
 
code/models/__pycache__/classification.cpython-39.pyc ADDED
Binary file (4.13 kB). View file
 
code/models/__pycache__/gates.cpython-39.pyc ADDED
Binary file (6.31 kB). View file
 
code/models/__pycache__/interpretation.cpython-39.pyc ADDED
Binary file (12.1 kB). View file
 
code/utils/__pycache__/__init__.cpython-39.pyc ADDED
Binary file (171 Bytes). View file
 
code/utils/__pycache__/distributions.cpython-39.pyc ADDED
Binary file (3.3 kB). View file
 
code/utils/__pycache__/getters_setters.cpython-39.pyc ADDED
Binary file (3.93 kB). View file
 
code/utils/__pycache__/metrics.cpython-39.pyc ADDED
Binary file (1.93 kB). View file
 
code/utils/__pycache__/optimizer.cpython-39.pyc ADDED
Binary file (4.39 kB). View file
 
code/utils/__pycache__/plot.cpython-39.pyc ADDED
Binary file (8.16 kB). View file