initial commit

This commit is contained in:
2025-01-23 20:20:07 +09:00
commit c918172088
3 changed files with 54 additions and 0 deletions

13
app.py Normal file
View File

@@ -0,0 +1,13 @@
# http://localhost:8501
try: import os, io, tempfile, streamlit
except: os.system('pip install -q streamlit')
finally: import streamlit as st
if st.runtime.exists():
st.title('맥모닝 OCR')
if img := st.file_uploader("Choose a file"):
st.image(io.BytesIO(blob := img.getvalue()))
with tempfile.TemporaryDirectory() as tmp, \
open(path := f'{tmp}/{img.name}', 'wb') as f:
f.write(blob)
st.code(os.popen(f'osascript ocr.applescript {path}').read())
else: os.system('streamlit run app.py --browser.gatherUsageStats false')