Skip to content

Commit

Permalink
removed excess cell output
Browse files Browse the repository at this point in the history
  • Loading branch information
srivarra committed Oct 14, 2022
1 parent 0485b63 commit 164fe3b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 268 deletions.
83 changes: 6 additions & 77 deletions templates/1_Segment_Image_Data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {
"slideshow": {
"slide_type": "slide"
Expand All @@ -18,17 +18,7 @@
"import"
]
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Matplotlib is building the font cache; this may take a moment.\n",
"<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)\n",
"<jemalloc>: (This is the expected behaviour if you are running under QEMU)\n"
]
}
],
"outputs": [],
"source": [
"# import required packages\n",
"import os\n",
Expand Down Expand Up @@ -99,31 +89,9 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Found cached dataset ark_example (/root/.cache/huggingface/datasets/angelolab___ark_example/segment_image_data/0.0.3/8706b23b2d493ead1f73ea1b46a6e17659a14810779785e49e7e710a923cd62d)\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c9fd353ba7774822903cacef488e410e",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
" 0%| | 0/1 [00:00<?, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"example_dataset.get_example_dataset(dataset=\"segment_image_data\", save_dir = base_dir, overwrite_existing = True)"
]
Expand Down Expand Up @@ -247,52 +215,13 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"metadata": {
"tags": [
"create_output"
]
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Processing tiffs in 3 batches...\n",
"Zipping preprocessed tif files.\n",
"Uploading files to DeepCell server.\n",
"Segmentation progress:\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "4dec7073ce1e455ead9a77dcedd26558",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
" 0%| | 0/100 [00:00<?]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"ename": "KeyboardInterrupt",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn [14], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m deepcell_service_utils\u001b[38;5;241m.\u001b[39mcreate_deepcell_output(deepcell_input_dir, deepcell_output_dir, fovs\u001b[38;5;241m=\u001b[39mfovs, scale\u001b[38;5;241m=\u001b[39mrescale_factor)\n",
"File \u001b[0;32m/usr/local/lib/python3.8/site-packages/ark/utils/deepcell_service_utils.py:160\u001b[0m, in \u001b[0;36mcreate_deepcell_output\u001b[0;34m(deepcell_input_dir, deepcell_output_dir, fovs, suffix, host, job_type, scale, timeout, zip_size, parallel)\u001b[0m\n\u001b[1;32m 158\u001b[0m executor\u001b[38;5;241m.\u001b[39mshutdown(wait\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m)\n\u001b[1;32m 159\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 160\u001b[0m \u001b[38;5;28;43mlist\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mmap\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m_zip_run_extract\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfov_groups\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mrange\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mlen\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mfov_groups\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/usr/local/lib/python3.8/site-packages/ark/utils/deepcell_service_utils.py:124\u001b[0m, in \u001b[0;36mcreate_deepcell_output.<locals>._zip_run_extract\u001b[0;34m(fov_group, group_index)\u001b[0m\n\u001b[1;32m 122\u001b[0m \u001b[38;5;66;03m# pass the zip file to deepcell.org\u001b[39;00m\n\u001b[1;32m 123\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mUploading files to DeepCell server.\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m--> 124\u001b[0m status \u001b[38;5;241m=\u001b[39m \u001b[43mrun_deepcell_direct\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 125\u001b[0m \u001b[43m \u001b[49m\u001b[43mzip_path\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdeepcell_output_dir\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mhost\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mjob_type\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mscale\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\n\u001b[1;32m 126\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 128\u001b[0m \u001b[38;5;66;03m# ensure execution is halted if run_deepcell_direct returned non-zero exit code\u001b[39;00m\n\u001b[1;32m 129\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m status \u001b[38;5;241m!=\u001b[39m \u001b[38;5;241m0\u001b[39m:\n",
"File \u001b[0;32m/usr/local/lib/python3.8/site-packages/ark/utils/deepcell_service_utils.py:286\u001b[0m, in \u001b[0;36mrun_deepcell_direct\u001b[0;34m(input_dir, output_dir, host, job_type, scale, timeout, num_retries)\u001b[0m\n\u001b[1;32m 283\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m redis_response[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mvalue\u001b[39m\u001b[38;5;124m'\u001b[39m][\u001b[38;5;241m0\u001b[39m] \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m [\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mdone\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mwaiting\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mnew\u001b[39m\u001b[38;5;124m'\u001b[39m]:\n\u001b[1;32m 284\u001b[0m \u001b[38;5;28mprint\u001b[39m(redis_response[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mvalue\u001b[39m\u001b[38;5;124m'\u001b[39m])\n\u001b[0;32m--> 286\u001b[0m \u001b[43mtime\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msleep\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m3.0\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 287\u001b[0m total_time \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;241m3\u001b[39m\n\u001b[1;32m 288\u001b[0m progress_bar\u001b[38;5;241m.\u001b[39mclose()\n",
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
]
}
],
"outputs": [],
"source": [
"deepcell_service_utils.create_deepcell_output(deepcell_input_dir, deepcell_output_dir, fovs=fovs, scale=rescale_factor)"
]
Expand Down
Loading

0 comments on commit 164fe3b

Please sign in to comment.