未验证 提交 84c8958d 编写于 作者: M Manuel Garcia 提交者: GitHub

Optimize imports (#3601)

Besides removing unnecessary imports, this also fixes the missing logger module in test_architectures.py within the static directory.
上级 d77c236f
...@@ -12,13 +12,10 @@ ...@@ -12,13 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import sys
import os import os
import os.path as osp
import re import re
import json
import glob import glob
import cv2
import numpy as np import numpy as np
from multiprocessing import Pool from multiprocessing import Pool
from functools import partial from functools import partial
...@@ -80,10 +77,10 @@ def py_cpu_nms_poly_fast(dets, thresh): ...@@ -80,10 +77,10 @@ def py_cpu_nms_poly_fast(dets, thresh):
polys = [] polys = []
for i in range(len(dets)): for i in range(len(dets)):
tm_polygon = [dets[i][0], dets[i][1], tm_polygon = [
dets[i][2], dets[i][3], dets[i][0], dets[i][1], dets[i][2], dets[i][3], dets[i][4],
dets[i][4], dets[i][5], dets[i][5], dets[i][6], dets[i][7]
dets[i][6], dets[i][7]] ]
polys.append(tm_polygon) polys.append(tm_polygon)
polys = np.array(polys) polys = np.array(polys)
order = scores.argsort()[::-1] order = scores.argsort()[::-1]
...@@ -124,7 +121,7 @@ def py_cpu_nms_poly_fast(dets, thresh): ...@@ -124,7 +121,7 @@ def py_cpu_nms_poly_fast(dets, thresh):
def poly2origpoly(poly, x, y, rate): def poly2origpoly(poly, x, y, rate):
origpoly = [] origpoly = []
for i in range(int(len(poly)/2)): for i in range(int(len(poly) / 2)):
tmp_x = float(poly[i * 2] + x) / float(rate) tmp_x = float(poly[i * 2] + x) / float(rate)
tmp_y = float(poly[i * 2 + 1] + y) / float(rate) tmp_y = float(poly[i * 2 + 1] + y) / float(rate)
origpoly.append(tmp_x) origpoly.append(tmp_x)
...@@ -196,11 +193,14 @@ def merge_single(output_dir, nms, pred_class_lst): ...@@ -196,11 +193,14 @@ def merge_single(output_dir, nms, pred_class_lst):
for det in nameboxnmsdict[imgname]: for det in nameboxnmsdict[imgname]:
confidence = det[-1] confidence = det[-1]
bbox = det[0:-1] bbox = det[0:-1]
outline = imgname + ' ' + str(confidence) + ' ' + ' '.join(map(str, bbox)) outline = imgname + ' ' + str(confidence) + ' ' + ' '.join(
map(str, bbox))
f_out.write(outline + '\n') f_out.write(outline + '\n')
def dota_generate_test_result(pred_txt_dir, output_dir='output', dota_version='v1.0'): def dota_generate_test_result(pred_txt_dir,
output_dir='output',
dota_version='v1.0'):
""" """
pred_txt_dir: dir of pred txt pred_txt_dir: dir of pred txt
output_dir: dir of output output_dir: dir of output
...@@ -228,7 +228,8 @@ def dota_generate_test_result(pred_txt_dir, output_dir='output', dota_version='v ...@@ -228,7 +228,8 @@ def dota_generate_test_result(pred_txt_dir, output_dir='output', dota_version='v
pred_classes_lst = [] pred_classes_lst = []
for class_name in pred_classes.keys(): for class_name in pred_classes.keys():
print('class_name: {}, count: {}'.format(class_name, len(pred_classes[class_name]))) print('class_name: {}, count: {}'.format(class_name,
len(pred_classes[class_name])))
pred_classes_lst.append((class_name, pred_classes[class_name])) pred_classes_lst.append((class_name, pred_classes[class_name]))
# step2: merge # step2: merge
...@@ -241,7 +242,8 @@ def dota_generate_test_result(pred_txt_dir, output_dir='output', dota_version='v ...@@ -241,7 +242,8 @@ def dota_generate_test_result(pred_txt_dir, output_dir='output', dota_version='v
if __name__ == '__main__': if __name__ == '__main__':
parser = argparse.ArgumentParser(description='dota anno to coco') parser = argparse.ArgumentParser(description='dota anno to coco')
parser.add_argument('--pred_txt_dir', help='path of pred txt dir') parser.add_argument('--pred_txt_dir', help='path of pred txt dir')
parser.add_argument('--output_dir', help='path of output dir', default='output') parser.add_argument(
'--output_dir', help='path of output dir', default='output')
parser.add_argument( parser.add_argument(
'--dota_version', '--dota_version',
help='dota_version, v1.0 or v1.5 or v2.0', help='dota_version, v1.0 or v1.5 or v2.0',
...@@ -251,5 +253,6 @@ if __name__ == '__main__': ...@@ -251,5 +253,6 @@ if __name__ == '__main__':
args = parser.parse_args() args = parser.parse_args()
# process # process
dota_generate_test_result(args.pred_txt_dir, args.output_dir, args.dota_version) dota_generate_test_result(args.pred_txt_dir, args.output_dir,
args.dota_version)
print('done!') print('done!')
...@@ -17,9 +17,6 @@ import os.path as osp ...@@ -17,9 +17,6 @@ import os.path as osp
import json import json
import glob import glob
import cv2 import cv2
import numpy as np
from PIL import Image
import logging
import argparse import argparse
# add python path of PadleDetection to sys.path # add python path of PadleDetection to sys.path
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
# limitations under the License. # limitations under the License.
import os import os
import sys
import re import re
import argparse import argparse
import pandas as pd import pandas as pd
......
...@@ -12,9 +12,7 @@ ...@@ -12,9 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import argparse
import os import os
import time
import logging import logging
import paddle import paddle
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
import os import os
from PIL import Image
import cv2 import cv2
import math import math
import numpy as np import numpy as np
......
...@@ -13,12 +13,10 @@ ...@@ -13,12 +13,10 @@
# limitations under the License. # limitations under the License.
import os import os
import time
import yaml import yaml
import glob import glob
from functools import reduce from functools import reduce
from PIL import Image
import cv2 import cv2
import numpy as np import numpy as np
import math import math
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from PIL import Image
import cv2 import cv2
import numpy as np import numpy as np
......
...@@ -19,7 +19,6 @@ import os ...@@ -19,7 +19,6 @@ import os
import cv2 import cv2
import numpy as np import numpy as np
from PIL import Image, ImageDraw from PIL import Image, ImageDraw
from scipy import ndimage
import math import math
......
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
* PaddleDetection中提供的默认配置一般是采用8卡训练的配置,配置文件中的`batch_size`数为每卡的batch size,若训练的时候不是使用8卡或者对`batch_size`有修改,需要等比例的调小初始`learning_rate`来获得较好的收敛效果 * PaddleDetection中提供的默认配置一般是采用8卡训练的配置,配置文件中的`batch_size`数为每卡的batch size,若训练的时候不是使用8卡或者对`batch_size`有修改,需要等比例的调小初始`learning_rate`来获得较好的收敛效果
* 如果使用自定义数据集并且样本数比较少,建议增大`snapshot_epoch`数来增加第一次进行eval的时候的训练轮数来保证模型已经较好收敛 * 如果使用自定义数据集并且样本数比较少,建议增大`snapshot_epoch`数来增加第一次进行eval的时候的训练轮数来保证模型已经较好收敛
* 若使用自定义数据集训练,可以加载我们发布的COCO或VOC数据集上训练好的权重进行finetune训练来加快收敛速度,可以使用`-o pretrain_weights=xxx`的方式指定预训练权重,xxx可以是Model Zoo里发布的模型权重链接 * 若使用自定义数据集训练,可以加载我们发布的COCO或VOC数据集上训练好的权重进行finetune训练来加快收敛速度,可以使用`-o pretrain_weights=xxx`的方式指定预训练权重,xxx可以是Model Zoo里发布的模型权重链接
...@@ -93,4 +93,4 @@ https://github.com/PaddlePaddle/PaddleDetection/blob/b87a1ea86fa18ce69e44a17ad1b ...@@ -93,4 +93,4 @@ https://github.com/PaddlePaddle/PaddleDetection/blob/b87a1ea86fa18ce69e44a17ad1b
TestDataset: TestDataset:
!ImageFolder !ImageFolder
anno_path: annotations/instances_val2017.json anno_path: annotations/instances_val2017.json
``` ```
\ No newline at end of file
...@@ -21,7 +21,6 @@ import os ...@@ -21,7 +21,6 @@ import os
import sys import sys
import yaml import yaml
import copy
import collections import collections
try: try:
......
...@@ -13,21 +13,19 @@ ...@@ -13,21 +13,19 @@
# limitations under the License. # limitations under the License.
import os import os
import copy
import traceback import traceback
import six import six
import sys import sys
import multiprocessing as mp
if sys.version_info >= (3, 0): if sys.version_info >= (3, 0):
import queue as Queue pass
else: else:
import Queue pass
import numpy as np import numpy as np
from paddle.io import DataLoader, DistributedBatchSampler from paddle.io import DataLoader, DistributedBatchSampler
from paddle.fluid.dataloader.collate import default_collate_fn from paddle.fluid.dataloader.collate import default_collate_fn
from ppdet.core.workspace import register, serializable, create from ppdet.core.workspace import register
from . import transform from . import transform
from .shm_utils import _get_shared_memory_size_in_M from .shm_utils import _get_shared_memory_size_in_M
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import os import os
import numpy as np import numpy as np
from collections import OrderedDict
try: try:
from collections.abc import Sequence from collections.abc import Sequence
except Exception: except Exception:
......
...@@ -23,8 +23,6 @@ import inspect ...@@ -23,8 +23,6 @@ import inspect
import math import math
from PIL import Image, ImageEnhance from PIL import Image, ImageEnhance
import numpy as np import numpy as np
import os
import sys
import cv2 import cv2
from copy import deepcopy from copy import deepcopy
......
...@@ -27,7 +27,6 @@ import cv2 ...@@ -27,7 +27,6 @@ import cv2
import numpy as np import numpy as np
import math import math
import copy import copy
import os
from ...modeling.keypoint_utils import get_affine_mat_kernel, warp_affine_joints, get_affine_transform, affine_transform from ...modeling.keypoint_utils import get_affine_mat_kernel, warp_affine_joints, get_affine_transform, affine_transform
from ppdet.core.workspace import serializable from ppdet.core.workspace import serializable
......
...@@ -31,7 +31,6 @@ import math ...@@ -31,7 +31,6 @@ import math
from .operators import BaseOperator, register_op from .operators import BaseOperator, register_op
from .batch_operators import Gt2TTFTarget from .batch_operators import Gt2TTFTarget
from ppdet.modeling.bbox_utils import bbox_iou_np_expand from ppdet.modeling.bbox_utils import bbox_iou_np_expand
from ppdet.core.workspace import serializable
from ppdet.utils.logger import setup_logger from ppdet.utils.logger import setup_logger
logger = setup_logger(__name__) logger = setup_logger(__name__)
......
...@@ -35,10 +35,9 @@ import os ...@@ -35,10 +35,9 @@ import os
import copy import copy
import cv2 import cv2
from PIL import Image, ImageEnhance, ImageDraw from PIL import Image, ImageDraw
from ppdet.core.workspace import serializable from ppdet.core.workspace import serializable
from ppdet.modeling.layers import AnchorGrid
from ppdet.modeling import bbox_utils from ppdet.modeling import bbox_utils
from ..reader import Compose from ..reader import Compose
...@@ -46,7 +45,7 @@ from .op_helper import (satisfy_sample_constraint, filter_and_process, ...@@ -46,7 +45,7 @@ from .op_helper import (satisfy_sample_constraint, filter_and_process,
generate_sample_bbox, clip_bbox, data_anchor_sampling, generate_sample_bbox, clip_bbox, data_anchor_sampling,
satisfy_sample_constraint_coverage, crop_image_sampling, satisfy_sample_constraint_coverage, crop_image_sampling,
generate_sample_bbox_square, bbox_area_sampling, generate_sample_bbox_square, bbox_area_sampling,
is_poly, gaussian_radius, draw_gaussian, transform_bbox) is_poly, transform_bbox)
from ppdet.utils.logger import setup_logger from ppdet.utils.logger import setup_logger
logger = setup_logger(__name__) logger = setup_logger(__name__)
......
...@@ -20,9 +20,7 @@ import os ...@@ -20,9 +20,7 @@ import os
import sys import sys
import datetime import datetime
import six import six
import numpy as np
import paddle
import paddle.distributed as dist import paddle.distributed as dist
from ppdet.utils.checkpoint import save_model from ppdet.utils.checkpoint import save_model
...@@ -217,7 +215,8 @@ class VisualDLWriter(Callback): ...@@ -217,7 +215,8 @@ class VisualDLWriter(Callback):
logger.error('visualdl not found, plaese install visualdl. ' logger.error('visualdl not found, plaese install visualdl. '
'for example: `pip install visualdl`.') 'for example: `pip install visualdl`.')
raise e raise e
self.vdl_writer = LogWriter(model.cfg.get('vdl_log_dir', 'vdl_log_dir/scalar')) self.vdl_writer = LogWriter(
model.cfg.get('vdl_log_dir', 'vdl_log_dir/scalar'))
self.vdl_loss_step = 0 self.vdl_loss_step = 0
self.vdl_mAP_step = 0 self.vdl_mAP_step = 0
self.vdl_image_step = 0 self.vdl_image_step = 0
......
...@@ -17,11 +17,9 @@ from __future__ import division ...@@ -17,11 +17,9 @@ from __future__ import division
from __future__ import print_function from __future__ import print_function
import os import os
import sys
import copy import copy
import time import time
import random
import datetime
import numpy as np import numpy as np
from PIL import Image from PIL import Image
......
from paddle.utils.cpp_extension import CppExtension, CUDAExtension, setup from paddle.utils.cpp_extension import CUDAExtension, setup
if __name__ == "__main__": if __name__ == "__main__":
setup( setup(
......
import numpy as np import numpy as np
import os
import sys import sys
import cv2
import time import time
import shapely
from shapely.geometry import Polygon from shapely.geometry import Polygon
import paddle import paddle
......
...@@ -150,7 +150,7 @@ def cocoapi_eval(jsonfile, ...@@ -150,7 +150,7 @@ def cocoapi_eval(jsonfile,
results_flatten = list(itertools.chain(*results_per_category)) results_flatten = list(itertools.chain(*results_per_category))
headers = ['category', 'AP'] * (num_columns // 2) headers = ['category', 'AP'] * (num_columns // 2)
results_2d = itertools.zip_longest( results_2d = itertools.zip_longest(
* [results_flatten[i::num_columns] for i in range(num_columns)]) *[results_flatten[i::num_columns] for i in range(num_columns)])
table_data = [headers] table_data = [headers]
table_data += [result for result in results_2d] table_data += [result for result in results_2d]
table = AsciiTable(table_data) table = AsciiTable(table_data)
......
...@@ -12,9 +12,7 @@ ...@@ -12,9 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import six import six
import os
import numpy as np import numpy as np
import cv2
def get_det_res(bboxes, bbox_nums, image_id, label_to_cat_id_map, bias=0): def get_det_res(bboxes, bbox_nums, image_id, label_to_cat_id_map, bias=0):
......
...@@ -12,10 +12,8 @@ ...@@ -12,10 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import copy
import os import os
import json import json
from collections import OrderedDict
from collections import defaultdict from collections import defaultdict
import numpy as np import numpy as np
from pycocotools.coco import COCO from pycocotools.coco import COCO
......
...@@ -12,9 +12,7 @@ ...@@ -12,9 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import os
import os.path as osp import os.path as osp
import glob
import pkg_resources import pkg_resources
try: try:
......
...@@ -21,7 +21,6 @@ import paddle ...@@ -21,7 +21,6 @@ import paddle
import ppdet import ppdet
import unittest import unittest
# NOTE: weights downloading costs time, we choose # NOTE: weights downloading costs time, we choose
# a small model for unittesting # a small model for unittesting
MODEL_NAME = 'ppyolo/ppyolo_tiny_650e_coco' MODEL_NAME = 'ppyolo/ppyolo_tiny_650e_coco'
......
...@@ -16,7 +16,6 @@ from __future__ import absolute_import ...@@ -16,7 +16,6 @@ from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
import paddle
from ppdet.core.workspace import register, create from ppdet.core.workspace import register, create
from .meta_arch import BaseArch from .meta_arch import BaseArch
......
...@@ -2,7 +2,6 @@ from __future__ import absolute_import ...@@ -2,7 +2,6 @@ from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
import numpy as np
import paddle import paddle
import paddle.nn as nn import paddle.nn as nn
from ppdet.core.workspace import register from ppdet.core.workspace import register
......
...@@ -19,7 +19,6 @@ from __future__ import print_function ...@@ -19,7 +19,6 @@ from __future__ import print_function
import paddle import paddle
from ppdet.core.workspace import register, create from ppdet.core.workspace import register, create
from .meta_arch import BaseArch from .meta_arch import BaseArch
import numpy as np
__all__ = ['S2ANet'] __all__ = ['S2ANet']
......
...@@ -20,10 +20,8 @@ import paddle ...@@ -20,10 +20,8 @@ import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle import ParamAttr from paddle import ParamAttr
from paddle.regularizer import L2Decay
from paddle.nn.initializer import KaimingNormal from paddle.nn.initializer import KaimingNormal
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
from numbers import Integral
from ..shape_spec import ShapeSpec from ..shape_spec import ShapeSpec
__all__ = ['BlazeNet'] __all__ = ['BlazeNet']
......
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
import paddle import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle import ParamAttr
from paddle.regularizer import L2Decay
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
from ppdet.modeling.ops import batch_norm, mish from ppdet.modeling.ops import batch_norm, mish
from ..shape_spec import ShapeSpec from ..shape_spec import ShapeSpec
......
...@@ -17,9 +17,9 @@ import paddle ...@@ -17,9 +17,9 @@ import paddle
from paddle import ParamAttr from paddle import ParamAttr
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle.nn import Conv2D, BatchNorm, AdaptiveAvgPool2D, Linear from paddle.nn import AdaptiveAvgPool2D, Linear
from paddle.regularizer import L2Decay from paddle.nn.initializer import Uniform
from paddle.nn.initializer import Uniform, KaimingNormal
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
from numbers import Integral from numbers import Integral
from ..shape_spec import ShapeSpec from ..shape_spec import ShapeSpec
......
...@@ -21,7 +21,7 @@ from paddle.nn.initializer import Normal ...@@ -21,7 +21,7 @@ from paddle.nn.initializer import Normal
from numbers import Integral from numbers import Integral
import math import math
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register
from ..shape_spec import ShapeSpec from ..shape_spec import ShapeSpec
__all__ = ['HRNet'] __all__ = ['HRNet']
......
...@@ -16,7 +16,6 @@ from __future__ import absolute_import ...@@ -16,7 +16,6 @@ from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle import ParamAttr from paddle import ParamAttr
......
...@@ -12,9 +12,8 @@ ...@@ -12,9 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
from .resnet import ResNet, Blocks, BasicBlock, BottleNeck from .resnet import ResNet, Blocks, BasicBlock, BottleNeck
......
...@@ -4,7 +4,6 @@ import paddle ...@@ -4,7 +4,6 @@ import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle import ParamAttr from paddle import ParamAttr
from paddle.regularizer import L2Decay
from paddle.nn import Conv2D, MaxPool2D from paddle.nn import Conv2D, MaxPool2D
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
from ..shape_spec import ShapeSpec from ..shape_spec import ShapeSpec
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
import math import math
import paddle import paddle
import paddle.nn.functional as F
import math
import numpy as np import numpy as np
......
...@@ -21,8 +21,6 @@ from paddle.nn.initializer import Normal, XavierUniform, KaimingNormal ...@@ -21,8 +21,6 @@ from paddle.nn.initializer import Normal, XavierUniform, KaimingNormal
from paddle.regularizer import L2Decay from paddle.regularizer import L2Decay
from ppdet.core.workspace import register, create from ppdet.core.workspace import register, create
from ppdet.modeling import ops
from .roi_extractor import RoIAlign from .roi_extractor import RoIAlign
from ..shape_spec import ShapeSpec from ..shape_spec import ShapeSpec
from ..bbox_utils import bbox2delta from ..bbox_utils import bbox2delta
......
...@@ -15,16 +15,13 @@ ...@@ -15,16 +15,13 @@
import paddle import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle.nn.initializer import Normal, XavierUniform from paddle.nn.initializer import Normal
from paddle.regularizer import L2Decay
from ppdet.core.workspace import register, create
from ppdet.modeling import ops
from ppdet.core.workspace import register
from .bbox_head import BBoxHead, TwoFCHead, XConvNormHead from .bbox_head import BBoxHead, TwoFCHead, XConvNormHead
from .roi_extractor import RoIAlign from .roi_extractor import RoIAlign
from ..shape_spec import ShapeSpec from ..shape_spec import ShapeSpec
from ..bbox_utils import bbox2delta, delta2bbox, clip_bbox, nonempty_bbox from ..bbox_utils import delta2bbox, clip_bbox, nonempty_bbox
__all__ = ['CascadeTwoFCHead', 'CascadeXConvNormHead', 'CascadeHead'] __all__ = ['CascadeTwoFCHead', 'CascadeXConvNormHead', 'CascadeHead']
......
...@@ -12,12 +12,10 @@ ...@@ -12,12 +12,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import numpy as np
import math import math
import paddle import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle import ParamAttr
from paddle.nn.initializer import KaimingUniform from paddle.nn.initializer import KaimingUniform
from ppdet.core.workspace import register from ppdet.core.workspace import register
from ppdet.modeling.losses import CTFocalLoss from ppdet.modeling.losses import CTFocalLoss
......
...@@ -14,11 +14,8 @@ ...@@ -14,11 +14,8 @@
import paddle import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F
from ppdet.core.workspace import register
from paddle.regularizer import L2Decay
from paddle import ParamAttr
from ppdet.core.workspace import register
from ..layers import AnchorGeneratorSSD from ..layers import AnchorGeneratorSSD
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
import paddle import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F
from ppdet.core.workspace import register from ppdet.core.workspace import register
from .. import layers as L from .. import layers as L
from ..backbones.hrnet import BasicBlock from ..backbones.hrnet import BasicBlock
......
...@@ -16,12 +16,9 @@ import paddle ...@@ -16,12 +16,9 @@ import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle.nn.initializer import KaimingNormal from paddle.nn.initializer import KaimingNormal
from paddle.regularizer import L2Decay
from ppdet.core.workspace import register, create from ppdet.core.workspace import register, create
from ppdet.modeling import ops
from ppdet.modeling.layers import ConvNormLayer from ppdet.modeling.layers import ConvNormLayer
from .roi_extractor import RoIAlign from .roi_extractor import RoIAlign
......
...@@ -16,7 +16,7 @@ import paddle ...@@ -16,7 +16,7 @@ import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle import ParamAttr from paddle import ParamAttr
from paddle.nn.initializer import Constant, Uniform, Normal from paddle.nn.initializer import Constant, Normal
from paddle.regularizer import L2Decay from paddle.regularizer import L2Decay
from ppdet.core.workspace import register from ppdet.core.workspace import register
from ppdet.modeling.layers import DeformableConvV2, LiteConv from ppdet.modeling.layers import DeformableConvV2, LiteConv
......
...@@ -21,7 +21,6 @@ import paddle ...@@ -21,7 +21,6 @@ import paddle
import paddle.nn as nn import paddle.nn as nn
from paddle import ParamAttr from paddle import ParamAttr
from paddle import to_tensor from paddle import to_tensor
from paddle.nn import Conv2D, BatchNorm2D, GroupNorm
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle.nn.initializer import Normal, Constant, XavierUniform from paddle.nn.initializer import Normal, Constant, XavierUniform
from paddle.regularizer import L2Decay from paddle.regularizer import L2Decay
......
...@@ -17,7 +17,7 @@ from __future__ import division ...@@ -17,7 +17,7 @@ from __future__ import division
from __future__ import print_function from __future__ import print_function
import paddle import paddle
import paddle.nn.functional as F
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
__all__ = ['CTFocalLoss'] __all__ = ['CTFocalLoss']
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
from __future__ import absolute_import from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
import numpy as np
import paddle import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
......
...@@ -16,11 +16,10 @@ from __future__ import absolute_import ...@@ -16,11 +16,10 @@ from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
import paddle
import paddle.nn.functional as F import paddle.nn.functional as F
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
from .iou_loss import IouLoss from .iou_loss import IouLoss
from ..bbox_utils import xywh2xyxy, bbox_iou from ..bbox_utils import bbox_iou
@register @register
......
...@@ -19,9 +19,9 @@ from __future__ import print_function ...@@ -19,9 +19,9 @@ from __future__ import print_function
import numpy as np import numpy as np
import paddle import paddle
import paddle.nn.functional as F
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
from ..bbox_utils import xywh2xyxy, bbox_iou from ..bbox_utils import bbox_iou
__all__ = ['IouLoss', 'GIoULoss', 'DIouLoss'] __all__ = ['IouLoss', 'GIoULoss', 'DIouLoss']
......
...@@ -20,7 +20,7 @@ from itertools import cycle, islice ...@@ -20,7 +20,7 @@ from itertools import cycle, islice
from collections import abc from collections import abc
import paddle import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
__all__ = ['HrHRNetLoss', 'KeyPointMSELoss'] __all__ = ['HrHRNetLoss', 'KeyPointMSELoss']
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
This code is borrow from https://github.com/nwojke/deep_sort/blob/master/deep_sort/track.py This code is borrow from https://github.com/nwojke/deep_sort/blob/master/deep_sort/track.py
""" """
import numpy as np
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
__all__ = ['TrackState', 'Track'] __all__ = ['TrackState', 'Track']
......
...@@ -12,15 +12,12 @@ ...@@ -12,15 +12,12 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import numpy as np
import math
import paddle import paddle
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle import ParamAttr from paddle import ParamAttr
import paddle.nn as nn import paddle.nn as nn
from paddle.nn.initializer import KaimingNormal from paddle.nn.initializer import KaimingNormal
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
from ppdet.modeling.layers import ConvNormLayer
from ..shape_spec import ShapeSpec from ..shape_spec import ShapeSpec
__all__ = ['BlazeNeck'] __all__ = ['BlazeNeck']
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
import numpy as np import numpy as np
import math import math
import paddle import paddle
import paddle.nn.functional as F
from paddle import ParamAttr
import paddle.nn as nn import paddle.nn as nn
from paddle.nn.initializer import KaimingUniform from paddle.nn.initializer import KaimingUniform
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
......
...@@ -12,13 +12,11 @@ ...@@ -12,13 +12,11 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import numpy as np
import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle import ParamAttr from paddle import ParamAttr
from paddle.nn.initializer import XavierUniform from paddle.nn.initializer import XavierUniform
from paddle.regularizer import L2Decay
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
from ppdet.modeling.layers import ConvNormLayer from ppdet.modeling.layers import ConvNormLayer
from ..shape_spec import ShapeSpec from ..shape_spec import ShapeSpec
......
...@@ -16,8 +16,7 @@ import paddle ...@@ -16,8 +16,7 @@ import paddle
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle import ParamAttr from paddle import ParamAttr
import paddle.nn as nn import paddle.nn as nn
from paddle.regularizer import L2Decay from ppdet.core.workspace import register
from ppdet.core.workspace import register, serializable
from ..shape_spec import ShapeSpec from ..shape_spec import ShapeSpec
__all__ = ['HRFPN'] __all__ = ['HRFPN']
......
...@@ -17,7 +17,6 @@ import paddle.nn as nn ...@@ -17,7 +17,6 @@ import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle import ParamAttr from paddle import ParamAttr
from paddle.nn.initializer import Constant, Uniform, Normal, XavierUniform from paddle.nn.initializer import Constant, Uniform, Normal, XavierUniform
from paddle import ParamAttr
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
from paddle.regularizer import L2Decay from paddle.regularizer import L2Decay
from ppdet.modeling.layers import DeformableConvV2, ConvNormLayer, LiteConv from ppdet.modeling.layers import DeformableConvV2, ConvNormLayer, LiteConv
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
import paddle import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle import ParamAttr
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
from ppdet.modeling.layers import DropBlock from ppdet.modeling.layers import DropBlock
from ..backbones.darknet import ConvBNLayer from ..backbones.darknet import ConvBNLayer
......
...@@ -21,12 +21,7 @@ from paddle.regularizer import L2Decay ...@@ -21,12 +21,7 @@ from paddle.regularizer import L2Decay
from paddle.fluid.framework import Variable, in_dygraph_mode from paddle.fluid.framework import Variable, in_dygraph_mode
from paddle.fluid import core from paddle.fluid import core
from paddle.fluid.layer_helper import LayerHelper from paddle.fluid.layer_helper import LayerHelper
from paddle.fluid.dygraph import layers from paddle.fluid.data_feeder import check_variable_and_dtype, check_type, check_dtype
from paddle.fluid.data_feeder import check_variable_and_dtype, check_type, check_dtype, convert_dtype
import math
import six
import numpy as np
from functools import reduce
__all__ = [ __all__ = [
'roi_pool', 'roi_pool',
......
...@@ -17,7 +17,7 @@ import paddle ...@@ -17,7 +17,7 @@ import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from ppdet.core.workspace import register from ppdet.core.workspace import register
from ppdet.modeling.bbox_utils import nonempty_bbox, rbox2poly, rbox2poly from ppdet.modeling.bbox_utils import nonempty_bbox, rbox2poly
from ppdet.modeling.layers import TTFBox from ppdet.modeling.layers import TTFBox
from .transformers import bbox_cxcywh_to_xyxy from .transformers import bbox_cxcywh_to_xyxy
try: try:
......
...@@ -12,15 +12,12 @@ ...@@ -12,15 +12,12 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import numpy as np
import math import math
import paddle import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F
from ppdet.core.workspace import register from ppdet.core.workspace import register
from .. import ops
@register @register
......
...@@ -12,11 +12,7 @@ ...@@ -12,11 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import numpy as np
import paddle import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
from .. import ops from .. import ops
......
...@@ -16,11 +16,8 @@ import paddle ...@@ -16,11 +16,8 @@ import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle.nn.initializer import Normal from paddle.nn.initializer import Normal
from paddle.regularizer import L2Decay
from ppdet.core.workspace import register from ppdet.core.workspace import register
from ppdet.modeling import ops
from .anchor_generator import AnchorGenerator from .anchor_generator import AnchorGenerator
from .target_layer import RPNTargetAssign from .target_layer import RPNTargetAssign
from .proposal_generator import ProposalGenerator from .proposal_generator import ProposalGenerator
......
...@@ -12,12 +12,9 @@ ...@@ -12,12 +12,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import six
import math
import numpy as np import numpy as np
import paddle import paddle
from ..bbox_utils import bbox2delta, bbox_overlaps from ..bbox_utils import bbox2delta, bbox_overlaps
import copy
def rpn_anchor_target(anchors, def rpn_anchor_target(anchors,
......
...@@ -17,7 +17,6 @@ import math ...@@ -17,7 +17,6 @@ import math
import paddle import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle import ParamAttr
from paddle.nn.initializer import KaimingUniform, Uniform from paddle.nn.initializer import KaimingUniform, Uniform
from ppdet.core.workspace import register from ppdet.core.workspace import register
from ppdet.modeling.heads.centernet_head import ConvLayer from ppdet.modeling.heads.centernet_head import ConvLayer
......
...@@ -16,7 +16,6 @@ from __future__ import print_function ...@@ -16,7 +16,6 @@ from __future__ import print_function
import unittest import unittest
import contextlib import contextlib
import numpy as np
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
......
...@@ -24,7 +24,6 @@ import numpy as np ...@@ -24,7 +24,6 @@ import numpy as np
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid.framework import Program, program_guard
from paddle.fluid.dygraph import base from paddle.fluid.dygraph import base
import ppdet.modeling.ops as ops import ppdet.modeling.ops as ops
......
...@@ -15,13 +15,9 @@ ...@@ -15,13 +15,9 @@
from __future__ import division from __future__ import division
import unittest import unittest
import numpy as np
from scipy.special import logit
from scipy.special import expit
import paddle import paddle
from paddle import fluid from paddle import fluid
from paddle.fluid import core
# add python path of PadleDetection to sys.path # add python path of PadleDetection to sys.path
import os import os
import sys import sys
...@@ -31,7 +27,6 @@ if parent_path not in sys.path: ...@@ -31,7 +27,6 @@ if parent_path not in sys.path:
from ppdet.modeling.losses import YOLOv3Loss from ppdet.modeling.losses import YOLOv3Loss
from ppdet.data.transform.op_helper import jaccard_overlap from ppdet.data.transform.op_helper import jaccard_overlap
import random
import numpy as np import numpy as np
......
...@@ -17,14 +17,11 @@ from __future__ import division ...@@ -17,14 +17,11 @@ from __future__ import division
from __future__ import print_function from __future__ import print_function
import math import math
import copy
import paddle import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.optimizer as optimizer import paddle.optimizer as optimizer
from paddle.optimizer.lr import CosineAnnealingDecay
import paddle.regularizer as regularizer import paddle.regularizer as regularizer
from paddle import cos
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
......
...@@ -20,12 +20,11 @@ import paddle ...@@ -20,12 +20,11 @@ import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from ppdet.core.workspace import register, serializable, load_config from ppdet.core.workspace import register, create, load_config
from ppdet.core.workspace import create
from ppdet.utils.logger import setup_logger
from ppdet.modeling import ops from ppdet.modeling import ops
from ppdet.utils.checkpoint import load_pretrain_weight from ppdet.utils.checkpoint import load_pretrain_weight
from ppdet.modeling.losses import YOLOv3Loss from ppdet.utils.logger import setup_logger
logger = setup_logger(__name__) logger = setup_logger(__name__)
......
...@@ -16,7 +16,6 @@ from __future__ import absolute_import ...@@ -16,7 +16,6 @@ from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
import paddle
from paddle.utils import try_import from paddle.utils import try_import
from ppdet.core.workspace import register, serializable from ppdet.core.workspace import register, serializable
......
...@@ -20,7 +20,6 @@ from __future__ import unicode_literals ...@@ -20,7 +20,6 @@ from __future__ import unicode_literals
import errno import errno
import os import os
import time import time
import re
import numpy as np import numpy as np
import paddle import paddle
import paddle.nn as nn import paddle.nn as nn
......
...@@ -29,10 +29,10 @@ import binascii ...@@ -29,10 +29,10 @@ import binascii
import tarfile import tarfile
import zipfile import zipfile
from .voc_utils import create_list
from ppdet.core.workspace import BASE_KEY from ppdet.core.workspace import BASE_KEY
from .logger import setup_logger from .logger import setup_logger
from .voc_utils import create_list
logger = setup_logger(__name__) logger = setup_logger(__name__)
__all__ = [ __all__ = [
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import functools
import logging import logging
import os import os
import sys import sys
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
import collections import collections
import numpy as np import numpy as np
import datetime
__all__ = ['SmoothedValue', 'TrainingStats'] __all__ = ['SmoothedValue', 'TrainingStats']
......
...@@ -20,7 +20,6 @@ from __future__ import unicode_literals ...@@ -20,7 +20,6 @@ from __future__ import unicode_literals
import numpy as np import numpy as np
from PIL import Image, ImageDraw from PIL import Image, ImageDraw
import cv2 import cv2
import os
import math import math
from .colormap import colormap from .colormap import colormap
......
...@@ -20,7 +20,6 @@ import os ...@@ -20,7 +20,6 @@ import os
import os.path as osp import os.path as osp
import re import re
import random import random
import shutil
__all__ = ['create_list'] __all__ = ['create_list']
......
...@@ -15,10 +15,9 @@ ...@@ -15,10 +15,9 @@
import os import os
import time import time
from functools import reduce from functools import reduce
import base64
import cv2 import cv2
import numpy as np import numpy as np
from paddlehub.module.module import moduleinfo, serving from paddlehub.module.module import moduleinfo
import blazeface.data_feed as D import blazeface.data_feed as D
......
...@@ -15,11 +15,9 @@ ...@@ -15,11 +15,9 @@
import os import os
import time import time
from functools import reduce from functools import reduce
import base64
import cv2 import cv2
import numpy as np import numpy as np
from paddlehub.module.module import moduleinfo, serving from paddlehub.module.module import moduleinfo
import solov2.processor as P import solov2.processor as P
import solov2.data_feed as D import solov2.data_feed as D
......
...@@ -13,10 +13,8 @@ ...@@ -13,10 +13,8 @@
# limitations under the License. # limitations under the License.
import os import os
import cv2 import cv2
import json
import math import math
import numpy as np import numpy as np
import argparse
HAT_SCALES = { HAT_SCALES = {
'1.png': [3.0, 0.9, .0], '1.png': [3.0, 0.9, .0],
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
# limitations under the License. # limitations under the License.
import os import os
import time
import base64 import base64
import json import json
...@@ -21,8 +20,7 @@ import cv2 ...@@ -21,8 +20,7 @@ import cv2
import numpy as np import numpy as np
import paddle.nn as nn import paddle.nn as nn
import paddlehub as hub import paddlehub as hub
from paddlehub.module.module import moduleinfo, serving, Module from paddlehub.module.module import moduleinfo, serving
import solov2_blazeface.processor as P import solov2_blazeface.processor as P
......
...@@ -16,7 +16,7 @@ from __future__ import division ...@@ -16,7 +16,7 @@ from __future__ import division
import cv2 import cv2
import numpy as np import numpy as np
from PIL import Image, ImageDraw from PIL import Image
import solov2_blazeface.face_makeup_main as face_makeup_main import solov2_blazeface.face_makeup_main as face_makeup_main
......
...@@ -12,12 +12,8 @@ ...@@ -12,12 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import paddle
import paddlehub as hub import paddlehub as hub
import cv2 import cv2
from PIL import Image
import numpy as np
import base64
img_file = 'demo_images/test.jpg' img_file = 'demo_images/test.jpg'
background = 'element_source/background/1.png' background = 'element_source/background/1.png'
......
...@@ -16,7 +16,9 @@ from __future__ import absolute_import ...@@ -16,7 +16,9 @@ from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
import os, sys import os
import sys
# add python path of PadleDetection to sys.path # add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3))) parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3)))
if parent_path not in sys.path: if parent_path not in sys.path:
...@@ -28,7 +30,6 @@ import yaml ...@@ -28,7 +30,6 @@ import yaml
import ast import ast
from functools import reduce from functools import reduce
from PIL import Image
import cv2 import cv2
import numpy as np import numpy as np
import paddle import paddle
...@@ -508,7 +509,7 @@ def predict_video(detector, camera_id): ...@@ -508,7 +509,7 @@ def predict_video(detector, camera_id):
fps = 30 fps = 30
width = int(capture.get(cv2.CAP_PROP_FRAME_WIDTH)) width = int(capture.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(capture.get(cv2.CAP_PROP_FRAME_HEIGHT)) height = int(capture.get(cv2.CAP_PROP_FRAME_HEIGHT))
fourcc = cv2.VideoWriter_fourcc(* 'mp4v') fourcc = cv2.VideoWriter_fourcc(*'mp4v')
if not os.path.exists(FLAGS.output_dir): if not os.path.exists(FLAGS.output_dir):
os.makedirs(FLAGS.output_dir) os.makedirs(FLAGS.output_dir)
out_path = os.path.join(FLAGS.output_dir, video_name) out_path = os.path.join(FLAGS.output_dir, video_name)
......
...@@ -18,7 +18,6 @@ from __future__ import division ...@@ -18,7 +18,6 @@ from __future__ import division
import cv2 import cv2
import numpy as np import numpy as np
from PIL import Image, ImageDraw from PIL import Image, ImageDraw
from scipy import ndimage
def visualize_box_mask(im, results, labels, mask_resolution=14, threshold=0.5): def visualize_box_mask(im, results, labels, mask_resolution=14, threshold=0.5):
......
...@@ -18,11 +18,6 @@ ...@@ -18,11 +18,6 @@
# #
import os import os
import sys import sys
# sys.path.insert(0, os.path.abspath('.'))
import sphinx_rtd_theme
from recommonmark.parser import CommonMarkParser
from recommonmark.transform import AutoStructify
sys.path.insert(0, os.path.abspath("..")) sys.path.insert(0, os.path.abspath(".."))
sys.path.insert(0, os.path.abspath("../../")) sys.path.insert(0, os.path.abspath("../../"))
......
...@@ -31,7 +31,6 @@ import uuid ...@@ -31,7 +31,6 @@ import uuid
import logging import logging
import signal import signal
import threading import threading
import traceback
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
......
...@@ -17,7 +17,6 @@ from __future__ import division ...@@ -17,7 +17,6 @@ from __future__ import division
from __future__ import print_function from __future__ import print_function
from __future__ import unicode_literals from __future__ import unicode_literals
import sys
import six import six
if six.PY3: if six.PY3:
import pickle import pickle
......
...@@ -24,7 +24,6 @@ import os ...@@ -24,7 +24,6 @@ import os
import time import time
import math import math
import struct import struct
import sys
import six import six
if six.PY3: if six.PY3:
...@@ -32,7 +31,6 @@ if six.PY3: ...@@ -32,7 +31,6 @@ if six.PY3:
else: else:
import cPickle as pickle import cPickle as pickle
import json
import uuid import uuid
import random import random
import numpy as np import numpy as np
......
...@@ -23,8 +23,6 @@ import inspect ...@@ -23,8 +23,6 @@ import inspect
import math import math
from PIL import Image, ImageEnhance from PIL import Image, ImageEnhance
import numpy as np import numpy as np
import os
import sys
import cv2 import cv2
from copy import deepcopy from copy import deepcopy
......
...@@ -20,8 +20,8 @@ import math ...@@ -20,8 +20,8 @@ import math
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid.param_attr import ParamAttr from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.initializer import Normal, Constant, NumpyArrayInitializer from paddle.fluid.initializer import Normal, Constant
from paddle.fluid.regularizer import L2Decay
from ppdet.modeling.ops import ConvNorm, DeformConvNorm from ppdet.modeling.ops import ConvNorm, DeformConvNorm
from ppdet.modeling.ops import MultiClassNMS from ppdet.modeling.ops import MultiClassNMS
......
...@@ -19,7 +19,6 @@ from __future__ import print_function ...@@ -19,7 +19,6 @@ from __future__ import print_function
import paddle import paddle
from paddle import fluid from paddle import fluid
from paddle.fluid.param_attr import ParamAttr from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.regularizer import L2Decay
from ppdet.modeling.ops import ConvNorm, DeformConvNorm, MaskMatrixNMS, DropBlock from ppdet.modeling.ops import ConvNorm, DeformConvNorm, MaskMatrixNMS, DropBlock
from ppdet.core.workspace import register from ppdet.core.workspace import register
......
...@@ -25,7 +25,6 @@ from paddle.fluid.initializer import Normal, Constant, Uniform, Xavier ...@@ -25,7 +25,6 @@ from paddle.fluid.initializer import Normal, Constant, Uniform, Xavier
from paddle.fluid.regularizer import L2Decay from paddle.fluid.regularizer import L2Decay
from ppdet.core.workspace import register from ppdet.core.workspace import register
from ppdet.modeling.ops import DeformConv, DropBlock, ConvNorm from ppdet.modeling.ops import DeformConv, DropBlock, ConvNorm
from ppdet.modeling.losses import GiouLoss
__all__ = ['TTFHead', 'TTFLiteHead'] __all__ = ['TTFHead', 'TTFLiteHead']
......
...@@ -22,8 +22,7 @@ from paddle import fluid ...@@ -22,8 +22,7 @@ from paddle import fluid
from paddle.fluid.param_attr import ParamAttr from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.regularizer import L2Decay from paddle.fluid.regularizer import L2Decay
from ppdet.modeling.ops import MultiClassNMS, MultiClassSoftNMS, MatrixNMS from ppdet.modeling.ops import MultiClassNMS, MultiClassSoftNMS
from ppdet.modeling.losses.yolo_loss import YOLOv3Loss
from ppdet.core.workspace import register from ppdet.core.workspace import register
from ppdet.modeling.ops import DropBlock from ppdet.modeling.ops import DropBlock
from .iou_aware import get_iou_aware_score from .iou_aware import get_iou_aware_score
......
...@@ -16,7 +16,6 @@ from __future__ import absolute_import ...@@ -16,7 +16,6 @@ from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
import numpy as np
from collections import OrderedDict from collections import OrderedDict
from paddle import fluid from paddle import fluid
......
...@@ -17,7 +17,6 @@ from __future__ import division ...@@ -17,7 +17,6 @@ from __future__ import division
from __future__ import print_function from __future__ import print_function
import numpy as np import numpy as np
import sys
from collections import OrderedDict from collections import OrderedDict
import copy import copy
......
...@@ -21,7 +21,6 @@ from collections import OrderedDict ...@@ -21,7 +21,6 @@ from collections import OrderedDict
from paddle import fluid from paddle import fluid
from ppdet.core.workspace import register from ppdet.core.workspace import register
import numpy as np
from ppdet.utils.check import check_version from ppdet.utils.check import check_version
__all__ = ['CornerNetSqueeze'] __all__ = ['CornerNetSqueeze']
......
...@@ -16,7 +16,6 @@ from __future__ import absolute_import ...@@ -16,7 +16,6 @@ from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
import numpy as np
from collections import OrderedDict from collections import OrderedDict
from paddle import fluid from paddle import fluid
......
...@@ -18,13 +18,9 @@ from __future__ import print_function ...@@ -18,13 +18,9 @@ from __future__ import print_function
from collections import OrderedDict from collections import OrderedDict
import copy import copy
import numpy as np
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.initializer import MSRA
from paddle.fluid.regularizer import L2Decay
from ppdet.experimental import mixed_precision_global_state
from ppdet.core.workspace import register from ppdet.core.workspace import register
from ppdet.utils.check import check_version from ppdet.utils.check import check_version
......
...@@ -16,14 +16,10 @@ from __future__ import absolute_import ...@@ -16,14 +16,10 @@ from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
import sys
from collections import OrderedDict from collections import OrderedDict
from paddle import fluid from paddle import fluid
from paddle.fluid.param_attr import ParamAttr from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.initializer import Xavier
from paddle.fluid.regularizer import L2Decay
from ppdet.core.workspace import register from ppdet.core.workspace import register
......
...@@ -17,7 +17,6 @@ from __future__ import division ...@@ -17,7 +17,6 @@ from __future__ import division
from __future__ import print_function from __future__ import print_function
from __future__ import unicode_literals from __future__ import unicode_literals
import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid import ParamAttr from paddle.fluid import ParamAttr
from paddle.fluid.initializer import ConstantInitializer from paddle.fluid.initializer import ConstantInitializer
......
...@@ -20,10 +20,7 @@ from paddle import fluid ...@@ -20,10 +20,7 @@ from paddle import fluid
from paddle.fluid.param_attr import ParamAttr from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.initializer import Uniform from paddle.fluid.initializer import Uniform
import functools
from ppdet.core.workspace import register from ppdet.core.workspace import register
from .resnet import ResNet
import math
__all__ = ['Hourglass'] __all__ = ['Hourglass']
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册