nyonyong commited on
Commit
0d81f48
1 Parent(s): 1b2702a

Directory fix

Browse files
TextDetection/utils/general.py CHANGED
@@ -35,6 +35,15 @@ import pkg_resources as pkg
35
  import torch
36
  import torchvision
37
  import yaml
 
 
 
 
 
 
 
 
 
38
  from ultralytics.yolo.utils.checks import check_requirements
39
 
40
  from utils import TryExcept, emojis
 
35
  import torch
36
  import torchvision
37
  import yaml
38
+
39
+ try:
40
+ import ultralytics
41
+
42
+ assert hasattr(ultralytics, "__version__") # verify package is not directory
43
+ except (ImportError, AssertionError):
44
+ os.system("pip install -U ultralytics")
45
+ import ultralytics
46
+
47
  from ultralytics.yolo.utils.checks import check_requirements
48
 
49
  from utils import TryExcept, emojis
requirements.txt CHANGED
@@ -14,7 +14,7 @@ thop>=0.1.1 # FLOPs computation
14
  torch>=1.7.0 # see https://pytorch.org/get-started/locally (recommended)
15
  torchvision>=0.8.1
16
  tqdm>=4.64.0
17
- ultralytics>=8.0.111
18
  # protobuf<=3.20.1 # https://github.com/ultralytics/yolov5/issues/8012
19
 
20
  # Logging ---------------------------------------------------------------------
 
14
  torch>=1.7.0 # see https://pytorch.org/get-started/locally (recommended)
15
  torchvision>=0.8.1
16
  tqdm>=4.64.0
17
+ ultralytics>=8.0.232
18
  # protobuf<=3.20.1 # https://github.com/ultralytics/yolov5/issues/8012
19
 
20
  # Logging ---------------------------------------------------------------------