{"id":23112385,"url":"https://github.com/lixx21/simple_object_localization_app","last_synced_at":"2026-04-18T07:32:03.748Z","repository":{"id":132838021,"uuid":"592285396","full_name":"lixx21/simple_object_localization_app","owner":"lixx21","description":"Vegetables object localization app using tensorflow.","archived":false,"fork":false,"pushed_at":"2023-02-01T08:08:42.000Z","size":1063,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-02T07:47:00.646Z","etag":null,"topics":["computer-vision","image-classification","keras","machine-learning","object-localization","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lixx21.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-01-23T11:57:32.000Z","updated_at":"2023-04-05T16:27:34.000Z","dependencies_parsed_at":"2023-07-16T21:01:50.883Z","dependency_job_id":null,"html_url":"https://github.com/lixx21/simple_object_localization_app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lixx21/simple_object_localization_app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixx21%2Fsimple_object_localization_app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixx21%2Fsimple_object_localization_app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixx21%2Fsimple_object_localization_app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixx21%2Fsimple_object_localization_app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lixx21","download_url":"https://codeload.github.com/lixx21/simple_object_localization_app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixx21%2Fsimple_object_localization_app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31961122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["computer-vision","image-classification","keras","machine-learning","object-localization","tensorflow"],"created_at":"2024-12-17T02:17:49.994Z","updated_at":"2026-04-18T07:32:03.718Z","avatar_url":"https://github.com/lixx21.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple_object_localization_app\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;This project is to localization and predict an object in the image **note: this project only detect cucumber, eggplant, and mushroom due the dataset that I used only contains those object**. I also using flask as a backend to create an API and html as an interface to make a web from it.\n\n# Dataset\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;You can get the dataset from [Kaggle - Image Localization Dataset](https://www.kaggle.com/datasets/mbkinaci/image-localization-dataset), The dataset contains object image with jpg format and xml file is contains annotation from the corresponding images. \n\n![image](https://user-images.githubusercontent.com/91602612/215395129-8cdb0cc4-7df1-49df-9925-587cce783edc.png)\n\n# Notebook\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;I built the model in .ipynb file, I used google colab to helped me built the model and this is the explanation about the .ipynb file:\n1. I test to plot image with the bounding box, I done this using ```xml.etree.ElementTree``` library to extract xml fit corresponding image, I extract  xmin, ymin, xmax, and ymax from xml file and plot the bounding box around the image using ```cv2.rectangle()``` with xmin, ymin, xmax, and ymax from the xml files, and this is the result\n\n![image](https://user-images.githubusercontent.com/91602612/215397616-6f14fd0d-ed89-4878-b91e-f40e4ac3a818.png)\n\n2. Then I read all xml files to extract label, xmin, ymin, xmax, and ymax from those xml files and append them into list. I encode the categorical value into numerical value **{\"cucumber\": 0, \"eggplant\": 1, \"mushroom\": 2}**, I also read all image files and append the image into list\n3. I used ```np.array()``` to convert the lists of image files and outputs (contains label, xmin, ymin, xmax, and ymax)\n4. Then I split inputs and outputs array into x_train, x_test, y_train, and y_test, using ```sklearn.model_selection.train_test_split()``` with parameters as follows **test_size = 0.3 and random_state = 42)**\n5. Because y_train and y_test has 5 values contains (label, xmin, ymin, xmax, and ymax) I seperate label with other values (coordinate xmin, ymin, xmax, and ymax to build the bounding box) because our model will have 2 outputs (labels and bounding box coordinate) and 1 input (image array).\n6. I encode the labels using ```tf.keras.utils.to_categorical()```\n7. For the **model** I used pretrained model MobileNetV2 with input_shape = (224,224,3), with 3 classes, weight = 'imagenet' and include_top = False\n8. then I added pretrained model into my own layers, I also compile the model with optimizers = Adam(lr=1e-4), loss function has 2 loss for classification is categorical_crossentropy and for bounding box is mse, also in metrics I used 2 metrics, for classification is accuracy and bounding box is mse. Then I fit the model with 50 epochs, and I get this result\n\n![image](https://user-images.githubusercontent.com/91602612/215409573-77dc380f-ddf5-4401-a938-599722ce90af.png)\n\n9. I saved the model to used in API later\n10. I test the model to predict image and got predict object localization as follows:\n\n![image](https://user-images.githubusercontent.com/91602612/215409758-11c115b7-5829-49bc-a82a-707e7c308b5d.png)\n\n# Web APP\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;For the web app I have:\n1. app.py for my backend and build API\n2. static folder for save static files like image and predicted image\n3. template folder to save html or front end folder\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;Here's the result\n\n![WhatsApp Image 2023-01-26 at 01 40 13](https://user-images.githubusercontent.com/91602612/215410363-8dcb4889-5b24-43f9-8b48-a4e91aade7f4.jpeg)\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flixx21%2Fsimple_object_localization_app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flixx21%2Fsimple_object_localization_app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flixx21%2Fsimple_object_localization_app/lists"}