Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/oktopuzSlid/detectorPlacas/llms.txt

Use this file to discover all available pages before exploring further.

By the end of this guide you will have a working DetectorPlacas environment and will have successfully run license plate detection on your first image — seeing bounding boxes and confidence scores drawn directly on the output. The setup takes about five minutes if you already have Python 3 installed.
DetectorPlacas requires TensorFlow 1.x. The detection scripts rely on tf.app.flags, tf.Graph(), tf.Session(), and tf.GraphDef() — all APIs that were removed or substantially changed in TensorFlow 2.x. Running the scripts under TF 2.x will raise AttributeError exceptions without modification. Use tensorflow==1.15, the final TF 1.x release.
1

Install Python Dependencies

Install the three core runtime libraries. tensorflow==1.15 is the last release in the 1.x series and the version most compatible with the Object Detection API utilities used by DetectorPlacas.
pip install tensorflow==1.15
pip install opencv-python
pip install numpy
Verify the TensorFlow version after installation:
python -c "import tensorflow as tf; print(tf.__version__)"
# Expected output: 1.15.x
2

Set Up the TensorFlow Object Detection API

Each script imports label_map_util and visualization_utils from object_detection.utils. These modules are part of the TensorFlow Models research repository and are not distributed via PyPI by default.Clone the repository and install the research package:
git clone https://github.com/tensorflow/models.git
cd models/research
pip install .
Alternatively, if you prefer not to install the package, add the research directory to your PYTHONPATH before running any script:
export PYTHONPATH=$PYTHONPATH:/path/to/models/research
Confirm the import works before continuing:
python -c "from object_detection.utils import label_map_util; print('OK')"
3

Prepare Model Artifacts

DetectorPlacas resolves all model paths relative to the working directory. Create the inference_graph/ subdirectory inside your project root and place the exported model files there:
project-root/
├── inference_graph/
│   ├── frozen_inference_graph.pb        ← required for inference
│   ├── model.ckpt.data-00000-of-00001
│   ├── model.ckpt.index
│   └── model.ckpt.meta
├── labelmap.pbtxt                        ← required for inference
├── Object_detection_image.py
├── Object_detection_video.py
├── Object_detection_webcam.py
└── interfaz.py
Create labelmap.pbtxt in the project root with a single class entry:
item {
  id: 1
  name: 'license_plate'
}
The scripts look for inference_graph/frozen_inference_graph.pb and labelmap.pbtxt using os.getcwd() as the base, so always run the scripts from the project root.
4

Run Detection

Choose the detection mode that fits your input. All commands should be run from the project root.GUI — recommended for first-time useThe Tkinter interface (window title: "Proyecto") lets you select a mode with radio buttons (IMAGEN, VIDEO, CAMARA), optionally enter an image directory path in the RUTA field, and click PRUEBA to launch the corresponding script:
python interfaz.py
Image detectionScans the specified directory for .jpg files using os.listdir() and runs inference on each one in sequence. Press any key to advance to the next image:
python Object_detection_image.py --ruta=/path/to/images
If --ruta is omitted, the script lists .jpg files in the current working directory:
python Object_detection_image.py
Video detectionReads prueba.mp4 from the working directory and processes it frame by frame. Press any key to step through each frame:
python Object_detection_video.py
Webcam detectionOpens camera index 0 at 1280×720 resolution and runs continuous inference. The feed stays live until you close the OpenCV window:
python Object_detection_webcam.py
5

Interpret Results

When a license plate is detected above the mode’s confidence threshold, DetectorPlacas draws a labelled bounding box directly on the frame using vis_util.visualize_boxes_and_labels_on_image_array. The box label shows the class name (license_plate) and the confidence score as a percentage.Confidence thresholds by mode:
  • Image: 0.65 — highest threshold, optimised for clean still frames
  • Video: 0.55 — relaxed slightly to handle motion blur across frames
  • Webcam: 0.50 — lowest threshold to catch plates under variable real-time lighting
Controls:
  • Any key — advances past the current image (image mode) or the current frame (video mode); cv2.waitKeyEx() is called after every frame
  • Close the window — exits webcam mode and triggers cv2.destroyAllWindows() and resource release
If no boxes appear, verify that frozen_inference_graph.pb is present in inference_graph/, that labelmap.pbtxt is in the project root, and that you are running the script from the correct working directory.
Start with python interfaz.py on your first run. The GUI exposes all three modes from a single window and handles the --ruta flag for you, so you can explore DetectorPlacas without memorising command-line arguments.

Detection Modes

Deep-dive into image, video, and webcam detection — covering confidence thresholds, directory scanning logic, frame-by-frame processing, and webcam resolution settings.

Script Reference

Full reference for every script: accepted flags, path resolution logic, tensor names, visualisation parameters, and the TF session lifecycle.

Build docs developers (and LLMs) love