add license

own
michaelowenliu 3 years ago
parent 8824551d6f
commit cdb5e7beaf
  1. 1
      paddlers/custom_models/cd/backbones/resnet.py
  2. 1
      paddlers/custom_models/gan/generators/builder.py
  3. 1
      paddlers/custom_models/gan/generators/rcan.py
  4. 2
      paddlers/custom_models/seg/farseg.py
  5. 4
      paddlers/datasets/coco.py
  6. 1
      paddlers/datasets/seg_dataset.py
  7. 4
      paddlers/datasets/voc.py
  8. 1
      paddlers/deploy/predictor.py
  9. 2
      paddlers/tasks/base.py
  10. 4
      paddlers/tasks/classifier.py
  11. 1
      paddlers/tasks/image_restorer.py
  12. 4
      paddlers/tasks/load_model.py
  13. 2
      paddlers/tasks/object_detector.py
  14. 4
      paddlers/tasks/segmenter.py
  15. 1
      paddlers/tasks/utils/visualize.py
  16. 2
      paddlers/tools/yolo_cluster.py
  17. 4
      paddlers/transforms/batch_operators.py
  18. 3
      paddlers/transforms/functions.py
  19. 2
      paddlers/transforms/operators.py
  20. 2
      paddlers/utils/checkpoint.py
  21. 2
      paddlers/utils/download.py
  22. 1
      paddlers/utils/env.py
  23. 1
      paddlers/utils/logging.py
  24. 2
      paddlers/utils/stats.py
  25. 2
      paddlers/utils/utils.py
  26. 8
      tools/coco2mask.py
  27. 22
      tools/coco_tools/json_AnnoSta.py
  28. 22
      tools/coco_tools/json_Img2Json.py
  29. 21
      tools/coco_tools/json_ImgSta.py
  30. 21
      tools/coco_tools/json_InfoShow.py
  31. 21
      tools/coco_tools/json_Merge.py
  32. 22
      tools/coco_tools/json_Split.py
  33. 4
      tools/mask2geojson.py
  34. 7
      tools/mask2shp.py
  35. 6
      tools/matcher.py
  36. 7
      tools/oif.py
  37. 2
      tools/spliter.py
  38. 4
      tools/utils/raster.py

@ -33,7 +33,6 @@ from __future__ import print_function
import paddle
import paddle.nn as nn
from paddle.utils.download import get_weights_path_from_url
__all__ = []

@ -13,6 +13,7 @@
# limitations under the License.
import copy
from ....models.ppgan.utils.registry import Registry
GENERATORS = Registry("GENERATOR")

@ -1,5 +1,6 @@
# base on https://github.com/kongdebug/RCAN-Paddle
import math
import paddle
import paddle.nn as nn

@ -18,11 +18,13 @@ Apache License [see LICENSE for details]
"""
import math
import paddle.nn as nn
import paddle.nn.functional as F
from paddle.vision.models import resnet50
from paddle import nn
import paddle.nn.functional as F
from .layers import (Identity, ConvReLU, kaiming_normal_init, constant_init)

@ -17,9 +17,11 @@ import copy
import os
import os.path as osp
import random
import numpy as np
from collections import OrderedDict
import numpy as np
from paddle.io import Dataset
from paddlers.utils import logging, get_num_workers, get_encoding, path_normalization, is_pic
from paddlers.transforms import ImgDecoder, MixupImage
from paddlers.tools import YOLOAnchorCluster

@ -16,6 +16,7 @@ import os.path as osp
import copy
from paddle.io import Dataset
from paddlers.utils import logging, get_num_workers, get_encoding, path_normalization, is_pic

@ -18,10 +18,12 @@ import os
import os.path as osp
import random
import re
import numpy as np
from collections import OrderedDict
import xml.etree.ElementTree as ET
import numpy as np
from paddle.io import Dataset
from paddlers.utils import logging, get_num_workers, get_encoding, path_normalization, is_pic
from paddlers.transforms import ImgDecoder, MixupImage
from paddlers.tools import YOLOAnchorCluster

@ -18,6 +18,7 @@ import numpy as np
from paddle.inference import Config
from paddle.inference import create_predictor
from paddle.inference import PrecisionType
from paddlers.tasks import load_model
from paddlers.utils import logging, Timer

@ -20,11 +20,13 @@ import copy
import math
import yaml
import json
import paddle
from paddle.io import DataLoader, DistributedBatchSampler
from paddleslim import QAT
from paddleslim.analysis import flops
from paddleslim import L1NormFilterPruner, FPGMFilterPruner
import paddlers
from paddlers.transforms import arrange_transforms
from paddlers.utils import (seconds_to_hms, get_single_card_bs, dict2str,

@ -14,11 +14,13 @@
import math
import os.path as osp
import numpy as np
from collections import OrderedDict
import numpy as np
import paddle
import paddle.nn.functional as F
from paddle.static import InputSpec
import paddlers.models.ppcls as paddleclas
import paddlers.custom_models.cls as cmcls
import paddlers

@ -14,7 +14,6 @@
import os
import time
import datetime
import paddle

@ -13,10 +13,12 @@
# limitations under the License.
import os.path as osp
import numpy as np
import yaml
import numpy as np
import paddle
import paddleslim
import paddlers
import paddlers.utils.logging as logging
from paddlers.transforms import build_transforms

@ -18,9 +18,11 @@ import collections
import copy
import os
import os.path as osp
import numpy as np
import paddle
from paddle.static import InputSpec
import paddlers.models.ppdet as ppdet
from paddlers.models.ppdet.modeling.proposal_generator.target_layer import BBoxAssigner, MaskAssigner
import paddlers

@ -14,12 +14,14 @@
import math
import os.path as osp
from collections import OrderedDict
import numpy as np
import cv2
from collections import OrderedDict
import paddle
import paddle.nn.functional as F
from paddle.static import InputSpec
import paddlers.models.ppseg as paddleseg
import paddlers.custom_models.seg as cmseg
import paddlers

@ -16,6 +16,7 @@ import os
import cv2
import numpy as np
import time
import paddlers.utils.logging as logging
from paddlers.utils import is_pic
from .det_metrics.coco_utils import loadRes

@ -14,9 +14,11 @@
import copy
import os
import numpy as np
from tqdm import tqdm
from scipy.cluster.vq import kmeans
from paddlers.utils import logging
__all__ = ['YOLOAnchorCluster']

@ -14,12 +14,14 @@
import traceback
import random
import numpy as np
try:
from collections.abc import Sequence
except Exception:
from collections import Sequence
import numpy as np
from paddle.fluid.dataloader.collate import default_collate_fn
from .operators import Transform, Resize, ResizeByShort, _Permute, interp_dict
from .box_utils import jaccard_overlap
from paddlers.utils import logging

@ -13,8 +13,9 @@
# limitations under the License.
import cv2
import numpy as np
import copy
import numpy as np
import shapely.ops
from shapely.geometry import Polygon, MultiPolygon, GeometryCollection
from sklearn.decomposition import PCA

@ -27,8 +27,8 @@ import numpy as np
import cv2
import imghdr
from PIL import Image
import paddlers
import paddlers
from .functions import normalize, horizontal_flip, permute, vertical_flip, center_crop, is_poly, \
horizontal_flip_poly, horizontal_flip_rle, vertical_flip_poly, vertical_flip_rle, crop_poly, \
crop_rle, expand_poly, expand_rle, resize_poly, resize_rle, de_haze, pca, select_bands, \

@ -14,8 +14,10 @@
import os
import os.path as osp
import glob
import paddle
from . import logging
from .download import download_and_decompress

@ -21,8 +21,10 @@ import time
import hashlib
import tarfile
import zipfile
import filelock
import paddle
from . import logging
DOWNLOAD_RETRY_LIMIT = 3

@ -16,6 +16,7 @@ import os
import platform
import random
import multiprocessing as mp
import numpy as np
import paddle

@ -15,6 +15,7 @@
import time
import os
import sys
import colorama
from colorama import init
import paddle

@ -13,9 +13,9 @@
# limitations under the License.
import collections
import numpy as np
import datetime
import numpy as np
class SmoothedValue(object):
"""Track a series of values and provide access to smoothed values over a

@ -20,7 +20,9 @@ import math
import imghdr
import chardet
import json
import numpy as np
from . import logging
import platform
import paddlers

@ -15,14 +15,16 @@
import os
import os.path as osp
import shutil
import cv2
import numpy as np
import json
import argparse
from collections import defaultdict
import cv2
import numpy as np
import glob
from tqdm import tqdm
from PIL import Image
from collections import defaultdict
from utils import Timer

@ -1,10 +1,17 @@
# -*- coding: utf-8 -*-
# @File : json_annotations_sta.py
# @Author : zhaoHL
# @Contact : huilin16@qq.com
# @Time Create First: 2021/8/1 10:25
# @Contributor : zhaoHL
# @Time Modify Last : 2021/8/1 10:25
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
'''
@File Description:
# json文件annotations信息,生成统计结果csv,对象框shape、对象看shape比例、对象框起始位置、对象结束位置、对象结束位置、对象类别、单个图像对象数量的分布
@ -22,6 +29,7 @@ python ./coco_tools/json_AnnoSta.py \
import os
import json
import argparse
import numpy as np
import pandas as pd
import seaborn as sns

@ -1,10 +1,17 @@
# -*- coding: utf-8 -*-
# @File : json_getTest.py
# @Author : zhaoHL
# @Contact : huilin16@qq.com
# @Time Create First: 2021/8/1 10:25
# @Contributor : zhaoHL
# @Time Modify Last : 2021/8/1 10:25
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
'''
@File Description:
# 根据test影像文件夹生成test.json
@ -16,6 +23,7 @@ python ./coco_tools/json_Img2Json.py \
import os, cv2
import json
import argparse
from tqdm import tqdm

@ -1,10 +1,17 @@
# -*- coding: utf-8 -*-
# @File : json_images_sta.py
# @Author : zhaoHL
# @Contact : huilin16@qq.com
# @Time Create First: 2021/8/1 10:25
# @Contributor : zhaoHL
# @Time Modify Last : 2021/8/1 10:25
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
'''
@File Description:
# 统计json文件images信息,生成统计结果csv,同时生成图像shape、图像shape比例的二维分布图

@ -1,10 +1,17 @@
# -*- coding: utf-8 -*-
# @File : json_infoShow.py
# @Author : zhaoHL
# @Contact : huilin16@qq.com
# @Time Create First: 2021/8/1 10:25
# @Contributor : zhaoHL
# @Time Modify Last : 2021/8/1 10:25
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
'''
@File Description:
# 输出json文件基本信息

@ -1,10 +1,17 @@
# -*- coding: utf-8 -*-
# @File : json_merge.py
# @Author : zhaoHL
# @Contact : huilin16@qq.com
# @Time Create First: 2021/8/1 10:25
# @Contributor : zhaoHL
# @Time Modify Last : 2021/8/1 10:25
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
'''
@File Description:
# 合并json文件,可以通过merge_keys控制合并的字段, 默认合并'images', 'annotations'字段

@ -1,10 +1,17 @@
# -*- coding: utf-8 -*-
# @File : json_split.py
# @Author : zhaoHL
# @Contact : huilin16@qq.com
# @Time Create First: 2021/8/1 10:25
# @Contributor : zhaoHL
# @Time Modify Last : 2021/8/1 10:25
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
'''
@File Description:
# json数据集划分,可以通过val_split_rate、val_split_num控制划分比例或个数, keep_val_inTrain可以设定是否在train中保留val相关信息
@ -16,6 +23,7 @@ python ./coco_tools/json_Split.py \
import json
import argparse
import pandas as pd
def get_annno(df_img_split, df_anno):

@ -13,11 +13,13 @@
# limitations under the License.
import codecs
import argparse
import cv2
import numpy as np
import argparse
import geojson
from geojson import Polygon, Feature, FeatureCollection
from utils import Raster, Timer

@ -14,11 +14,10 @@
import os
import os.path as osp
import numpy as np
import argparse
from PIL import Image
from utils import Raster, Timer
import numpy as np
from PIL import Image
try:
from osgeo import gdal, ogr, osr
except ImportError:
@ -26,6 +25,8 @@ except ImportError:
import ogr
import osr
from utils import Raster, Timer
def _mask2tif(mask_path, tmp_path, proj, geot):
mask = np.asarray(Image.open(mask_path))

@ -12,16 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import numpy as np
import cv2
import argparse
from utils import Raster, raster2uint8, Timer
import numpy as np
import cv2
try:
from osgeo import gdal
except ImportError:
import gdal
from utils import Raster, raster2uint8, Timer
class MatchError(Exception):
def __str__(self):

@ -12,13 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import numpy as np
import pandas as pd
import itertools
import argparse
from utils import Raster, Timer
from easydict import EasyDict as edict
import numpy as np
import pandas as pd
from utils import Raster, Timer
def _calcOIF(rgb, stds, rho):
r, g, b = rgb

@ -16,7 +16,9 @@ import os
import os.path as osp
import argparse
from math import ceil
from PIL import Image
from utils import Raster, Timer

@ -13,8 +13,10 @@
# limitations under the License.
import os.path as osp
import numpy as np
from typing import List, Tuple, Union
import numpy as np
from paddlers.transforms.functions import to_uint8 as raster2uint8
try:

Loading…
Cancel
Save