jbarrow
FFDNet L
šŖ Automatically convert a PDF into a fillable form. š» Hosted Models (detect.semanticdocs.org) | š CommonForms Paper | š¤ Dataset | 𦾠Models FFDNet-L is the 25 million parameter object detector trained on the dataset from the paper CommonForms: A Large, Diverse Dataset for Form Field Detection. The model detects widgets from among three classes: TextBoxes, ChoiceButtons (checkboxes), and Signature fields. | Model | Text | Choice | Signature | AP (ā) | |-------|------|--------|-----------|--------| | FFDNet-S (1216px) | 61.5 | 71.3 | 84.2 | 72.3 | | FFDNet-L (1216px) | 71.4 | 78.1 | 93.5 | 81.0 | The `commonforms` package can be installed with either `uv` or `pip`, feel free to choose your package manager flavor. The `uv` command: Once it's installed, you should be able to run the CLI command on ~any PDF. Refer to the `commonforms` documentation for the latest information. The simplest usage will run inference on your CPU using the default suggested settings: | Argument | Type | Default | Description | |----------|------|---------|-------------| | `input` | Path | Required | Path to the input PDF file | | `output` | Path | Required | Path to save the output PDF file | | `--model` | str | `FFDNet-L` | Model name (FFDNet-L/FFDNet-S) or path to custom .pt file | | `--keep-existing-fields` | flag | `False` | Keep existing form fields in the PDF | | `--use-signature-fields` | flag | `False` | Use signature fields instead of text fields for detected signatures | | `--device` | str | `cpu` | Device for inference (e.g., `cpu`, `cuda`, `0`) | | `--image-size` | int | `1600` | Image size for inference | | `--confidence` | float | `0.3` | Confidence threshold for detection | | `--fast` | flag | `False` | If running on a CPU, you can trade off accuracy for speed and run in about half the time | All of the above arguments are keyword arguments to the `prepareform` function. E.g. if you want to prepare a with signature fields and keep existing fields at 1216 resolution, you would run: CommonForms: A Large, Diverse Dataset for Form Field Detection