qupath / qupath-extension-djl

A QuPath extension for working with Deep Java Library (https://djl.ai)
Apache License 2.0
5 stars 4 forks source link

Add ability to poll engines for available devices #21

Closed alanocallaghan closed 2 months ago

alanocallaghan commented 4 months ago

This seems to me the only thing needed for WSInfer/InstanSeg's use of DJL.

Not sure about how to handle when the engine isn't available, but empty set seemed more logical than assuming CPU only for an engine that effectively doesn't exist.

petebankhead commented 4 months ago

This code looks familiar - I presume it came from the WSInfer extension?

I think MPS is only actually available with PyTorch, so we should probably restrict it to that - otherwise DJL should already know the engines. With WSInfer we knew that we were using PyTorch, so the check there wasn't needed.

(Still waiting for Apple Silicon to be supported with TensorFlow Java (seems close), and then it'll need integrated into DJL.)

alanocallaghan commented 4 months ago

Yes from WSInfer originally, currently used in InstanSeg but it seems likely that InstanSeg won't properly support MPS either way at this point