未验证 提交 f3caf39c 编写于 作者: K Kaipeng Deng 提交者: GitHub

unify setup_logger (#1928)

上级 48ddaa99
......@@ -14,11 +14,11 @@
import os
import numpy as np
import logging
from ppdet.core.workspace import register, serializable
from .dataset import DetDataset
logger = logging.getLogger(__name__)
from ppdet.utils.logger import setup_logger
logger = setup_logger(__name__)
@register
......
......@@ -20,8 +20,9 @@ import xml.etree.ElementTree as ET
from ppdet.core.workspace import register, serializable
from .dataset import DetDataset
import logging
logger = logging.getLogger(__name__)
from ppdet.utils.logger import setup_logger
logger = setup_logger(__name__)
@register
......
......@@ -14,12 +14,13 @@
import os
import numpy as np
import logging
logger = logging.getLogger(__name__)
from ppdet.core.workspace import register, serializable
from .dataset import DataSet
from ppdet.utils.logger import setup_logger
logger = setup_logger(__name__)
@register
@serializable
......
......@@ -21,14 +21,14 @@ try:
except Exception:
from collections import Sequence
import logging
import cv2
import numpy as np
from .operator import register_op, BaseOperator, ResizeOp
from .op_helper import jaccard_overlap, gaussian2D
from scipy import ndimage
logger = logging.getLogger(__name__)
from ppdet.utils.logger import setup_logger
logger = setup_logger(__name__)
__all__ = [
'PadBatchOp',
......
......@@ -21,14 +21,14 @@ try:
except Exception:
from collections import Sequence
import logging
import cv2
import numpy as np
from .operator import register_op, BaseOperator
from .op_helper import jaccard_overlap, gaussian2D
from .operators import NormalizeImage, Permute
logger = logging.getLogger(__name__)
from ppdet.utils.logger import setup_logger
logger = setup_logger(__name__)
__all__ = [
'PadBatch',
......
......@@ -28,7 +28,6 @@ except Exception:
from numbers import Number, Integral
import uuid
import logging
import random
import math
import numpy as np
......@@ -47,7 +46,8 @@ from .op_helper import (satisfy_sample_constraint, filter_and_process,
generate_sample_bbox_square, bbox_area_sampling,
is_poly, gaussian_radius, draw_gaussian)
logger = logging.getLogger(__name__)
from ppdet.utils.logger import setup_logger
logger = setup_logger(__name__)
registered_ops = []
......
......@@ -28,7 +28,6 @@ except Exception:
from numbers import Number
import uuid
import logging
import random
import math
import numpy as np
......@@ -47,7 +46,8 @@ from .op_helper import (satisfy_sample_constraint, filter_and_process,
generate_sample_bbox_square, bbox_area_sampling,
is_poly, gaussian_radius, draw_gaussian)
logger = logging.getLogger(__name__)
from ppdet.utils.logger import setup_logger
logger = setup_logger(__name__)
@register_op
......
......@@ -17,8 +17,6 @@ from __future__ import division
from __future__ import print_function
import math
import logging
import paddle
import paddle.nn as nn
......@@ -30,7 +28,8 @@ from ppdet.core.workspace import register, serializable
__all__ = ['LearningRate', 'OptimizerBuilder']
logger = logging.getLogger(__name__)
from ppdet.utils.logger import setup_logger
logger = setup_logger(__name__)
@serializable
......
......@@ -16,12 +16,12 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import numpy as np
__all__ = ["bbox_overlaps", "box_to_delta"]
from .logger import setup_logger
logger = setup_logger(__name__)
logger = logging.getLogger(__name__)
__all__ = ["bbox_overlaps", "box_to_delta"]
def bbox_overlaps(boxes_1, boxes_2):
......
......@@ -19,10 +19,11 @@ from __future__ import print_function
import sys
import paddle
import logging
import six
import paddle.version as fluid_version
logger = logging.getLogger(__name__)
from .logger import setup_logger
logger = setup_logger(__name__)
__all__ = ['check_gpu', 'check_version', 'check_config']
......
......@@ -24,8 +24,9 @@ import re
import numpy as np
import paddle
from .download import get_weights_path
import logging
logger = logging.getLogger(__name__)
from .logger import setup_logger
logger = setup_logger(__name__)
def is_url(path):
......
......@@ -23,8 +23,8 @@ import json
import cv2
import numpy as np
import logging
logger = logging.getLogger(__name__)
from .logger import setup_logger
logger = setup_logger(__name__)
__all__ = [
'bbox_eval',
......
......@@ -27,8 +27,8 @@ import zipfile
from .voc_utils import create_list
import logging
logger = logging.getLogger(__name__)
from .logger import setup_logger
logger = setup_logger(__name__)
__all__ = [
'get_weights_path', 'get_dataset_path', 'download_dataset',
......
......@@ -6,8 +6,9 @@ import os
import sys
import json
from ppdet.py_op.post_process import get_det_res, get_seg_res
import logging
logger = logging.getLogger(__name__)
from .logger import setup_logger
logger = setup_logger(__name__)
def json_eval_results(metric, json_directory=None, dataset=None):
......
......@@ -19,8 +19,9 @@ from __future__ import unicode_literals
import sys
import numpy as np
import logging
logger = logging.getLogger(__name__)
from .logger import setup_logger
logger = setup_logger(__name__)
__all__ = ['bbox_area', 'jaccard_overlap', 'DetectionMAP']
......
......@@ -16,13 +16,13 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import numpy as np
import cv2
__all__ = ['nms']
from .logger import setup_logger
logger = setup_logger(__name__)
logger = logging.getLogger(__name__)
__all__ = ['nms']
def box_flip(boxes, im_shape):
......
......@@ -25,8 +25,8 @@ from ..data.source.voc import pascalvoc_label
from .map_utils import DetectionMAP
from .coco_eval import bbox2out
import logging
logger = logging.getLogger(__name__)
from .logger import setup_logger
logger = setup_logger(__name__)
__all__ = ['bbox_eval', 'bbox2out', 'get_category_info']
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册