未验证 提交 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 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import os
import os.path as osp
import re
import json
import glob
import cv2
import numpy as np
from multiprocessing import Pool
from functools import partial
......@@ -80,10 +77,10 @@ def py_cpu_nms_poly_fast(dets, thresh):
polys = []
for i in range(len(dets)):
tm_polygon = [dets[i][0], dets[i][1],
dets[i][2], dets[i][3],
dets[i][4], dets[i][5],
dets[i][6], dets[i][7]]
tm_polygon = [
dets[i][0], dets[i][1], dets[i][2], dets[i][3], dets[i][4],
dets[i][5], dets[i][6], dets[i][7]
]
polys.append(tm_polygon)
polys = np.array(polys)
order = scores.argsort()[::-1]
......@@ -124,7 +121,7 @@ def py_cpu_nms_poly_fast(dets, thresh):
def poly2origpoly(poly, x, y, rate):
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_y = float(poly[i * 2 + 1] + y) / float(rate)
origpoly.append(tmp_x)
......@@ -196,11 +193,14 @@ def merge_single(output_dir, nms, pred_class_lst):
for det in nameboxnmsdict[imgname]:
confidence = det[-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')
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
output_dir: dir of output
......@@ -228,7 +228,8 @@ def dota_generate_test_result(pred_txt_dir, output_dir='output', dota_version='v
pred_classes_lst = []
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]))
# step2: merge
......@@ -241,7 +242,8 @@ def dota_generate_test_result(pred_txt_dir, output_dir='output', dota_version='v
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='dota anno to coco')
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(
'--dota_version',
help='dota_version, v1.0 or v1.5 or v2.0',
......@@ -251,5 +253,6 @@ if __name__ == '__main__':
args = parser.parse_args()
# 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!')
......@@ -17,9 +17,6 @@ import os.path as osp
import json
import glob
import cv2
import numpy as np
from PIL import Image
import logging
import argparse
# add python path of PadleDetection to sys.path
......
......@@ -13,7 +13,6 @@
# limitations under the License.
import os
import sys
import re
import argparse
import pandas as pd
......
......@@ -12,9 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import argparse
import os
import time
import logging
import paddle
......
......@@ -13,7 +13,7 @@
# limitations under the License.
import os
from PIL import Image
import cv2
import math
import numpy as np
......
......@@ -13,12 +13,10 @@
# limitations under the License.
import os
import time
import yaml
import glob
from functools import reduce
from PIL import Image
import cv2
import numpy as np
import math
......
......@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from PIL import Image
import cv2
import numpy as np
......
......@@ -19,7 +19,6 @@ import os
import cv2
import numpy as np
from PIL import Image, ImageDraw
from scipy import ndimage
import math
......
......@@ -25,9 +25,9 @@
* 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
TestDataset:
!ImageFolder
anno_path: annotations/instances_val2017.json
```
\ No newline at end of file
```
......@@ -21,7 +21,6 @@ import os
import sys
import yaml
import copy
import collections
try:
......
......@@ -13,21 +13,19 @@
# limitations under the License.
import os
import copy
import traceback
import six
import sys
import multiprocessing as mp
if sys.version_info >= (3, 0):
import queue as Queue
pass
else:
import Queue
pass
import numpy as np
from paddle.io import DataLoader, DistributedBatchSampler
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 .shm_utils import _get_shared_memory_size_in_M
......
......@@ -14,7 +14,7 @@
import os
import numpy as np
from collections import OrderedDict
try:
from collections.abc import Sequence
except Exception:
......
......@@ -23,8 +23,6 @@ import inspect
import math
from PIL import Image, ImageEnhance
import numpy as np
import os
import sys
import cv2
from copy import deepcopy
......
......@@ -27,7 +27,6 @@ import cv2
import numpy as np
import math
import copy
import os
from ...modeling.keypoint_utils import get_affine_mat_kernel, warp_affine_joints, get_affine_transform, affine_transform
from ppdet.core.workspace import serializable
......
......@@ -31,7 +31,6 @@ import math
from .operators import BaseOperator, register_op
from .batch_operators import Gt2TTFTarget
from ppdet.modeling.bbox_utils import bbox_iou_np_expand
from ppdet.core.workspace import serializable
from ppdet.utils.logger import setup_logger
logger = setup_logger(__name__)
......
......@@ -35,10 +35,9 @@ import os
import copy
import cv2
from PIL import Image, ImageEnhance, ImageDraw
from PIL import Image, ImageDraw
from ppdet.core.workspace import serializable
from ppdet.modeling.layers import AnchorGrid
from ppdet.modeling import bbox_utils
from ..reader import Compose
......@@ -46,7 +45,7 @@ from .op_helper import (satisfy_sample_constraint, filter_and_process,
generate_sample_bbox, clip_bbox, data_anchor_sampling,
satisfy_sample_constraint_coverage, crop_image_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
logger = setup_logger(__name__)
......
......@@ -20,9 +20,7 @@ import os
import sys
import datetime
import six
import numpy as np
import paddle
import paddle.distributed as dist
from ppdet.utils.checkpoint import save_model
......@@ -217,7 +215,8 @@ class VisualDLWriter(Callback):
logger.error('visualdl not found, plaese install visualdl. '
'for example: `pip install visualdl`.')
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_mAP_step = 0
self.vdl_image_step = 0
......
......@@ -17,11 +17,9 @@ from __future__ import division
from __future__ import print_function
import os
import sys
import copy
import time
import random
import datetime
import numpy as np
from PIL import Image
......
from paddle.utils.cpp_extension import CppExtension, CUDAExtension, setup
from paddle.utils.cpp_extension import CUDAExtension, setup
if __name__ == "__main__":
setup(
......
import numpy as np
import os
import sys
import cv2
import time
import shapely
from shapely.geometry import Polygon
import paddle
......
......@@ -150,7 +150,7 @@ def cocoapi_eval(jsonfile,
results_flatten = list(itertools.chain(*results_per_category))
headers = ['category', 'AP'] * (num_columns // 2)
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 += [result for result in results_2d]
table = AsciiTable(table_data)
......
......@@ -12,9 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import six
import os
import numpy as np
import cv2
def get_det_res(bboxes, bbox_nums, image_id, label_to_cat_id_map, bias=0):
......
......@@ -12,10 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import copy
import os
import json
from collections import OrderedDict
from collections import defaultdict
import numpy as np
from pycocotools.coco import COCO
......
......@@ -12,9 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import os.path as osp
import glob
import pkg_resources
try:
......
......@@ -21,7 +21,6 @@ import paddle
import ppdet
import unittest
# NOTE: weights downloading costs time, we choose
# a small model for unittesting
MODEL_NAME = 'ppyolo/ppyolo_tiny_650e_coco'
......
......@@ -16,7 +16,6 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import paddle
from ppdet.core.workspace import register, create
from .meta_arch import BaseArch
......
......@@ -2,7 +2,6 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import paddle
import paddle.nn as nn
from ppdet.core.workspace import register
......
......@@ -19,7 +19,6 @@ from __future__ import print_function
import paddle
from ppdet.core.workspace import register, create
from .meta_arch import BaseArch
import numpy as np
__all__ = ['S2ANet']
......
......@@ -20,10 +20,8 @@ import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from paddle import ParamAttr
from paddle.regularizer import L2Decay
from paddle.nn.initializer import KaimingNormal
from ppdet.core.workspace import register, serializable
from numbers import Integral
from ..shape_spec import ShapeSpec
__all__ = ['BlazeNet']
......
......@@ -15,8 +15,7 @@
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from paddle import ParamAttr
from paddle.regularizer import L2Decay
from ppdet.core.workspace import register, serializable
from ppdet.modeling.ops import batch_norm, mish
from ..shape_spec import ShapeSpec
......
......@@ -17,9 +17,9 @@ import paddle
from paddle import ParamAttr
import paddle.nn as nn
import paddle.nn.functional as F
from paddle.nn import Conv2D, BatchNorm, AdaptiveAvgPool2D, Linear
from paddle.regularizer import L2Decay
from paddle.nn.initializer import Uniform, KaimingNormal
from paddle.nn import AdaptiveAvgPool2D, Linear
from paddle.nn.initializer import Uniform
from ppdet.core.workspace import register, serializable
from numbers import Integral
from ..shape_spec import ShapeSpec
......
......@@ -21,7 +21,7 @@ from paddle.nn.initializer import Normal
from numbers import Integral
import math
from ppdet.core.workspace import register, serializable
from ppdet.core.workspace import register
from ..shape_spec import ShapeSpec
__all__ = ['HRNet']
......
......@@ -16,7 +16,6 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from paddle import ParamAttr
......
......@@ -12,9 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from ppdet.core.workspace import register, serializable
from .resnet import ResNet, Blocks, BasicBlock, BottleNeck
......
......@@ -4,7 +4,6 @@ import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from paddle import ParamAttr
from paddle.regularizer import L2Decay
from paddle.nn import Conv2D, MaxPool2D
from ppdet.core.workspace import register, serializable
from ..shape_spec import ShapeSpec
......
......@@ -14,8 +14,6 @@
import math
import paddle
import paddle.nn.functional as F
import math
import numpy as np
......
......@@ -21,8 +21,6 @@ from paddle.nn.initializer import Normal, XavierUniform, KaimingNormal
from paddle.regularizer import L2Decay
from ppdet.core.workspace import register, create
from ppdet.modeling import ops
from .roi_extractor import RoIAlign
from ..shape_spec import ShapeSpec
from ..bbox_utils import bbox2delta
......
......@@ -15,16 +15,13 @@
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from paddle.nn.initializer import Normal, XavierUniform
from paddle.regularizer import L2Decay
from ppdet.core.workspace import register, create
from ppdet.modeling import ops
from paddle.nn.initializer import Normal
from ppdet.core.workspace import register
from .bbox_head import BBoxHead, TwoFCHead, XConvNormHead
from .roi_extractor import RoIAlign
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']
......
......@@ -12,12 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import numpy as np
import math
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from paddle import ParamAttr
from paddle.nn.initializer import KaimingUniform
from ppdet.core.workspace import register
from ppdet.modeling.losses import CTFocalLoss
......
......@@ -14,11 +14,8 @@
import paddle
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
......
......@@ -14,7 +14,7 @@
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from ppdet.core.workspace import register
from .. import layers as L
from ..backbones.hrnet import BasicBlock
......
......@@ -16,12 +16,9 @@ import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from paddle.nn.initializer import KaimingNormal
from paddle.regularizer import L2Decay
from ppdet.core.workspace import register, create
from ppdet.modeling import ops
from ppdet.modeling.layers import ConvNormLayer
from .roi_extractor import RoIAlign
......
......@@ -16,7 +16,7 @@ import paddle
import paddle.nn as nn
import paddle.nn.functional as F
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 ppdet.core.workspace import register
from ppdet.modeling.layers import DeformableConvV2, LiteConv
......
......@@ -21,7 +21,6 @@ import paddle
import paddle.nn as nn
from paddle import ParamAttr
from paddle import to_tensor
from paddle.nn import Conv2D, BatchNorm2D, GroupNorm
import paddle.nn.functional as F
from paddle.nn.initializer import Normal, Constant, XavierUniform
from paddle.regularizer import L2Decay
......
......@@ -17,7 +17,7 @@ from __future__ import division
from __future__ import print_function
import paddle
import paddle.nn.functional as F
from ppdet.core.workspace import register, serializable
__all__ = ['CTFocalLoss']
......
......@@ -15,7 +15,7 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
......
......@@ -16,11 +16,10 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import paddle
import paddle.nn.functional as F
from ppdet.core.workspace import register, serializable
from .iou_loss import IouLoss
from ..bbox_utils import xywh2xyxy, bbox_iou
from ..bbox_utils import bbox_iou
@register
......
......@@ -19,9 +19,9 @@ from __future__ import print_function
import numpy as np
import paddle
import paddle.nn.functional as F
from ppdet.core.workspace import register, serializable
from ..bbox_utils import xywh2xyxy, bbox_iou
from ..bbox_utils import bbox_iou
__all__ = ['IouLoss', 'GIoULoss', 'DIouLoss']
......
......@@ -20,7 +20,7 @@ from itertools import cycle, islice
from collections import abc
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from ppdet.core.workspace import register, serializable
__all__ = ['HrHRNetLoss', 'KeyPointMSELoss']
......
......@@ -15,7 +15,6 @@
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
__all__ = ['TrackState', 'Track']
......
......@@ -12,15 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import numpy as np
import math
import paddle
import paddle.nn.functional as F
from paddle import ParamAttr
import paddle.nn as nn
from paddle.nn.initializer import KaimingNormal
from ppdet.core.workspace import register, serializable
from ppdet.modeling.layers import ConvNormLayer
from ..shape_spec import ShapeSpec
__all__ = ['BlazeNeck']
......
......@@ -15,8 +15,6 @@
import numpy as np
import math
import paddle
import paddle.nn.functional as F
from paddle import ParamAttr
import paddle.nn as nn
from paddle.nn.initializer import KaimingUniform
from ppdet.core.workspace import register, serializable
......
......@@ -12,13 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import numpy as np
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from paddle import ParamAttr
from paddle.nn.initializer import XavierUniform
from paddle.regularizer import L2Decay
from ppdet.core.workspace import register, serializable
from ppdet.modeling.layers import ConvNormLayer
from ..shape_spec import ShapeSpec
......
......@@ -16,8 +16,7 @@ import paddle
import paddle.nn.functional as F
from paddle import ParamAttr
import paddle.nn as nn
from paddle.regularizer import L2Decay
from ppdet.core.workspace import register, serializable
from ppdet.core.workspace import register
from ..shape_spec import ShapeSpec
__all__ = ['HRFPN']
......
......@@ -17,7 +17,6 @@ import paddle.nn as nn
import paddle.nn.functional as F
from paddle import ParamAttr
from paddle.nn.initializer import Constant, Uniform, Normal, XavierUniform
from paddle import ParamAttr
from ppdet.core.workspace import register, serializable
from paddle.regularizer import L2Decay
from ppdet.modeling.layers import DeformableConvV2, ConvNormLayer, LiteConv
......
......@@ -15,7 +15,6 @@
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from paddle import ParamAttr
from ppdet.core.workspace import register, serializable
from ppdet.modeling.layers import DropBlock
from ..backbones.darknet import ConvBNLayer
......
......@@ -21,12 +21,7 @@ from paddle.regularizer import L2Decay
from paddle.fluid.framework import Variable, in_dygraph_mode
from paddle.fluid import core
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, convert_dtype
import math
import six
import numpy as np
from functools import reduce
from paddle.fluid.data_feeder import check_variable_and_dtype, check_type, check_dtype
__all__ = [
'roi_pool',
......
......@@ -17,7 +17,7 @@ import paddle
import paddle.nn as nn
import paddle.nn.functional as F
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 .transformers import bbox_cxcywh_to_xyxy
try:
......
......@@ -12,15 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import numpy as np
import math
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from ppdet.core.workspace import register
from .. import ops
@register
......
......@@ -12,11 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import numpy as np
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from ppdet.core.workspace import register, serializable
from .. import ops
......
......@@ -16,11 +16,8 @@ import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from paddle.nn.initializer import Normal
from paddle.regularizer import L2Decay
from ppdet.core.workspace import register
from ppdet.modeling import ops
from .anchor_generator import AnchorGenerator
from .target_layer import RPNTargetAssign
from .proposal_generator import ProposalGenerator
......
......@@ -12,12 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import six
import math
import numpy as np
import paddle
from ..bbox_utils import bbox2delta, bbox_overlaps
import copy
def rpn_anchor_target(anchors,
......
......@@ -17,7 +17,6 @@ import math
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from paddle import ParamAttr
from paddle.nn.initializer import KaimingUniform, Uniform
from ppdet.core.workspace import register
from ppdet.modeling.heads.centernet_head import ConvLayer
......
......@@ -16,7 +16,6 @@ from __future__ import print_function
import unittest
import contextlib
import numpy as np
import paddle
import paddle.fluid as fluid
......
......@@ -24,7 +24,6 @@ import numpy as np
import paddle
import paddle.fluid as fluid
from paddle.fluid.framework import Program, program_guard
from paddle.fluid.dygraph import base
import ppdet.modeling.ops as ops
......
......@@ -15,13 +15,9 @@
from __future__ import division
import unittest
import numpy as np
from scipy.special import logit
from scipy.special import expit
import paddle
from paddle import fluid
from paddle.fluid import core
# add python path of PadleDetection to sys.path
import os
import sys
......@@ -31,7 +27,6 @@ if parent_path not in sys.path:
from ppdet.modeling.losses import YOLOv3Loss
from ppdet.data.transform.op_helper import jaccard_overlap
import random
import numpy as np
......
......@@ -17,14 +17,11 @@ from __future__ import division
from __future__ import print_function
import math
import copy
import paddle
import paddle.nn as nn
import paddle.optimizer as optimizer
from paddle.optimizer.lr import CosineAnnealingDecay
import paddle.regularizer as regularizer
from paddle import cos
from ppdet.core.workspace import register, serializable
......
......@@ -20,12 +20,11 @@ import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from ppdet.core.workspace import register, serializable, load_config
from ppdet.core.workspace import create
from ppdet.utils.logger import setup_logger
from ppdet.core.workspace import register, create, load_config
from ppdet.modeling import ops
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__)
......
......@@ -16,7 +16,6 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import paddle
from paddle.utils import try_import
from ppdet.core.workspace import register, serializable
......
......@@ -20,7 +20,6 @@ from __future__ import unicode_literals
import errno
import os
import time
import re
import numpy as np
import paddle
import paddle.nn as nn
......
......@@ -29,10 +29,10 @@ import binascii
import tarfile
import zipfile
from .voc_utils import create_list
from ppdet.core.workspace import BASE_KEY
from .logger import setup_logger
from .voc_utils import create_list
logger = setup_logger(__name__)
__all__ = [
......
......@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import functools
import logging
import os
import sys
......
......@@ -14,7 +14,6 @@
import collections
import numpy as np
import datetime
__all__ = ['SmoothedValue', 'TrainingStats']
......
......@@ -20,7 +20,6 @@ from __future__ import unicode_literals
import numpy as np
from PIL import Image, ImageDraw
import cv2
import os
import math
from .colormap import colormap
......
......@@ -20,7 +20,6 @@ import os
import os.path as osp
import re
import random
import shutil
__all__ = ['create_list']
......
......@@ -15,10 +15,9 @@
import os
import time
from functools import reduce
import base64
import cv2
import numpy as np
from paddlehub.module.module import moduleinfo, serving
from paddlehub.module.module import moduleinfo
import blazeface.data_feed as D
......
......@@ -15,11 +15,9 @@
import os
import time
from functools import reduce
import base64
import cv2
import numpy as np
from paddlehub.module.module import moduleinfo, serving
from paddlehub.module.module import moduleinfo
import solov2.processor as P
import solov2.data_feed as D
......
......@@ -13,10 +13,8 @@
# limitations under the License.
import os
import cv2
import json
import math
import numpy as np
import argparse
HAT_SCALES = {
'1.png': [3.0, 0.9, .0],
......
......@@ -13,7 +13,6 @@
# limitations under the License.
import os
import time
import base64
import json
......@@ -21,8 +20,7 @@ import cv2
import numpy as np
import paddle.nn as nn
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
......
......@@ -16,7 +16,7 @@ from __future__ import division
import cv2
import numpy as np
from PIL import Image, ImageDraw
from PIL import Image
import solov2_blazeface.face_makeup_main as face_makeup_main
......
......@@ -12,12 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle
import paddlehub as hub
import cv2
from PIL import Image
import numpy as np
import base64
img_file = 'demo_images/test.jpg'
background = 'element_source/background/1.png'
......
......@@ -16,7 +16,9 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3)))
if parent_path not in sys.path:
......@@ -28,7 +30,6 @@ import yaml
import ast
from functools import reduce
from PIL import Image
import cv2
import numpy as np
import paddle
......@@ -508,7 +509,7 @@ def predict_video(detector, camera_id):
fps = 30
width = int(capture.get(cv2.CAP_PROP_FRAME_WIDTH))
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):
os.makedirs(FLAGS.output_dir)
out_path = os.path.join(FLAGS.output_dir, video_name)
......
......@@ -18,7 +18,6 @@ from __future__ import division
import cv2
import numpy as np
from PIL import Image, ImageDraw
from scipy import ndimage
def visualize_box_mask(im, results, labels, mask_resolution=14, threshold=0.5):
......
......@@ -18,11 +18,6 @@
#
import os
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("../../"))
......
......@@ -31,7 +31,6 @@ import uuid
import logging
import signal
import threading
import traceback
logger = logging.getLogger(__name__)
......
......@@ -17,7 +17,6 @@ from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
import six
if six.PY3:
import pickle
......
......@@ -24,7 +24,6 @@ import os
import time
import math
import struct
import sys
import six
if six.PY3:
......@@ -32,7 +31,6 @@ if six.PY3:
else:
import cPickle as pickle
import json
import uuid
import random
import numpy as np
......
......@@ -23,8 +23,6 @@ import inspect
import math
from PIL import Image, ImageEnhance
import numpy as np
import os
import sys
import cv2
from copy import deepcopy
......
......@@ -20,8 +20,8 @@ import math
import paddle.fluid as fluid
from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.initializer import Normal, Constant, NumpyArrayInitializer
from paddle.fluid.regularizer import L2Decay
from paddle.fluid.initializer import Normal, Constant
from ppdet.modeling.ops import ConvNorm, DeformConvNorm
from ppdet.modeling.ops import MultiClassNMS
......
......@@ -19,7 +19,6 @@ from __future__ import print_function
import paddle
from paddle import fluid
from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.regularizer import L2Decay
from ppdet.modeling.ops import ConvNorm, DeformConvNorm, MaskMatrixNMS, DropBlock
from ppdet.core.workspace import register
......
......@@ -25,7 +25,6 @@ from paddle.fluid.initializer import Normal, Constant, Uniform, Xavier
from paddle.fluid.regularizer import L2Decay
from ppdet.core.workspace import register
from ppdet.modeling.ops import DeformConv, DropBlock, ConvNorm
from ppdet.modeling.losses import GiouLoss
__all__ = ['TTFHead', 'TTFLiteHead']
......
......@@ -22,8 +22,7 @@ from paddle import fluid
from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.regularizer import L2Decay
from ppdet.modeling.ops import MultiClassNMS, MultiClassSoftNMS, MatrixNMS
from ppdet.modeling.losses.yolo_loss import YOLOv3Loss
from ppdet.modeling.ops import MultiClassNMS, MultiClassSoftNMS
from ppdet.core.workspace import register
from ppdet.modeling.ops import DropBlock
from .iou_aware import get_iou_aware_score
......
......@@ -16,7 +16,6 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from collections import OrderedDict
from paddle import fluid
......
......@@ -17,7 +17,6 @@ from __future__ import division
from __future__ import print_function
import numpy as np
import sys
from collections import OrderedDict
import copy
......
......@@ -21,7 +21,6 @@ from collections import OrderedDict
from paddle import fluid
from ppdet.core.workspace import register
import numpy as np
from ppdet.utils.check import check_version
__all__ = ['CornerNetSqueeze']
......
......@@ -16,7 +16,6 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from collections import OrderedDict
from paddle import fluid
......
......@@ -18,13 +18,9 @@ from __future__ import print_function
from collections import OrderedDict
import copy
import numpy as np
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.utils.check import check_version
......
......@@ -16,14 +16,10 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
from collections import OrderedDict
from paddle import fluid
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
......
......@@ -17,7 +17,6 @@ from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import paddle
import paddle.fluid as fluid
from paddle.fluid import ParamAttr
from paddle.fluid.initializer import ConstantInitializer
......
......@@ -20,10 +20,7 @@ from paddle import fluid
from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.initializer import Uniform
import functools
from ppdet.core.workspace import register
from .resnet import ResNet
import math
__all__ = ['Hourglass']
......
......@@ -20,8 +20,6 @@ from collections import OrderedDict
from paddle import fluid
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
......
......@@ -28,8 +28,6 @@ from numbers import Integral
from paddle.fluid.initializer import MSRA
import math
from .name_adapter import NameAdapter
__all__ = ['HRNet']
......
......@@ -22,10 +22,7 @@ import paddle.fluid as fluid
from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.regularizer import L2Decay
import math
import numpy as np
from collections import OrderedDict
from ppdet.core.workspace import register
from numbers import Integral
......
......@@ -16,20 +16,11 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import OrderedDict
from paddle import fluid
from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.framework import Variable
from paddle.fluid.regularizer import L2Decay
from paddle.fluid.initializer import Constant
from ppdet.core.workspace import register, serializable
from numbers import Integral
from .nonlocal_helper import add_space_nonlocal
from .name_adapter import NameAdapter
from .resnet import ResNet, ResNetC5
from .resnet import ResNet
__all__ = ['Res2Net', 'Res2NetC5']
......
......@@ -15,9 +15,6 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.initializer import NumpyArrayInitializer
from paddle import fluid
from ppdet.core.workspace import register, serializable
......
......@@ -18,7 +18,6 @@ from __future__ import print_function
from paddle import fluid
from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.initializer import Normal, Constant, NumpyArrayInitializer
from ppdet.core.workspace import register, serializable
INF = 1e8
......
......@@ -15,9 +15,6 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.initializer import NumpyArrayInitializer
from paddle import fluid
from ppdet.core.workspace import register, serializable
......
......@@ -16,9 +16,6 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.initializer import NumpyArrayInitializer
from paddle import fluid
from ppdet.core.workspace import register, serializable
......
......@@ -14,7 +14,6 @@
import paddle.fluid as fluid
from paddle.fluid.layer_helper import LayerHelper
from paddle.fluid.framework import Variable
import paddle.fluid.layers as layers
from paddle.fluid.layers import (tensor, iou_similarity, bipartite_match,
target_assign, box_coder)
......
......@@ -17,12 +17,10 @@ from __future__ import division
from __future__ import print_function
import paddle.fluid as fluid
from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.initializer import Normal, Xavier
from paddle.fluid.initializer import Normal
from paddle.fluid.regularizer import L2Decay
from paddle.fluid.initializer import MSRA
from ppdet.modeling.ops import MultiClassNMS
from ppdet.modeling.ops import ConvNorm
from ppdet.modeling.losses import SmoothL1Loss
from ppdet.core.workspace import register
......
......@@ -17,12 +17,8 @@ from __future__ import division
from __future__ import print_function
from paddle import fluid
from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.initializer import MSRA
from paddle.fluid.regularizer import L2Decay
from ppdet.core.workspace import register
from ppdet.modeling.ops import ConvNorm
__all__ = ['FusedSemanticHead']
......
......@@ -17,10 +17,8 @@ from __future__ import division
from __future__ import print_function
import unittest
import numpy as np
import paddle
import paddle.fluid as fluid
import os
import sys
# add python path of PadleDetection to sys.path
......@@ -29,9 +27,9 @@ if parent_path not in sys.path:
sys.path.append(parent_path)
try:
from ppdet.utils.check import enable_static_mode, logger
from ppdet.modeling.tests.decorator_helper import prog_scope
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.check import enable_static_mode
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
......
......@@ -19,8 +19,6 @@ from __future__ import print_function
import logging
import numpy as np
import paddle.fluid as fluid
__all__ = ["bbox_overlaps", "box_to_delta"]
logger = logging.getLogger(__name__)
......
......@@ -24,7 +24,7 @@ import time
import paddle.fluid as fluid
from .voc_eval import bbox_eval as voc_bbox_eval
from .post_process import mstest_box_post_process, mstest_mask_post_process, box_flip
from .post_process import mstest_box_post_process, mstest_mask_post_process
__all__ = ['parse_fetches', 'eval_run', 'eval_results', 'json_eval_results']
......
......@@ -18,7 +18,6 @@ from __future__ import print_function
import os
import yaml
import numpy as np
from collections import OrderedDict
import logging
......
......@@ -17,10 +17,6 @@ from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import numpy as np
from .coco_eval import bbox2out
import logging
......
......@@ -19,7 +19,6 @@ from __future__ import print_function
import logging
import numpy as np
import cv2
import paddle.fluid as fluid
__all__ = ['nms']
......
......@@ -18,8 +18,6 @@ from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import numpy as np
from ..data.source.voc import pascalvoc_label
from .map_utils import DetectionMAP
......
......@@ -20,7 +20,6 @@ import os
import os.path as osp
import re
import random
import shutil
__all__ = ['create_list']
......
......@@ -20,7 +20,6 @@ import os
import numpy as np
from ppdet.data.source.widerface import widerface_label
from ppdet.utils.coco_eval import bbox2out
import logging
logger = logging.getLogger(__name__)
......
......@@ -16,7 +16,9 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3)))
if parent_path not in sys.path:
......@@ -27,11 +29,9 @@ FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
import numpy as np
from collections import OrderedDict
from paddleslim.dist.single_distiller import merge, l2_loss
import paddle
from paddle import fluid
try:
......
......@@ -16,7 +16,8 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 4)))
......@@ -28,13 +29,11 @@ FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
import numpy as np
from collections import OrderedDict
from paddleslim.dist.single_distiller import merge, l2_loss
from paddleslim.dist.single_distiller import merge
from paddleslim.prune import Pruner
from paddleslim.analysis import flops
import paddle
from paddle import fluid
try:
......
......@@ -17,8 +17,6 @@ from __future__ import division
from __future__ import print_function
import numpy as np
import paddle.fluid as fluid
from paddle.fluid.param_attr import ParamAttr
from paddleslim.nas.search_space.search_space_base import SearchSpaceBase
from paddleslim.nas.search_space.search_space_registry import SEARCHSPACE
from ppdet.modeling.backbones.blazenet import BlazeNet
......
......@@ -16,7 +16,9 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3)))
if parent_path not in sys.path:
......@@ -27,7 +29,6 @@ import numpy as np
import datetime
from collections import deque
import paddle
from paddle import fluid
import logging
......@@ -61,7 +62,6 @@ except ImportError as e:
from paddleslim.analysis import flops, TableLatencyEvaluator
from paddleslim.nas import SANAS
import search_space
@register
......
......@@ -16,14 +16,14 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3)))
if parent_path not in sys.path:
sys.path.append(parent_path)
import paddle
import paddle.fluid as fluid
from paddleslim.prune import Pruner
from paddleslim.analysis import flops
......
......@@ -16,13 +16,14 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3)))
if parent_path not in sys.path:
sys.path.append(parent_path)
import paddle
from paddle import fluid
import logging
......
......@@ -16,7 +16,9 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
......@@ -26,7 +28,6 @@ import glob
import numpy as np
from PIL import Image
import paddle
from paddle import fluid
from paddleslim.prune import Pruner
from paddleslim.analysis import flops
......
......@@ -16,7 +16,8 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3)))
......@@ -29,7 +30,6 @@ import datetime
from collections import deque
from paddleslim.prune import Pruner
from paddleslim.analysis import flops
import paddle
from paddle import fluid
import logging
......
......@@ -16,14 +16,14 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3)))
if parent_path not in sys.path:
sys.path.append(parent_path)
import paddle
import paddle.fluid as fluid
import logging
......
......@@ -16,7 +16,9 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3)))
if parent_path not in sys.path:
......@@ -27,7 +29,6 @@ FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
import paddle
from paddle import fluid
try:
......
......@@ -16,17 +16,17 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3)))
if parent_path not in sys.path:
sys.path.append(parent_path)
import glob
import numpy as np
from PIL import Image
import paddle
from paddle import fluid
import logging
......
......@@ -12,10 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import paddle
import paddle.fluid as fluid
from paddleslim.quant import quant_aware, convert
import numpy as np
from paddle.fluid.layer_helper import LayerHelper
......
......@@ -16,7 +16,9 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3)))
if parent_path not in sys.path:
......@@ -28,7 +30,6 @@ import datetime
from collections import deque
import shutil
import paddle
from paddle import fluid
import logging
......@@ -58,7 +59,7 @@ except ImportError as e:
else:
raise e
from paddleslim.quant import quant_aware, convert
from paddleslim.quant import quant_aware
from pact import pact, get_optimizer
......
......@@ -16,29 +16,22 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3)))
if parent_path not in sys.path:
sys.path.append(parent_path)
import time
import numpy as np
import datetime
from collections import deque
import paddle
from paddle import fluid
from ppdet.experimental import mixed_precision_context
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.data.reader import create_reader
from ppdet.utils import dist_utils
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results
from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.utils.check import check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint
from paddleslim.prune import sensitivity
import logging
......
......@@ -29,7 +29,6 @@ logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
from scipy.cluster.vq import kmeans
import random
import numpy as np
from tqdm import tqdm
......
......@@ -17,7 +17,7 @@ from __future__ import print_function
import os
import sys
from argparse import ArgumentParser, RawDescriptionHelpFormatter
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
......@@ -114,8 +114,9 @@ def list_modules(**kwargs):
print("")
max_len = max([len(mod.name) for mod in modules])
for mod in modules:
print(color_tty.green(mod.name.ljust(max_len)),
mod.doc.split('\n')[0])
print(
color_tty.green(mod.name.ljust(max_len)),
mod.doc.split('\n')[0])
print("")
......
......@@ -16,13 +16,14 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
sys.path.append(parent_path)
import paddle
import paddle.fluid as fluid
import logging
......
......@@ -23,7 +23,6 @@ parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
sys.path.append(parent_path)
import paddle
from paddle import fluid
import logging
......
......@@ -16,14 +16,14 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
sys.path.append(parent_path)
import yaml
import paddle
from paddle import fluid
import logging
......
......@@ -23,7 +23,6 @@ parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
sys.path.append(parent_path)
import paddle
import paddle.fluid as fluid
import numpy as np
import cv2
......
......@@ -16,7 +16,9 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
......@@ -27,7 +29,6 @@ import numpy as np
import six
from PIL import Image, ImageOps
import paddle
from paddle import fluid
import logging
......
......@@ -16,7 +16,9 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
......@@ -30,7 +32,6 @@ import six
from collections import deque
from paddle.fluid import profiler
import paddle
from paddle import fluid
from paddle.fluid.layers.learning_rate_scheduler import _decay_step_counter
from paddle.fluid.optimizer import ExponentialMovingAverage
......
......@@ -16,7 +16,9 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
......@@ -33,7 +35,6 @@ import random
import datetime
import six
from collections import deque
import paddle
from paddle.fluid import profiler
from paddle import fluid
......
......@@ -19,11 +19,9 @@ import glob
import json
import os
import os.path as osp
import sys
import shutil
import xml.etree.ElementTree as ET
from tqdm import tqdm
import re
import numpy as np
import PIL.ImageDraw
......
......@@ -27,13 +27,12 @@ from ppdet.utils.logger import setup_logger
logger = setup_logger('ppdet.anchor_cluster')
from scipy.cluster.vq import kmeans
import random
import numpy as np
from tqdm import tqdm
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.core.workspace import load_config, merge_config
class BaseAnchorCluster(object):
......
......@@ -16,7 +16,9 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
......
......@@ -15,7 +15,10 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
......@@ -24,7 +27,6 @@ if parent_path not in sys.path:
# ignore warning log
import warnings
warnings.filterwarnings('ignore')
import glob
import paddle
from paddle.distributed import ParallelEnv
......
......@@ -15,7 +15,10 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
......
......@@ -15,7 +15,10 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
......
......@@ -15,7 +15,10 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
......@@ -24,7 +27,6 @@ if parent_path not in sys.path:
# ignore warning log
import warnings
warnings.filterwarnings('ignore')
import glob
import paddle
from paddle.distributed import ParallelEnv
......
......@@ -16,22 +16,21 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import os
import sys
# add python path of PadleDetection to sys.path
parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
sys.path.append(parent_path)
import random
import numpy as np
# ignore warning log
import warnings
warnings.filterwarnings('ignore')
import paddle
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.checkpoint import load_weight
from ppdet.core.workspace import load_config, merge_config
from ppdet.engine import Trainer, init_parallel_env, set_random_seed, init_fleet_env
from ppdet.slim import build_slim_model
......
......@@ -19,11 +19,9 @@ import glob
import json
import os
import os.path as osp
import sys
import shutil
import xml.etree.ElementTree as ET
from tqdm import tqdm
import re
import numpy as np
import PIL.ImageDraw
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册