Skip to main content

Pavimentados

User Manual

analytics image (flat) Quality Gate Status Downloads

video_results.gif

Description


Pavimentados is a tool that allows the identification of pavement faults located on highways or roads. This library provides an environment to use computer vision models developed to detect different elements. The detected elements are then used to generate metrics that aid the process of planning road maintenance.

The model files can be downloaded from this link.

Important changes: Unlike the previous version, this new version does not include traffic sign detection. We hope to be able to include it again in future versions.

Main Features


Some of the features available are:

  • Scoring using the models already developed.
  • Workflows for image acquisition and assessment.
  • Evaluation of gps information to determine the location of faults and elements.
  • Image or video support.
  • Support for GPS data in different formats (GPRRA, csv, embedded in image).

Instalation


Install the library using the following command:

pip install pavimentados

Next,

tar -xzvf model_20240818.tar.gz

Quick Start


In the notebooks folder there is a complete example of how to process both images and videos present in notebooks/road_videos and notebooks/road_images. The results are saved to notebooks/outputs.

The first step is to import the components that create a workflow with images:

from pavimentados.processing.processors import MultiImage_Processor
from pavimentados.processing.workflows import Workflow_Processor

In this example, there is the image processor object MultiImage_Processor which is in charge of taking the images and analyzing them individually using the models. In addition, there is the Workflow_Processor object that is in charge of the image processing workflow.

Internally, the Workflow_Processor has objects that can interpret different image sources or GPS information.

Among the allowed image sources are:

  • image_routes: A list of image routes.
  • image_folder: A folder with all images.
  • video: The path to a video file.

Among the allowed GPS data sources are:

  • image_routes: A list of paths to the routes of the images that have the gps data embedded in them.
  • image_folder: A path to a folder with all the images that have the gps data embedded in them.
  • loc: A file in NMEA format.
  • gpx: A file in GPX format

Once these elements are imported, the processor is instantiated as follows:

from pathlib import Path
models_path = Path("./artifacts")  # Path to downloaded model
ml_processor = MultiImage_Processor(artifacts_path=str(models_path))

Alternatively, an additional JSON file can be specified to set or overwrite certain configuration parameters of the models.

ml_processor = MultiImage_Processor(artifacts_path=str(models_path), config_file="./models_config.json")

These parameters allow the specification of parameter such as the confidence, iou, or maximum amount of detections per frame.

Example of the configuration file:

{
	"paviment_model": {
		"yolo_threshold": 0.20,
		"yolo_iou": 0.45,
		"yolo_max_detections": 100
	}
}

The workflow object receives the instantiated processor. Without it is not able to execute the workflow.

input_video_file = "sample.mp4"
input_gps_file = "sample.log"

# Create a workflow for videos
workflow = Workflow_Processor(
    input_video_file, image_source_type="video", gps_source_type="loc", gps_input=input_gps_file, adjust_gps=True
)

The last step is to execute the workflow:

results = workflow.execute(ml_processor, 
                           batch_size=16, 
                           video_output_file="processed_video.mp4" 
                           )
  • video_output_file and image_folder_output are optional and are only to save output video or image files along detections.

The results can be saved in csv format or used for further processing.

# Save results to outputs directory
import pandas as pd
for result_name in results.keys():
    pd.DataFrame(results[result_name]).to_csv(f"{result_name}.csv")

In the results object you will find the following:

  1. table_summary_sections: DataFrame with summary table by sections.
  2. data_resulting: DataFrame with results per frame.
  3. data_resulting_fails: DataFrame with results by unique faults encountered.
  4. signals_summary : DataFrame with results by signal.

To see more details about the results please refer to this page.

Project structure


  • docs: Documentation files.
  • models: Reference path where the downloaded model artifact should be placed.
  • notebooks: Examples of how to process images and videos.
  • pavimentados/analyzers: Modules for image/video processing and generation of the final output.
  • pavimentados/configs: General configuration and parameters of the models.
  • pavimentados/models: Modules for YoloV8 and Siamese models.
  • pavimentados/processing: Workflows for processing.

Changelog


For information regarding the latest changes/updates in the library please refer to the changes document.

Authors


This package has been developed by:

Jose Maria Marquez Blanco
Joan Alberto Cerretani
Victor Durand

Metadata

Release files for pavimentados 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pavimentados 1.1.0
File Size Uploaded
pavimentados-1.1.0.tar.gz 29.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pavimentados 1.1.0
File Interpreter ABI Platform
pavimentados-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 60.6 kB

Release files / pavimentados-1.1.0.tar.gz

Download URL pavimentados-1.1.0.tar.gz
Size 29.0 kB
Tags Source
SHA-256 checksum
How to use checksums
72393dfcc7bb13454ca452644d49f42d3890266e751eb8dddb5ae57593f68430
BLAKE2b-256 checksum
How to use checksums
f662911e3b5fed7dddeed3dbca712aea2e823b51957f999202a735b7c5b3afb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release files / pavimentados-1.1.0-py3-none-any.whl

Download URL pavimentados-1.1.0-py3-none-any.whl
Size 31.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e170530a02b8dee9f106b1111b89ea230c4944b52d8721bf0b290572b15d9b0f
BLAKE2b-256 checksum
How to use checksums
d7db011fb2125a4b003df03171beeade6984dcc1536563dce786c78551e13c54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.5

2 release files

1.0.4

2 release files

0.31.3

2 release files

0.31.2

2 release files

0.31.1

2 release files

0.31.0

2 release files

0.30.0

2 release files

0.29.1

2 release files

0.29.0

2 release files

0.28.1

2 release files

0.28.0

2 release files

0.27.0

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.24.0

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.21.0

2 release files

0.18.0

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.16.1

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.9.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page