Skip to content

Commit

Permalink
Adding new/updated cellcanvas_generate-pixel-embedding_0.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuowenzhao committed Aug 13, 2024
1 parent 0922059 commit 1255220
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
Binary file modified album_catalog_index.db
Binary file not shown.
3 changes: 3 additions & 0 deletions solutions/cellcanvas/generate-pixel-embedding/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.8] - 2024-08-13


## [0.1.7] - 2024-08-11
Remove defaults

Expand Down
18 changes: 10 additions & 8 deletions solutions/cellcanvas/generate-pixel-embedding/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
- nvidia
- conda-forge
dependencies:
- python=3.10
- cudatoolkit=11.8
- python=3.9
- cudatoolkit
- pytorch
- torchvision
- torchaudio
- pytorch-cuda=11.8
- pytorch-cuda
- numpy
- pip
- pytorch-lightning
Expand All @@ -22,7 +22,7 @@
- zarr
- pip:
- git+https://github.com/morphometrics/morphospaces.git
- git+https://github.com/uermel/copick.git
- copick==0.5.5
"""

MODEL_URL = "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/model_swinvit.pt"
Expand Down Expand Up @@ -56,12 +56,14 @@ def run():
import numpy as np
from monai.inferers import sliding_window_inference
from copick.impl.filesystem import CopickRootFSSpec
from copick.models import TCopickFeatures
# from copick.models import TCopickFeatures
from morphospaces.networks.swin_unetr import PixelEmbeddingSwinUNETR
from numcodecs import Blosc
from torch.cuda.amp import autocast
import sys
import torch

print(f'Cuda is available {torch.cuda.is_available()}')
# Dummy classes for Qt components
class DummyQtComponent:
def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -121,7 +123,7 @@ class DummyQtWidgetsModule:

print(f"Determined embedding dimension: {embedding_dim}")

copick_features: TCopickFeatures = tomogram.new_features(embedding_name)
copick_features = tomogram.new_features(embedding_name)
out_array = zarr.open_array(store=copick_features.zarr(),
compressor=Blosc(cname='zstd', clevel=3, shuffle=2),
dtype='float32',
Expand Down Expand Up @@ -173,7 +175,7 @@ def sliding_window_processor(image, roi_size, overlap, device):
setup(
group="cellcanvas",
name="generate-pixel-embedding",
version="0.1.7",
version="0.1.8",
title="Predict Tomogram Embeddings with SwinUNETR using Copick API",
description="Apply a SwinUNETR model to a tomogram fetched using the Copick API to produce embeddings, and save them in a Zarr.",
solution_creators=["Kyle Harrington"],
Expand All @@ -192,4 +194,4 @@ def sliding_window_processor(image, roi_size, overlap, device):
dependencies={
"environment_file": env_file
},
)
)
6 changes: 3 additions & 3 deletions solutions/cellcanvas/generate-pixel-embedding/solution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ args:
name: embedding_name
required: true
type: string
changelog: Remove defaults
changelog: null
description: Apply a SwinUNETR model to a tomogram fetched using the Copick API to
produce embeddings, and save them in a Zarr.
group: cellcanvas
Expand All @@ -37,6 +37,6 @@ tags:
- deep learning
- cryoet
- tomogram
timestamp: '2024-08-11T10:17:32.207012'
timestamp: '2024-08-13T15:10:07.510854'
title: Predict Tomogram Embeddings with SwinUNETR using Copick API
version: 0.1.7
version: 0.1.8

0 comments on commit 1255220

Please sign in to comment.