Skip to content

Commit

Permalink
fix(YOLOX): fix several bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
葛政(实习) authored and FateScript committed Jul 19, 2021
1 parent 8506f7e commit 42c9f1c
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions demo/ONNXRuntime/onnx_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from yolox.data.data_augment import preproc as preprocess
from yolox.data.datasets import COCO_CLASSES
from yolox.utils import mkdir, multiclass_nms, postprocess, vis
from yolox.utils import mkdir, multiclass_nms, demo_postprocess, vis


def make_parser():
Expand Down Expand Up @@ -72,7 +72,7 @@ def make_parser():

ort_inputs = {session.get_inputs()[0].name: img[None, :, :, :]}
output = session.run(None, ort_inputs)
predictions = postprocess(output[0], input_shape, p6=args.with_p6)[0]
predictions = demo_postprocess(output[0], input_shape, p6=args.with_p6)[0]

boxes = predictions[:, :4]
scores = predictions[:, 4:5] * predictions[:, 5:]
Expand Down
4 changes: 2 additions & 2 deletions demo/OpenVINO/python/openvino_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from yolox.data.data_augment import preproc as preprocess
from yolox.data.datasets import COCO_CLASSES
from yolox.utils import mkdir, multiclass_nms, postprocess, vis
from yolox.utils import mkdir, multiclass_nms, demo_postprocess, vis


def parse_args() -> argparse.Namespace:
Expand Down Expand Up @@ -130,7 +130,7 @@ def main():
# ---------------------------Step 8. Process output--------------------------------------------------------------------
res = res[out_blob]

predictions = postprocess(res, (h, w), p6=False)[0]
predictions = demo_postprocess(res, (h, w), p6=False)[0]

boxes = predictions[:, :4]
scores = predictions[:, 4, None] * predictions[:, 5:]
Expand Down
2 changes: 1 addition & 1 deletion exps/example/yolox_voc/yolox_voc_s.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def get_eval_loader(self, batch_size, is_distributed, testdev=False):
return val_loader

def get_evaluator(self, batch_size, is_distributed, testdev=False):
from yolox.evalutors import VOCEvaluator
from yolox.evaluators import VOCEvaluator

val_loader = self.get_eval_loader(batch_size, is_distributed, testdev=testdev)
evaluator = VOCEvaluator(
Expand Down
2 changes: 1 addition & 1 deletion yolox/core/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def before_train(self):
is_distributed=self.is_distributed,
no_aug=self.no_aug
)
logger.info("init prefetcher, this might take a while...")
logger.info("init prefetcher, this might take one minute or less...")
self.prefetcher = DataPrefetcher(self.train_loader)
# max_iter means iters per epoch
self.max_iter = len(self.train_loader)
Expand Down
2 changes: 1 addition & 1 deletion yolox/data/datasets/voc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import cv2
import numpy as np

from yolox.evalutors.voc_eval import voc_eval
from yolox.evaluators.voc_eval import voc_eval

from .datasets_wrapper import Dataset
from .voc_classes import VOC_CLASSES
Expand Down
2 changes: 1 addition & 1 deletion yolox/exp/yolox_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def get_eval_loader(self, batch_size, is_distributed, testdev=False):
return val_loader

def get_evaluator(self, batch_size, is_distributed, testdev=False):
from yolox.evalutors import COCOEvaluator
from yolox.evaluators import COCOEvaluator

val_loader = self.get_eval_loader(batch_size, is_distributed, testdev=testdev)
evaluator = COCOEvaluator(
Expand Down
4 changes: 2 additions & 2 deletions yolox/utils/demo_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import numpy as np

__all__ = ["mkdir", "nms", "multiclass_nms", "postprocess"]
__all__ = ["mkdir", "nms", "multiclass_nms", "demo_postprocess"]


def mkdir(path):
Expand Down Expand Up @@ -64,7 +64,7 @@ def multiclass_nms(boxes, scores, nms_thr, score_thr):
return np.concatenate(final_dets, 0)


def postprocess(outputs, img_size, p6=False):
def demo_postprocess(outputs, img_size, p6=False):

grids = []
expanded_strides = []
Expand Down

0 comments on commit 42c9f1c

Please sign in to comment.