{"id":28712431,"url":"https://github.com/polusai/theia","last_synced_at":"2025-06-14T23:05:50.551Z","repository":{"id":171386826,"uuid":"627479258","full_name":"PolusAI/theia","owner":"PolusAI","description":"A scalable deep learning based bleed through correction algorithm.","archived":false,"fork":false,"pushed_at":"2024-02-02T14:00:22.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-04-14T02:55:37.208Z","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/PolusAI.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}},"created_at":"2023-04-13T14:50:51.000Z","updated_at":"2023-04-14T11:58:54.000Z","dependencies_parsed_at":"2024-02-02T15:25:14.718Z","dependency_job_id":"458ab3a3-13aa-41ec-8213-8cb6ad3b7a02","html_url":"https://github.com/PolusAI/theia","commit_stats":null,"previous_names":["polusai/theia"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PolusAI/theia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolusAI%2Ftheia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolusAI%2Ftheia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolusAI%2Ftheia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolusAI%2Ftheia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PolusAI","download_url":"https://codeload.github.com/PolusAI/theia/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolusAI%2Ftheia/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259896237,"owners_count":22928331,"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","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":"2025-06-14T23:05:49.596Z","updated_at":"2025-06-14T23:05:50.526Z","avatar_url":"https://github.com/PolusAI.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Theia (v0.1.2)\n\nBleed-Through Correction in Fluorescent Microscopy Images\n\n## Installation\n\n### Linux\n\n- From PyPI: `pip install \"theia-py==0.1.2\"`\n- Using poetry: `poetry add theia-py@0.1.2`\n\n### MacOS (Apple Silicon)\n\n1. Install xcode command line tools:\n   - `xcode-select --install`\n2. Install miniforge:\n   - [Instructions](https://github.com/conda-forge/miniforge)\n3. Disable the `base` conda environment from activating by default:\n  - `conda config --set auto_activate_base false`\n4. Install poetry:\n  - `curl -sSL https://install.python-poetry.org | python3 -`\n  - Add poetry to your path using the hint provided by the poetry installer.\n5. Create a conda environment:\n  - `conda create -n theia python=3.9`\n  - `conda activate theia`\n6. Install tensorflow dependencies:\n  - `conda install -c apple tensorflow-deps`\n7. Install using poetry:\n  - `poetry add theia-py@0.1.2`\n\n### Windows\n\n1. Re-evaluate your life choices.\n2. Install Linux.\n3. Read this document from the beginning.\n\n## Usage\n\nHere is a simple example of how to use Theia to correct a set of images.\nFor a more detailed example, see the streamlit app in `examples/rxrx.py`.\n\n```python\nimport theia\n\n# Load training and validation images\ntrain_images = ...\nvalid_images = ...\n\n# Make a tile-generator for feeding the model\ntrain_generator = theia.TileGenerator(train_images, tile_size=(256, 256), normalize=False)\nvalid_generator = theia.TileGenerator(valid_images, tile_size=(256, 256), normalize=False)\n\n# Build the model\nmodel = theia.models.Neural(\n    num_channels=...,\n    channel_overlap=1,\n    kernel_size=5,\n    alpha=1,\n    beta=1,\n    tile_size=256,\n)\nmodel.early_stopping(\n    min_delta=1e-3,\n    patience=4,\n    verbose=1,\n    restore_best_weights=True,\n)\nmodel.compile(optimizer=\"adam\")\nmodel.fit_theia(\n    train_gen=train_gen,\n    valid_gen=valid_gen,\n    epochs=128,\n    verbose=1,\n)\n\n# Get the transformer\ntransformer = model.transformer\n\n# Correct and save the images\nfor image in train_images + valid_images:\n    corrected_image = transformer.transform(image, remove_interactions=True)\n    with open(\"\u003cpath-to-image\u003e\", \"w\") as f:\n        ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolusai%2Ftheia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolusai%2Ftheia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolusai%2Ftheia/lists"}