PaddlePaddle / PaddleClas

A treasure chest for visual classification and recognition powered by PaddlePaddle
Apache License 2.0
5.5k stars 1.17k forks source link

Direct prediction API #3126

Open TheMattBin opened 7 months ago

TheMattBin commented 7 months ago

I was working in prediction of binary classification model under the following environment:

1. PaddleClas and PaddlePaddle version: PaddleClas release/2.5 and PaddlePaddle 2.6
2. Environmental
  a. OS: Linux
  b. Python 3.12
  c. CUDA/cuDNN version: CUDA11.7/cuDNN 8.4

so I used the python python/predict_cls.py to predict my own images, however I would like to know if I can pass the images as ndarray since I want to customize the prediction script for convenient inference?

Thanks!

changdazhou commented 7 months ago

you can refer to here: https://github.com/PaddlePaddle/PaddleClas/blob/release/2.5/deploy/python/predict_cls.py#L89C9-L89C14