{"id":25094648,"url":"https://github.com/akshay326/k-means-clustering-api","last_synced_at":"2025-08-19T13:05:57.281Z","repository":{"id":79357918,"uuid":"127620725","full_name":"akshay326/k-means-clustering-api","owner":"akshay326","description":"Sample Python API using flask, uses PyTorch to cluster image vectors","archived":false,"fork":false,"pushed_at":"2018-05-31T11:13:45.000Z","size":48211,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-16T03:53:42.235Z","etag":null,"topics":["api","k-means","k-means-clustering","k-means-implementation-in-python","python","pytorch"],"latest_commit_sha":null,"homepage":null,"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/akshay326.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":"2018-04-01T10:52:31.000Z","updated_at":"2019-10-28T16:15:48.000Z","dependencies_parsed_at":"2023-04-17T13:59:02.583Z","dependency_job_id":null,"html_url":"https://github.com/akshay326/k-means-clustering-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/akshay326/k-means-clustering-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshay326%2Fk-means-clustering-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshay326%2Fk-means-clustering-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshay326%2Fk-means-clustering-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshay326%2Fk-means-clustering-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akshay326","download_url":"https://codeload.github.com/akshay326/k-means-clustering-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshay326%2Fk-means-clustering-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271158498,"owners_count":24709078,"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-08-19T02:00:09.176Z","response_time":63,"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":["api","k-means","k-means-clustering","k-means-implementation-in-python","python","pytorch"],"created_at":"2025-02-07T15:28:27.667Z","updated_at":"2025-08-19T13:05:57.216Z","avatar_url":"https://github.com/akshay326.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# k-means-clustering-api\nSample Python API using flask, uses PyTorch to cluster image vectors. Originally forked [from here](https://github.com/christiansafka/img2vec)\n\n![Flask Logo](https://filestore.hasura.io/v1/file/ee1848f5-9f04-40ba-9d97-60342ba7d673) \n![PyTorch Logo](https://www.tertiarycourses.com.sg/media/catalog/product/cache/1/image/512x/040ec09b1e35df139433887a97daa66f/p/y/pytorch.png) \n![Heroku Logo](https://logmatic.io/wp-content/uploads/2015/05/blogimageheroku1.png)\n\n# How to use\nJust make a __PUT__ request [here](http://beard-app.herokuapp.com/image_clustering) with base64 encoded image data using text/plain.\n \nFor python, refer [sample python script.py](https://github.com/AKS1996/k-means-clustering-api/blob/master/sample_python_script.py)\n\nIn Javascript/AJAX\n```javascript\nvar settings = {\n  \"async\": true,\n  \"crossDomain\": true,\n  \"url\": \"https://beard-app.herokuapp.com/image_clustering\",\n  \"method\": \"PUT\",\n  \"headers\": {\n    \"Content-Type\": \"text/plain\"\n  },\n  \"data\": \"/9j/4A....NpI//Z\"   // This is base64 encoded image data\n\n}\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});\n``` \n\nAlso, try the sample `ImageMatch.apk` android file\n\n## Sample Result\nSample Image \n\n![Image of a cat](cat.jpg)\n\n```json\n[\n  [\n    0.8155140106062471, \n    \"https://www.googleapis.com/download/storage/v1/b/python-clustering-api.appspot.com/o/images%2FFace%2F124.jpg?generation=1522585329188523\u0026alt=media\"\n  ], \n  [\n    0.8145577585207011, \n    \"https://www.googleapis.com/download/storage/v1/b/python-clustering-api.appspot.com/o/images%2FFace%2F242.jpg?generation=1522585299229997\u0026alt=media\"\n  ], \n  [\n    0.7914929138145477, \n    \"https://www.googleapis.com/download/storage/v1/b/python-clustering-api.appspot.com/o/images%2FFace%2F212.jpg?generation=1522584727478100\u0026alt=media\"\n  ], \n  [\n    0.7806927914191767, \n    \"https://www.googleapis.com/download/storage/v1/b/python-clustering-api.appspot.com/o/images%2FFace%2F099.jpg?generation=1522585251917855\u0026alt=media\"\n  ], \n  [\n    0.6948463995381056, \n    \"https://www.googleapis.com/download/storage/v1/b/python-clustering-api.appspot.com/o/images%2FFace%2F119.jpg?generation=1522584693369035\u0026alt=media\"\n  ]\n]\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshay326%2Fk-means-clustering-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakshay326%2Fk-means-clustering-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshay326%2Fk-means-clustering-api/lists"}