PaddlePaddle / PaddleClas

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

Direct prediction API #3126

Open TheMattBin opened 2 months ago

TheMattBin commented 2 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 2 months ago

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