pratikshahp commited on
Commit
1319515
1 Parent(s): 8c42d0e

Create model.py

Browse files
Files changed (1) hide show
  1. model.py +8 -0
model.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ # Load model directly
2
+ import os
3
+ from dotenv import load_dotenv
4
+ load_dotenv()
5
+ model_name = os.getenv('MODEL_NAME') # model name for huggingface.co in .env file
6
+ from transformers import AutoImageProcessor, AutoModelForObjectDetection
7
+ processor = AutoImageProcessor.from_pretrained(model_name)
8
+ model = AutoModelForObjectDetection.from_pretrained(model_name)