ohjho commited on
Commit
0c27b24
1 Parent(s): 38761f7

updated app to not use sidebar

Browse files
Files changed (2) hide show
  1. .gitignore +129 -0
  2. app.py +6 -5
.gitignore ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hugging Face Space doesn't like binary files
2
+ *.jpg
3
+
4
+ # Byte-compiled / optimized / DLL files
5
+ __pycache__/
6
+ data/
7
+ results/
8
+ weights/
9
+ *.py[cod]
10
+ *$py.class
11
+
12
+ # C extensions
13
+ *.so
14
+
15
+ # Distribution / packaging
16
+ .Python
17
+ build/
18
+ develop-eggs/
19
+ dist/
20
+ downloads/
21
+ eggs/
22
+ .eggs/
23
+ lib/
24
+ lib64/
25
+ parts/
26
+ sdist/
27
+ var/
28
+ wheels/
29
+ pip-wheel-metadata/
30
+ share/python-wheels/
31
+ *.egg-info/
32
+ .installed.cfg
33
+ *.egg
34
+ MANIFEST
35
+
36
+ # PyInstaller
37
+ # Usually these files are written by a python script from a template
38
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
39
+ *.manifest
40
+ *.spec
41
+
42
+ # Installer logs
43
+ pip-log.txt
44
+ pip-delete-this-directory.txt
45
+
46
+ # Unit test / coverage reports
47
+ htmlcov/
48
+ .tox/
49
+ .nox/
50
+ .coverage
51
+ .coverage.*
52
+ .cache
53
+ nosetests.xml
54
+ coverage.xml
55
+ *.cover
56
+ .hypothesis/
57
+ .pytest_cache/
58
+
59
+ # Translations
60
+ *.mo
61
+ *.pot
62
+
63
+ # Django stuff:
64
+ *.log
65
+ local_settings.py
66
+ db.sqlite3
67
+
68
+ # Flask stuff:
69
+ instance/
70
+ .webassets-cache
71
+
72
+ # Scrapy stuff:
73
+ .scrapy
74
+
75
+ # Sphinx documentation
76
+ docs/_build/
77
+
78
+ # PyBuilder
79
+ target/
80
+
81
+ # Jupyter Notebook
82
+ .ipynb_checkpoints
83
+
84
+ # IPython
85
+ profile_default/
86
+ ipython_config.py
87
+
88
+ # pyenv
89
+ .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don’t work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # celery beat schedule file
99
+ celerybeat-schedule
100
+
101
+ # SageMath parsed files
102
+ *.sage.py
103
+
104
+ # Environments
105
+ .env
106
+ .venv
107
+ env/
108
+ venv/
109
+ ENV/
110
+ env.bak/
111
+ venv.bak/
112
+
113
+ # Spyder project settings
114
+ .spyderproject
115
+ .spyproject
116
+
117
+ # Rope project settings
118
+ .ropeproject
119
+
120
+ # mkdocs documentation
121
+ /site
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+ .dmypy.json
126
+ dmypy.json
127
+
128
+ # Pyre type checker
129
+ .pyre/
app.py CHANGED
@@ -73,8 +73,9 @@ def im_draw_bbox(pil_im, x0, y0, x1, y1, color = 'black', width = 3, caption = N
73
 
74
  def Main(model_dict):
75
  st.set_page_config(layout = 'wide')
76
- show_miro_logo()
77
- with st.sidebar.expander('Saliency Demo'):
 
78
  st.info(f'''
79
  [TensorFlow Implementation of MSI-Net](https://github.com/alexanderkroner/saliency)
80
  which archived
@@ -82,8 +83,8 @@ def Main(model_dict):
82
  [MIT Saliency Benchmark dataset](http://saliency.mit.edu/datasets.html)
83
  ''')
84
 
85
- im = get_image(st_asset = st.sidebar.expander('Input Image', expanded = True), extension_list = ['jpg','jpeg'])
86
- aspect_ratio = st.sidebar.selectbox('aspect ratio', help = 'to demo saliency cropping',
87
  options = ['','16x9','4x3'])
88
  if im:
89
  aspect_ratio_tup = tuple([int(i) for i in aspect_ratio.split('x')]) if aspect_ratio else None
@@ -94,7 +95,7 @@ def Main(model_dict):
94
  l_col.image(im, caption = 'Input Image')
95
  r_col.image(saliency_im, caption = 'Saliency Map')
96
  else:
97
- st.warning(f':point_left: please provide an image')
98
 
99
  if __name__ == '__main__':
100
  model_dict = load_model()
 
73
 
74
  def Main(model_dict):
75
  st.set_page_config(layout = 'wide')
76
+ l_col, r_col = st.columns(2)
77
+ show_miro_logo(st_asset = l_col)
78
+ with l_col.expander('Saliency Demo'):
79
  st.info(f'''
80
  [TensorFlow Implementation of MSI-Net](https://github.com/alexanderkroner/saliency)
81
  which archived
 
83
  [MIT Saliency Benchmark dataset](http://saliency.mit.edu/datasets.html)
84
  ''')
85
 
86
+ im = get_image(st_asset = r_col.expander('Input Image', expanded = True), extension_list = ['jpg','jpeg'])
87
+ aspect_ratio = r_col.selectbox('aspect ratio', help = 'to demo saliency cropping',
88
  options = ['','16x9','4x3'])
89
  if im:
90
  aspect_ratio_tup = tuple([int(i) for i in aspect_ratio.split('x')]) if aspect_ratio else None
 
95
  l_col.image(im, caption = 'Input Image')
96
  r_col.image(saliency_im, caption = 'Saliency Map')
97
  else:
98
+ st.warning(f'please provide an image :point_up:')
99
 
100
  if __name__ == '__main__':
101
  model_dict = load_model()