Skip to main content

Build Status Open In Colab

Contents

Installation

pip install devolearn

Example notebooks

Segmenting the C. elegans embryo

  • Importing the model
from devolearn import embryo_segmentor
segmentor = embryo_segmentor()
  • Running the model on an image and viewing the prediction
seg_pred = segmentor.predict(image_path = "sample_data/images/seg_sample.jpg")
plt.imshow(seg_pred)
plt.show()
  • Running the model on a video and saving the predictions into a folder
filenames = segmentor.predict_from_video(video_path = "sample_data/videos/seg_sample.mov", centroid_mode = False, save_folder = "preds")
  • Finding the centroids of the segmented features
seg_pred, centroids = segmentor.predict(image_path = "sample_data/images/seg_sample.jpg", centroid_mode = True)
plt.imshow(seg_pred)
plt.show()
  • Saving the centroids from each frame into a CSV
df = segmentor.predict_from_video(video_path = "sample_data/videos/seg_sample.mov", centroid_mode = True, save_folder = "preds")
df.to_csv("centroids.csv")

Generating synthetic images of embryos with a Pre-trained GAN

  • Importing the model
from devolearn import Generator, embryo_generator_model
generator = embryo_generator_model()
  • Generating a picture and viewing it with matplotlib
gen_image = generator.generate()  
plt.imshow(gen_image)
plt.show()
  • Generating n images and saving them into foldername with a custom size
generator.generate_n_images(n = 5, foldername= "generated_images", image_size= (700,500))

Predicting populations of cells within the C. elegans embryo

  • Importing the population model for inferences
from devolearn import lineage_population_model
  • Loading a model instance to be used to estimate lineage populations of embryos from videos/photos.
model = lineage_population_model(mode = "cpu")
  • Making a prediction from an image
print(model.predict(image_path = "sample_data/images/embryo_sample.png"))
  • Making predictions from a video and saving the predictions into a CSV file
results = model.predict_from_video(video_path = "sample_data/videos/embryo_timelapse.mov", save_csv = True, csv_name = "video_preds.csv", ignore_first_n_frames= 10, ignore_last_n_frames= 10 )
  • Plotting the model's predictions from a video
plot = model.create_population_plot_from_video(video_path = "sample_data/videos/embryo_timelapse.mov", save_plot= True, plot_name= "plot.png", ignore_last_n_frames= 0 )
plot.show()
Model Data source
Segmenting the C. elegans embryo 3DMMS: robust 3D Membrane Morphological Segmentation of C. elegans embryo
Cell lineage population prediction + embryo GAN EPIC dataset

Authors/maintainers:

Feel free to join our Slack workspace!

Metadata

Release files for devolearn 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for devolearn 0.3.0
File Size Uploaded
devolearn-0.3.0.tar.gz 1.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for devolearn 0.3.0
File Interpreter ABI Platform
devolearn-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.8 MB

Release files / devolearn-0.3.0.tar.gz

Download URL devolearn-0.3.0.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
c41bd25f208cf1e0b3f6ea896dcc03cfc251b866c1fc6003ae884e434c308d28
BLAKE2b-256 checksum
How to use checksums
47ced07bb787ad37ea1ac301c4ec88c649a0cf3ddf0d8acfd6266c8ba76841aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

Release files / devolearn-0.3.0-py3-none-any.whl

Download URL devolearn-0.3.0-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c62c1382071cb61c84cae1806ecb0843704e8348cf7c6b2eefa1e149defc4efd
BLAKE2b-256 checksum
How to use checksums
cb35ef245a00a00632ea0a2e6c4c58e863755d4681497ce5dff0209241297f52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page