{"id":20681494,"url":"https://github.com/cizodevahm/image-caption-generator","last_synced_at":"2026-04-22T19:33:34.699Z","repository":{"id":255333998,"uuid":"849263553","full_name":"cizodevahm/Image-Caption-Generator","owner":"cizodevahm","description":"This project is an image caption generator that uses a deep learning model to generate captions for images. The model is trained using the Flickr8k dataset and leverages a pre-trained Xception model for feature extraction and an LSTM network for sequence processing.","archived":false,"fork":false,"pushed_at":"2024-08-29T09:54:05.000Z","size":60,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T20:45:45.002Z","etag":null,"topics":["captions","deep-learning","imagecaptioning","lstm","nueral-networks","xception-model"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cizodevahm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-29T09:27:26.000Z","updated_at":"2024-08-29T09:57:29.000Z","dependencies_parsed_at":"2024-08-29T11:13:18.321Z","dependency_job_id":null,"html_url":"https://github.com/cizodevahm/Image-Caption-Generator","commit_stats":null,"previous_names":["cizodevahm/image-caption-generator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cizodevahm/Image-Caption-Generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cizodevahm%2FImage-Caption-Generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cizodevahm%2FImage-Caption-Generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cizodevahm%2FImage-Caption-Generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cizodevahm%2FImage-Caption-Generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cizodevahm","download_url":"https://codeload.github.com/cizodevahm/Image-Caption-Generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cizodevahm%2FImage-Caption-Generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32152594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T17:06:48.269Z","status":"ssl_error","status_checked_at":"2026-04-22T17:06:19.037Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["captions","deep-learning","imagecaptioning","lstm","nueral-networks","xception-model"],"created_at":"2024-11-16T22:11:04.444Z","updated_at":"2026-04-22T19:33:34.675Z","avatar_url":"https://github.com/cizodevahm.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image Caption Generator\nThis project is an image caption generator that uses a deep learning model to generate captions for images. The model is trained using the Flickr8k dataset and leverages a pre-trained Xception model for feature extraction and an LSTM network for sequence processing.\n\n## Requirements\n- Python 3.x\n- NumPy\n- Pillow\n- Keras\n- TensorFlow\n- tqdm\n\n## Installation\nTo install the required packages, run:\n```bash\npip install numpy pillow keras tensorflow tqdm\n```\n\n## Usage\n**Training**\n1. Prepare the Dataset:\n  - Download the Flickr8k dataset [1](https://github.com/jbrownlee/Datasets/releases/download/Flickr8k/Flickr8k_Dataset.zip) [2](https://github.com/jbrownlee/Datasets/releases/download/Flickr8k/Flickr8k_text.zip) and place the images in a directory.\n  - Ensure the captions file is in the correct format and location.\n2. Run the Notebook:\n  - Open the Jupyter Notebook ```training_caption_generator.ipynb```.\n  - Follow the steps in the notebook to preprocess the data, extract features, and train the model.\n\n**Testing**\n1. Run the Testing Script:\n - Use the provided ```testing_caption_generator.py``` script to generate captions for new images.\n - Example usage:\n  ```bash\n   python testing_caption_generator.py --image \u003cpath_to_image\u003e\n  ```\n\n## Functions\n**Training Functions**\n\n- ```load_doc(filename)```: Loads a text file into memory.\n- ```all_img_captions(filename)```: Retrieves all images with their captions.\n- ```cleaning_text(captions)```: Cleans the text by lowercasing, removing punctuation, and filtering out \nwords with numbers.\n- ```text_vocabulary(descriptions)```: Builds a vocabulary of all unique words.\n- ```save_descriptions(descriptions, filename)```: Saves all descriptions to a file.\n- ```extract_features(directory)```: Extracts features from images using the Xception model.\n- ```data_generator(descriptions, features, tokenizer, max_length)```: Generates input-output sequence \npairs for training.\n- ```define_model(vocab_size, max_length)```: Defines the image captioning model architecture.\n\n**Testing Functions**\n\n- ```extract_features(filename, model)```: Extracts features from an image using the Xception model.\n- ```word_for_id(integer, tokenizer)```: Maps an integer to a word using the tokenizer.\n- ```generate_desc(model, tokenizer, photo, max_length)```: Generates a caption for an image using the \ntrained model.\n\n## License\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcizodevahm%2Fimage-caption-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcizodevahm%2Fimage-caption-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcizodevahm%2Fimage-caption-generator/lists"}