This repository provides search experience with your images by Azure Computer Vision. Using streamlit framework, we can easily build an app, and customize it with your preferences.
- Python environment
- Azure subscription
- Computer vision resource
- Your image files with
jpg
,jpeg
orpng
format1
- Please execute the following in your terminal:
pip install -r ./requirements.txt
- By using
common/config.ini
, you can specify the setting. See this page in detail.[Azure] subscription_key = 12345xxxyyy cv_endpoint = https://xxxx.cognitiveservices.azure.com/ language = ja
-
Run the app
streamlit run ./st_app.py
-
You will find the following message. Then, copy and pate the URL in your browser2:
You can now view your Streamlit app in your browser. Local URL: http://localhost:8501 Network URL: http://xxx.xxx.xxx.xxx:8501
-
In registering your image, select your image in your local folder
-
Once you select your image, you will find the analyzed result3:
If you want to more results, change the prarmeters:
- If you want to generate search index with your images, follow the instructions:
- Delete
df_tag_db.pkl
file, and all images fromupload_images
directories. - Follow the instruction
1. Register image
.
- Delete
- IF you ignore SSL check in consuming Azure CV, set
SSL_check
variable asFalse
inst_app.py
. It's not recommended, but please change it under your environment.
├─common
│ ├─config.ini : Configuration file. Generate it by yourself
│ └─generate_tag_db.py : Main functions
├─docs : Defines this repository
├─upload_images : Store uploaded images
│ └─images : Your images
├─ df_tag_db.pkl : Defines search index as pandas DataFrame
├─ st_app.py : App in streamlit
└─ README.md : Instruction of the repository
- Azure Computer Vision
- Streamlit
Footnotes
-
Refer to detailed requirements for images ↩
-
Go to streamlit doc for more reference. ↩
-
As we see, the presented tags are in Japanese. If you want to change the displayed language, change
language
incommon/config.ini
asen
, for example. Go here, if you need more detail. ↩