pip install -r requirements.txt
- To prepare datafor training use
data/prepare_data.py
. - To merge multiple json files data use
merge_json_data.py
Update the Required configs for the model in config.py
model
: LayoutLMv2/LayoutLMv3image_dir
: Path to the folder consisting of all the imagesdata_path
: Path to the final Prepared data file(full_data.json)output_path
: Path to the Output folder.banned_txt_path
: Path to the txt file of banned filesepochs
: Number of Epochs to train forbatch_size
: The Batch-Sizelearning_rate
: Learning Ratedata_split
: Test Split from the datadevice
: GPU Deviceinit_checkpoint
: Initial checkpoint to the huggingface modelwandb credentials..
python train.py
python infer.py -i IMAGE_INPUT -q QUESTION -m MODEL_PATH