Skip to content

kyoro1/knowledge_mining_computer_vision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

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.

Prerequisites

How to build an app

1. Install necessary libraries

  • Please execute the following in your terminal:
    pip install -r ./requirements.txt

2. Configure the environment

  • 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

3. Run streamlit app with your terminal:

  • 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
    
  • Once you successfully run your app, you will see: top page

How to use the app

1. Register image

  • In registering your image, select your image in your local folder browse image

  • Once you select your image, you will find the analyzed result3: analyzed image

2. Search image

  • If you input your interest by word, your will find the search results: Search result

3. Customize your preferences

If you want to more results, change the prarmeters:

  • topN: 5 tags are shown in each picture topN

  • Search result: 4 search results are shown Search results

4. Further usage

  • If you want to generate search index with your images, follow the instructions:
    • Delete df_tag_db.pkl file, and all images from upload_images directories.
    • Follow the instruction 1. Register image.
  • IF you ignore SSL check in consuming Azure CV, set SSL_check variable as False in st_app.py. It's not recommended, but please change it under your environment.

Directory structure

├─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

References

Footnotes

  1. Refer to detailed requirements for images

  2. Go to streamlit doc for more reference.

  3. As we see, the presented tags are in Japanese. If you want to change the displayed language, change language in common/config.ini as en, for example. Go here, if you need more detail.

About

This repository provides search experience with your images by Azure Computer Vision.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages