__init__.py 1.8 KB
Newer Older
M
mamingjie-China 已提交
1
# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
J
jiangjiajun 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14 15
#
# 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 __future__ import absolute_import
J
jiangjiajun 已提交
16

17 18 19 20 21 22 23 24
import os
if 'FLAGS_eager_delete_tensor_gb' not in os.environ:
    os.environ['FLAGS_eager_delete_tensor_gb'] = '0.0'
if 'FLAGS_allocator_strategy' not in os.environ:
    os.environ['FLAGS_allocator_strategy'] = 'auto_growth'
if "CUDA_VISIBLE_DEVICES" in os.environ:
    if os.environ["CUDA_VISIBLE_DEVICES"].count("-1") > 0:
        os.environ["CUDA_VISIBLE_DEVICES"] = ""
J
jiangjiajun 已提交
25

J
jiangjiajun 已提交
26 27 28 29 30 31
from .utils.utils import get_environ_info
from . import cv
from . import det
from . import seg
from . import cls
from . import slim
C
Channingss 已提交
32
from . import convertor
S
sunyanfang01 已提交
33
from . import tools
J
jiangjiajun 已提交
34
from . import deploy
J
jiangjiajun 已提交
35

J
jiangjiajun 已提交
36 37 38
try:
    import pycocotools
except:
C
Channingss 已提交
39 40 41 42
    print(
        "[WARNING] pycocotools is not installed, detection model is not available now."
    )
    print(
J
jiangjiajun 已提交
43
        "[WARNING] pycocotools install: https://paddlex.readthedocs.io/zh_CN/develop/install.html#pycocotools"
C
Channingss 已提交
44
    )
J
jiangjiajun 已提交
45

J
jiangjiajun 已提交
46
import paddlehub as hub
47 48
if hub.version.hub_version < '1.8.2':
    raise Exception("[ERROR] paddlehub >= 1.8.2 is required")
J
jiangjiajun 已提交
49

J
jiangjiajun 已提交
50 51 52
env_info = get_environ_info()
load_model = cv.models.load_model
datasets = cv.datasets
S
modify  
sunyanfang01 已提交
53
transforms = cv.transforms
J
jiangjiajun 已提交
54 55

log_level = 2
J
jiangjiajun 已提交
56 57 58

from . import interpret

J
jiangjiajun 已提交
59
__version__ = '1.1.5'