pskeshu commited on
Commit
ac00bb1
Β·
1 Parent(s): 50f6d31

Improve mobile responsiveness and fix random button

Browse files
Files changed (2) hide show
  1. CLAUDE.md +30 -0
  2. app.py +63 -3
CLAUDE.md CHANGED
@@ -1,5 +1,35 @@
1
  # Anton Microscopy Project Memory
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ## VLM Integration Options
4
 
5
  ### Current Implementation
 
1
  # Anton Microscopy Project Memory
2
 
3
+ ## Current Development Priorities
4
+
5
+ ### 1. Standardize Experimental Context for VLM
6
+ **Priority: HIGH**
7
+ - Need consistent, structured biological context across all VLM interactions
8
+ - Current implementation uses ad-hoc context dictionaries in `app.py:305-322`
9
+ - Goal: Create standardized context schema that VLM can reliably interpret
10
+ - Location: `/anton/core/pipeline.py` and `/anton/vlm/interface.py`
11
+
12
+ ### 2. Implement Qualitative Parallel Pipeline
13
+ **Priority: HIGH**
14
+ - Current pipeline runs stages sequentially
15
+ - Need parallel processing for qualitative analysis components
16
+ - Target: `/anton/analysis/qualitative.py` and `/anton/core/pipeline.py`
17
+ - Benefits: Faster analysis, better resource utilization
18
+
19
+ ### 3. Revise VQA/Prompts for 4 Stages
20
+ **Priority: MEDIUM-HIGH**
21
+ - Complete overhaul of all 4-stage prompts needed
22
+ - Current prompts: `/prompts/stage1_global.txt`, `stage2_objects.txt`, `stage3_features.txt`, `stage4_population.txt`
23
+ - Need more specific, microscopy-focused questioning
24
+ - Improve consistency and biological relevance
25
+
26
+ ### 4. Overhaul CMPO Mapping Strategy
27
+ **Priority: MEDIUM-HIGH**
28
+ - Current CMPO mapping in `/anton/cmpo/mapping.py` needs complete rethink
29
+ - Issues: Basic keyword matching, low confidence scores
30
+ - Goal: Semantic understanding, context-aware phenotype classification
31
+ - Consider: LLM-based mapping, embedding similarity, hierarchical classification
32
+
33
  ## VLM Integration Options
34
 
35
  ### Current Implementation
app.py CHANGED
@@ -21,6 +21,50 @@ st.set_page_config(
21
  layout="wide"
22
  )
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  # Add Anton to path
25
  sys.path.append(str(Path(__file__).parent))
26
 
@@ -136,10 +180,26 @@ else:
136
 
137
  # Analysis controls
138
  st.sidebar.subheader("πŸ”¬ Analysis")
139
- analyze_btn = st.sidebar.button("πŸš€ Analyze Image", type="primary", use_container_width=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
 
141
- # Main content area
142
- col1, col2 = st.columns([1, 1])
143
 
144
  # Left column: Image display
145
  with col1:
 
21
  layout="wide"
22
  )
23
 
24
+ # Mobile-responsive CSS
25
+ st.markdown("""
26
+ <style>
27
+ /* Mobile-first responsive design */
28
+ @media (max-width: 768px) {
29
+ .main .block-container {
30
+ padding-left: 1rem;
31
+ padding-right: 1rem;
32
+ max-width: 100%;
33
+ }
34
+
35
+ /* Make buttons more mobile-friendly */
36
+ .stButton > button {
37
+ width: 100%;
38
+ height: 3rem;
39
+ font-size: 1.1rem;
40
+ }
41
+
42
+ /* Improve sidebar on mobile */
43
+ .css-1d391kg {
44
+ width: 100%;
45
+ }
46
+
47
+ /* Stack columns on mobile */
48
+ .css-12w0qpk {
49
+ flex-direction: column;
50
+ }
51
+ }
52
+
53
+ /* Better button styling */
54
+ .stButton > button {
55
+ border-radius: 0.5rem;
56
+ border: none;
57
+ padding: 0.5rem 1rem;
58
+ font-weight: 600;
59
+ }
60
+
61
+ /* Improve spacing */
62
+ .element-container {
63
+ margin-bottom: 1rem;
64
+ }
65
+ </style>
66
+ """, unsafe_allow_html=True)
67
+
68
  # Add Anton to path
69
  sys.path.append(str(Path(__file__).parent))
70
 
 
180
 
181
  # Analysis controls
182
  st.sidebar.subheader("πŸ”¬ Analysis")
183
+ sidebar_analyze_btn = st.sidebar.button("πŸš€ Analyze Image (Sidebar)", type="primary", use_container_width=True)
184
+
185
+ # Main content area with mobile-friendly layout
186
+ st.markdown("---")
187
+
188
+ # Mobile-friendly analyze button in main area
189
+ col_btn1, col_btn2, col_btn3 = st.columns([1, 2, 1])
190
+ with col_btn2:
191
+ main_analyze_btn = st.button("πŸš€ Analyze Image", type="primary", use_container_width=True, key="main_analyze")
192
+
193
+ # Mobile user guidance
194
+ st.info("πŸ“± **Mobile users**: Use the big 'Analyze Image' button above! The sidebar controls may be hidden on mobile devices.")
195
+
196
+ # Combine button states
197
+ analyze_btn = sidebar_analyze_btn or main_analyze_btn
198
+
199
+ st.markdown("---")
200
 
201
+ # Responsive columns - stack on mobile
202
+ col1, col2 = st.columns([1, 1], gap="medium")
203
 
204
  # Left column: Image display
205
  with col1: