commit
272a61db64
|
@ -17,6 +17,7 @@ import paddle
|
||||||
import numpy.ctypeslib as ctl
|
import numpy.ctypeslib as ctl
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import json
|
import json
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
|
@ -24,13 +25,19 @@ from ctypes import *
|
||||||
from numpy.ctypeslib import ndpointer
|
from numpy.ctypeslib import ndpointer
|
||||||
|
|
||||||
__dir__ = os.path.dirname(os.path.abspath(__file__))
|
__dir__ = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
winmode = None
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
lib_filename = "index.dll"
|
lib_filename = "index.dll"
|
||||||
|
if sys.version_info.minor >= 8:
|
||||||
|
winmode = 0x8
|
||||||
else:
|
else:
|
||||||
lib_filename = "index.so"
|
lib_filename = "index.so"
|
||||||
so_path = os.path.join(__dir__, lib_filename)
|
so_path = os.path.join(__dir__, lib_filename)
|
||||||
try:
|
try:
|
||||||
lib = ctypes.cdll.LoadLibrary(so_path)
|
if winmode is not None:
|
||||||
|
lib = ctypes.CDLL(so_path, winmode=winmode)
|
||||||
|
else:
|
||||||
|
lib = ctypes.CDLL(so_path)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
readme_path = os.path.join(__dir__, "README.md")
|
readme_path = os.path.join(__dir__, "README.md")
|
||||||
print(
|
print(
|
||||||
|
|
|
@ -87,6 +87,7 @@ wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/infere
|
||||||
# 下载识别inference模型并解压
|
# 下载识别inference模型并解压
|
||||||
wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/product_ResNet50_vd_aliproduct_v1.0_infer.tar && tar -xf product_ResNet50_vd_aliproduct_v1.0_infer.tar
|
wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/product_ResNet50_vd_aliproduct_v1.0_infer.tar && tar -xf product_ResNet50_vd_aliproduct_v1.0_infer.tar
|
||||||
|
|
||||||
|
cd ../
|
||||||
# 下载demo数据并解压
|
# 下载demo数据并解压
|
||||||
wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/data/recognition_demo_data_v1.0.tar && tar -xf recognition_demo_data_v1.0.tar
|
wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/data/recognition_demo_data_v1.0.tar && tar -xf recognition_demo_data_v1.0.tar
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
prettytable
|
prettytable
|
||||||
ujson
|
ujson
|
||||||
opencv-python==4.1.2.30
|
opencv-python==4.4.0.46
|
||||||
pillow
|
pillow
|
||||||
tqdm
|
tqdm
|
||||||
PyYAML
|
PyYAML
|
||||||
|
|
Loading…
Reference in New Issue