spacr 0.4.60__py3-none-any.whl → 0.9.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. spacr/__init__.py +2 -4
  2. spacr/__main__.py +3 -3
  3. spacr/core.py +13 -107
  4. spacr/gui.py +0 -1
  5. spacr/gui_core.py +2 -2
  6. spacr/gui_utils.py +5 -14
  7. spacr/io.py +189 -200
  8. spacr/mediar.py +12 -8
  9. spacr/plot.py +50 -13
  10. spacr/settings.py +71 -14
  11. spacr/submodules.py +21 -14
  12. spacr/timelapse.py +192 -6
  13. spacr/utils.py +180 -56
  14. {spacr-0.4.60.dist-info → spacr-0.9.0.dist-info}/METADATA +64 -62
  15. {spacr-0.4.60.dist-info → spacr-0.9.0.dist-info}/RECORD +20 -72
  16. {spacr-0.4.60.dist-info → spacr-0.9.0.dist-info}/WHEEL +1 -1
  17. spacr/resources/MEDIAR/.gitignore +0 -18
  18. spacr/resources/MEDIAR/LICENSE +0 -21
  19. spacr/resources/MEDIAR/README.md +0 -189
  20. spacr/resources/MEDIAR/SetupDict.py +0 -39
  21. spacr/resources/MEDIAR/config/baseline.json +0 -60
  22. spacr/resources/MEDIAR/config/mediar_example.json +0 -72
  23. spacr/resources/MEDIAR/config/pred/pred_mediar.json +0 -17
  24. spacr/resources/MEDIAR/config/step1_pretraining/phase1.json +0 -55
  25. spacr/resources/MEDIAR/config/step1_pretraining/phase2.json +0 -58
  26. spacr/resources/MEDIAR/config/step2_finetuning/finetuning1.json +0 -66
  27. spacr/resources/MEDIAR/config/step2_finetuning/finetuning2.json +0 -66
  28. spacr/resources/MEDIAR/config/step3_prediction/base_prediction.json +0 -16
  29. spacr/resources/MEDIAR/config/step3_prediction/ensemble_tta.json +0 -23
  30. spacr/resources/MEDIAR/core/BasePredictor.py +0 -120
  31. spacr/resources/MEDIAR/core/BaseTrainer.py +0 -240
  32. spacr/resources/MEDIAR/core/Baseline/Predictor.py +0 -59
  33. spacr/resources/MEDIAR/core/Baseline/Trainer.py +0 -113
  34. spacr/resources/MEDIAR/core/Baseline/__init__.py +0 -2
  35. spacr/resources/MEDIAR/core/Baseline/utils.py +0 -80
  36. spacr/resources/MEDIAR/core/MEDIAR/EnsemblePredictor.py +0 -105
  37. spacr/resources/MEDIAR/core/MEDIAR/Predictor.py +0 -234
  38. spacr/resources/MEDIAR/core/MEDIAR/Trainer.py +0 -172
  39. spacr/resources/MEDIAR/core/MEDIAR/__init__.py +0 -3
  40. spacr/resources/MEDIAR/core/MEDIAR/utils.py +0 -429
  41. spacr/resources/MEDIAR/core/__init__.py +0 -2
  42. spacr/resources/MEDIAR/core/utils.py +0 -40
  43. spacr/resources/MEDIAR/evaluate.py +0 -71
  44. spacr/resources/MEDIAR/generate_mapping.py +0 -121
  45. spacr/resources/MEDIAR/image/examples/img1.tiff +0 -0
  46. spacr/resources/MEDIAR/image/examples/img2.tif +0 -0
  47. spacr/resources/MEDIAR/image/failure_cases.png +0 -0
  48. spacr/resources/MEDIAR/image/mediar_framework.png +0 -0
  49. spacr/resources/MEDIAR/image/mediar_model.PNG +0 -0
  50. spacr/resources/MEDIAR/image/mediar_results.png +0 -0
  51. spacr/resources/MEDIAR/main.py +0 -125
  52. spacr/resources/MEDIAR/predict.py +0 -70
  53. spacr/resources/MEDIAR/requirements.txt +0 -14
  54. spacr/resources/MEDIAR/train_tools/__init__.py +0 -3
  55. spacr/resources/MEDIAR/train_tools/data_utils/__init__.py +0 -1
  56. spacr/resources/MEDIAR/train_tools/data_utils/custom/CellAware.py +0 -88
  57. spacr/resources/MEDIAR/train_tools/data_utils/custom/LoadImage.py +0 -161
  58. spacr/resources/MEDIAR/train_tools/data_utils/custom/NormalizeImage.py +0 -77
  59. spacr/resources/MEDIAR/train_tools/data_utils/custom/__init__.py +0 -3
  60. spacr/resources/MEDIAR/train_tools/data_utils/custom/modalities.pkl +0 -0
  61. spacr/resources/MEDIAR/train_tools/data_utils/datasetter.py +0 -208
  62. spacr/resources/MEDIAR/train_tools/data_utils/transforms.py +0 -148
  63. spacr/resources/MEDIAR/train_tools/data_utils/utils.py +0 -84
  64. spacr/resources/MEDIAR/train_tools/measures.py +0 -200
  65. spacr/resources/MEDIAR/train_tools/models/MEDIARFormer.py +0 -102
  66. spacr/resources/MEDIAR/train_tools/models/__init__.py +0 -1
  67. spacr/resources/MEDIAR/train_tools/utils.py +0 -70
  68. spacr/stats.py +0 -221
  69. /spacr/{cellpose.py → spacr_cellpose.py} +0 -0
  70. {spacr-0.4.60.dist-info → spacr-0.9.0.dist-info}/LICENSE +0 -0
  71. {spacr-0.4.60.dist-info → spacr-0.9.0.dist-info}/entry_points.txt +0 -0
  72. {spacr-0.4.60.dist-info → spacr-0.9.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spacr
3
- Version: 0.4.60
3
+ Version: 0.9.0
4
4
  Summary: Spatial phenotype analysis of crisp screens (SpaCr)
5
5
  Home-page: https://github.com/EinarOlafsson/spacr
6
6
  Author: Einar Birnir Olafsson
@@ -10,76 +10,78 @@ Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  Description-Content-Type: text/x-rst
12
12
  License-File: LICENSE
13
- Requires-Dist: numpy<2.0,>=1.26.4
14
- Requires-Dist: pandas<3.0,>=2.2.1
15
- Requires-Dist: scipy<2.0,>=1.12.0
16
- Requires-Dist: cellpose<4.0,>=3.0.6
17
- Requires-Dist: scikit-image<1.0,>=0.22.0
18
- Requires-Dist: scikit-learn<2.0,>=1.4.1
19
- Requires-Dist: scikit-posthocs<0.20,>=0.10.0
20
- Requires-Dist: mahotas<2.0,>=1.4.13
21
- Requires-Dist: btrack<1.0,>=0.6.5
22
- Requires-Dist: trackpy<1.0,>=0.6.2
23
- Requires-Dist: statsmodels<1.0,>=0.14.1
24
- Requires-Dist: shap<1.0,>=0.45.0
25
- Requires-Dist: torch<3.0,>=2.0
26
- Requires-Dist: torchvision<1.0,>=0.1
27
- Requires-Dist: torch-geometric<3.0,>=2.5
28
- Requires-Dist: torchcam<1.0,>=0.4.0
29
- Requires-Dist: transformers<5.0,>=4.45.2
30
- Requires-Dist: segmentation-models-pytorch>=0.3.3
31
- Requires-Dist: monai>=1.3.0
32
- Requires-Dist: captum<1.0,>=0.7.0
33
- Requires-Dist: seaborn<1.0,>=0.13.2
34
- Requires-Dist: matplotlib<4.0,>=3.8.3
35
- Requires-Dist: matplotlib-venn<2.0,>=1.1
36
- Requires-Dist: adjustText<2.0,>=1.2.0
37
- Requires-Dist: bottleneck<2.0,>=1.3.6
38
- Requires-Dist: numexpr<3.0,>=2.8.4
39
- Requires-Dist: opencv-python-headless<5.0,>=4.9.0.80
40
- Requires-Dist: pillow<11.0,>=10.2.0
41
- Requires-Dist: tifffile>=2023.4.12
42
- Requires-Dist: nd2reader<4.0,>=3.3.0
13
+ Requires-Dist: numpy <2.0,>=1.26.4
14
+ Requires-Dist: pandas <3.0,>=2.2.1
15
+ Requires-Dist: scipy <2.0,>=1.12.0
16
+ Requires-Dist: cellpose <4.0,>=3.0.6
17
+ Requires-Dist: scikit-image <1.0,>=0.22.0
18
+ Requires-Dist: scikit-learn <2.0,>=1.4.1
19
+ Requires-Dist: scikit-posthocs <0.20,>=0.10.0
20
+ Requires-Dist: mahotas <2.0,>=1.4.13
21
+ Requires-Dist: btrack <1.0,>=0.6.5
22
+ Requires-Dist: trackpy <1.0,>=0.6.2
23
+ Requires-Dist: statsmodels <1.0,>=0.14.1
24
+ Requires-Dist: shap <1.0,>=0.45.0
25
+ Requires-Dist: torch <3.0,>=2.0
26
+ Requires-Dist: torchvision <1.0,>=0.1
27
+ Requires-Dist: torch-geometric <3.0,>=2.5
28
+ Requires-Dist: torchcam <1.0,>=0.4.0
29
+ Requires-Dist: transformers <5.0,>=4.45.2
30
+ Requires-Dist: segmentation-models-pytorch >=0.3.3
31
+ Requires-Dist: monai >=1.3.0
32
+ Requires-Dist: captum <1.0,>=0.7.0
33
+ Requires-Dist: seaborn <1.0,>=0.13.2
34
+ Requires-Dist: matplotlib <4.0,>=3.8.3
35
+ Requires-Dist: matplotlib-venn <2.0,>=1.1
36
+ Requires-Dist: adjustText <2.0,>=1.2.0
37
+ Requires-Dist: bottleneck <2.0,>=1.3.6
38
+ Requires-Dist: numexpr <3.0,>=2.8.4
39
+ Requires-Dist: opencv-python-headless <5.0,>=4.9.0.80
40
+ Requires-Dist: pillow <11.0,>=10.2.0
41
+ Requires-Dist: tifffile >=2023.4.12
42
+ Requires-Dist: nd2reader <4.0,>=3.3.0
43
43
  Requires-Dist: czifile
44
+ Requires-Dist: pylibCZIrw <6.0,>=5.0.0
45
+ Requires-Dist: aicspylibczi
44
46
  Requires-Dist: readlif
45
- Requires-Dist: imageio<3.0,>=2.34.0
46
- Requires-Dist: pingouin<1.0,>=0.5.5
47
- Requires-Dist: umap-learn<1.0,>=0.5.6
48
- Requires-Dist: ttkthemes<4.0,>=3.2.2
49
- Requires-Dist: xgboost<3.0,>=2.0.3
50
- Requires-Dist: PyWavelets<2.0,>=1.6.0
51
- Requires-Dist: ttf-opensans>=2020.10.30
52
- Requires-Dist: customtkinter<6.0,>=5.2.2
53
- Requires-Dist: biopython<2.0,>=1.80
54
- Requires-Dist: lxml<6.0,>=5.1.0
55
- Requires-Dist: psutil<6.0,>=5.9.8
56
- Requires-Dist: gputil<2.0,>=1.4.0
57
- Requires-Dist: gpustat<2.0,>=1.1.1
58
- Requires-Dist: pyautogui<1.0,>=0.9.54
59
- Requires-Dist: tables<4.0,>=3.8.0
60
- Requires-Dist: rapidfuzz<4.0,>=3.9
61
- Requires-Dist: keyring<16.0,>=15.1
62
- Requires-Dist: screeninfo<1.0,>=0.8.1
63
- Requires-Dist: fastremap>=1.14.1
64
- Requires-Dist: pytz>=2023.3.post1
65
- Requires-Dist: tqdm>=4.65.0
66
- Requires-Dist: wandb>=0.16.2
67
- Requires-Dist: openai<2.0,>=1.50.2
47
+ Requires-Dist: imageio <3.0,>=2.34.0
48
+ Requires-Dist: pingouin <1.0,>=0.5.5
49
+ Requires-Dist: umap-learn <1.0,>=0.5.6
50
+ Requires-Dist: ttkthemes <4.0,>=3.2.2
51
+ Requires-Dist: xgboost <3.0,>=2.0.3
52
+ Requires-Dist: PyWavelets <2.0,>=1.6.0
53
+ Requires-Dist: ttf-opensans >=2020.10.30
54
+ Requires-Dist: customtkinter <6.0,>=5.2.2
55
+ Requires-Dist: biopython <2.0,>=1.80
56
+ Requires-Dist: lxml <6.0,>=5.1.0
57
+ Requires-Dist: psutil <6.0,>=5.9.8
58
+ Requires-Dist: gputil <2.0,>=1.4.0
59
+ Requires-Dist: gpustat <2.0,>=1.1.1
60
+ Requires-Dist: pyautogui <1.0,>=0.9.54
61
+ Requires-Dist: tables <4.0,>=3.8.0
62
+ Requires-Dist: rapidfuzz <4.0,>=3.9
63
+ Requires-Dist: keyring <16.0,>=15.1
64
+ Requires-Dist: screeninfo <1.0,>=0.8.1
65
+ Requires-Dist: fastremap >=1.14.1
66
+ Requires-Dist: pytz >=2023.3.post1
67
+ Requires-Dist: tqdm >=4.65.0
68
+ Requires-Dist: wandb >=0.16.2
69
+ Requires-Dist: openai <2.0,>=1.50.2
68
70
  Requires-Dist: gdown
69
- Requires-Dist: IPython<9.0,>=8.18.1
71
+ Requires-Dist: IPython <9.0,>=8.18.1
70
72
  Requires-Dist: ipykernel
71
- Requires-Dist: ipywidgets<9.0,>=8.1.2
72
- Requires-Dist: brokenaxes<1.0,>=0.6.2
73
- Requires-Dist: huggingface-hub<0.25,>=0.24.0
73
+ Requires-Dist: ipywidgets <9.0,>=8.1.2
74
+ Requires-Dist: brokenaxes <1.0,>=0.6.2
75
+ Requires-Dist: huggingface-hub <0.25,>=0.24.0
74
76
  Provides-Extra: dev
75
- Requires-Dist: pytest<3.11,>=3.9; extra == "dev"
77
+ Requires-Dist: pytest <3.11,>=3.9 ; extra == 'dev'
76
78
  Provides-Extra: full
77
- Requires-Dist: opencv-python; extra == "full"
79
+ Requires-Dist: opencv-python ; extra == 'full'
78
80
  Provides-Extra: headless
79
- Requires-Dist: opencv-python-headless; extra == "headless"
81
+ Requires-Dist: opencv-python-headless ; extra == 'headless'
80
82
 
81
83
  .. |Documentation Status| image:: https://readthedocs.org/projects/spacr/badge/?version=latest
82
- :target: https://spacr.readthedocs.io/en/latest/?badge=latest
84
+ :target: https://einarolafsson.github.io/spacr
83
85
  .. |PyPI version| image:: https://badge.fury.io/py/spacr.svg
84
86
  :target: https://badge.fury.io/py/spacr
85
87
  .. |Python version| image:: https://img.shields.io/pypi/pyversions/spacr
@@ -1,5 +1,5 @@
1
- spacr/__init__.py,sha256=iPlE-WRc1CjSNGPMbVvEKlJsTQlKjq29VjzvNUCpcOM,1401
2
- spacr/__main__.py,sha256=bkAJJD2kjIqOP-u1kLvct9jQQCeUXzlEjdgitwi1Lm8,75
1
+ spacr/__init__.py,sha256=EoGInYks0M4foZElYNhksrQK6aEO1au7cncWexWNhRw,1376
2
+ spacr/__main__.py,sha256=H4MjaMF9ohZL6xfl1kTxVn1Nt_vEhhZArENMMBv8f4E,77
3
3
  spacr/app_annotate.py,sha256=W9eLPa_LZIvXsXx_-0iDFEU938LBDvRy6prXo0qF4KQ,2533
4
4
  spacr/app_classify.py,sha256=urTP_wlZ58hSyM5a19slYlBxN0PdC-9-ga0hvq8CGWc,165
5
5
  spacr/app_make_masks.py,sha256=pqDhRpluiHZz-kPX2Zh_KbYe4TsU43qYBa_7f-rsjpw,1694
@@ -7,82 +7,30 @@ spacr/app_mask.py,sha256=l-dBY8ftzCMdDe6-pXc2Nh_u-idNL9G7UOARiLJBtds,153
7
7
  spacr/app_measure.py,sha256=_K7APYIeOKpV6e_LcqabBjvEi7mfq9Fch8175x1x0k8,162
8
8
  spacr/app_sequencing.py,sha256=DjG26jy4cpddnV8WOOAIiExtOe9MleVMY4MFa5uTo5w,157
9
9
  spacr/app_umap.py,sha256=ZWAmf_OsIKbYvolYuWPMYhdlVe-n2CADoJulAizMiEo,153
10
- spacr/cellpose.py,sha256=RBHMs2vwXcfkj0xqAULpALyzJYXddSRycgZSzmwI7v0,14755
11
10
  spacr/chat_bot.py,sha256=n3Fhqg3qofVXHmh3H9sUcmfYy9MmgRnr48663MVdY9E,1244
12
- spacr/core.py,sha256=ghesCiRKxdHqnujztb9XiuhhZ-3gBs7aQIIzvqaf-iI,51409
11
+ spacr/core.py,sha256=w4E3Pg-ZnA8BOK0iUMTjiNO0GeR5YCEs8fUTbESzqjY,47392
13
12
  spacr/deep_spacr.py,sha256=055tIo3WP3elGFiIuSZaLURgu2XyUDxAdbw5ezASEqM,54526
14
- spacr/gui.py,sha256=ARyn9Q_g8HoP-cXh1nzMLVFCKqthY4v2u9yORyaQqQE,8230
15
- spacr/gui_core.py,sha256=AYXZpdKMRezJfS7Xcfztdc2yco6lV21ovwkyKQGbIZg,56206
13
+ spacr/gui.py,sha256=NhMh96KoArrSAaJBV6PhDQpIC1cQpxgb6SclhRbYG8s,8122
14
+ spacr/gui_core.py,sha256=jQPDQVP43YL_AW7Sm8cIQgdZVaB9Yig8U6ov9clCYOc,56180
16
15
  spacr/gui_elements.py,sha256=5a3BOpctBPklsT1NungqS72h1Bg1FArUndE0OfvWD8Y,152646
17
- spacr/gui_utils.py,sha256=dWVPFwDj793Z3ERG4mMC0hI0MKkOrvXJpUYlcjpCBsU,41357
18
- spacr/io.py,sha256=eZj5RCqje3xb_4BwPC0ASBqI-c7_6EeQYv8zrQf0tCc,159371
16
+ spacr/gui_utils.py,sha256=vv_uBOA0n-04KCCicYHhNt3sRbm0IPLM5r8QX5EkJ1Q,40867
17
+ spacr/io.py,sha256=SYLhupKnOJJscNSGE4N67E32-ywhwrjRccIfZrL38Uk,157966
19
18
  spacr/logger.py,sha256=lJhTqt-_wfAunCPl93xE65Wr9Y1oIHJWaZMjunHUeIw,1538
20
19
  spacr/measure.py,sha256=Z3u4BU5RzcY82IZuboQ0OsxuXaPVwOlH65Rw6FrL5z4,55045
21
- spacr/mediar.py,sha256=FwLvbLQW5LQzPgvJZG8Lw7GniA2vbZx6Jv6vIKu7I5c,14743
20
+ spacr/mediar.py,sha256=p0F515eFbm6_rePSnChsgqrgH-H5Sr_3zWrghtOnAUg,14863
22
21
  spacr/ml.py,sha256=XCRZeX7UkbMctQICIoskeWVx8CCmmCoHNauUOAkfFq0,91692
23
22
  spacr/openai.py,sha256=5vBZ3Jl2llYcW3oaTEXgdyCB2aJujMUIO5K038z7w_A,1246
24
- spacr/plot.py,sha256=lmpIJozfxMyOyGAMno4j-C7NPjDYRMr29SDAnrV-bb4,170815
23
+ spacr/plot.py,sha256=DGQulM2425DFVRMT9ZVvZW8EMxnc3hzjXhcL7fTMrGA,172668
25
24
  spacr/sequencing.py,sha256=EY12RdW5QRKpHDRQCw1QoAlxCq8FK2v6WoVa5uuDBXQ,26745
26
- spacr/settings.py,sha256=j2H5OieJKwu-TITlfP5tAnUGUhBjng8ECy3jXm3JMb8,86599
25
+ spacr/settings.py,sha256=LzJbebCRkDVYJxbojZKQE88MJ8Fg8iR6HZNHjN_np28,88687
27
26
  spacr/sim.py,sha256=1xKhXimNU3ukzIw-3l9cF3Znc_brW8h20yv8fSTzvss,71173
28
27
  spacr/sp_stats.py,sha256=mbhwsyIqt5upsSD346qGjdCw7CFBa0tIS7zHU9e0jNI,9536
29
- spacr/stats.py,sha256=mbhwsyIqt5upsSD346qGjdCw7CFBa0tIS7zHU9e0jNI,9536
30
- spacr/submodules.py,sha256=dNiUqwDYwJ2J1s3DkwGLOTB-TzyGq_GXoojpCrLMm7A,82812
31
- spacr/timelapse.py,sha256=lh3Aev5S7Ou1YWPBYBYeSGU0I-NPb0-4znYfm2NYf_I,39629
28
+ spacr/spacr_cellpose.py,sha256=RBHMs2vwXcfkj0xqAULpALyzJYXddSRycgZSzmwI7v0,14755
29
+ spacr/submodules.py,sha256=Z2i4kv_rWdxqoXsOKCF7BaSXtvaCZB69Ow8_FQBnZsY,83093
30
+ spacr/timelapse.py,sha256=YJciEQS15eVC9R9adcen62xx7uttGAr_Gaz1vGX2Ke8,46824
32
31
  spacr/toxo.py,sha256=GoNfgyH-NJx3WOzNQPgzODir7Jp65fs7UM46XpzcrUo,26056
33
- spacr/utils.py,sha256=20FRbevoFmPA61vS50tR48g6DpGkIvInGPv9nE810gQ,231668
32
+ spacr/utils.py,sha256=ddeLh_KWA1bQsB9R3OtljFmsoWrriWjIJDq7x61J_XI,236185
34
33
  spacr/version.py,sha256=axH5tnGwtgSnJHb5IDhiu4Zjk5GhLyAEDRe-rnaoFOA,409
35
- spacr/resources/MEDIAR/.gitignore,sha256=Ff1q9Nme14JUd-4Q3jZ65aeQ5X4uttptssVDgBVHYo8,152
36
- spacr/resources/MEDIAR/LICENSE,sha256=yEj_TRDLUfDpHDNM0StALXIt6mLqSgaV2hcCwa6_TcY,1065
37
- spacr/resources/MEDIAR/README.md,sha256=TlL2XhmmNhYTtaBlMCnlJRW-K7qOVeqH1ABLabZAe2k,11877
38
- spacr/resources/MEDIAR/SetupDict.py,sha256=oHyOrGgKTRYbTjqlLWv1HXWAQ39urXih9AI56h4vcFk,869
39
- spacr/resources/MEDIAR/evaluate.py,sha256=7exc1Du1RXGelme7wAodcqPd6VIe_nFdOoPT2w09O-4,2181
40
- spacr/resources/MEDIAR/generate_mapping.py,sha256=6FqWgAegWExUF2DFc_vOQzH1c7g9-efhNDpq2t7lGh8,3688
41
- spacr/resources/MEDIAR/main.py,sha256=8KKelA75anJbvpCGXQbAO5OipHE-hx-q04_OB2Z90NQ,3573
42
- spacr/resources/MEDIAR/predict.py,sha256=V2GUdy3LM595gCoAjBOk22-QitaKRKRqJX3Hgdc4FEU,2141
43
- spacr/resources/MEDIAR/requirements.txt,sha256=7fapaH6LrDiKsdkjkl8oQ8oR2u49-n-OChMWa5wg7fY,225
44
- spacr/resources/MEDIAR/config/baseline.json,sha256=moqZ8Bf0rf1hcoJswp9EvE1IrqSfO4lzJGkj3-emIqc,1603
45
- spacr/resources/MEDIAR/config/mediar_example.json,sha256=B6mFpDgCpOJpN4Foj1hC_X4zCRyWXra3XsZ0DBqvGnQ,2114
46
- spacr/resources/MEDIAR/config/pred/pred_mediar.json,sha256=oE4YmuPFfH6_rK9PFBRX18aIPalZfni3NYGfRtOhTIU,385
47
- spacr/resources/MEDIAR/config/step1_pretraining/phase1.json,sha256=UuIkrGMZZmfMYpreh41BH9Yq3fBhBxoWAyeOR53oGsU,1520
48
- spacr/resources/MEDIAR/config/step1_pretraining/phase2.json,sha256=CIoi54TOI74laouA222-iIBrRGTrZ3pg8HQolpDquxo,1640
49
- spacr/resources/MEDIAR/config/step2_finetuning/finetuning1.json,sha256=073AeKRJLv-O7gyET0_SAxnFkwZ-Rcc4zNoql3f1p7c,1923
50
- spacr/resources/MEDIAR/config/step2_finetuning/finetuning2.json,sha256=SfNAH5Kt3Xet23JN0CKp7Lnm8mKNpOYrdmQZ0BBM5Rs,1936
51
- spacr/resources/MEDIAR/config/step3_prediction/base_prediction.json,sha256=qCinHOIatRvgqhNF-Ucx6YwIj9lRVWj0p_O9z5OY6j8,478
52
- spacr/resources/MEDIAR/config/step3_prediction/ensemble_tta.json,sha256=7NmBQTgyGBw1XFB4uWEGebj8CAoh1FklJbJPuhQwQQg,803
53
- spacr/resources/MEDIAR/core/BasePredictor.py,sha256=lvjAnHK7WXoaqnWI-1juf3_XU_v-ePo8Rme6qJc7Uq4,3664
54
- spacr/resources/MEDIAR/core/BaseTrainer.py,sha256=E-fayADu9A5Vd80NyZY49xFl2lPgLsoh4Nd3HkDjp5U,7428
55
- spacr/resources/MEDIAR/core/__init__.py,sha256=pR63haYRlkWrc9btVLSLVhk6nc94vmqreAs5H8I9LOw,46
56
- spacr/resources/MEDIAR/core/utils.py,sha256=h4z0Mdl08p3ftOwfAqtMVJ9-c6qBVna_9w9s0L25YBM,948
57
- spacr/resources/MEDIAR/core/Baseline/Predictor.py,sha256=mDHSG2jSJyLWr_j2gSzADjfmb0Ol76GI30HfpV0XR3U,1535
58
- spacr/resources/MEDIAR/core/Baseline/Trainer.py,sha256=OzkFeSF0sRn1Wej253I4h99f7v9wD3tKv88YYXLAtd4,3451
59
- spacr/resources/MEDIAR/core/Baseline/__init__.py,sha256=WinVVW50c_UhZDcUkX4RESjy8eSQOjMiU-KynfSGP_I,48
60
- spacr/resources/MEDIAR/core/Baseline/utils.py,sha256=V2e4a00ZdYFlHFaorLTI1CgX8gt_KFSfrpm_XikygiA,2370
61
- spacr/resources/MEDIAR/core/MEDIAR/EnsemblePredictor.py,sha256=5BSz3mwe9B26aTQiNhqwDI2VxAOxnvNsjAhYlFMuBDw,3416
62
- spacr/resources/MEDIAR/core/MEDIAR/Predictor.py,sha256=FfA012HXmvrMnYJBsovCdgbrWL5-Ca-PwZN1mIsNfik,6763
63
- spacr/resources/MEDIAR/core/MEDIAR/Trainer.py,sha256=7OueMwovWxSb8UY033X--KJnk55Mh5EQu6LGdUl8_OU,5745
64
- spacr/resources/MEDIAR/core/MEDIAR/__init__.py,sha256=yFkZq29jm8Sf-Bf_h1KAiMaUxU47uBeOMU27m92fjh8,81
65
- spacr/resources/MEDIAR/core/MEDIAR/utils.py,sha256=1rcVONsnnPvIEkPW1mu5mCt1YQJqXPtAyEWtxAQIvpE,14641
66
- spacr/resources/MEDIAR/image/failure_cases.png,sha256=y9mmqGJ5Q5FNpHCekio_UZdrxGLraRXn2yZLLm__rNI,2390420
67
- spacr/resources/MEDIAR/image/mediar_framework.png,sha256=wucJ9Qyoi4Yi_A-D0HyCpEw8-bjFHS7AAeyzfQL7Iks,1048242
68
- spacr/resources/MEDIAR/image/mediar_model.PNG,sha256=JQuxGxfGcBY07-JRBGhtDA0FcKnENV_7HVy3uAq3_rE,348059
69
- spacr/resources/MEDIAR/image/mediar_results.png,sha256=LffVaF8WQ9yq8hkmGQBvTklzy3KlopsrtZ4NKzB0oLk,3213351
70
- spacr/resources/MEDIAR/image/examples/img1.tiff,sha256=GNl9ngl5ZVEz0Dvy1RoEQipSCcavAQx_I1LwUOuQM3o,921872
71
- spacr/resources/MEDIAR/image/examples/img2.tif,sha256=YAk6yYRVOu6Gg8X4BUo_LaSfMZraH-uAN8gF6Cs0ivs,8414906
72
- spacr/resources/MEDIAR/train_tools/__init__.py,sha256=XXnPlgCbF3GEfnwIbUB2MniUl2Ve6QOf7jhEuiqbiis,71
73
- spacr/resources/MEDIAR/train_tools/measures.py,sha256=LOJmJzLVO4XsJX4XHuppuXknN5HncarDV5url39GRzA,5770
74
- spacr/resources/MEDIAR/train_tools/utils.py,sha256=7ISUS0Uw-dU83XD-WFzNTOPBX4SwSoF0iWNGMcGmTZM,1911
75
- spacr/resources/MEDIAR/train_tools/data_utils/__init__.py,sha256=QVo7-uqgr0vdP4s8nZ47LKDqxabnzbO0MKt8E1sR8as,26
76
- spacr/resources/MEDIAR/train_tools/data_utils/datasetter.py,sha256=uiPhC46gQMbeYhpTehX4Qm0_dUQJ6NXaVCg3a19HGpA,6323
77
- spacr/resources/MEDIAR/train_tools/data_utils/transforms.py,sha256=vNZQB_qPh-Jeovb1FhnbCUFl6HoV6px7QHa4ZC8RO-Q,5147
78
- spacr/resources/MEDIAR/train_tools/data_utils/utils.py,sha256=yJo2BSLr9ARwTkuJwIoSJrZXPE4E3DlPRAT97hQzYwY,2556
79
- spacr/resources/MEDIAR/train_tools/data_utils/custom/CellAware.py,sha256=bG100wH2okxnnEQh0ZRR3GM8n99azB2z5iu7aINXjm0,2865
80
- spacr/resources/MEDIAR/train_tools/data_utils/custom/LoadImage.py,sha256=wK69UHjCzq2L2_Ny5m9I5H6DGYRF8yCfmhCA39DOCW4,5431
81
- spacr/resources/MEDIAR/train_tools/data_utils/custom/NormalizeImage.py,sha256=7DfWVusYRRuEyA8eXujNyGJz0dubx7b7uhgEzzrh3-4,2152
82
- spacr/resources/MEDIAR/train_tools/data_utils/custom/__init__.py,sha256=SalCNvPyiy0rqLpjdoXPXGoWlKf-8K9vtDQ70HXOXe0,80
83
- spacr/resources/MEDIAR/train_tools/data_utils/custom/modalities.pkl,sha256=C1D7NkUZ5er7Kdeyhhwjo0IGUvCsVfKPBzcwfaORd8Q,3762
84
- spacr/resources/MEDIAR/train_tools/models/MEDIARFormer.py,sha256=UN8BYjraTNNdZUAGjl3yF566ERHAHQvj3GAQ6OETUOI,3615
85
- spacr/resources/MEDIAR/train_tools/models/__init__.py,sha256=CkY6rZxr-c9XxXNpQbYUYvHXDpf9E6rUmY1bQ47aEP8,28
86
34
  spacr/resources/data/lopit.csv,sha256=ERI5f9W8RdJGiSx_khoaylD374f8kmvLia1xjhD_mII,4421709
87
35
  spacr/resources/data/toxoplasma_metadata.csv,sha256=9TXx0VlClDHAxQmaLhoklE8NuETduXaGHZjhR_6lZfs,2969409
88
36
  spacr/resources/font/open_sans/OFL.txt,sha256=bGMoWBRrE2RcdzDiuYiB8A9OVFlJ0sA2imWwce2DAdo,4484
@@ -153,9 +101,9 @@ spacr/resources/icons/umap.png,sha256=dOLF3DeLYy9k0nkUybiZMe1wzHQwLJFRmgccppw-8b
153
101
  spacr/resources/images/plate1_E01_T0001F001L01A01Z01C02.tif,sha256=Tl0ZUfZ_AYAbu0up_nO0tPRtF1BxXhWQ3T3pURBCCRo,7958528
154
102
  spacr/resources/images/plate1_E01_T0001F001L01A02Z01C01.tif,sha256=m8N-V71rA1TT4dFlENNg8s0Q0YEXXs8slIn7yObmZJQ,7958528
155
103
  spacr/resources/images/plate1_E01_T0001F001L01A03Z01C03.tif,sha256=Pbhk7xn-KUP6RSIhJsxQcrHFImBm3GEpLkzx7WOc-5M,7958528
156
- spacr-0.4.60.dist-info/LICENSE,sha256=SR-2MeGc6SCM1UORJYyarSWY_A-JaOMFDj7ReSs9tRM,1083
157
- spacr-0.4.60.dist-info/METADATA,sha256=Na4GGSJEuobmjgAo8HSbejQ0h8E1etVHb249v5oBB6Y,6096
158
- spacr-0.4.60.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
159
- spacr-0.4.60.dist-info/entry_points.txt,sha256=BMC0ql9aNNpv8lUZ8sgDLQMsqaVnX5L535gEhKUP5ho,296
160
- spacr-0.4.60.dist-info/top_level.txt,sha256=GJPU8FgwRXGzKeut6JopsSRY2R8T3i9lDgya42tLInY,6
161
- spacr-0.4.60.dist-info/RECORD,,
104
+ spacr-0.9.0.dist-info/LICENSE,sha256=SR-2MeGc6SCM1UORJYyarSWY_A-JaOMFDj7ReSs9tRM,1083
105
+ spacr-0.9.0.dist-info/METADATA,sha256=mk6s6xqwjy95ZgAc3fxWVNAoK_XsAceqHtB6e2PaRwE,6208
106
+ spacr-0.9.0.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
107
+ spacr-0.9.0.dist-info/entry_points.txt,sha256=BMC0ql9aNNpv8lUZ8sgDLQMsqaVnX5L535gEhKUP5ho,296
108
+ spacr-0.9.0.dist-info/top_level.txt,sha256=GJPU8FgwRXGzKeut6JopsSRY2R8T3i9lDgya42tLInY,6
109
+ spacr-0.9.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (72.2.0)
2
+ Generator: setuptools (72.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,18 +0,0 @@
1
- config/
2
- *.log
3
- *.ipynb
4
- *.ipynb_checkpoints/
5
- __pycache__/
6
- results/
7
- weights/
8
- wandb/
9
- data/
10
- submissions/
11
- /.vscode
12
- *.npy
13
- *.pth
14
- *.sh
15
- *.json
16
- *.out
17
- *.zip
18
- *.tiff
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 opcrisis
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,189 +0,0 @@
1
-
2
- # **MEDIAR: Harmony of Data-Centric and Model-Centric for Multi-Modality Microscopy**
3
- ![1-2](https://user-images.githubusercontent.com/12638561/207771867-0b1414f2-cf48-4747-9cda-3304e6d86bfd.png)
4
-
5
-
6
- This repository provides an official implementation of [MEDIAR: MEDIAR: Harmony of Data-Centric and Model-Centric for Multi-Modality Microscopy](https://arxiv.org/abs/2212.03465), which achieved the ***"1st winner"*** in the [NeurIPS-2022 Cell Segmentation Challenge](https://neurips22-cellseg.grand-challenge.org/).
7
-
8
- To access and try mediar directly, please see links below.
9
- - <a href="https://colab.research.google.com/drive/1iFnGu6A_p-5s_eATjNtfjb9-MR5L3pLB?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a>
10
- - [Huggingface Space](https://huggingface.co/spaces/ghlee94/MEDIAR?logs=build)
11
- - [Napari Plugin](https://github.com/joonkeekim/mediar-napari)
12
- - [Docker Image](https://hub.docker.com/repository/docker/joonkeekim/mediar/general)
13
-
14
- # 1. MEDIAR Overview
15
- <img src="./image/mediar_framework.png" width="1200"/>
16
-
17
- MEIDAR is a framework for efficient cell instance segmentation of multi-modality microscopy images. The above figure illustrates an overview of our approach. MEDIAR harmonizes data-centric and model-centric approaches as the learning and inference strategies, achieving a **0.9067** Mean F1-score on the validation datasets. We provide a brief description of methods that combined in the MEDIAR. Please refer to our paper for more information.
18
- # 2. Methods
19
-
20
- ## **Data-Centric**
21
- - **Cell Aware Augmentation** : We apply two novel cell-aware augmentations. *cell-wisely intensity is randomization* (Cell Intensity Diversification) and *cell-wise boundary pixels exclusion* in the label. The boundary exclusion is adopted only in the pre-training phase.
22
-
23
- - **Two-phase Pretraining and Fine-tuning** : To extract knowledge from large public datasets, we first pretrained our model on public sets, then fine-tune.
24
- - Pretraining : We use 7,2412 labeled images from four public datasets for pretraining: OmniPose, CellPose, LiveCell and DataScienceBowl-2018. MEDIAR takes two different phases for the pretraining. the MEDIAR-Former model with encoder parameters initialized from ImageNet-1k pretraining.
25
-
26
- - Fine-tuning : We use two different model for ensemble. First model is fine-tuned 200 epochs using target datasets. Second model is fine-tuned 25 epochs using both target and public datsets.
27
-
28
- - **Modality Discovery & Amplified Sampling** : To balance towards the latent modalities in the datasets, we conduct K-means clustering and discover 40 modalities. In the training phase, we over-sample the minor cluster samples.
29
-
30
- - **Cell Memory Replay** : We concatenate the data from the public dataset with a small portion to the batch and train with boundary-excluded labels.
31
-
32
- ## **Model-Centric**
33
- - **MEDIAR-Former Architecture** : MEDIAR-Former follows the design paradigm of U-Net, but use SegFormer and MA-Net for the encoder and decoder. The two heads of MEDIAR-Former predicts cell probability and gradieng flow.
34
-
35
- <img src="./image/mediar_model.PNG" width="1200"/>
36
-
37
- - **Gradient Flow Tracking** : We utilize gradient flow tracking proposed by [CellPose](https://github.com/MouseLand/cellpose).
38
-
39
- - **Ensemble with Stochastic TTA**: During the inference, the MEIDAR conduct prediction as sliding-window manner with importance map generated by the gaussian filter. We use two fine-tuned models from phase1 and phase2 pretraining, and ensemble their outputs by summation. For each outputs, test-time augmentation is used.
40
- # 3. Experiments
41
-
42
- ### **Dataset**
43
- - Official Dataset
44
- - We are provided the target dataset from [Weakly Supervised Cell Segmentation in Multi-modality High-Resolution Microscopy Images](https://neurips22-cellseg.grand-challenge.org/). It consists of 1,000 labeled images, 1,712 unlabeled images and 13 unlabeled whole slide image from various microscopy types, tissue types, and staining types. Validation set is given with 101 images including 1 whole slide image.
45
-
46
- - Public Dataset
47
- - [OmniPose](http://www.cellpose.org/dataset_omnipose) : contains mixtures of 14 bacterial species. We only use 611 bacterial cell microscopy images and discard 118 worm images.
48
- - [CellPose](https://www.cellpose.org/dataset) : includes Cytoplasm, cellular microscopy, fluorescent cells images. We used 551 images by discarding 58 non-microscopy images. We convert all images as gray-scale.
49
- - [LiveCell](https://github.com/sartorius-research/LIVECell) : is a large-scale dataset with 5,239 images containing 1,686,352 individual cells annotated by trained crowdsources from 8 distinct cell types.
50
- - [DataScienceBowl 2018](https://www.kaggle.com/competitions/sartorius-cell-instance-segmentation/overview) : 841 images contain 37,333 cells from 22 cell types, 15 image resolutions, and five visually similar groups.
51
-
52
- ### **Testing steps**
53
- - **Ensemble Prediction with TTA** : MEDIAR uses sliding-window inference with the overlap size between the adjacent patches as 0.6 and gaussian importance map. To predict the different views on the image, MEDIAR uses Test-Time Augmentation (TTA) for the model prediction and ensemble two models described in **Two-phase Pretraining and Fine-tuning**.
54
-
55
- - **Inference time** : MEDIAR conducts most images in less than 1sec and it depends on the image size and the number of cells, even with ensemble prediction with TTA. Detailed evaluation-time results are in the paper.
56
-
57
- ### **Preprocessing & Augmentations**
58
- | Strategy | Type | Probability |
59
- |----------|:-------------|------|
60
- | `Clip` | Pre-processing | . |
61
- | `Normalization` | Pre-processing | . |
62
- | `Scale Intensity` | Pre-processing | . |
63
- | `Zoom` | Spatial Augmentation | 0.5 |
64
- | `Spatial Crop` | Spatial Augmentation | 1.0 |
65
- | `Axis Flip` | Spatial Augmentation | 0.5 |
66
- | `Rotation` | Spatial Augmentation | 0.5 |
67
- | `Cell-Aware Intensity` | Intensity Augmentation | 0.25 |
68
- | `Gaussian Noise` | Intensity Augmentation | 0.25 |
69
- | `Contrast Adjustment` | Intensity Augmentation | 0.25 |
70
- | `Gaussian Smoothing` | Intensity Augmentation | 0.25 |
71
- | `Histogram Shift` | Intensity Augmentation | 0.25 |
72
- | `Gaussian Sharpening` | Intensity Augmentation | 0.25 |
73
- | `Boundary Exclusion` | Others | . |
74
-
75
-
76
- | Learning Setups | Pretraining | Fine-tuning |
77
- |----------------------------------------------------------------------|---------------------------------------------------------|---------------------------------------------------------|
78
- | Initialization (Encoder) | Imagenet-1k pretrained | from Pretraining |
79
- | Initialization (Decoder, Head) | He normal initialization | from Pretraining|
80
- | Batch size | 9 | 9 |
81
- | Total epochs | 80 (60) | 200 (25) |
82
- | Optimizer | AdamW | AdamW |
83
- | Initial learning rate (lr) | 5e-5 | 2e-5 |
84
- | Lr decay schedule | Cosine scheduler (100 interval) | Cosine scheduler (100 interval) |
85
- | Loss function | MSE, BCE | MSE, BCE |
86
-
87
- # 4. Results
88
- ### **Validation Dataset**
89
- - Quantitative Evaluation
90
- - Our MEDIAR achieved **0.9067** validation mean F1-score.
91
- - Qualitative Evaluation
92
- <img src="./image/mediar_results.png" width="1200"/>
93
-
94
- - Failure Cases
95
- <img src="./image/failure_cases.png" width="1200"/>
96
-
97
- ### **Test Dataset**
98
- ![F1_osilab](https://user-images.githubusercontent.com/12638561/207772559-2185b79c-8288-4556-a3b4-9bd1d359fceb.png)
99
- ![RunningTime_osilab](https://user-images.githubusercontent.com/12638561/207772555-c3b29071-6e03-4985-837a-da7b3dd3b65d.png)
100
-
101
-
102
- # 5. Reproducing
103
-
104
- ### **Our Environment**
105
- | Computing Infrastructure| |
106
- |-------------------------|----------------------------------------------------------------------|
107
- | System | Ubuntu 18.04.5 LTS |
108
- | CPU | AMD EPYC 7543 32-Core Processor CPU@2.26GHz |
109
- | RAM | 500GB; 3.125MT/s |
110
- | GPU (number and type) | NVIDIA A5000 (24GB) 2ea |
111
- | CUDA version | 11.7 |
112
- | Programming language | Python 3.9 |
113
- | Deep learning framework | Pytorch (v1.12, with torchvision v0.13.1) |
114
- | Code dependencies | MONAI (v0.9.0), Segmentation Models (v0.3.0) |
115
- | Specific dependencies | None |
116
-
117
- To install requirements:
118
-
119
- ```
120
- pip install -r requirements.txt
121
- wandb off
122
- ```
123
-
124
- ## Dataset
125
- - The datasets directories under the root should the following structure:
126
-
127
- ```
128
- Root
129
- ├── Datasets
130
- │ ├── images (images can have various extensions: .tif, .tiff, .png, .bmp ...)
131
- │ │ ├── cell_00001.png
132
- │ │ ├── cell_00002.tif
133
- │ │ ├── cell_00003.xxx
134
- │ │ ├── ...
135
- │ └── labels (labels must have .tiff extension.)
136
- │ │ ├── cell_00001_label.tiff
137
- │ │ ├── cell_00002.label.tiff
138
- │ │ ├── cell_00003.label.tiff
139
- │ │ ├── ...
140
- └── ...
141
- ```
142
-
143
- Before execute the codes, run the follwing code to generate path mappting json file:
144
-
145
- ```python
146
- python ./generate_mapping.py --root=<path_to_data>
147
- ```
148
-
149
- ## Training
150
-
151
- To train the model(s) in the paper, run the following command:
152
-
153
- ```python
154
- python ./main.py --config_path=<path_to_config>
155
- ```
156
- Configuration files are in `./config/*`. We provide the pretraining, fine-tuning, and prediction configs. You can refer to the configuration options in the `./config/mediar_example.json`. We also implemented the official challenge baseline code in our framework. You can run the baseline code by running the `./config/baseline.json`.
157
-
158
- ## Inference
159
-
160
- To conduct prediction on the testing cases, run the following command:
161
-
162
- ```python
163
- python predict.py --config_path=<path_to_config>
164
- ```
165
-
166
- ## Evaluation
167
- If you have the labels run the following command for evaluation:
168
-
169
- ```python
170
- python ./evaluate.py --pred_path=<path_to_prediciton_results> --gt_path=<path_to_ground_truth_labels>
171
- ```
172
-
173
- The configuration files for `predict.py` is slightly different. Please refer to the config files in `./config/step3_prediction/*`.
174
- ## Trained Models
175
-
176
- You can download MEDIAR pretrained and finetuned models here:
177
-
178
- - [Google Drive Link](https://drive.google.com/drive/folders/1RgMxHIT7WsKNjir3wXSl7BrzlpS05S18?usp=share_link).
179
-
180
- ## Citation of this Work
181
- ```
182
- @article{lee2022mediar,
183
- title={Mediar: Harmony of data-centric and model-centric for multi-modality microscopy},
184
- author={Lee, Gihun and Kim, SangMook and Kim, Joonkee and Yun, Se-Young},
185
- journal={arXiv preprint arXiv:2212.03465},
186
- year={2022}
187
- }
188
- ```
189
-
@@ -1,39 +0,0 @@
1
- import torch.optim as optim
2
- import torch.optim.lr_scheduler as lr_scheduler
3
- import monai
4
-
5
- import core
6
- from train_tools import models
7
- from train_tools.models import *
8
-
9
- __all__ = ["TRAINER", "OPTIMIZER", "SCHEDULER"]
10
-
11
- TRAINER = {
12
- "baseline": core.Baseline.Trainer,
13
- "mediar": core.MEDIAR.Trainer,
14
- }
15
-
16
- PREDICTOR = {
17
- "baseline": core.Baseline.Predictor,
18
- "mediar": core.MEDIAR.Predictor,
19
- "ensemble_mediar": core.MEDIAR.EnsemblePredictor,
20
- }
21
-
22
- MODELS = {
23
- "unet": monai.networks.nets.UNet,
24
- "unetr": monai.networks.nets.unetr.UNETR,
25
- "swinunetr": monai.networks.nets.SwinUNETR,
26
- "mediar-former": models.MEDIARFormer,
27
- }
28
-
29
- OPTIMIZER = {
30
- "sgd": optim.SGD,
31
- "adam": optim.Adam,
32
- "adamw": optim.AdamW,
33
- }
34
-
35
- SCHEDULER = {
36
- "step": lr_scheduler.StepLR,
37
- "multistep": lr_scheduler.MultiStepLR,
38
- "cosine": lr_scheduler.CosineAnnealingLR,
39
- }
@@ -1,60 +0,0 @@
1
- {
2
- "data_setups":{
3
- "labeled":{
4
- "root": "/home/gihun/data/CellSeg/",
5
- "mapping_file": "./train_tools/data_utils/mapping_labeled.json",
6
- "tuning_mapping_file": "/home/gihun/CellSeg/train_tools/data_utils/mapping_tuning.json",
7
- "batch_size": 8,
8
- "valid_portion": 0.1
9
- },
10
- "unlabeled":{
11
- "enabled": false
12
- },
13
- "public":{
14
- "enabled": false
15
- }
16
- },
17
- "train_setups":{
18
- "model":{
19
- "name": "swinunetr",
20
- "params": {
21
- "img_size": 512,
22
- "in_channels": 3,
23
- "out_channels": 3,
24
- "spatial_dims": 2
25
- },
26
- "pretrained":{
27
- "enabled": false
28
- }
29
- },
30
- "trainer": {
31
- "name": "baseline",
32
- "params": {
33
- "num_epochs": 200,
34
- "valid_frequency": 1,
35
- "device": "cuda:0",
36
- "algo_params": {}
37
- }
38
- },
39
- "optimizer":{
40
- "name": "adamw",
41
- "params": {"lr": 5e-5}
42
- },
43
- "scheduler":{
44
- "enabled": false
45
- },
46
- "seed": 19940817
47
- },
48
- "pred_setups":{
49
- "input_path":"/home/gihun/data/CellSeg/Official/TuningSet",
50
- "output_path": "./results/baseline",
51
- "make_submission": true,
52
- "exp_name": "baseline",
53
- "algo_params": {}
54
- },
55
- "wandb_setups":{
56
- "project": "CellSeg",
57
- "group": "Baseline",
58
- "name": "baseline"
59
- }
60
- }