提交 61f96444 编写于 作者: W wuzewu

All classes inherit from object

上级 65d4e626
...@@ -23,7 +23,7 @@ from paddlehub.common.arg_helper import add_argument, print_arguments ...@@ -23,7 +23,7 @@ from paddlehub.common.arg_helper import add_argument, print_arguments
ENTRY = "hub" ENTRY = "hub"
class BaseCommand: class BaseCommand(object):
command_dict = {} command_dict = {}
@classmethod @classmethod
......
...@@ -61,7 +61,7 @@ def get_ph_value(): ...@@ -61,7 +61,7 @@ def get_ph_value():
return 11 return 11
class TablePrinter: class TablePrinter(object):
def __init__(self, def __init__(self,
titles, titles,
placeholders, placeholders,
......
...@@ -45,7 +45,7 @@ def progress(str, end=False): ...@@ -45,7 +45,7 @@ def progress(str, end=False):
sys.stdout.flush() sys.stdout.flush()
class Downloader: class Downloader(object):
def download_file(self, def download_file(self,
url, url,
save_path, save_path,
......
...@@ -29,7 +29,7 @@ RESOURCE_LIST_FILE = "resource_list_file.yml" ...@@ -29,7 +29,7 @@ RESOURCE_LIST_FILE = "resource_list_file.yml"
CACHE_TIME = 60 * 10 CACHE_TIME = 60 * 10
class HubServer: class HubServer(object):
def __init__(self, server_url=None): def __init__(self, server_url=None):
if not server_url: if not server_url:
server_url = "https://paddlehub.bj.bcebos.com/" server_url = "https://paddlehub.bj.bcebos.com/"
......
...@@ -22,7 +22,7 @@ import paddlehub as hub ...@@ -22,7 +22,7 @@ import paddlehub as hub
from paddlehub.common.downloader import default_downloader from paddlehub.common.downloader import default_downloader
class ImageClassificationDataset: class ImageClassificationDataset(object):
def __init__(self): def __init__(self):
self.base_path = None self.base_path = None
self.train_list_file = None self.train_list_file = None
......
...@@ -19,7 +19,7 @@ from __future__ import print_function ...@@ -19,7 +19,7 @@ from __future__ import print_function
import yaml import yaml
class CSVFileParser: class CSVFileParser(object):
def __init__(self): def __init__(self):
pass pass
...@@ -46,7 +46,7 @@ class CSVFileParser: ...@@ -46,7 +46,7 @@ class CSVFileParser:
return self.content return self.content
class YAMLFileParser: class YAMLFileParser(object):
def __init__(self): def __init__(self):
pass pass
...@@ -59,7 +59,7 @@ class YAMLFileParser: ...@@ -59,7 +59,7 @@ class YAMLFileParser:
return yaml.load(content, Loader=yaml.BaseLoader) return yaml.load(content, Loader=yaml.BaseLoader)
class TextFileParser: class TextFileParser(object):
def __init__(self): def __init__(self):
pass pass
......
...@@ -17,7 +17,7 @@ from __future__ import division ...@@ -17,7 +17,7 @@ from __future__ import division
from __future__ import print_function from __future__ import print_function
class BaseProcessor: class BaseProcessor(object):
def __init__(self, module): def __init__(self, module):
pass pass
......
...@@ -29,7 +29,7 @@ CHECK_INFO_PB_FILENAME = "check_info.pb" ...@@ -29,7 +29,7 @@ CHECK_INFO_PB_FILENAME = "check_info.pb"
FILE_SEP = "/" FILE_SEP = "/"
class ModuleChecker: class ModuleChecker(object):
def __init__(self, module_path): def __init__(self, module_path):
self.module_path = module_path self.module_path = module_path
......
...@@ -25,7 +25,7 @@ from paddlehub.common.dir import MODULE_HOME ...@@ -25,7 +25,7 @@ from paddlehub.common.dir import MODULE_HOME
import paddlehub as hub import paddlehub as hub
class LocalModuleManager: class LocalModuleManager(object):
def __init__(self, module_home=None): def __init__(self, module_home=None):
self.local_modules_dir = module_home if module_home else MODULE_HOME self.local_modules_dir = module_home if module_home else MODULE_HOME
self.modules_dict = {} self.modules_dict = {}
......
...@@ -21,7 +21,7 @@ from paddle.fluid.framework import Variable ...@@ -21,7 +21,7 @@ from paddle.fluid.framework import Variable
from paddlehub.common.utils import to_list from paddlehub.common.utils import to_list
class Signature: class Signature(object):
def __init__(self, def __init__(self,
name, name,
inputs, inputs,
......
...@@ -32,7 +32,7 @@ color_mode_dict = { ...@@ -32,7 +32,7 @@ color_mode_dict = {
} }
class ImageClassificationReader: class ImageClassificationReader(object):
def __init__(self, def __init__(self,
image_width, image_width,
image_height, image_height,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册