danielrosehill Claude commited on
Commit
467753c
·
1 Parent(s): ea95d12

Increase annotation marker size and remove emojis

Browse files

- Increase circle radius from 1/80 to 1/50 of image size (min 25px)
- Increase font size from 1/40 to 1/25 of image size (min 32px)
- Increase white border thickness from 2px to 4px
- Increase circle outline width from 2px to 3px
- Remove all emojis from app.py and README.md for cleaner UI
- Keep HuggingFace metadata emoji field intact

These changes make annotation markers much more visible on satellite imagery.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +12 -12
README.md CHANGED
@@ -10,7 +10,7 @@ pinned: false
10
  short_description: Professional satellite imagery intelligence analysis
11
  ---
12
 
13
- # 🛰️ SATINT Analyst
14
 
15
  Professional satellite imagery intelligence analysis powered by Meta Llama 3.2 Vision 90B. This application provides expert-level SATINT (Satellite Intelligence) analysis of overhead imagery with objective, uncensored assessments.
16
 
 
10
  short_description: Professional satellite imagery intelligence analysis
11
  ---
12
 
13
+ # SATINT Analyst
14
 
15
  Professional satellite imagery intelligence analysis powered by Meta Llama 3.2 Vision 90B. This application provides expert-level SATINT (Satellite Intelligence) analysis of overhead imagery with objective, uncensored assessments.
16
 
app.py CHANGED
@@ -33,7 +33,7 @@ def draw_annotations(image, annotations):
33
 
34
  # Try to load a better font, fall back to default if not available
35
  try:
36
- font_size = max(20, min(width, height) // 40)
37
  font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", font_size)
38
  except:
39
  font = ImageFont.load_default()
@@ -44,12 +44,12 @@ def draw_annotations(image, annotations):
44
  x = int(ann['x'] * width)
45
  y = int(ann['y'] * height)
46
 
47
- # Circle radius based on image size
48
- radius = max(15, min(width, height) // 80)
49
 
50
- # Draw outer circle (white border)
51
  draw.ellipse(
52
- [(x - radius - 2, y - radius - 2), (x + radius + 2, y + radius + 2)],
53
  fill='white',
54
  outline='white'
55
  )
@@ -59,7 +59,7 @@ def draw_annotations(image, annotations):
59
  [(x - radius, y - radius), (x + radius, y + radius)],
60
  fill='red',
61
  outline='white',
62
- width=2
63
  )
64
 
65
  # Draw number
@@ -210,7 +210,7 @@ Remember: The annotations will be numbered automatically in the order you list t
210
  if "ANNOTATIONS:" not in analysis_text:
211
  # Model didn't provide annotations section
212
  error_msg = """
213
- ⚠️ **ANNOTATION MODE ERROR**
214
 
215
  The AI model did not provide an ANNOTATIONS: section in its response.
216
  This means it didn't follow the annotation format instructions.
@@ -244,7 +244,7 @@ Try again, or use Text Only mode for standard analysis.
244
  annotated_image = draw_annotations(image, annotations)
245
 
246
  # Add annotation count to the analysis
247
- annotation_count_msg = f"\n\n**✓ {len(annotations)} annotation(s) marked on image**\n\n"
248
 
249
  # Clean up the analysis text to remove JSON section
250
  # Keep only the analysis part
@@ -256,14 +256,14 @@ Try again, or use Text Only mode for standard analysis.
256
  analysis_text = analysis_text[12:].strip()
257
  else:
258
  # Annotations array was empty
259
- analysis_text = "\n\n⚠️ **No annotations provided by AI model**\n\n" + analysis_text
260
 
261
  return analysis_text, annotated_image
262
 
263
  except Exception as e:
264
  # If annotation parsing fails, return original image with a detailed note
265
  error_msg = f"""
266
- ⚠️ **ANNOTATION MODE ERROR**
267
 
268
  The AI model's response could not be parsed for annotations. This usually happens when:
269
  - The model doesn't return properly formatted JSON
@@ -290,7 +290,7 @@ Error details: {str(e)}
290
  # Create Gradio interface
291
  with gr.Blocks(title="SATINT Analyst - Satellite Imagery Analysis", theme=gr.themes.Soft()) as demo:
292
  gr.Markdown("""
293
- # 🛰️ SATINT Analyst
294
  ### Professional Satellite Imagery Intelligence Analysis
295
 
296
  Upload satellite imagery and receive professional intelligence analysis from an AI-powered SATINT analyst.
@@ -340,7 +340,7 @@ with gr.Blocks(title="SATINT Analyst - Satellite Imagery Analysis", theme=gr.the
340
  with gr.Column(scale=1):
341
  gr.Markdown("### Intelligence Analysis")
342
  with gr.Row():
343
- copy_btn = gr.Button("📋 Copy to Clipboard", size="sm", scale=0)
344
  analysis_output = gr.Markdown(
345
  value="*Analysis will appear here...*",
346
  height=600,
 
33
 
34
  # Try to load a better font, fall back to default if not available
35
  try:
36
+ font_size = max(32, min(width, height) // 25)
37
  font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", font_size)
38
  except:
39
  font = ImageFont.load_default()
 
44
  x = int(ann['x'] * width)
45
  y = int(ann['y'] * height)
46
 
47
+ # Circle radius based on image size (larger for better visibility)
48
+ radius = max(25, min(width, height) // 50)
49
 
50
+ # Draw outer circle (white border) - thicker for better visibility
51
  draw.ellipse(
52
+ [(x - radius - 4, y - radius - 4), (x + radius + 4, y + radius + 4)],
53
  fill='white',
54
  outline='white'
55
  )
 
59
  [(x - radius, y - radius), (x + radius, y + radius)],
60
  fill='red',
61
  outline='white',
62
+ width=3
63
  )
64
 
65
  # Draw number
 
210
  if "ANNOTATIONS:" not in analysis_text:
211
  # Model didn't provide annotations section
212
  error_msg = """
213
+ **ANNOTATION MODE ERROR**
214
 
215
  The AI model did not provide an ANNOTATIONS: section in its response.
216
  This means it didn't follow the annotation format instructions.
 
244
  annotated_image = draw_annotations(image, annotations)
245
 
246
  # Add annotation count to the analysis
247
+ annotation_count_msg = f"\n\n**{len(annotations)} annotation(s) marked on image**\n\n"
248
 
249
  # Clean up the analysis text to remove JSON section
250
  # Keep only the analysis part
 
256
  analysis_text = analysis_text[12:].strip()
257
  else:
258
  # Annotations array was empty
259
+ analysis_text = "\n\n**WARNING: No annotations provided by AI model**\n\n" + analysis_text
260
 
261
  return analysis_text, annotated_image
262
 
263
  except Exception as e:
264
  # If annotation parsing fails, return original image with a detailed note
265
  error_msg = f"""
266
+ **ANNOTATION MODE ERROR**
267
 
268
  The AI model's response could not be parsed for annotations. This usually happens when:
269
  - The model doesn't return properly formatted JSON
 
290
  # Create Gradio interface
291
  with gr.Blocks(title="SATINT Analyst - Satellite Imagery Analysis", theme=gr.themes.Soft()) as demo:
292
  gr.Markdown("""
293
+ # SATINT Analyst
294
  ### Professional Satellite Imagery Intelligence Analysis
295
 
296
  Upload satellite imagery and receive professional intelligence analysis from an AI-powered SATINT analyst.
 
340
  with gr.Column(scale=1):
341
  gr.Markdown("### Intelligence Analysis")
342
  with gr.Row():
343
+ copy_btn = gr.Button("Copy to Clipboard", size="sm", scale=0)
344
  analysis_output = gr.Markdown(
345
  value="*Analysis will appear here...*",
346
  height=600,