Download app.py from Pezh/Image: direct link, hf CLI and curl.
- Browser
- Download file 287 Bytes
-
https://huggingface.co/spaces/Pezh/Image/resolve/main/app.py
- Command line
-
hf download hf://spaces/Pezh/Image/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Pezh/Image/resolve/main/app.py
287 Bytes
| import streamlit as st | |
| import os | |
| from pdf2image import convert_from_path | |
| def convert_pdf_to_images(pdf_path): | |
| images = convert_from_path(pdf_path) | |
| for i, image in enumerate(images): | |
| image.save(f'image{i}.png') | |
| if st.button('ss'): | |
| convert_pdf_to_images('hoor.pdf') | |