{"id":19347286,"url":"https://github.com/sarthakjshetty/fracture","last_synced_at":"2025-07-31T01:37:12.894Z","repository":{"id":75476063,"uuid":"136440745","full_name":"SarthakJShetty/Fracture","owner":"SarthakJShetty","description":"Vision Based Inspection tool comprising of retrained Inception V3 network and OpenCV Filters for fracture detection. Published at A2IC 2019.","archived":false,"fork":false,"pushed_at":"2019-06-19T05:18:42.000Z","size":966,"stargazers_count":11,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-23T05:41:31.669Z","etag":null,"topics":["computer-vision","image-processing","inceptionv3","opencv","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/SarthakJShetty.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,"zenodo":null}},"created_at":"2018-06-07T07:42:12.000Z","updated_at":"2024-08-12T19:39:09.000Z","dependencies_parsed_at":"2023-06-06T14:45:13.291Z","dependency_job_id":null,"html_url":"https://github.com/SarthakJShetty/Fracture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SarthakJShetty/Fracture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SarthakJShetty%2FFracture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SarthakJShetty%2FFracture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SarthakJShetty%2FFracture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SarthakJShetty%2FFracture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SarthakJShetty","download_url":"https://codeload.github.com/SarthakJShetty/Fracture/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SarthakJShetty%2FFracture/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267972905,"owners_count":24174395,"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-07-30T02:00:09.044Z","response_time":70,"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-processing","inceptionv3","opencv","python"],"created_at":"2024-11-10T04:15:24.916Z","updated_at":"2025-07-31T01:37:12.885Z","avatar_url":"https://github.com/SarthakJShetty.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fracture\nBuilding a Computer Vision based tool for detecting fractures and fatiguing in mechanical components.\n\n### :warning: Code is buggy :warning:\n\n### Introduction:\n- This project aims to develop a tool for identifying fractures and fissures in a mechanical component.\n\n- The tool makes use of OpenCV and TensorFlow. OpenCV is used to visually detect the presence of the fracture and TensorFlow is used to predict the presence of fractures.\n\n\t \u003cstrong\u003eNote:\u003c/strong\u003e Most of the TensorFlow code has been pulled from the TensorFlow repository sans a few changes.\n\n- Paper on the approach \u0026 results presented at the \u003ca title=\"A2IC\" href=\"https://premc.org/conferences/a2ic-artificial-intelligence/\" target=\"_blank\"\u003eArtificial Intelligence International Conference\u003c/a\u003e in Barcelona is available on arXiv \u003ca title=\"arXiv link to paper\" href=\"https://arxiv.org/abs/1901.08864\" target=\"_blank\"\u003ehere\u003c/a\u003e!\n\n### Overview of model:\n\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"https://raw.githubusercontent.com/SarthakJShetty/Fracture/master/Data/Pipeline_Overview_PNG.png\" title=\"Outline of model\"\u003e\n\t\u003cfigcaption\u003e\u003cem\u003eFig 1. Block diagram of pipeline\u003c/em\u003e\n\t\u003c/figcaption\u003e\n\u003c/p\u003e\n\n### Working:\n1. A image is sent to the OpenCV code which runs it through a series of \"Kernels\", which include:\n\n\t- Sobel-X\n\t- Sobel-Y\n\t- Small Blur\n\t- Large Blur\n\t- Sharpen\n\t- Laplacian\n\n2. The OpenCV code serves as a detector for fractures and relays it to the operator.\n\n3. The image is then passed to the ```label_image.py``` [script](https://github.com/SarthakJShetty/Fracture/blob/master/label_image.py), which predicts whether the object is classified as fractured or not.\n\n4. A ```retrain.py``` [script](https://github.com/SarthakJShetty/Fracture/blob/master/retrain.py) code is provided which is trained on the dataset of images. \n\n5. A webscraper has been developed which scrapes Google Images for the images to build your dataset (yet to be developed).\n\n#### Usage:\n\n1. Clone the repository:\n\n\t```git clone https://github.com/SarthakJShetty/Fracture.git```\n\n2. Using the webscraper, scrape images from Google Images to build your dataset.\n\n\t\u003cstrong\u003eUsage:\u003c/strong\u003e ```python webscraper.py --search \"Gears\" --num_images 100 --directory /path/to/dataset/directory```\n\n\t\u003cstrong\u003eNote:\u003c/strong\u003e Make sure that both categories of images are in a common directory.\n\n\t\u003cstrong\u003eCredits: This \u003ca title=\"Webscraper\" href=\"https://github.com/SarthakJShetty/Fracture/blob/master/webscraper.py\"\u003ewebscraper\u003c/a\u003e was written by \u003ca title=\"genekogan\" href=\"http://genekogan.com/\" target=\"_blank\"\u003egenekogan\u003c/a\u003e. All credits to him for developing the scrapper.\u003c/strong\u003e\n\n3. Retrain the final layers of Inception V3, to identify the images in the new dataset.\n\n\t\u003cstrong\u003eUsage:\u003c/strong\u003e ```python retrain.py --image_dir path/to/dataset/directory --path_to_files=\"project_name\"```\n\n\t\u003cstrong\u003eNote:\u003c/strong\u003e The ```path_to_files``` creates a new file ```project_name``` under the ```tmp``` folder, and stores retrain logs, bottlenecks, checkpoints for the project here.\u003c/strong\u003e\n\n4. The previous step will cause logs and graphs to be generated during the training, and will take up a generous amount of space. We require the labels, bottlenecks and output graphs generated for the ```Labeller.py``` script.\n\n5. We can now use ```Labeller.py``` to identify the whether the given component is defective or not. \n\n\t\u003cstrong\u003eUsage:\u003c/strong\u003e ```python Labeller.py --graph=path/of/tmp/file/generated/output_graph.pb --labels=path/of/tmp/file/project_name/generated/labels.txt --output_layer=final_result```\n\n6. The above step triggers the ```VideoCapture()``` function, which displays the camera feed. Once the specimen is in position, press the Q button on the keyboard, the script will retain the latest frame and pass it onto the ```Labeller.py``` and ```Kerneler.py``` programs.\n\n#### Results of Kerneler:\n\n- **Laplacian Kernel:** \n\t\t\u003cp align=\"center\"\u003e\n\t\t\t\u003cimg title=\"Laplacian Filter\" src=\"https://raw.githubusercontent.com/SarthakJShetty/Fracture/master/Results/Laplacian_Gray.jpg\"/\u003e\n\t\t\t\u003cfigcaption\u003e\n\t\t\t\t\u003cem\u003eFig 2. Result of Laplacian Kernel\u003c/em\u003e\n\t\t\t\u003c/figcaption\u003e\n\t\t\u003c/p\u003e\n\n- **Sharpen:** \t\n\t\t\u003cp align=\"center\"\u003e\n\t\t\t\u003cimg title=\"Sharpening filter\" src=\"https://raw.githubusercontent.com/SarthakJShetty/Fracture/master/Results/Sharpen_Gray.jpg\"/\u003e\n\t\t\t\u003cfigcaption\u003e\n\t\t\t\t\u003cem\u003eFig 3. Result of Sharpening Kernel\u003c/em\u003e\n\t\t\t\u003c/figcaption\u003e\n\t\t\u003c/p\u003e\n\n- **Sobel X:** \n\t\t\u003cp align=\"center\"\u003e\n\t\t\t\u003cimg title=\"Sobel-X filter\" src=\"https://raw.githubusercontent.com/SarthakJShetty/Fracture/master/Results/Sobel%20X_Gray.jpg\"/\u003e\n\t\t\t\u003cfigcaption\u003e\n\t\t\t\u003cem\u003eFig 4. Result of Sobel-X Kernel\u003c/em\u003e\n\t\t\t\u003c/figcaption\u003e\n\t\t\u003c/p\u003e\n\n- **Sobel Y:** \n\t\t\u003cp align=\"center\"\u003e\n\t\t\t\u003cimg title=\"Sobel-Y filter\" src=\"https://raw.githubusercontent.com/SarthakJShetty/Fracture/master/Results/Sobel%20Y_Gray.jpg\"/\u003e\n\t\t\t\u003cfigcaption\u003e\n\t\t\t\u003cem\u003eFig 5. Result of Sobel-Y Kernel\u003c/em\u003e\n\t\t\t\u003c/figcaption\u003e\n\t\t\u003c/p\u003e\n\n#### Results of TensorFlow model:\n\n- **\u003ca title=\"Result 1\" href=\"https://raw.githubusercontent.com/SarthakJShetty/Fracture/master/Results/Predictions_Terminal_1.png\"\u003ePrediction 1:\u003c/a\u003e**\n\t\t\u003cp align=\"center\"\u003e\n\t\t\t\u003cimg title=\"Prediction 1\" src=\"https://raw.githubusercontent.com/SarthakJShetty/Fracture/master/Results/Predictions_Terminal_1.png\"\u003e\n\t\t\t\u003cfigcaption\u003e\n\t\t\t\u003cem\u003eFig 6. Prediction 1 made by model\u003c/em\u003e\n\t\t\t\u003c/figcaption\u003e\n\t\t\u003c/p\u003e\n\n- **\u003ca title=\"Result 2\" href=\"\"\u003ePrediction 2:\u003c/a\u003e**\n\t\t\u003cp align=\"center\"\u003e\n\t\t\t\u003cimg title=\"Prediction 2\" src=\"https://raw.githubusercontent.com/SarthakJShetty/Fracture/master/Results/Predictions_Terminal_2.png\"\u003e\n\t\t\t\u003cfigcaption\u003e\n\t\t\t\u003cem\u003eFig 7. Prediction 2 made by model\u003c/em\u003e\n\t\t\t\u003c/figcaption\u003e\n\t\t\u003c/p\u003e\n\n- **Train accuracy:**\n\t\t\u003cp align=\"center\"\u003e\n\t\t\t\u003cimg title=\"Training accuracy\" src=\"https://raw.githubusercontent.com/SarthakJShetty/Fracture/master/Data/TrainingAccuracy_vs_Steps.png\"\u003e\n\t\t\t\u003cfigcaption\u003e\n\t\t\t\u003cem\u003eFig 8. Training Accuracy vs Steps\u003c/em\u003e\n\t\t\t\u003c/figcaption\u003e\n\t\t\u003c/p\u003e\n\n- **Validation accuracy:**\n\t\t\u003cp align=\"center\"\u003e\n\t\t\t\u003cimg title=\"Validation accuracy\" src=\"https://raw.githubusercontent.com/SarthakJShetty/Fracture/master/Data/ValidationAccuracy_vs_Steps.png\"\u003e\n\t\t\t\u003cfigcaption\u003e\n\t\t\t\u003cem\u003eFig 9. Validation Accuracy vs Steps\u003c/em\u003e\n\t\t\t\u003c/figcaption\u003e\n\t\t\u003c/p\u003e\n\n- **Cross-entropy (Training):**\n\t\t\u003cp align=\"center\"\u003e\n\t\t\t\u003cimg title=\"Cross-entropy during training\" src=\"https://raw.githubusercontent.com/SarthakJShetty/Fracture/master/Data/TrainingEntropy_vs_Steps.png\"\u003e\n\t\t\t\u003cfigcaption\u003e\n\t\t\t\u003cem\u003eFig 10. Training Entropy vs Steps\u003c/em\u003e\n\t\t\t\u003c/figcaption\u003e\n\t\t\u003c/p\u003e\n\n- **Cross-entropy (Validation):**\n\t\t\u003cp align=\"center\"\u003e\n\t\t\t\u003cimg title=\"Cross-entropy during validation\" src=\"https://raw.githubusercontent.com/SarthakJShetty/Fracture/master/Data/ValidationEntropy_vs_Steps.png\"\u003e\n\t\t\t\u003cfigcaption\u003e\n\t\t\t\u003cem\u003eFig 11. Validation Entropy vs Steps\u003c/em\u003e\n\t\t\t\u003c/figcaption\u003e\n\t\t\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarthakjshetty%2Ffracture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarthakjshetty%2Ffracture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarthakjshetty%2Ffracture/lists"}