From 045dccddd847846b3633017dd4d633e86f1195c8 Mon Sep 17 00:00:00 2001 From: guillem Date: Mon, 10 Aug 2026 08:36:04 +0200 Subject: [PATCH 1/3] feat: fix image plot example, add necessary libraries and README link --- README.md | 4 +++ .../DTEx207_GAN_image_generation.ipynb | 28 +++++++++---------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b71be91c2..a7035749d 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,10 @@ Here you find a series of notebooks providing an overview of the core features o These are examples of how DeepTrack2 can be used on real datasets: +- DTEx207 **[Gan Image Generation](https://github.com/DeepTrackAI/DeepTrack2/blob/develop/tutorials/2-examples/DTEx207_GAN_image_generation.ipynb)** + + Genereting realistic electron microscopy images with a conditional GAN + - DTEx211 **[MNIST](https://github.com/DeepTrackAI/DeepTrack2/blob/develop/tutorials/2-examples/DTEx211_MNIST.ipynb)** Training a fully connected neural network to identify handwritten digits using MNIST dataset. diff --git a/tutorials/2-examples/DTEx207_GAN_image_generation.ipynb b/tutorials/2-examples/DTEx207_GAN_image_generation.ipynb index 3a9f2fb9c..63dfff7d2 100644 --- a/tutorials/2-examples/DTEx207_GAN_image_generation.ipynb +++ b/tutorials/2-examples/DTEx207_GAN_image_generation.ipynb @@ -1,17 +1,5 @@ { "cells": [ - { - "cell_type": "raw", - "id": "512bca8a", - "metadata": { - "vscode": { - "languageId": "raw" - } - }, - "source": [ - "# TODO: Complete example" - ] - }, { "cell_type": "markdown", "id": "1c61223d", @@ -32,12 +20,22 @@ "# !pip install deeptrack # Uncomment if running on Colab/Kaggle." ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "005cac6c", + "metadata": {}, + "outputs": [], + "source": [ + "# !pip install deeplay # Uncomment if needed" + ] + }, { "cell_type": "markdown", "id": "04e6451e", "metadata": {}, "source": [ - "In this tutorial, you will train a conditional GAN to translate segmentation masks into realistic electron microscopy images. The dataset contains raw ssTEM images paired with segmentation maps that identify structures in the tissue.\n", + "In this tutorial, you will train a conditional GAN to translate segmentation masks into realistic electron microscopy images. The dataset contains raw sTEM images paired with segmentation maps that identify structures in the tissue.\n", "\n", "You will prepare the dataset, build the generator and discriminator, train the GAN to generate images, and finally evaluate the model by comparing generated images with the ground truth." ] @@ -163,7 +161,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "cbedf5da", "metadata": {}, "outputs": [], @@ -175,7 +173,7 @@ " >> dt.Lambda(select_labels, class_labels=[255, 191]))\n", " \n", "pip = ((seg_pip & im_pip) >> dt.FlipLR(sources.flip_lr)\n", - " >> dt.FlipUD(sources.flip_ud) >> dt.Crop(crop=(256, 256, 3))\n", + " >> dt.FlipUD(sources.flip_ud) >> dt.Crop(crop=(256, 256, 3), time_consistent=True)\n", " >> dt.MoveAxis(2, 0) >> dt.pytorch.ToTensor(dtype=torch.float))" ] }, From 230a727a931f7de7c0831dab3742e40abf14343e Mon Sep 17 00:00:00 2001 From: guillem Date: Mon, 10 Aug 2026 10:40:16 +0200 Subject: [PATCH 2/3] fix: explanation in markdown cell --- tutorials/2-examples/DTEx207_GAN_image_generation.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/2-examples/DTEx207_GAN_image_generation.ipynb b/tutorials/2-examples/DTEx207_GAN_image_generation.ipynb index 63dfff7d2..3fa6acbe3 100644 --- a/tutorials/2-examples/DTEx207_GAN_image_generation.ipynb +++ b/tutorials/2-examples/DTEx207_GAN_image_generation.ipynb @@ -35,7 +35,7 @@ "id": "04e6451e", "metadata": {}, "source": [ - "In this tutorial, you will train a conditional GAN to translate segmentation masks into realistic electron microscopy images. The dataset contains raw sTEM images paired with segmentation maps that identify structures in the tissue.\n", + "In this tutorial, you will train a conditional GAN to translate segmentation masks into realistic electron microscopy images. The dataset contains raw serial section transmission electron microscopy (ssTEM) images paired with segmentation maps that identify structures in the tissue.\n", "\n", "You will prepare the dataset, build the generator and discriminator, train the GAN to generate images, and finally evaluate the model by comparing generated images with the ground truth." ] From af01f1867a4960842b3f79726d3f43b985631211 Mon Sep 17 00:00:00 2001 From: guillem Date: Mon, 10 Aug 2026 10:45:11 +0200 Subject: [PATCH 3/3] ci: remove old reference to GAN notebook --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index a7035749d..a5045410e 100644 --- a/README.md +++ b/README.md @@ -162,10 +162,6 @@ These are examples of how DeepTrack2 can be used on real datasets: Tracking multiple particles in 3D for holography. -- DTEx217 **GAN image generation** - - Using a GAN to create cell image from masks. - Specific examples for label-free particle tracking using **LodeSTAR**: - DTEx231A **LodeSTAR to Detect Particles**