-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest_dolphin_parsing.sh
More file actions
49 lines (42 loc) · 1.52 KB
/
test_dolphin_parsing.sh
File metadata and controls
49 lines (42 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
echo "==================================="
echo "Dolphin Advanced Parsing Test"
echo "==================================="
echo ""
# Create test image inside container
echo "1. Creating test document inside container..."
docker exec openregister-dolphin-vlm python3 << 'PYTHON_EOF'
from PIL import Image, ImageDraw
img = Image.new('RGB', (800, 600), color='white')
draw = ImageDraw.Draw(img)
draw.text((50, 50), 'Test Document - Dolphin Parser', fill='black')
draw.text((50, 120), 'This is a sample document for testing', fill='black')
draw.rectangle([(50, 200), (400, 350)], outline='black', width=2)
draw.line([(50, 250), (400, 250)], fill='black', width=2)
draw.text((100, 215), 'Product | Price', fill='black')
draw.text((100, 270), 'Widget A | $19.99', fill='black')
draw.text((100, 300), 'Widget B | $29.99', fill='black')
img.save('/app/test_doc.png')
print('✓ Test document created')
PYTHON_EOF
echo ""
echo "2. Testing document parsing..."
RESULT=$(docker exec openregister-dolphin-vlm curl -s -X POST \
http://localhost:5000/parse \
-F 'file=@/app/test_doc.png' \
-F 'parse_layout=true' \
-F 'extract_tables=true')
echo ""
echo "3. Parsing Results:"
echo "$RESULT" | python3 -m json.tool 2>&1 | head -100
echo ""
echo "4. Checking if text was extracted..."
if echo "$RESULT" | grep -q "Test Document"; then
echo "✓ Text extraction working!"
else
echo "⚠ Text may not have been extracted"
fi
echo ""
echo "==================================="
echo "Test Complete!"
echo "==================================="