diff --git a/examples/check_dataset.ipynb b/examples/check_dataset.ipynb index 98e025b..c9d0af0 100644 --- a/examples/check_dataset.ipynb +++ b/examples/check_dataset.ipynb @@ -90,10 +90,14 @@ "# for Tierpsy tracker data this will be the root path of a folder containing subfolders for each videos\n", "dataset_path = \"wormpose_data/datasets/sample_data\"\n", "\n", + "# Set if the worm is lighter than the background in the image\n", + "# In the sample data, the worm is darker so we set this variable to False\n", + "worm_is_lighter = False\n", + "\n", "# This function loads the dataset\n", "# optional fields: there is an optional resize parameter to resize the images\n", "# also you can select specific videos from the dataset instead of loading them all\n", - "dataset = load_dataset(dataset_loader, dataset_path)" + "dataset = load_dataset(dataset_loader, dataset_path, worm_is_lighter=worm_is_lighter)" ] }, { @@ -310,9 +314,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.4" + "version": "3.8.6" } }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +} diff --git a/examples/tutorial_sample_data.ipynb b/examples/tutorial_sample_data.ipynb index 0d6347c..bca4a4b 100644 --- a/examples/tutorial_sample_data.ipynb +++ b/examples/tutorial_sample_data.ipynb @@ -97,10 +97,14 @@ "dataset_root_name = os.path.basename(os.path.normpath(dataset_path))\n", "project_dir = os.path.join(default_paths.WORK_DIR, dataset_root_name)\n", "\n", + "# Set if the worm is lighter than the background in the image\n", + "# in the sample data, the worm is darker so we set this variable to False\n", + "worm_is_lighter = False\n", + "\n", "# This function loads the dataset\n", "# optional fields: there is an optional resize parameter to resize the images\n", "# also you can select specific videos from the dataset instead of loading them all\n", - "dataset = load_dataset(dataset_loader, dataset_path)" + "dataset = load_dataset(dataset_loader, dataset_path, worm_is_lighter=worm_is_lighter)" ] }, { @@ -153,7 +157,9 @@ "from wormpose.demo.synthetic_simple_visualizer import SyntheticSimpleVisualizer\n", "from ipython_utils import ImagesViewer, display_as_slider\n", "\n", - "synth_viz = SyntheticSimpleVisualizer(dataset_loader, dataset_path).generate()\n", + "synth_viz = SyntheticSimpleVisualizer(dataset_loader,\n", + " dataset_path, \n", + " worm_is_lighter=worm_is_lighter).generate()\n", "img_viewer, img_viewer_plot = ImagesViewer(), ImagesViewer()\n", "num_images = 50\n", "\n", @@ -194,7 +200,9 @@ "from wormpose.demo.real_simple_visualizer import RealSimpleVisualizer\n", "from ipython_utils import ImagesViewer, display_as_slider\n", "\n", - "viz = RealSimpleVisualizer(dataset_loader, dataset_path).generate()\n", + "viz = RealSimpleVisualizer(dataset_loader, \n", + " dataset_path, \n", + " worm_is_lighter=worm_is_lighter).generate()\n", "orig_img_viewer, processed_img_viewer = ImagesViewer(), ImagesViewer()\n", "\n", "max_viz = 100\n", @@ -234,7 +242,10 @@ "from wormpose.commands import calibrate\n", "from ipython_utils import ImagesViewer\n", "\n", - "video_name, result_file = next(calibrate(dataset_loader, dataset_path, save_images=True))\n", + "video_name, result_file = next(calibrate(dataset_loader, \n", + " dataset_path, \n", + " worm_is_lighter=worm_is_lighter,\n", + " save_images=True))\n", "\n", "VIEW_SCORES = 5\n", "\n", @@ -285,7 +296,8 @@ "display(fp)\n", "\n", "gen_progress = generate(dataset_loader,\n", - " dataset_path, \n", + " dataset_path,\n", + " worm_is_lighter=worm_is_lighter,\n", " num_train_samples=1000)\n", "for progress_value in gen_progress:\n", " fp.value = progress_value" @@ -447,9 +459,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.5" + "version": "3.8.6" } }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +}