Slackbot
01/13/2023, 12:48 AMEric Riddoch
01/13/2023, 12:57 AMHeatMap
, but a HeatmapBatch
. Is my approach completely off?
preprocessed_image: NDArray = ...
image_with_heatmap: Heatmap = await generate_heatmap_runner.async_run(preproccessed_image)
assert type(image_with_heatmap) == Heatmap # fail!
# Shouldn't generate_heatmap_runner.async_run(preproccessed_image) have implicitly returned somethign like batch[batch_index]?
Eric Riddoch
01/13/2023, 1:23 AMJiang
01/13/2023, 3:18 AMJiang
01/13/2023, 3:20 AMclass CustomeRunner:
def predict(self):
...
return [image1, image2], [score1, score2]
Jiang
01/13/2023, 3:21 AMJiang
01/13/2023, 3:23 AMEric Riddoch
01/13/2023, 5:40 AMbatch_dim
set to 0
. I'll try running your example.Eric Riddoch
01/13/2023, 5:54 AMEric Riddoch
01/13/2023, 5:55 AM<http://localhost:3000>
and quickly clicked on the "execute" button on all three pages. With these inputs:
Inputs:
{
"input": 0
}
{
"input": 1
}
{
"input": 2
}
Output:
{
"output": [
"image0",
0
]
}
It looks like the batching is not happening. I tried running it with the --production
flag as well with the same result.Eric Riddoch
01/13/2023, 5:57 AM[image1, score1], [image2, score2]
in your example?Eric Riddoch
01/13/2023, 7:04 AMtime.sleep(2)
into the /predict
handler in an attempt to get the server to hang long enough for me to click all 3 "execute" buttons in the browser windows I had open, but it didn't seem to work.Jiang
01/13/2023, 7:35 AMOh also, did you mean to writeNoin your example?[image1, score1], [image2, score2]
Jiang
01/13/2023, 7:35 AMreturn [image1, image2], [score1, score2]
Jiang
01/13/2023, 7:36 AMtuple([image1, image2, ...], [score1, score2, ...])
Jiang
01/13/2023, 7:36 AMEric Riddoch
01/13/2023, 8:55 AM