Feng Wang commited on
Commit
665328e
·
1 Parent(s): 871109f

fix(plugins): update workflow and fix bug of kwargs in nano (#844)

Browse files
.github/workflows/format_check.sh CHANGED
@@ -4,12 +4,12 @@ set -e
4
 
5
  export PYTHONPATH=$PWD:$PYTHONPATH
6
 
7
- flake8 yolox || flake8_ret=$?
8
  if [ "$flake8_ret" ]; then
9
  exit $flake8_ret
10
  fi
11
  echo "All flake check passed!"
12
- isort --check-only -rc yolox || isort_ret=$?
13
  if [ "$isort_ret" ]; then
14
  exit $isort_ret
15
  fi
 
4
 
5
  export PYTHONPATH=$PWD:$PYTHONPATH
6
 
7
+ flake8 yolox exps tools || flake8_ret=$?
8
  if [ "$flake8_ret" ]; then
9
  exit $flake8_ret
10
  fi
11
  echo "All flake check passed!"
12
+ isort --check-only -rc yolox exps || isort_ret=$?
13
  if [ "$isort_ret" ]; then
14
  exit $isort_ret
15
  fi
.gitignore CHANGED
@@ -4,6 +4,8 @@
4
  # user experiments directory
5
  YOLOX_outputs/
6
  datasets/
 
 
7
 
8
  # temporary files which can be created if a process still has a handle open of a deleted file
9
  .fuse_hidden*
 
4
  # user experiments directory
5
  YOLOX_outputs/
6
  datasets/
7
+ # do not ignore datasets under yolox/data
8
+ !*yolox/data/datasets/
9
 
10
  # temporary files which can be created if a process still has a handle open of a deleted file
11
  .fuse_hidden*
exps/default/nano.py CHANGED
@@ -33,8 +33,14 @@ class Exp(MyExp):
33
  from yolox.models import YOLOX, YOLOPAFPN, YOLOXHead
34
  in_channels = [256, 512, 1024]
35
  # NANO model use depthwise = True, which is main difference.
36
- backbone = YOLOPAFPN(self.depth, self.width, in_channels=in_channels, self.act, depthwise=True)
37
- head = YOLOXHead(self.num_classes, self.width, in_channels=in_channels, self.act, depthwise=True)
 
 
 
 
 
 
38
  self.model = YOLOX(backbone, head)
39
 
40
  self.model.apply(init_yolo)
 
33
  from yolox.models import YOLOX, YOLOPAFPN, YOLOXHead
34
  in_channels = [256, 512, 1024]
35
  # NANO model use depthwise = True, which is main difference.
36
+ backbone = YOLOPAFPN(
37
+ self.depth, self.width, in_channels=in_channels,
38
+ act=self.act, depthwise=True,
39
+ )
40
+ head = YOLOXHead(
41
+ self.num_classes, self.width, in_channels=in_channels,
42
+ act=self.act, depthwise=True
43
+ )
44
  self.model = YOLOX(backbone, head)
45
 
46
  self.model.apply(init_yolo)
exps/default/yolov3.py CHANGED
@@ -4,7 +4,6 @@
4
 
5
  import os
6
 
7
- import torch
8
  import torch.nn as nn
9
 
10
  from yolox.exp import Exp as MyExp
@@ -32,4 +31,3 @@ class Exp(MyExp):
32
  self.model.head.initialize_biases(1e-2)
33
 
34
  return self.model
35
-
 
4
 
5
  import os
6
 
 
7
  import torch.nn as nn
8
 
9
  from yolox.exp import Exp as MyExp
 
31
  self.model.head.initialize_biases(1e-2)
32
 
33
  return self.model
 
tools/demo.py CHANGED
@@ -298,7 +298,10 @@ def main(exp, args):
298
  trt_file = None
299
  decoder = None
300
 
301
- predictor = Predictor(model, exp, COCO_CLASSES, trt_file, decoder, args.device, args.fp16, args.legacy)
 
 
 
302
  current_time = time.localtime()
303
  if args.demo == "image":
304
  image_demo(predictor, vis_folder, args.path, current_time, args.save_result)
 
298
  trt_file = None
299
  decoder = None
300
 
301
+ predictor = Predictor(
302
+ model, exp, COCO_CLASSES, trt_file, decoder,
303
+ args.device, args.fp16, args.legacy,
304
+ )
305
  current_time = time.localtime()
306
  if args.demo == "image":
307
  image_demo(predictor, vis_folder, args.path, current_time, args.save_result)
tools/export_onnx.py CHANGED
@@ -101,7 +101,7 @@ def main():
101
  from onnxsim import simplify
102
 
103
  input_shapes = {args.input: list(dummy_input.shape)} if args.dynamic else None
104
-
105
  # use onnxsimplify to reduce reduent model.
106
  onnx_model = onnx.load(args.output_name)
107
  model_simp, check = simplify(onnx_model,
 
101
  from onnxsim import simplify
102
 
103
  input_shapes = {args.input: list(dummy_input.shape)} if args.dynamic else None
104
+
105
  # use onnxsimplify to reduce reduent model.
106
  onnx_model = onnx.load(args.output_name)
107
  model_simp, check = simplify(onnx_model,
tools/export_torchscript.py CHANGED
@@ -7,7 +7,6 @@ import os
7
  from loguru import logger
8
 
9
  import torch
10
- from torch import nn
11
 
12
  from yolox.exp import get_exp
13
 
 
7
  from loguru import logger
8
 
9
  import torch
 
10
 
11
  from yolox.exp import get_exp
12
 
tools/trt.py CHANGED
@@ -27,7 +27,9 @@ def make_parser():
27
  help="pls input your expriment description file",
28
  )
29
  parser.add_argument("-c", "--ckpt", default=None, type=str, help="ckpt path")
30
- parser.add_argument("-w", '--workspace', type=int, default=32, help='max workspace size in detect')
 
 
31
  parser.add_argument("-b", '--batch', type=int, default=1, help='max batch size in detect')
32
  return parser
33
 
 
27
  help="pls input your expriment description file",
28
  )
29
  parser.add_argument("-c", "--ckpt", default=None, type=str, help="ckpt path")
30
+ parser.add_argument(
31
+ "-w", '--workspace', type=int, default=32, help='max workspace size in detect'
32
+ )
33
  parser.add_argument("-b", '--batch', type=int, default=1, help='max batch size in detect')
34
  return parser
35