jonahkaye commited on
Commit
47751d3
1 Parent(s): cb0f9e5
Files changed (5) hide show
  1. README.md +20 -0
  2. config.json +51 -0
  3. preprocessor_config.json +18 -0
  4. pytorch_model.bin +3 -0
  5. requirements.txt +1 -0
README.md ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ widget:
4
+ - src: https://www.invoicesimple.com/wp-content/uploads/2018/06/Sample-Invoice-printable.png
5
+ example_title: Invoice
6
+ ---
7
+
8
+ # Table Transformer (fine-tuned for Table Detection)
9
+
10
+ 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).
11
+
12
+ 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.
13
+
14
+ ## Model description
15
+
16
+ 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.
17
+
18
+ ## Usage
19
+
20
+ 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.
config.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation_dropout": 0.0,
3
+ "activation_function": "relu",
4
+ "architectures": [
5
+ "TableTransformerForObjectDetection"
6
+ ],
7
+ "attention_dropout": 0.0,
8
+ "auxiliary_loss": false,
9
+ "backbone": "resnet18",
10
+ "bbox_cost": 5,
11
+ "bbox_loss_coefficient": 5,
12
+ "ce_loss_coefficient": 1,
13
+ "class_cost": 1,
14
+ "d_model": 256,
15
+ "decoder_attention_heads": 8,
16
+ "decoder_ffn_dim": 2048,
17
+ "decoder_layerdrop": 0.0,
18
+ "decoder_layers": 6,
19
+ "dice_loss_coefficient": 1,
20
+ "dilation": false,
21
+ "dropout": 0.1,
22
+ "encoder_attention_heads": 8,
23
+ "encoder_ffn_dim": 2048,
24
+ "encoder_layerdrop": 0.0,
25
+ "encoder_layers": 6,
26
+ "eos_coefficient": 0.4,
27
+ "giou_cost": 2,
28
+ "giou_loss_coefficient": 2,
29
+ "id2label": {
30
+ "0": "table",
31
+ "1": "table rotated"
32
+ },
33
+ "init_std": 0.02,
34
+ "init_xavier_std": 1.0,
35
+ "is_encoder_decoder": true,
36
+ "label2id": {
37
+ "table": 0,
38
+ "table rotated": 1
39
+ },
40
+ "mask_loss_coefficient": 1,
41
+ "max_position_embeddings": 1024,
42
+ "model_type": "table-transformer",
43
+ "num_channels": 3,
44
+ "num_hidden_layers": 6,
45
+ "num_queries": 15,
46
+ "position_embedding_type": "sine",
47
+ "scale_embedding": false,
48
+ "torch_dtype": "float32",
49
+ "transformers_version": "4.24.0.dev0",
50
+ "use_pretrained_backbone": true
51
+ }
preprocessor_config.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_normalize": true,
3
+ "do_resize": true,
4
+ "feature_extractor_type": "DetrFeatureExtractor",
5
+ "format": "coco_detection",
6
+ "image_mean": [
7
+ 0.485,
8
+ 0.456,
9
+ 0.406
10
+ ],
11
+ "image_std": [
12
+ 0.229,
13
+ 0.224,
14
+ 0.225
15
+ ],
16
+ "max_size": 800,
17
+ "size": 800
18
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1d9babb11711211dd9fea2f477b7ba11f3656623505b07f9e30bfd41f143a9c7
3
+ size 115393245
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ timm