Skip to content

Commit

Permalink
update style of slider_predict.py
Browse files Browse the repository at this point in the history
  • Loading branch information
huilin16 committed Jul 27, 2023
1 parent 0eacec7 commit 3469cef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions paddlers/tasks/utils/slider_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,13 +512,14 @@ def _construct_reader(eager_load, *args, **kwargs):
batch_out = predict_func(batch_data, transforms=transforms)

for out, (xoff_, yoff_) in zip(batch_out, batch_offsets):
if len(out['label_map'].shape)==3:
if len(out['label_map'].shape) == 3:
for i in range(out['label_map'].shape[0]):
out_single = {}
out_single['label_map'] = out['label_map'][i]
out_single['score_map'] = out['score_map'][i]
# Get processed result
pred = overlap_processor.process_pred(out_single, xoff_, yoff_)
pred = overlap_processor.process_pred(out_single,
xoff_, yoff_)
# Write to file
band.WriteArray(pred, xoff_, yoff_)
else:
Expand Down

0 comments on commit 3469cef

Please sign in to comment.