nicolafan / image-captioning-cnn-rnn

Tensorflow/Keras implementation of an image captioning neural network, using CNN and RNN
MIT License
6 stars 1 forks source link

Prediction plot: fix axes #11

Closed vijaybirju closed 1 year ago

vijaybirju commented 1 year ago

Closes #10

Remove cartesian axes from the prediction plot

nicolafan commented 1 year ago

Hi and thank you for this PR! Just two tweaks and it's ok.

vijaybirju commented 1 year ago

is it going to merge? It is my first PR😅 or still some change required

vijaybirju commented 1 year ago

Hey nicolafan , is there something to change? can you please guide This is first PR

nicolafan commented 1 year ago

No problem :smile:. Usually a PR is followed by a review (the one I started) and the reviewer (me) and contributor (you) continue to add commits until everything is OK. In our case, I've opened a review and I made some suggestions for you to correct something. Usually, the reviewer waits some time for the contributor to add the requested things. If the contributor seems not to be interested anymore in the PR, the reviewer closes it or makes the needed changes. So I was waiting for you to add the changes I've commented. You don't have to do it right now :smile: . @vijaybirju

nicolafan commented 1 year ago

Basically we should add the axis("off") to the len(images) == 1 case and remove it from the second-last line of the main function.

vijaybirju commented 1 year ago

Ohh ok, it sad it could be my first PR

nicolafan commented 1 year ago

You can add the new commits to the same branch, and they will be included in this PR.

vijaybirju commented 1 year ago

Ok, I am going to do it but I don't what exactly I have to do

nicolafan commented 1 year ago

Ahhh ok you mean in terms of code. Let's see:

# visualize results
    # Create a grid of subplots
    fig, axs = plt.subplots(math.ceil(len(images) / 3), 3, figsize=(5, 5))

    if len(images) == 1:
        image, caption = predictions[0]
        axs.imshow(image)
        axs.set_title(caption)
      # add here axs.axis("off"), this is the case where we have a single image to show
      # and we must turn the axes off
    else:
        i = 0
        j = 0
        for image, caption in predictions:
            # Plot each image in a separate subplot with a caption
            axs[i][j].imshow(image)
            axs[i][j].set_title(caption, fontsize="8")
            axs[i][j].axis("off") # this is what you added
            j += 1
            if j >= 3:
                j = 0
                i += 1

    # Show the plot
    plt.axis("off") # remove this line, it is not needed now
    plt.show()

These are the changes we need to do. Let me know if there are any problems.

vijaybirju commented 1 year ago

No, I know the code but how do I push will i merge it or push it i made changes in my fork repo

nicolafan commented 1 year ago

Ok, you have to push the changes on vijaybirju:patch-1. They will automatically appear here. Then I will merge them.

vijaybirju commented 1 year ago

should I make a changs in patch-1 in my repo or In your repo? I made changes know how it going to merge is anything remains from my side

nicolafan commented 1 year ago

New changes should be made in the same branch of the PR (patch-1) of your repo. Once you push them, they will be visible here.

vijaybirju commented 1 year ago

I have pushed

vijaybirju commented 1 year ago

image

is it mean I have pushed changes?

nicolafan commented 1 year ago

I've seen in your repo. Basically, you pushed on branch main of your repo, which means that these changes are not available here. You should push on the same branch on which you opened a PR. This branch, in your case, is patch-1.

vijaybirju commented 1 year ago

Done nicolanfan,

nicolafan commented 1 year ago

Great! Thank you for contributing :smile:

vijaybirju commented 1 year ago

Thanks for guiding me like a brother. I can't express my gratitude in words. A random guy from the internet helps me that much, i was not expected

vijaybirju commented 1 year ago

ok i will delete it

image what is this

nicolafan commented 1 year ago

Thank you for these words! There are many things to learn when one does their first PR. It was the same thing also for me and I was helped in the same way!

The screen you shared is your GitHub story, it shows that you contributed to this repository. It is a good thing! :smile:

vijaybirju commented 1 year ago

Thanks you