dahalsweekar / Deep-Weed-Segmentation

This repository offers an implementation of diverse segmentation models for semantic segmentation. The provided method allows the integration of different networks and backbones to create a combination of choices.
MIT License
0 stars 1 forks source link

predicted output is coming blank #1

Closed AkramSyed002 closed 11 months ago

AkramSyed002 commented 11 months ago

i have run your code on google colab and output for model unet using backbone vgg16

Screenshot 2023-12-02 at 1 01 34 PM

i have check for other model and backbone too but the result is same, kindly let me know how i can reslove it

dahalsweekar commented 11 months ago

I appreciate your interest.

Yes, there is a problem where if you load a saved model, it refuses to yield an output. This problem is stated in the 'Task list' heading in Git Hub. For the paper, I separately wrote a code to predict the results on Google Colab. One way to yield a proper result is to train the model and simultaneously test for the output as provided in the args list in 'train.py' by enabling '--test'.

Thank you.

On Sat, Dec 2, 2023 at 10:47 AM Akram Syed @.***> wrote:

i have run your code on google colab and output for model unet using backbone vgg16 Screenshot.2023-12-02.at.1.01.34.PM.png (view on web) https://github.com/dahalsweekar/Deep-Weed-Segmentation/assets/68083755/dff9ed50-8517-4a88-b94b-4f0f190792d6

— Reply to this email directly, view it on GitHub https://github.com/dahalsweekar/Deep-Weed-Segmentation/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AX2WJ2PPVL5XWTYXJRGMLY3YHKY4TAVCNFSM6AAAAABADXYYS2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGAZDCOBVHE2DCMQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Engineer, Sweekar Kirtpur, Kathmandu Nepal

AkramSyed002 commented 11 months ago

thank you sir for yours response i appreciate your kindness

On Sat, Dec 2, 2023 at 2:15 PM Sweekar Dahal @.***> wrote:

I appreciate your interest.

Yes, there is a problem where if you load a saved model, it refuses to yield an output. This problem is stated in the 'Task list' heading in Git Hub. For the paper, I separately wrote a code to predict the results on Google Colab. One way to yield a proper result is to train the model and simultaneously test for the output as provided in the args list in 'train.py' by enabling '--test'.

Thank you.

On Sat, Dec 2, 2023 at 10:47 AM Akram Syed @.***> wrote:

i have run your code on google colab and output for model unet using backbone vgg16 Screenshot.2023-12-02.at.1.01.34.PM.png (view on web) < https://github.com/dahalsweekar/Deep-Weed-Segmentation/assets/68083755/dff9ed50-8517-4a88-b94b-4f0f190792d6>

— Reply to this email directly, view it on GitHub https://github.com/dahalsweekar/Deep-Weed-Segmentation/issues/1, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AX2WJ2PPVL5XWTYXJRGMLY3YHKY4TAVCNFSM6AAAAABADXYYS2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGAZDCOBVHE2DCMQ>

. You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Engineer, Sweekar Kirtpur, Kathmandu Nepal

— Reply to this email directly, view it on GitHub https://github.com/dahalsweekar/Deep-Weed-Segmentation/issues/1#issuecomment-1837056781, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQHOAK2SAK4N65CC3N2RBA3YHLBOJAVCNFSM6AAAAABADXYYS2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZXGA2TMNZYGE . You are receiving this because you authored the thread.Message ID: @.***>

--

Akram SyedReact Native Developer 03465673700 https://www.linkedin.com/in/akram-syed/

AkramSyed002 commented 11 months ago

I appreciate your interest. Yes, there is a problem where if you load a saved model, it refuses to yield an output. This problem is stated in the 'Task list' heading in Git Hub. For the paper, I separately wrote a code to predict the results on Google Colab. One way to yield a proper result is to train the model and simultaneously test for the output as provided in the args list in 'train.py' by enabling '--test'. Thank you. On Sat, Dec 2, 2023 at 10:47 AM Akram Syed @.> wrote: i have run your code on google colab and output for model unet using backbone vgg16 Screenshot.2023-12-02.at.1.01.34.PM.png (view on web) https://github.com/dahalsweekar/Deep-Weed-Segmentation/assets/68083755/dff9ed50-8517-4a88-b94b-4f0f190792d6 — Reply to this email directly, view it on GitHub <#1>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AX2WJ2PPVL5XWTYXJRGMLY3YHKY4TAVCNFSM6AAAAABADXYYS2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGAZDCOBVHE2DCMQ . You are receiving this because you are subscribed to this thread.Message ID: @.> -- Engineer, Sweekar Kirtpur, Kathmandu Nepal

I have identified the issue, it is happening because in training, you are sending backbone parameter but in eval and test, it is always set as 'None' so in prepare_dataset.py line 88, normalize changes data to float64 while originally data has been trained on uint8 images so that is why we get blank images so simple correction is to:

(self.Y_train_cat, self.Y_test_cat, self.X_train, self.Y_test, self.X_test, self.p_weights, self.n_classes) = Prepare_Dataset(self.PATCH_SIZE, binary=binary, backbone=backbone, data_path=data_path).prepare_all()

in both eval.py and test.py files, line 39 and line 44 respectively