vericudebuget commited on
Commit
faee608
·
verified ·
1 Parent(s): 5bae2c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -3,7 +3,11 @@ from huggingface_hub import HfApi
3
  import os
4
  import json
5
  from datetime import datetime
6
- import cv2
 
 
 
 
7
  import random
8
 
9
  # Initialize the Hugging Face API with the token
 
3
  import os
4
  import json
5
  from datetime import datetime
6
+ try:
7
+ import cv2
8
+ except ImportError:
9
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "opencv-python"])
10
+ import cv2
11
  import random
12
 
13
  # Initialize the Hugging Face API with the token