Package: viasegura
VIAseguraContent Table:Project DescriptionMain FeaturesInstallationUsing the ModelsUser's guidesAutoresLicenseProject DescriptionVIAsegura is an API that helps to use artificial intelligence models developed by the Inter-American Development Bank to automatically tag items on the streets. The tags it places are some of those needed to implement the iRAP road safety methodology.To use it you must contact the Inter-American Development Bank to obtain the credentials that give access to the models with which the API works.These models require images with the specifications of the iRAP projects. This means that they have been taken every 20 meters along the entire path to be analyzed. In addition, some of the models require images to be taken from the front and others from the side of the car. The models yield 1 result for each model for groups of 5 images or less.So far, 15 models compatible with the iRAP labeling specifications have been developed and are specified in the table below.Model NameDescriptionType of ImageClassesdelineationAdequacy of road linesFrontal2street lightingPresence of street lightingFrontal2carriagewayCarriageway label for sectionFrontal2service roadPresence of a service roadFrontal2road conditionCondition of the road surfaceFrontal3skid resistanceSkidding resistanceFrontal3upgrade costInfluence surroundings on cost of major worksFrontal3speed managementPresence of features to reduce operating speedFrontal3bicycle facilityPresence of facilities for bicyclistsFrontal2quality of curveHow adecuate is the curveFrontal2vehicle parkingPresence of parking on the roadFrontal2property access pointsDetects access to propertiesFrontal2area_typeDetects if there is an urban or rural areaLateral2land useDescribes the use of the land surrounding the roadLateral4number of lanesThe numebr of lanes detectedFrontal5Some of the models can identify all the classes or categories, others can help you sort through the available options.Main FeaturesSome of the features now available are as follows:Scoring using the models already developedGrouping by groups of 5 images from an image listDownload models directly into the root of the packageInstalationTo install you can use the following commandspip install viaseguraThen to download the models use the following commandsfrom viasegura import download_models

download_models(url = <signed_url>)Or alternativilyfrom viasegura import download_models

download_models(aws_access_key = <aws_access_key>, signature = <signature>, expires = <expiration_time>)To obtain the corresponding credentials for downloading the models, please contact the Inter-American Development Bank atinfradigital@iadb.orgYou can also clone the repository but remember that the package is configured to download the models and place them in the root of the environment. You can change the locations manually as followsfrom viasegura import download_models

download_models(url = <signed_url>, system_path = <new_working_path>)Or alternativilyfrom viasegura import download_models

download_models(aws_access_key = <aws_access_key>, signature = <signature>, expires = <expiration_time>, system_path = <new_working_path>)Remember to put that path every time you instantiate a model so that you can find the artifacts you need to run them.Using the ModelsIn order to make the instance of a model you can use the following commandsfrom viasegura import ModelLabeler

labeler = ModelLabeler(<type>)You can use either "frontal" or "lateral" tag in order to use the group of models desired (see table above)For example, we can see both instance types:from viasegura import ModelLabeler

frontal_labeler = ModelLabeler('frontal')orfrom viasegura import ModelLabeler

lateral_labeler = ModelLabeler('lateral')Also you can especify which models to load using the parameter model filter and the name of the models to use, (see the table above):from viasegura import ModelLabeler

frontal_labeler = ModelLabeler('frontal', model_filter = ['delineation', 'street_lighting', 'carriageway'])In addition, you can make it work using the GPU specifying the device where the models are going to run, for examplefrom viasegura import ModelLabeler

frontal_labeler = ModelLabeler('frontal', device='/device:GPU:0')User GuideYou can see and entire example of use onthis link.Also make sure to see themanualto understand the scope of the project and how to make a project from scratch using the viasegura models.You can modify the devices used according to the TensorFlow documentation regarding GPU usage (seehttps://www.tensorflow.org/guide/gpu)AutoresThis package has been developed by:Jose Maria Marquez BlancoJoan Alberto CerretaniLicenseThe distribution of this software is according with the followinglicense