Skip to content

chatgpt4pcg/similarity-checking-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Similarity Checking Script

This repository contains a script for checking the similarity of text in images using a fine-tuned version of vit-base-patch16-224-in21k trained on a generated dataset of letters from various typefaces.

You can try an online demo of the model at https://huggingface.co/spaces/pittawat/vit-base-uppercase-english-characters.

Installation

To use this script, you must have conda installed on your system.

  1. Clone this repository to your local machine.
  2. Navigate to the repository directory in your terminal.
  3. Create the new conda environment or use an existing one by running conda create -n chatgpt4pcg python=3.11. Then activate the environment by running conda activate chatgpt4pcg.
  4. Run pip3 install -r requirements.txt to install the necessary dependencies.

Usage

  1. Run python3 main.py -s "<SOURCE_FOLDER>" to start the similarity checking process. For example, python3 main.py -s "./competition". In some cases, you may need to run python main.py -s "./competition" (python without 3) instead.
  2. The script will output the result in JSON format inside the similarity folder under the <SOURCE_FOLDER>/<TEAM_FOLDER>/<CHARACTER>/similarity. A file similarity_log_<DATE_TIME>.txt will be created inside logs folder.

Please note that <STAGE> can be raw, intermediate, levels, images, stability, similarity, or diversity. <CHARACTER> can be A, B, C, ..., Z.

Please ensure that the source folder has the following structure:

<SOURCE_FOLDER>
├── <TEAM_NAME>
|   ├── <STAGE>
│   │    └── <CHARACTER>
│   │       ├── <TRIAL_NUMBER>.jpg
│   │       ├── <TRIAL_NUMBER>.jpg
│   │       └── <TRIAL_NUMBER>.png
│   └── <STAGE>
│        └── <CHARACTER>
│           ├── <TRIAL_NUMBER>.txt
│           ├── <TRIAL_NUMBER>.txt
│           └── <TRIAL_NUMBER>.txt
└── <TEAM_NAME>
    ├── <STAGE>
    │    └── <CHARACTER>
    │       ├── <TRIAL_NUMBER>.jpg
    │       ├── <TRIAL_NUMBER>.png
    │       └── <TRIAL_NUMBER>.jpg
    └── <STAGE>
         └── <CHARACTER>
            ├── <TRIAL_NUMBER>.txt
            ├── <TRIAL_NUMBER>.txt
            └── <TRIAL_NUMBER>.txt

For example,

competition
├── team1
|   ├── images
│   │    └── I
│   │       ├── team1_I_1.jpg
│   │       ├── team1_I_2.jpg
│   │       └── team1_I_3.png
│   └── intermediate
│        └── I
│           ├── team1_I_1.txt
│           ├── team1_I_2.txt
│           └── team1_I_3.txt
└── team2
    ├── images
    │    └── A
    │       ├── team2_A_1.jpg
    │       ├── team2_A_2.png
    │       └── team2_A_3.jpg
    └── raw
         └── B
            ├── team2_B_1.txt
            ├── team2_B_2.txt
            └── team2_B_3.txt

Contributing

If you would like to contribute to this project, please fork this repository and submit a pull request. Please ensure that your code is well documented and that you have tested your code before submitting a pull request.

Bug Reporting

If you find any bugs, please submit an issue on this repository.

About

This repository contains a script for checking the similarity between an input image and a target character.

Topics

Resources

Stars

Watchers

Forks

Languages