diff --git a/models/__init__.py b/models/__init__.py index 7928da7df031c790203c18c1933414ef485a038d..85cbd8cac3816e6264269b9e295b280c0e6d7963 100644 --- a/models/__init__.py +++ b/models/__init__.py @@ -1 +1,25 @@ +# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. +# +#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. + +from . import resnet +from . import darknet +from . import yolov3 + from .resnet import * +from .darknet import * +from .yolov3 import * + +__all__ = resnet.__all__ \ + + darknet.__all__ \ + + yolov3.__all__ diff --git a/yolov3/darknet.py b/models/darknet.py similarity index 99% rename from yolov3/darknet.py rename to models/darknet.py index ae97558684d7212d28b80d10f6bb7af45c1cf292..095cf7d63c628483b3b0842f4c54d81bba75ceb6 100755 --- a/yolov3/darknet.py +++ b/models/darknet.py @@ -19,7 +19,7 @@ from paddle.fluid.regularizer import L2Decay from paddle.fluid.dygraph.nn import Conv2D, BatchNorm from model import Model -from download import get_weights_path +from .download import get_weights_path __all__ = ['DarkNet53', 'ConvBNLayer', 'darknet53'] diff --git a/yolov3/modeling.py b/models/yolov3.py similarity index 98% rename from yolov3/modeling.py rename to models/yolov3.py index 699fadb10a2cb6654f139f1014cfd11e4fb178b9..c2bbc88ee27cb08269bd2a986ff7b55b4f199999 100644 --- a/yolov3/modeling.py +++ b/models/yolov3.py @@ -21,10 +21,10 @@ from paddle.fluid.param_attr import ParamAttr from paddle.fluid.regularizer import L2Decay from model import Model, Loss -from download import get_weights_path -from darknet import darknet53, ConvBNLayer +from .darknet import darknet53, ConvBNLayer +from .download import get_weights_path -__all__ = ['YoloLoss', 'YOLOv3'] +__all__ = ['YoloLoss', 'YOLOv3', 'yolov3_darknet53'] # {num_layers: (url, md5)} pretrain_infos = { diff --git a/yolov3/infer.py b/yolov3/infer.py index 612e5175181106f575bf2929ea1d1a7cf71e5e3b..f19e86615a0b1c8c57f3469f5a5bdcaa85535e9c 100644 --- a/yolov3/infer.py +++ b/yolov3/infer.py @@ -25,7 +25,8 @@ from paddle.fluid.optimizer import Momentum from paddle.fluid.io import DataLoader from model import Model, Input, set_device -from modeling import yolov3_darknet53, YoloLoss +from models import yolov3_darknet53, YoloLoss + from coco import COCODataset from transforms import * from visualizer import draw_bbox diff --git a/yolov3/main.py b/yolov3/main.py index de4fd7c95d4856a6623fa9f6c5d871fe26d60283..c659b5f2470ffa0c8bcbe0a9ad8d76ca52e28aa0 100644 --- a/yolov3/main.py +++ b/yolov3/main.py @@ -27,7 +27,8 @@ from paddle.fluid.io import DataLoader from model import Model, Input, set_device from distributed import DistributedBatchSampler -from modeling import yolov3_darknet53, YoloLoss +from models import yolov3_darknet53, YoloLoss + from coco_metric import COCOMetric from coco import COCODataset from transforms import *