glenn-jocher commited on
Commit
a833ee2
1 Parent(s): dbce1bc

Update check_requirements() exclude list (#2974)

Browse files
Files changed (6) hide show
  1. detect.py +1 -1
  2. hubconf.py +1 -1
  3. test.py +1 -1
  4. train.py +1 -1
  5. utils/autoanchor.py +2 -1
  6. utils/plots.py +2 -1
detect.py CHANGED
@@ -172,7 +172,7 @@ if __name__ == '__main__':
172
  parser.add_argument('--hide-conf', default=False, action='store_true', help='hide confidences')
173
  opt = parser.parse_args()
174
  print(opt)
175
- check_requirements(exclude=('pycocotools', 'thop'))
176
 
177
  with torch.no_grad():
178
  if opt.update: # update all models (to fix SourceChangeWarning)
 
172
  parser.add_argument('--hide-conf', default=False, action='store_true', help='hide confidences')
173
  opt = parser.parse_args()
174
  print(opt)
175
+ check_requirements(exclude=('tensorboard', 'pycocotools', 'thop'))
176
 
177
  with torch.no_grad():
178
  if opt.update: # update all models (to fix SourceChangeWarning)
hubconf.py CHANGED
@@ -15,7 +15,7 @@ from utils.google_utils import attempt_download
15
  from utils.torch_utils import select_device
16
 
17
  dependencies = ['torch', 'yaml']
18
- check_requirements(Path(__file__).parent / 'requirements.txt', exclude=('pycocotools', 'thop'))
19
 
20
 
21
  def create(name, pretrained, channels, classes, autoshape, verbose):
 
15
  from utils.torch_utils import select_device
16
 
17
  dependencies = ['torch', 'yaml']
18
+ check_requirements(Path(__file__).parent / 'requirements.txt', exclude=('tensorboard', 'pycocotools', 'thop'))
19
 
20
 
21
  def create(name, pretrained, channels, classes, autoshape, verbose):
test.py CHANGED
@@ -310,7 +310,7 @@ if __name__ == '__main__':
310
  opt.save_json |= opt.data.endswith('coco.yaml')
311
  opt.data = check_file(opt.data) # check file
312
  print(opt)
313
- check_requirements()
314
 
315
  if opt.task in ('train', 'val', 'test'): # run normally
316
  test(opt.data,
 
310
  opt.save_json |= opt.data.endswith('coco.yaml')
311
  opt.data = check_file(opt.data) # check file
312
  print(opt)
313
+ check_requirements(exclude=('tensorboard', 'pycocotools', 'thop'))
314
 
315
  if opt.task in ('train', 'val', 'test'): # run normally
316
  test(opt.data,
train.py CHANGED
@@ -497,7 +497,7 @@ if __name__ == '__main__':
497
  set_logging(opt.global_rank)
498
  if opt.global_rank in [-1, 0]:
499
  check_git_status()
500
- check_requirements()
501
 
502
  # Resume
503
  wandb_run = check_wandb_resume(opt)
 
497
  set_logging(opt.global_rank)
498
  if opt.global_rank in [-1, 0]:
499
  check_git_status()
500
+ check_requirements(exclude=('pycocotools', 'thop'))
501
 
502
  # Resume
503
  wandb_run = check_wandb_resume(opt)
utils/autoanchor.py CHANGED
@@ -3,7 +3,6 @@
3
  import numpy as np
4
  import torch
5
  import yaml
6
- from scipy.cluster.vq import kmeans
7
  from tqdm import tqdm
8
 
9
  from utils.general import colorstr
@@ -76,6 +75,8 @@ def kmean_anchors(path='./data/coco128.yaml', n=9, img_size=640, thr=4.0, gen=10
76
  Usage:
77
  from utils.autoanchor import *; _ = kmean_anchors()
78
  """
 
 
79
  thr = 1. / thr
80
  prefix = colorstr('autoanchor: ')
81
 
 
3
  import numpy as np
4
  import torch
5
  import yaml
 
6
  from tqdm import tqdm
7
 
8
  from utils.general import colorstr
 
75
  Usage:
76
  from utils.autoanchor import *; _ = kmean_anchors()
77
  """
78
+ from scipy.cluster.vq import kmeans
79
+
80
  thr = 1. / thr
81
  prefix = colorstr('autoanchor: ')
82
 
utils/plots.py CHANGED
@@ -16,7 +16,6 @@ import seaborn as sns
16
  import torch
17
  import yaml
18
  from PIL import Image, ImageDraw, ImageFont
19
- from scipy.signal import butter, filtfilt
20
 
21
  from utils.general import xywh2xyxy, xyxy2xywh
22
  from utils.metrics import fitness
@@ -54,6 +53,8 @@ def hist2d(x, y, n=100):
54
 
55
 
56
  def butter_lowpass_filtfilt(data, cutoff=1500, fs=50000, order=5):
 
 
57
  # https://stackoverflow.com/questions/28536191/how-to-filter-smooth-with-scipy-numpy
58
  def butter_lowpass(cutoff, fs, order):
59
  nyq = 0.5 * fs
 
16
  import torch
17
  import yaml
18
  from PIL import Image, ImageDraw, ImageFont
 
19
 
20
  from utils.general import xywh2xyxy, xyxy2xywh
21
  from utils.metrics import fitness
 
53
 
54
 
55
  def butter_lowpass_filtfilt(data, cutoff=1500, fs=50000, order=5):
56
+ from scipy.signal import butter, filtfilt
57
+
58
  # https://stackoverflow.com/questions/28536191/how-to-filter-smooth-with-scipy-numpy
59
  def butter_lowpass(cutoff, fs, order):
60
  nyq = 0.5 * fs