Hamidreza-Hashemp commited on
Commit
4ca43b0
·
1 Parent(s): fff5b4e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -35,14 +35,14 @@ def deepfakeclassifier(potential_test_video, option):
35
  models = []
36
  model_paths = [os.path.join(weights_dir, model) for model in models_dir]
37
  for path in model_paths:
38
- model = DeepFakeClassifier(encoder="tf_efficientnet_b7_ns").to('cuda')
39
  print("loading state dict {}".format(path))
40
  checkpoint = torch.load(path, map_location="cpu")
41
  state_dict = checkpoint.get("state_dict", checkpoint)
42
  model.load_state_dict({re.sub("^module.", "", k): v for k, v in state_dict.items()}, strict=True)
43
  model.eval()
44
  del checkpoint
45
- models.append(model.half())
46
 
47
  frames_per_video = 32
48
  video_reader = VideoReader()
 
35
  models = []
36
  model_paths = [os.path.join(weights_dir, model) for model in models_dir]
37
  for path in model_paths:
38
+ model = DeepFakeClassifier(encoder="tf_efficientnet_b7_ns").to('cpu')
39
  print("loading state dict {}".format(path))
40
  checkpoint = torch.load(path, map_location="cpu")
41
  state_dict = checkpoint.get("state_dict", checkpoint)
42
  model.load_state_dict({re.sub("^module.", "", k): v for k, v in state_dict.items()}, strict=True)
43
  model.eval()
44
  del checkpoint
45
+ models.append(model.float())
46
 
47
  frames_per_video = 32
48
  video_reader = VideoReader()