Gaurav-Mhatre commited on
Commit
814175f
·
verified ·
1 Parent(s): cf86411

Update image_detect.py

Browse files
Files changed (1) hide show
  1. image_detect.py +3 -3
image_detect.py CHANGED
@@ -3,15 +3,15 @@ from transformers import CLIPProcessor, CLIPModel
3
  from PIL import Image
4
 
5
  class ImageDeepfakeDetector:
6
- def __init__(self, local_model_path="./local_clip_model"):
7
  print("⚡ Loading Image AI Model...")
8
  try:
 
9
  self.model = CLIPModel.from_pretrained("openai/clip-vit-base-patch32")
10
- self.processor = CLIPProcessor.from_pretrained(local_model_path)
11
  print("✅ Image Model Ready.")
12
  except Exception as e:
13
  print(f"❌ Error: {e}")
14
- print("Run 'setup_model.py' first.")
15
  exit()
16
 
17
  def predict(self, image_path):
 
3
  from PIL import Image
4
 
5
  class ImageDeepfakeDetector:
6
+ def __init__(self):
7
  print("⚡ Loading Image AI Model...")
8
  try:
9
+ # Both model and processor now pull directly from Hugging Face!
10
  self.model = CLIPModel.from_pretrained("openai/clip-vit-base-patch32")
11
+ self.processor = CLIPProcessor.from_pretrained("openai/clip-vit-base-patch32")
12
  print("✅ Image Model Ready.")
13
  except Exception as e:
14
  print(f"❌ Error: {e}")
 
15
  exit()
16
 
17
  def predict(self, image_path):