update
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
3b7ced3eb7
commit
289879c8dd
|
|
@ -16,6 +16,7 @@ steps:
|
|||
PYTHONPATH: /drone/src/
|
||||
DATA_DIR: /drone/src/data/
|
||||
commands:
|
||||
- git diff --name-only `git merge-base refs/remotes/origin/master HEAD`..HEAD | grep finetune/facenet_transfer_learning.py > /dev/null || exit 78
|
||||
- python -m pip install -q -U pip
|
||||
- pip install -q torchsummary matplotlib pytorch-metric-learning torchinfo torch torchvision tqdm Pillow facenet-pytorch
|
||||
- apt update -qq
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
from os import getcwd
|
||||
from os.path import join
|
||||
from onnxruntime import InferenceSession, SessionOptions, __version__
|
||||
from onnxruntime import InferenceSession, SessionOptions, __version__, get_all_providers, get_available_providers
|
||||
from PIL import Image
|
||||
import numpy
|
||||
|
||||
print(get_all_providers())
|
||||
print(get_available_providers())
|
||||
|
||||
onnx_session = InferenceSession(
|
||||
path_or_bytes="test_script/retinaface.onnx",
|
||||
path_or_bytes=r"retinaface.onnx",
|
||||
providers=[
|
||||
'CUDAExecutionProvider',
|
||||
('TensorrtExecutionProvider', {
|
||||
|
|
@ -13,6 +16,7 @@ onnx_session = InferenceSession(
|
|||
'trt_engine_cache_path': join(getcwd(), 'onnx_cache'),
|
||||
'trt_fp16_enable': True,
|
||||
}),
|
||||
'DmlExecutionProvider',
|
||||
'CPUExecutionProvider'
|
||||
]
|
||||
)
|
||||
|
|
@ -20,7 +24,7 @@ print(__version__)
|
|||
image_arr = numpy.expand_dims(numpy.array(
|
||||
Image.open(r'C:\Users\tomokazu\CLionProjects\ameba_blog_downloader\manaka_test.jpg').convert('RGB')), 0).transpose(
|
||||
0, 3, 1, 2).astype(numpy.float32)
|
||||
image_arr /= 255.0
|
||||
# image_arr /= 255.0
|
||||
print(image_arr)
|
||||
print(image_arr.shape)
|
||||
res = onnx_session.run(input_feed={'input': image_arr}, output_names=["bbox", "confidence", "landmark"])
|
||||
|
|
|
|||
Loading…
Reference in New Issue