{"id":21850598,"url":"https://github.com/freakwill/image-encoding","last_synced_at":"2026-05-16T08:42:07.936Z","repository":{"id":236216749,"uuid":"792157545","full_name":"Freakwill/image-encoding","owner":"Freakwill","description":"image encoding by dimensional reduction models (in scikit-learn)","archived":false,"fork":false,"pushed_at":"2024-08-11T11:01:03.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T17:55:47.906Z","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/Freakwill.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}},"created_at":"2024-04-26T05:06:24.000Z","updated_at":"2024-08-11T11:01:06.000Z","dependencies_parsed_at":"2025-03-21T17:49:10.974Z","dependency_job_id":"27348795-a3b3-4b15-a23d-f38b13b80f95","html_url":"https://github.com/Freakwill/image-encoding","commit_stats":null,"previous_names":["freakwill/image-encoding"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Freakwill/image-encoding","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freakwill%2Fimage-encoding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freakwill%2Fimage-encoding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freakwill%2Fimage-encoding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freakwill%2Fimage-encoding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Freakwill","download_url":"https://codeload.github.com/Freakwill/image-encoding/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freakwill%2Fimage-encoding/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266417040,"owners_count":23925300,"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-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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-11-28T00:18:28.625Z","updated_at":"2026-05-16T08:42:07.868Z","avatar_url":"https://github.com/Freakwill.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# image-encoding\nimage encoding by dimensional reduction models (in scikit-learn)\n\n## Examples\n\n### 1\n```python\n    def demo_digit(folder=pathlib.Path.cwd(), *args, **kwargs):\n        if isinstance(folder, str):\n            folder = pathlib.Path(folder)\n\n        from sklearn import datasets\n        digists = datasets.load_digits()\n\n        model = FastICA(*args, **kwargs)   # the backend model\n        enc = ImageEncoder(model, size=(8,8))\n        ip.fit(digists.data * (255//16))\n\n        save_in(enc.eigen_images, folder / 'eigen', exist_ok=True)\n        # generate new images\n        save_in(enc.generate(10, toimage=True), folder / 'eigen', exist_ok=True, prefix='generated')\n\n\n    demo_digit(n_components=15)\n```\n\n### 2\n\n```python\n    def demo_face(folder=pathlib.Path.cwd(), *args, **kwargs):\n        # save images in the folder before demo\n        \n        if isinstance(folder, str):\n            folder = pathlib.Path(folder)\n        # define a backend model, such as PCA, NMF\n        model = PCA(*args, **kwargs)\n        enc = ImageEncoder(model)\n        # a user-friendly API calling `fit` method of the model\n        enc.ezfit(folder=folder)  # folder where the images are stored\n        # save the eigen images in `eigen/` subfolder\n        save_in(enc.eigen_images, folder / 'eigen', exist_ok=True)\n        # generate new images and save them in `generated/` subfolder\n        save_in(enc.generate(10, toimage=True), folder / 'generated', exist_ok=True)\n\n    # save the images (with the same size and mode) in the current path or a special folder\n    demo_face(n_components=10)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreakwill%2Fimage-encoding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreakwill%2Fimage-encoding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreakwill%2Fimage-encoding/lists"}