Skip to content

Commit d74a1db

Browse files
Update .gitignore and genimi_based_poc_app.py
1 parent 86256e2 commit d74a1db

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ __pycache__/
77
*.so
88

99
# Distribution / packaging
10+
output/
1011
.Python
1112
build/
1213
develop-eggs/

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,9 @@ HemoCountAI for Google AI Hackathon 2024
3535
## Environment Variables
3636

3737
`GOOGLE_API_KEY_FILE`
38+
39+
## Compiling an executable
40+
41+
```bash
42+
pyinstaller --noconfirm --onefile --windowed --icon ".../logo.ico" --name "HemoCountAI" --add-data ".../HemoCountAI-1/.venv/Lib/site-packages/ultralytics;ultralytics/" --add-data ".../HemoCountAI-1/utils;utils/" --add-data ".../HemoCountAI-1/logo.png;." ".../HemoCountAI-1/genimi_based_poc_app.py"
43+
```

genimi_based_poc_app.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
import tkinter as tk
2+
import os
3+
import sys
24
from tkinter import ttk
35
from PIL import Image, ImageTk
46
from utils.blood_count_analysis import open_image, analyze_image
57
from utils.lab_report_analysis import upload_pdf, analyze_pdf, download_sample_pdf
68
from tkinter import messagebox
79

10+
def resource_path(relative_path):
11+
try:
12+
base_path = sys._MEIPASS
13+
except Exception:
14+
base_path = os.path.abspath(".")
15+
16+
return os.path.join(base_path, relative_path)
17+
818
def verify_login(username, password, login_top_level, root):
919
# Dummy authentication logic (replace with your own logic)
1020
if username == "admin" and password == "password":
@@ -141,15 +151,12 @@ def main():
141151
right_frame = tk.Frame(existing_tab, bg=right_bg_color)
142152
right_frame.pack(side="right", fill="both", expand=True)
143153

144-
# Path to your logo image
145-
logo_path = 'logo.png' # Replace with your logo image path
146-
147154
# Get the dominant color from the logo
148155
#dominant_color = get_dominant_color(logo_path)
149156
button_bg = "#FFA500" #'#36648b' #'#{:02x}{:02x}{:02x}'.format(*dominant_color) # Convert RGB to hex
150157

151158
# Load the logo
152-
logo_image = Image.open(logo_path)
159+
logo_image = Image.open(resource_path("logo.png"))
153160
logo_image.thumbnail((200, 200)) # Resize if necessary
154161
logo_photo = ImageTk.PhotoImage(logo_image)
155162

utils/blood_count_analysis.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1-
import textwrap
21
import google.generativeai as genai
32
import os
43
import tkinter as tk
54
from tkinter import filedialog
65
from PIL import Image, ImageTk
76
from tkinter import messagebox
8-
import re
97
import tkinter.font as tkFont
108
from collections import Counter
119
from PIL import Image
1210
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
1311
from matplotlib.figure import Figure
1412
import pandas as pd
1513
import seaborn as sns
16-
import re
17-
import re
1814
import matplotlib.pyplot as plt
1915
from utils.image_processing import detect_blood_cell
2016
import glob

0 commit comments

Comments
 (0)