deepjavalibrary / djl-serving

A universal scalable machine learning model deployment solution
Apache License 2.0
193 stars 65 forks source link

Is there any example about this "map" operation? #415

Closed oswardlx closed 1 year ago

oswardlx commented 1 year ago

As a final example, here is one that features a more complicated interaction. The human detection model will find all of the humans in an image. Then, the "splitHumans" function will turn all of them into separate images that can be treated as a list. The "map" will apply the "poseEstimation" model to each of the detected humans in the list.

workflow: humans: ["splitHumans", ["humanDetection", "in"]] out: ["map", "poseEstimation", "humans"]

zachgk commented 1 year ago

For clarification, the code here is not currently a real example, more of a pseudo-code to describe how the workflow system works. The available workflow functions can be found within the package ai.djl.serving.workflow.function's javadoc.

If you are interested, there is a plan to build a real example based on this and the Pose Estimation example.