When executing the demo, I found that `refine_foreground` takes more than 4 seconds. Is there any way to speed up this process?