Closed bhaveshoswal closed 3 years ago
@bhaveshoswal what is the dataset which you are using ?
@bhaveshoswal @shashankg7 when i run this code i get a error "All input arrays and the target array must have the same number of samples." Can you please help on the same ?
You have to take any five images and five questions on it as I have taken in Texts and Images variable then code will run and make all images size to (224,224)
@bhaveshoswal hi thanks i was able to resolve it. did u tried ur code on flickr data ? in that there are 5 captions for one image , how are you trying to handle that? have u completed training on flickr data ?
I Tried on 5 images and their 5 captions from flicker data
@bhaveshoswal @deepnarainsingh if you are still trying to implement this type of model in Keras (without the ability to finetune the ConvNet), I have a working implementation in this repository.
@bhaveshoswal thanks for your sharing, how to handle real flickr data? are you used data_generator? please explain me, i need that. regards.
@kucingit3m not using data_generator just reshape the image size to (224,224) and do embedding on caption for five caption repeat the image vector five times for it in training data hope thats helps you.
@bhaveshoswal thanks! thats help me. but why my loss model always getting up every epoch, did you ever experienced that?
@bhaveshoswal thanks for the explanation. I have given the input just as you explained above but my loss kept on increasing for every epoch. Did you face such issue while training ?
Also could you also explain how to give the test data. I mean there is only a image present for which we need to get the caption. So how do we give the data for testing ?
Thanks in advance.
@elliottd thanks for your implementation bur it is totally different from what I am trying to do.
@kucingit3m that's same with me
@indra215 you have to give two inputs first image of size (224,224) and other partial caption for example [START A] according to the image you give
@bhaveshoswal thanks for the reply. I've followed your example code above (on a much larger dataset) where in you used the entire caption in the partial_captions
and in the next_words
, you gave the 0 and 1 encoding of the words present in the partial_captions
. But where is this partial caption meaning coming in the data ? I mean you are giving the entire caption in the partial_captions
.
Did you successfully train this model and generated captions on some real data ? If so could you please help me in the code on how to give the input data for training the model.
Also how to give the data while testing on a new image where we don't have any partial_caption
there.
Thank you in advance.
Hi, it seems the image captioning example has gone. @bhaveshoswal Did you finish your codes?
where is the image caption code? I just git cloned the keras code, and there is nothing in there for captioning.
@junyongyou @bhomass This might be of your help https://github.com/anuragmishracse/caption_generator .
The most recent version of the captioning example can be found here. It's an older commit (0b2c044, 8 March 2017) of the keras repo.
Why was it removed from the set of examples?
On Mon, Jun 26, 2017 at 12:11 PM, Pavlos notifications@github.com wrote:
The latest version of the captioning example can be found here https://github.com/fchollet/keras/blob/0b2c044d48a335e97ffef4b6c76031fa12627ec9/docs/templates/getting-started/sequential-model-guide.md#architecture-for-learning-image-captions-with-a-convnet-and-a-gated-recurrent-unit. It's an older commit (8 March 2017) of the keras repo.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fchollet/keras/issues/2295#issuecomment-311005030, or mute the thread https://github.com/notifications/unsubscribe-auth/AFdLCHeNfetGEjS0RIuQM3mMFCFcn9TAks5sH3XPgaJpZM4IGGhT .
Not sure... It works with keras 2 with minor modifications so I don't see a practical reason. Maybe the application was just too niche?
Hello, if someone is interested you can find an image captioning in keras 2.0 here
thanks!
OSError: Unable to open file (Unable to open file: name = 'vgg16_weights.h5', errno = 2, error message = 'no such file or directory', flags = 0, o_flags = 0)
getting this error after writing the convolution layers.any new updated code for this example. please send provide the link for practise
@SJameer You can use vgg16 in keras.applications, here: https://keras.io/applications/#vgg16
@anuragmishracse - how much time does it take for the language model ? My program is running for past 2 hrs on a GPU, still no result .....
I have used the keras example code of Image Captioning in that I have used the VGG pretrained model for extracting image features(4096) and for text part I have done indexing to the unique words and post zero padding according the max caption length(which is equal the length of biggest sentence in data) and for next words I created a numpy array of (number of example, vocabulary size) vocabulary size is equal to number of unique words in data. The next words is a 1's 0's matrix 1 means present of word in the sentence 0 absence.
for predicting what should be given exactly in partial caption and in next words if we consider "cat sat on mat".
And in training data I am appending "START" and "END" tokens in the start and end of training captions.
here is my code:
correct me if I am doing wrong in code
for this task i am taking only 5 example to know the working of this model and also I want to know whether my approach is right or wrong. Afterwords I am going to use flickr8k dataset for the same