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.

DetectorPlacas ships four Python scripts: three detection scripts that each handle a different input source (static images, a video file, and a live webcam feed) and one Tkinter GUI launcher that wraps all three. This page documents every flag, constant, visualization setting, and behavioral detail drawn directly from the source code for each script.
Detects license plates in all .jpg files found in a target directory. The script iterates over every matching file, runs the frozen-graph inference pipeline on each image in sequence, and opens an OpenCV window to display the annotated result before advancing to the next file.Run command
python Object_detection_image.py --ruta=/path/to/images
FlagThe flag is defined using tf.app.flags:
flags = tf.app.flags
flags.DEFINE_string('ruta', '', 'Path to the CSV input')
FLAGS = flags.FLAGS
--ruta
string
default:""
Path to the directory containing .jpg image files. When left empty the script falls back to os.getcwd(), so detection runs against the current working directory.
Constants
NameValuePurpose
MODEL_NAME'inference_graph'Subdirectory containing the frozen graph
NUM_CLASSES1Only one class: license plate
PATH_TO_CKPTos.path.join(CWD_PATH, MODEL_NAME, 'frozen_inference_graph.pb')Full path to the frozen .pb model file
PATH_TO_LABELSos.path.join(CWD_PATH, 'labelmap.pbtxt')Full path to the label map
PATH_TO_IMAGEos.path.join(CWD_PATH)Base directory for image discovery
Visualization settings
vis_util.visualize_boxes_and_labels_on_image_array(
    image,
    np.squeeze(boxes),
    np.squeeze(classes).astype(np.int32),
    np.squeeze(scores),
    category_index,
    use_normalized_coordinates=True,
    line_thickness=8,
    min_score_thresh=0.65)
SettingValue
min_score_thresh0.65 — detections below 65 % confidence are suppressed
line_thickness8 px bounding-box border
use_normalized_coordinatesTrue — boxes are in [0, 1] range
Window title: 'Detector de Placas PRUEBA-IMAGEN'Behavior: Uses os.listdir() to collect every .jpg file under --ruta. For each image, runs a sess.run() inference pass, annotates the result with vis_util, then calls cv2.waitKeyEx() — press any key to advance to the next image. cv2.destroyAllWindows() is called after all images have been processed.

Shared TensorFlow tensors

All three detection scripts retrieve the same five tensors from the loaded detection_graph using get_tensor_by_name(). These names are fixed by the TF Object Detection API export format.
Tensor nameRoleShape / notes
image_tensor:0Input — the image batch fed to the model[batch, H, W, 3] — RGB uint8 values
detection_boxes:0Output — predicted bounding boxes[batch, num_detections, 4] — normalized [ymin, xmin, ymax, xmax] in range [0, 1]
detection_scores:0Output — confidence score per detection[batch, num_detections] — float in [0, 1]
detection_classes:0Output — class index per detection[batch, num_detections]1 = license plate; cast to int32 with .astype(np.int32)
num_detections:0Output — count of valid detections returned[batch] — integer scalar per image in the batch
image_tensor      = detection_graph.get_tensor_by_name('image_tensor:0')
detection_boxes   = detection_graph.get_tensor_by_name('detection_boxes:0')
detection_scores  = detection_graph.get_tensor_by_name('detection_scores:0')
detection_classes = detection_graph.get_tensor_by_name('detection_classes:0')
num_detections    = detection_graph.get_tensor_by_name('num_detections:0')

Build docs developers (and LLMs) love