{"id":16516748,"url":"https://github.com/adamspannbauer/lens_blur","last_synced_at":"2025-07-24T14:33:53.212Z","repository":{"id":83432134,"uuid":"170877665","full_name":"AdamSpannbauer/lens_blur","owner":"AdamSpannbauer","description":null,"archived":false,"fork":false,"pushed_at":"2019-02-15T17:25:05.000Z","size":6867,"stargazers_count":5,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-05T06:51:56.752Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/AdamSpannbauer.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}},"created_at":"2019-02-15T14:29:06.000Z","updated_at":"2022-10-18T12:02:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"6cc2b3d9-097b-4b8e-80dd-cdf7e77c17ae","html_url":"https://github.com/AdamSpannbauer/lens_blur","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AdamSpannbauer/lens_blur","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdamSpannbauer%2Flens_blur","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdamSpannbauer%2Flens_blur/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdamSpannbauer%2Flens_blur/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdamSpannbauer%2Flens_blur/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdamSpannbauer","download_url":"https://codeload.github.com/AdamSpannbauer/lens_blur/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdamSpannbauer%2Flens_blur/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266856125,"owners_count":23995632,"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-24T02:00:09.469Z","response_time":99,"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":[],"created_at":"2024-10-11T16:26:32.905Z","updated_at":"2025-07-24T14:33:53.202Z","avatar_url":"https://github.com/AdamSpannbauer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Poor Man's Portrait Mode\n\n\u003e Inspired by [Computerphile](https://www.youtube.com/watch?v=vNG3ZAd8wCc)\n\nQuickly thrown together imitation of iPhone's 'portrait mode'.  Made with Mask RCNN and a complex kernel lens blur.\n\nPerformance is... quite terrible on my local machine, but no need/desire to optimize.\n\n### Example Output\n\n\u003cp align='center'\u003e\n  \u003cimg src='readme/example_output.png' width=85%\u003e\n\u003c/p\u003e\n\n### Process\n\n* Run pre-trained COCO Mask RCNN (reference: [GluonCV](https://gluon-cv.mxnet.io/api/model_zoo.html#gluoncv.model_zoo.MaskRCNN)).\n* Assume largest detected object mask is focal point.\n* Apply lens blur everywhere but on largest detected object (reference: [Computerphile](https://github.com/mikepound/convolve))\n\n\n### Example Usage\n\nThis is the code used to generate the above example output (found in file: [`apply_portrait_mode.py`](apply_portrait_mode.py)).\n\n```python\nimport cv2\nfrom portrait_mode import portrait_mode\n\nIMAGE_PATH = 'images/jasper_deck.jpg'\n\n# Run detection and blurring effects\nportrait_mode_img, original_img = portrait_mode(IMAGE_PATH)\n\n# Display results\ncv2.imshow(\"Poor Man's Portrait Mode\", portrait_mode_img)\ncv2.imshow('Original', original_img)\ncv2.waitKey(0)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamspannbauer%2Flens_blur","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamspannbauer%2Flens_blur","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamspannbauer%2Flens_blur/lists"}