Skip to content

fix compression after resizing in remote inference#33

Closed
jianwensong wants to merge 1 commit into
InterDigitalInc:mainfrom
jianwensong:main-20260518-remote
Closed

fix compression after resizing in remote inference#33
jianwensong wants to merge 1 commit into
InterDigitalInc:mainfrom
jianwensong:main-20260518-remote

Conversation

@jianwensong
Copy link
Copy Markdown
Contributor

@jianwensong jianwensong commented May 18, 2026

While testing remote inference with compress_after_resizing enabled, I found that the current implementation ignores the output of _org_mapper_func.

The resized images should all be in RGB format to ensure correct YUV conversion. However, in both YOLOXCustomMapper, Detectron2’s DatasetMapper, and MMPOSECustomMapper, the output of _org_mapper_func is in BGR format. Therefore, using these outputs directly leads to incorrect colors when compress_after_resizing is enabled. This PR provides a fix to this issue.

In addition, a minor issue related to image-based remote inference when enabling compress_after_resizing has been fixed. (f6d23ae has fixed this, the conflict has been solved) Could you please review the fix? Thanks.

@jianwensong jianwensong force-pushed the main-20260518-remote branch from 6d370e4 to a4faee7 Compare May 18, 2026 06:24
@fracape
Copy link
Copy Markdown
Collaborator

fracape commented May 18, 2026

Hi Jianwen,
Apologies, I forgot to push Hyomin's PR on this to the public github. I see that you are rebasing. We'll check tomorrow (our time)

@jianwensong
Copy link
Copy Markdown
Contributor Author

jianwensong commented May 18, 2026

Hi Jianwen, Apologies, I forgot to push Hyomin's PR on this to the public github. I see that you are rebasing. We'll check tomorrow (our time)

No problem. I have rebased the code and solved the conflict. Thanks.

@fracape
Copy link
Copy Markdown
Collaborator

fracape commented May 18, 2026

Did you close it? I believe you address a bit more than what was done.

@jianwensong jianwensong reopened this May 18, 2026
@jianwensong
Copy link
Copy Markdown
Contributor Author

Sorry. I intended to delete one comment and wrongly selected close the PR.

@chyomin06
Copy link
Copy Markdown
Collaborator

chyomin06 commented May 18, 2026

@jianwensong , Thanks for the PR.
I reviewed the changes, it is agreed to have a proper conversion to RGB format to save an image.
However, it is preferable to minize changes since it may affect the original path.
Please review the latest commit with hash 8305e3e , and let us know if the updates work for you.

@jianwensong
Copy link
Copy Markdown
Contributor Author

@chyomin06 Thanks for the updates. That looks really good! The only issue is that this commit seems not work with Detectron2’s DatasetMapper (the one imported directly from detectron2, not the customized version in utils), which I believe also outputs images in BGR format.

@chyomin06
Copy link
Copy Markdown
Collaborator

@jianwensong , Thanks for the PR. I reviewed the changes, it is agreed to have a proper conversion to RGB format to save an image. However, it is preferable to minize changes since it may affect the original path. Please review the latest commit with hash 8305e3e , and let us know if the updates work for you.

I think it should work since Detectron2 dataset mapper has the same property attribute, image_format.

@jianwensong
Copy link
Copy Markdown
Contributor Author

@chyomin06 I see. Thank you for the explanation. Yes, you are right. I will close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants