Skip to content

The-Next-Staar/NextStar-Search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ–ผ๏ธ The Next Star - Facial Image Search System

๐Ÿ“‹ Features

  1. Annotation Data Embedding Generation - Converts annotation data into vectors using the Sentence Transformer model (distiluse-base-multilingual-cased-v2 HUGGING FACE).
  2. Search and Save Image Results - Searches for the top 3 annotations most similar to the input query and saves the corresponding images in the result/ directory.
  3. Similarity-Based Search - The search is based on semantic similarity, allowing for relevant results even if the query does not exactly match any annotations.

โš™๏ธ Requirements

The following Python packages are required to run this project:

  • Python 3.7 or higher
  • numpy
  • faiss
  • sentence-transformers
  • scikit-learn

You can install the necessary packages with the following command:

pip install -r requirements.txt

๐Ÿš€ How to Run

  1. Prepare Data and Generate Embeddings

    Load the annotation data and generate sentence embeddings. This step will create the embeddings.npy file.

    python data_preparation.py
  2. Run the Main Program

    The main program takes a query input from the terminal, performs the search, and outputs the results.

    python main.py

    Example:

    Enter your search query: ๊ณ ์–‘์ด์ƒ ๋ˆˆ๋งค, ๋‚ ๋ ตํ•œ ํ„ฑ์„ , ์˜ค๋˜‘ํ•œ ์ฝ”

    This command searches for the 3 most similar annotations to the query, copies the corresponding images to the result/ directory, and prints the full details of the matched annotations to the terminal.

๐Ÿ“‚ Results

The search results are saved in the result/ directory. The directory will contain the image files corresponding to the matched annotations, and the detailed information of the matched annotations will be printed in the terminal.

Example output:

{
  "id": 1,
  "category": "best",
  "image": "result/image02.png",
  "annotation": "๊ฐ•์•„์ง€์ƒ ๋ˆˆ๋งค, ๋„ํšŒ์  ์ด๋ฏธ์ง€, ์ฐจ๊ฐ€์šด ์ด๋ฏธ์ง€, ๋„ํ†ฐํ•œ ์• ๊ต์‚ด, ๊ณ„๋ž€ํ˜•, ๋ญ‰ํˆญํ•œ ํ„ฑ ๋, ๋„ํ†ฐํ•œ ์ฝง๋ง์šธ, ์ ๋‹นํ•œ ์ฝง๋ณผ, ์„ ๋ช…ํ•œ ์Œ์ปคํ’€, ๋„ํ†ฐํ•œ ์•„๋žซ์ž…์ˆ , ํ•˜์–€ ํ”ผ๋ถ€, ์ž๊ธฐ์ฃผ๋„์ ์„ฑํ–ฅ ์ด๋ฏธ์ง€, ์—ฌ์„ฑ๋ฏธ๊ฐ€ ์žˆ๋Š” ์–ผ๊ตด, ์ˆ™๋…€๊ฐ™์€ ์ด๋ฏธ์ง€",
  "name": "best_female_image02"
}

โš ๏ธ Notes

  • Be sure to run data_preparation.py first to generate the embeddings.npy file.
  • Verify that the image paths and annotation data are correctly specified.
  • Run main.py from the projectโ€™s root directory to ensure correct file paths.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages