gghsgn commited on
Commit
68d1e58
1 Parent(s): 08964bc

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)