xuebinqin / U-2-Net

The code for our newly accepted paper in Pattern Recognition 2020: "U^2-Net: Going Deeper with Nested U-Structure for Salient Object Detection."
Apache License 2.0
8.31k stars 1.43k forks source link

Image Masking: The position of the object is changing #286

Open ashikrafi opened 2 years ago

ashikrafi commented 2 years ago

Hi @xuebinqin,

Image Masking: The position of the object is changing

You guys did a great job. Based on this architecture, I am trying to create some impactful work. However, I am having problems but am not able to find the root cause.

The following lines create a mask that does not reflect the original image.

    model = get_model(model_name)
    img = Image.open(io.BytesIO(data)).convert("RGB")
    mask = detect.predict(model, np.array(img)).convert("L")

What I mean is the position of the object in the image changes. Eventually, the output image changes after the image composite. Could you please help me out?

I have attached input.jpg, mask.png, and output.png for your consideration. Would you check it out?

  1. Input Image

input

  1. Image Masking (look, the position of the object is changing)

mask

  1. Output after the composite

output

ashikrafi commented 2 years ago

anyone there? could you please help me out?

xuebinqin commented 2 years ago

please double check your dataloader to see if the image random crop is enabled. If yes, disable that. Besides, you can debug your input step by step by saving the input to the hard disk drive for double checking.

On Thu, Jan 27, 2022 at 6:51 PM Md Ashikur Rahman @.***> wrote:

anyone there? could you please help me out?

— Reply to this email directly, view it on GitHub https://github.com/xuebinqin/U-2-Net/issues/286#issuecomment-1023289886, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSGOROUP4ZD6P5SN4SVJZDUYFLXRANCNFSM5MUXQ3WQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

-- Xuebin Qin PhD Department of Computing Science University of Alberta, Edmonton, AB, Canada Homepage: https://xuebinqin.github.io/