Skip to content

Commit

Permalink
* log模块info不输出
Browse files Browse the repository at this point in the history
  • Loading branch information
jadehh committed Feb 28, 2023
1 parent 98d2906 commit 2e4f573
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Acllite v1.0.5
## Acllite v1.0.6

### 更新日志
* log模块info不输出
* 注释打开Rtsp视频流的输出
* 注释Decode channel %d frame %d failed输出
* 注释掉部分输出
Expand Down
2 changes: 1 addition & 1 deletion acllite/acllite_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def log_info(*log_msg):
"""
log_str = [str(i) for i in log_msg]
log_str = "".join(log_str)
print(log_str)
# print(log_str)
caller_frame = sys._getframe().f_back
# caller file
filename = caller_frame.f_code.co_filename
Expand Down
12 changes: 6 additions & 6 deletions acllite/acllite_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self, model_path, load_type=0):
resource_list.register(self)

def _init_resource(self):
log_info("Init model resource start...")
# log_info("Init model resource start...")
if not os.path.isfile(self._model_path):
log_error(
"model_path failed, please check. model_path=%s" %
Expand Down Expand Up @@ -83,12 +83,12 @@ def _init_resource(self):
# recode input data address,if need malloc memory,the memory will be
# reuseable
self._init_input_buffer()
log_info("Init model resource success")
# log_info("Init model resource success")

return const.SUCCESS

def _gen_output_dataset(self, ouput_num):
log_info("[AclLiteModel] create model output dataset:")
# log_info("[AclLiteModel] create model output dataset:")
dataset = acl.mdl.create_dataset()
for i in range(ouput_num):
# malloc device memory for output
Expand All @@ -98,13 +98,13 @@ def _gen_output_dataset(self, ouput_num):
# crate oputput data buffer
dataset_buffer = acl.create_data_buffer(buf, size)
_, ret = acl.mdl.add_dataset_buffer(dataset, dataset_buffer)
log_info("malloc output %d, size %d" % (i, size))
# log_info("malloc output %d, size %d" % (i, size))
if ret:
acl.rt.free(buf)
acl.destroy_data_buffer(dataset_buffer)
utils.check_ret("acl.destroy_data_buffer", ret)
self._output_dataset = dataset
log_info("Create model output dataset success")
# log_info("Create model output dataset success")

def _init_input_buffer(self):
self._input_num = acl.mdl.get_num_inputs(self._model_desc)
Expand Down Expand Up @@ -439,7 +439,7 @@ def destroy(self):

self._is_destroyed = True
resource_list.unregister(self)
log_info("AclLiteModel release source success")
# log_info("AclLiteModel release source success")

def __del__(self):
self.destroy()
14 changes: 7 additions & 7 deletions acllite/acllite_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def init(self):
"""
init resource
"""
print("init resource stage:")
# print("init resource stage:")
ret = acl.init()
utils.check_ret("acl.init", ret)

Expand All @@ -91,20 +91,20 @@ def init(self):
self.run_mode, ret = acl.rt.get_run_mode()
utils.check_ret("acl.rt.get_run_mode", ret)

print("Init resource success")
# print("Init resource success")

def __del__(self):
print("acl resource release all resource")
# print("acl resource release all resource")
resource_list.destroy()
if self.stream:
print("acl resource release stream")
# print("acl resource release stream")
acl.rt.destroy_stream(self.stream)

if self.context:
print("acl resource release context")
# print("acl resource release context")
acl.rt.destroy_context(self.context)

print("Reset acl device ", self.device_id)
# print("Reset acl device ", self.device_id)
acl.rt.reset_device(self.device_id)
acl.finalize()
print("Release acl resource success")
# print("Release acl resource success")
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def find_packages(path,pack_list):
find_packages("acllite",pack_list)
setup(
name="acllite",
version="1.0.5",
version="1.0.6",
keywords=("pip", "acllite", ""),
description="acllite",
long_description=long_description,
Expand Down

0 comments on commit 2e4f573

Please sign in to comment.