commit b5979403abc9cdc7cda7f7438dd44bb2dc68d420 Author: ailab Date: Thu Jul 11 15:29:14 2024 +0800 first commit diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3476589 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,33 @@ +*.7z filter=lfs diff=lfs merge=lfs -text +*.arrow filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.ftz filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.h5 filter=lfs diff=lfs merge=lfs -text +*.joblib filter=lfs diff=lfs merge=lfs -text +*.lfs.* filter=lfs diff=lfs merge=lfs -text +*.mlmodel filter=lfs diff=lfs merge=lfs -text +*.model filter=lfs diff=lfs merge=lfs -text +*.msgpack filter=lfs diff=lfs merge=lfs -text +*.npy filter=lfs diff=lfs merge=lfs -text +*.npz filter=lfs diff=lfs merge=lfs -text +*.onnx filter=lfs diff=lfs merge=lfs -text +*.ot filter=lfs diff=lfs merge=lfs -text +*.parquet filter=lfs diff=lfs merge=lfs -text +*.pb filter=lfs diff=lfs merge=lfs -text +*.pickle filter=lfs diff=lfs merge=lfs -text +*.pkl filter=lfs diff=lfs merge=lfs -text +*.pt filter=lfs diff=lfs merge=lfs -text +*.pth filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +saved_model/**/* filter=lfs diff=lfs merge=lfs -text +*.tar.* filter=lfs diff=lfs merge=lfs -text +*.tflite filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.wasm filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text +*tfevents* filter=lfs diff=lfs merge=lfs -text +model.safetensors filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md new file mode 100644 index 0000000..473aa2f --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +--- +license: mit +widget: +- src: https://www.invoicesimple.com/wp-content/uploads/2018/06/Sample-Invoice-printable.png + example_title: Invoice +--- + +# Table Transformer (fine-tuned for Table Detection) + +Table Transformer (DETR) model trained on PubTables1M. It was introduced in the paper [PubTables-1M: Towards Comprehensive Table Extraction From Unstructured Documents](https://arxiv.org/abs/2110.00061) by Smock et al. and first released in [this repository](https://github.com/microsoft/table-transformer). + +Disclaimer: The team releasing Table Transformer did not write a model card for this model so this model card has been written by the Hugging Face team. + +## Model description + +The Table Transformer is equivalent to [DETR](https://huggingface.co/docs/transformers/model_doc/detr), a Transformer-based object detection model. Note that the authors decided to use the "normalize before" setting of DETR, which means that layernorm is applied before self- and cross-attention. + +## Usage + +You can use the raw model for detecting tables in documents. See the [documentation](https://huggingface.co/docs/transformers/main/en/model_doc/table-transformer) for more info. \ No newline at end of file diff --git a/config.json b/config.json new file mode 100644 index 0000000..3e86a23 --- /dev/null +++ b/config.json @@ -0,0 +1,51 @@ +{ + "activation_dropout": 0.0, + "activation_function": "relu", + "architectures": [ + "TableTransformerForObjectDetection" + ], + "attention_dropout": 0.0, + "auxiliary_loss": false, + "backbone": "resnet18", + "bbox_cost": 5, + "bbox_loss_coefficient": 5, + "ce_loss_coefficient": 1, + "class_cost": 1, + "d_model": 256, + "decoder_attention_heads": 8, + "decoder_ffn_dim": 2048, + "decoder_layerdrop": 0.0, + "decoder_layers": 6, + "dice_loss_coefficient": 1, + "dilation": false, + "dropout": 0.1, + "encoder_attention_heads": 8, + "encoder_ffn_dim": 2048, + "encoder_layerdrop": 0.0, + "encoder_layers": 6, + "eos_coefficient": 0.4, + "giou_cost": 2, + "giou_loss_coefficient": 2, + "id2label": { + "0": "table", + "1": "table rotated" + }, + "init_std": 0.02, + "init_xavier_std": 1.0, + "is_encoder_decoder": true, + "label2id": { + "table": 0, + "table rotated": 1 + }, + "mask_loss_coefficient": 1, + "max_position_embeddings": 1024, + "model_type": "table-transformer", + "num_channels": 3, + "num_hidden_layers": 6, + "num_queries": 15, + "position_embedding_type": "sine", + "scale_embedding": false, + "torch_dtype": "float32", + "transformers_version": "4.24.0.dev0", + "use_pretrained_backbone": true +} diff --git a/model.safetensors b/model.safetensors new file mode 100644 index 0000000..31cfbbc --- /dev/null +++ b/model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f1aa73170102c038d40155e2734b343bf07e0fe12594228a8590943b01dccf7 +size 115317516 diff --git a/preprocessor_config.json b/preprocessor_config.json new file mode 100644 index 0000000..545efb6 --- /dev/null +++ b/preprocessor_config.json @@ -0,0 +1,18 @@ +{ + "do_normalize": true, + "do_resize": true, + "feature_extractor_type": "DetrFeatureExtractor", + "format": "coco_detection", + "image_mean": [ + 0.485, + 0.456, + 0.406 + ], + "image_std": [ + 0.229, + 0.224, + 0.225 + ], + "max_size": 800, + "size": 800 +} diff --git a/pytorch_model.bin b/pytorch_model.bin new file mode 100644 index 0000000..d550834 --- /dev/null +++ b/pytorch_model.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d9babb11711211dd9fea2f477b7ba11f3656623505b07f9e30bfd41f143a9c7 +size 115393245