--- language: - en - km metrics: - accuracy pipeline_tag: object-detection --- # YOLOv7 Finetuned Figure/Graph Detection Model This repository provides a YOLOv7 model finetuned for detecting figures and graphs in document images, such as those found in scientific papers. The model and code are open for public use and research. ## Model Overview - **Base Model:** YOLOv7 - **Task:** Figure/Graph detection in document images - **Finetuned on:** Custom dataset of figures and graphs ## Quick Start ### 1. Clone the repository and install dependencies ```bash # Clone this repository cd https://huggingface.co/vichetkao/graph_detection_model python -m venv .venv .\.venv\Scripts\activate cd ../.. pip install -r requirements.txt ``` ### 2. Download the Model Weights Download the `best.pt` weights from this Hugging Face model page and place it in `run/train/weights/best.pt` or specify the path with `--weights`. ### 3. Run Detection You can run detection on your images using the provided script: ```bash python run_detect_testing.py --source "testing" --name testing_graph_bbox --device 0 ``` - `--source`: Path to your image folder or file (default: `testing`) - `--weights`: (Optional) Path to your model weights (`best.pt`) - `--device`: Set to `0` for GPU or `cpu` for CPU inference ### 4. Output - Results will be saved in `run/detect/testing_graph_bbox` - YOLO label files will be in `run/detect/testing_graph_bbox/labels` ## Example Detection Results Below are some example detection results from the model: