Unverified 提交 a833ee2a authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Update check_requirements() exclude list (#2974)

上级 dbce1bc5
...@@ -172,7 +172,7 @@ if __name__ == '__main__': ...@@ -172,7 +172,7 @@ if __name__ == '__main__':
parser.add_argument('--hide-conf', default=False, action='store_true', help='hide confidences') parser.add_argument('--hide-conf', default=False, action='store_true', help='hide confidences')
opt = parser.parse_args() opt = parser.parse_args()
print(opt) print(opt)
check_requirements(exclude=('pycocotools', 'thop')) check_requirements(exclude=('tensorboard', 'pycocotools', 'thop'))
with torch.no_grad(): with torch.no_grad():
if opt.update: # update all models (to fix SourceChangeWarning) if opt.update: # update all models (to fix SourceChangeWarning)
......
...@@ -15,7 +15,7 @@ from utils.google_utils import attempt_download ...@@ -15,7 +15,7 @@ from utils.google_utils import attempt_download
from utils.torch_utils import select_device from utils.torch_utils import select_device
dependencies = ['torch', 'yaml'] dependencies = ['torch', 'yaml']
check_requirements(Path(__file__).parent / 'requirements.txt', exclude=('pycocotools', 'thop')) check_requirements(Path(__file__).parent / 'requirements.txt', exclude=('tensorboard', 'pycocotools', 'thop'))
def create(name, pretrained, channels, classes, autoshape, verbose): def create(name, pretrained, channels, classes, autoshape, verbose):
......
...@@ -310,7 +310,7 @@ if __name__ == '__main__': ...@@ -310,7 +310,7 @@ if __name__ == '__main__':
opt.save_json |= opt.data.endswith('coco.yaml') opt.save_json |= opt.data.endswith('coco.yaml')
opt.data = check_file(opt.data) # check file opt.data = check_file(opt.data) # check file
print(opt) print(opt)
check_requirements() check_requirements(exclude=('tensorboard', 'pycocotools', 'thop'))
if opt.task in ('train', 'val', 'test'): # run normally if opt.task in ('train', 'val', 'test'): # run normally
test(opt.data, test(opt.data,
......
...@@ -497,7 +497,7 @@ if __name__ == '__main__': ...@@ -497,7 +497,7 @@ if __name__ == '__main__':
set_logging(opt.global_rank) set_logging(opt.global_rank)
if opt.global_rank in [-1, 0]: if opt.global_rank in [-1, 0]:
check_git_status() check_git_status()
check_requirements() check_requirements(exclude=('pycocotools', 'thop'))
# Resume # Resume
wandb_run = check_wandb_resume(opt) wandb_run = check_wandb_resume(opt)
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
import numpy as np import numpy as np
import torch import torch
import yaml import yaml
from scipy.cluster.vq import kmeans
from tqdm import tqdm from tqdm import tqdm
from utils.general import colorstr 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,6 +75,8 @@ def kmean_anchors(path='./data/coco128.yaml', n=9, img_size=640, thr=4.0, gen=10
Usage: Usage:
from utils.autoanchor import *; _ = kmean_anchors() from utils.autoanchor import *; _ = kmean_anchors()
""" """
from scipy.cluster.vq import kmeans
thr = 1. / thr thr = 1. / thr
prefix = colorstr('autoanchor: ') prefix = colorstr('autoanchor: ')
......
...@@ -16,7 +16,6 @@ import seaborn as sns ...@@ -16,7 +16,6 @@ import seaborn as sns
import torch import torch
import yaml import yaml
from PIL import Image, ImageDraw, ImageFont from PIL import Image, ImageDraw, ImageFont
from scipy.signal import butter, filtfilt
from utils.general import xywh2xyxy, xyxy2xywh from utils.general import xywh2xyxy, xyxy2xywh
from utils.metrics import fitness from utils.metrics import fitness
...@@ -54,6 +53,8 @@ def hist2d(x, y, n=100): ...@@ -54,6 +53,8 @@ def hist2d(x, y, n=100):
def butter_lowpass_filtfilt(data, cutoff=1500, fs=50000, order=5): def butter_lowpass_filtfilt(data, cutoff=1500, fs=50000, order=5):
from scipy.signal import butter, filtfilt
# https://stackoverflow.com/questions/28536191/how-to-filter-smooth-with-scipy-numpy # https://stackoverflow.com/questions/28536191/how-to-filter-smooth-with-scipy-numpy
def butter_lowpass(cutoff, fs, order): def butter_lowpass(cutoff, fs, order):
nyq = 0.5 * fs nyq = 0.5 * fs
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论