Replies: 18 comments
-
Hello, @weypro do you have any implementation detail in your mind? Should we lazily generate image patches while performing sliced inference or should we export slices to disk and read them while iterating? |
Beta Was this translation helpful? Give feedback.
-
The later seems to be a general solution and easier to be implemented. To be frank, before I skim the code
In the function
The full code is (
Well, it works, and I can use the default setting |
Beta Was this translation helpful? Give feedback.
-
Hi there, sorry for jumping late. It sounds a really nice improvement, my only concern was mutation on |
Beta Was this translation helpful? Give feedback.
-
To prove the effect, I try to watch the memory after slicing. The result is that the gap is only tens of megabytes, which means that the improvement is presumably a coincidence and can be ignored.
With pympler, I have proved the fact that the memory of
If you don't mind, I can draft the PR by adding a Boolean parameter |
Beta Was this translation helpful? Give feedback.
-
@weypro Thanks for detailed comment and analysis. My only question here is can't we just refactor and update the code without preserving |
Beta Was this translation helpful? Give feedback.
-
OK. We can replace
Or even we can remove
The time difference is nearly one second. We can take this solution if the consumption is acceptable. @devrimcavusoglu |
Beta Was this translation helpful? Give feedback.
-
@weypro Yes, indeed I meant the latter. To remove the current merging (after) and replacing completely with merging (during prediction) and without making it parametric, but I consider more about if this is the case for all prediction sizes, but I will for now assume that it will never be worse than current in terms of memory, and the trade-off between time is neglible (which is the case). However, the former I'll leave the other related discussions to the PR for now (we may want to test some additional/edge cases). |
Beta Was this translation helpful? Give feedback.
-
Which implementation is faster by 1 second? |
Beta Was this translation helpful? Give feedback.
-
The former is faster. |
Beta Was this translation helpful? Give feedback.
-
Applying postprocess at each prediction would affect the overall accuracy (since the merged/suppressed boxes will be different). Have @weypro evaluated the effect of this change in terms of AP? |
Beta Was this translation helpful? Give feedback.
-
Then maybe we can set the default of the buffer as |
Beta Was this translation helpful? Give feedback.
-
No. Further research is indeed needed. |
Beta Was this translation helpful? Give feedback.
-
We can conduct the related research in the pr 👍 |
Beta Was this translation helpful? Give feedback.
-
My question is how to express |
Beta Was this translation helpful? Give feedback.
-
I am not supportive for |
Beta Was this translation helpful? Give feedback.
-
I want the default to stay same as the current implementation (merge after all predictions), at least till we are sure the AP is not decreasing with buffering. To manage that, default value can be |
Beta Was this translation helpful? Give feedback.
-
Yes, I'm also not opposed to that, that's why I am also for the buffer implementation. I was just pointing out that |
Beta Was this translation helpful? Give feedback.
-
PR is here. #445 |
Beta Was this translation helpful? Give feedback.
-
When I try to perform sliced prediction with the default setting
256*256
(486 slices), the error occurs.If I change
256*256
to512*512
(243 slices), it can work. The size of the sample image is5500*4000
My total memory is only 16GB, and I think it is necessary to add the slices cache, in that way the script can deal with even more bigger images without the memory limitations.
Beta Was this translation helpful? Give feedback.
All reactions