git status check bug fix

This commit is contained in:
Glenn Jocher 2020-04-18 18:06:11 -07:00
parent 693c06b26c
commit accce6b565
1 changed files with 2 additions and 1 deletions

View File

@ -20,7 +20,7 @@ from . import torch_utils # , google_utils
matplotlib.rc('font', **{'size': 11}) matplotlib.rc('font', **{'size': 11})
# Suggest 'git pull' # Suggest 'git pull'
s = subprocess.check_output('git status -uno', shell=True).decode('utf-8') s = subprocess.check_output('if [ -d .git ]; then git status -uno; fi', shell=True).decode('utf-8')
if 'Your branch is behind' in s: if 'Your branch is behind' in s:
print(s[s.find('Your branch is behind'):s.find('\n\n')] + '\n') print(s[s.find('Your branch is behind'):s.find('\n\n')] + '\n')
@ -561,6 +561,7 @@ def non_max_suppression(prediction, conf_thres=0.1, iou_thres=0.6, multi_label=T
# x[:, :4] = torch.mm(weights.T, x[:, :4]) # x[:, :4] = torch.mm(weights.T, x[:, :4])
weights = (box_iou(boxes[i], boxes) > iou_thres) * scores[None] # box weights weights = (box_iou(boxes[i], boxes) > iou_thres) * scores[None] # box weights
x[i, :4] = torch.mm(weights / weights.sum(1, keepdim=True), x[:, :4]).float() # merged boxes x[i, :4] = torch.mm(weights / weights.sum(1, keepdim=True), x[:, :4]).float() # merged boxes
elif method == 'vision': elif method == 'vision':
i = torchvision.ops.boxes.nms(boxes, scores, iou_thres) i = torchvision.ops.boxes.nms(boxes, scores, iou_thres)
elif method == 'fast': # FastNMS from https://github.com/dbolya/yolact elif method == 'fast': # FastNMS from https://github.com/dbolya/yolact