{"id":31642261,"url":"https://github.com/aliemad5/yolo-keras-object-detection-model","last_synced_at":"2026-04-28T21:35:00.488Z","repository":{"id":314281461,"uuid":"1054892169","full_name":"aliemad5/YOLO-Keras-object-detection-model","owner":"aliemad5","description":"This project runs real-time object detection with YOLOv11 and OpenCV. It captures webcam frames, detects objects, and displays bounding boxes with labels. It uses my custom Keras CNN for training. See details about the CNN at the website below. This code is for view and test only. If you want to use it in real projects read the LICENSE.","archived":false,"fork":false,"pushed_at":"2025-10-04T08:01:56.000Z","size":82,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-04T10:06:50.900Z","etag":null,"topics":["ai","image","keras","object-detection","opencv","python","tensorflow","yolov11"],"latest_commit_sha":null,"homepage":"https://github.com/aliemad5/Keras-custom-image-deep-learning-code?tab=readme-ov-file","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aliemad5.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-11T13:26:21.000Z","updated_at":"2025-10-04T08:01:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"8556bbfb-5138-4e4a-8f04-a9185af0cb33","html_url":"https://github.com/aliemad5/YOLO-Keras-object-detection-model","commit_stats":null,"previous_names":["aliemad5/yolo-keras-object-detection-model"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aliemad5/YOLO-Keras-object-detection-model","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliemad5%2FYOLO-Keras-object-detection-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliemad5%2FYOLO-Keras-object-detection-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliemad5%2FYOLO-Keras-object-detection-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliemad5%2FYOLO-Keras-object-detection-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aliemad5","download_url":"https://codeload.github.com/aliemad5/YOLO-Keras-object-detection-model/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliemad5%2FYOLO-Keras-object-detection-model/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278717448,"owners_count":26033542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"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":["ai","image","keras","object-detection","opencv","python","tensorflow","yolov11"],"created_at":"2025-10-07T03:57:44.656Z","updated_at":"2025-10-07T03:57:52.212Z","avatar_url":"https://github.com/aliemad5.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\nAuthor: Ali Emad Elsamanoudy\n\nEmail:ali.elsamanoudy623@gmail.com\n\n## License\nCopyright (c) 2025 Ali Emad Elsamanoudy\n\n[MIT License](./LICENSE) — **CREDIT REQUIRED. DO NOT IGNORE.**\n\n## What you can do\n\n\n## Requirements\n- Have Google Drive App\n- Have The Keras training model [Custom Keras Model Repo](https://github.com/aliemad5/Keras-custom-image-deep-learning-code)\n- Have Pycharm or VScode\n- Have a working Webcam\n\n## Instructions\n\n\n## Imports\n```python\nfrom ultralytics import YOLO\nfrom tensorflow import keras\nimport cv2\nimport numpy as np\n```\n## Load YOLO model\n```python\nyolo_model = YOLO(\"yolov11n.pt\")\n```\n## Load custom model\nThis project uses a pre-trained Keras model saved as **mykeras.h5**. The full training code, data preprocessing, and experiments for this model are explained in another repository: [Custom Keras Model Repo](https://github.com/aliemad5/Keras-custom-image-deep-learning-code)\n```python\nkeras_model = keras.models.load_model(\"mykeras.h5\")\n```\n# Open Webcam\n```python\nvideo = cv2.VideoCapture(0)\n```\n## Main loop\n```python\nwhile video.isOpened(): \n    ret, frame = video.read()\n    if not ret:\n        break\n\n    results = yolo_model.predict(frame, verbose=False)\n    boxes = results[0].boxes.xyxy.cpu().numpy().astype(int)\n\n    if len(boxes) \u003e 0:\n        for x1, y1, x2, y2 in boxes:\n            cropped = frame[y1:y2, x1:x2]\n            if cropped.size == 0: \n                continue\n\n            cropped_rgb = cv2.cvtColor(cropped, cv2.COLOR_BGR2RGB)\n            resized = cv2.resize(cropped_rgb, (300, 300))\n            expanded = np.expand_dims(resized, axis=0) / 255.0  # normalize\n            prediction = keras_model.predict(expanded, verbose=0)\n            class_id = np.argmax(prediction)\n\n            cv2.rectangle(frame, (x1, y1), (x2, y2), (255, 255, 0), 3)\n            cv2.putText(frame,\n                        f\"Class: {class_id}\",\n                        (x1, y1 - 10),\n                        cv2.FONT_HERSHEY_SIMPLEX,\n                        0.6,\n                        (255, 0, 0),\n                        2)\n\n```\n## Show output and exit\n```python\n    cv2.imshow(\"YOLO + Keras Project\", frame)\n\n   \n    if cv2.waitKey(1) \u0026 0xFF == ord(\"q\"):\n        break\n\n\nvideo.release()\ncv2.destroyAllWindows()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliemad5%2Fyolo-keras-object-detection-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliemad5%2Fyolo-keras-object-detection-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliemad5%2Fyolo-keras-object-detection-model/lists"}