CodeProject.AI Version 2.0

prsmith777

Getting comfortable
Joined
Dec 23, 2019
Messages
271
Reaction score
389
Location
Colorado
I tried refreshing and clearing browser cache. The option is not there.

lpr.png
 

Tinman

Known around here
Joined
Nov 2, 2015
Messages
1,220
Reaction score
1,508
Location
USA
Most of these problems are from NOT letting CP install fully. When you do the install select "remove previously installed modules & data" and then wait for the installer finish the initial setup. BE SURE to leave status window open and watch the progress of each component as it is downloaded and installed. It will take at least 15-20 minutes to install just the 3 basic parts. Patience is a key factor here :)
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
2,062
Reaction score
958
@MikeLud1 Something must be wrong with my install. I get "Call Failed" when I try to install any module.
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,224
Reaction score
4,277
Location
Brooklyn, NY
Ok I did that and no change
Also open the below file with notepad and post what is in the file, like the below.

{
"Modules": {
"ObjectDetectionYOLOv5Net": {
"AutoStart": true
},
"ObjectDetectionYOLOv5-6.2": {
"AutoStart": false
},
"FaceProcessing": {
"AutoStart": false
},
"TrainingObjectDetectionYOLOv5": {
"AutoStart": false
},
"ObjectDetectionYOLOv8": {
"AutoStart": false
}
}
}
 

prsmith777

Getting comfortable
Joined
Dec 23, 2019
Messages
271
Reaction score
389
Location
Colorado
Also open the below file with notepad and post what is in the file, like the below.

{
"Modules": {
"ObjectDetectionYOLOv5Net": {
"AutoStart": true
},
"ObjectDetectionYOLOv5-6.2": {
"AutoStart": false
},
"FaceProcessing": {
"AutoStart": false
},
"TrainingObjectDetectionYOLOv5": {
"AutoStart": false
},
"ObjectDetectionYOLOv8": {
"AutoStart": false
}
}
}
Sorry, which file is that?
 

prsmith777

Getting comfortable
Joined
Dec 23, 2019
Messages
271
Reaction score
389
Location
Colorado
So replacing my modulesettings.json with yours has returned the GPU option.

However, when I test LPR using CP.AI Explorer I get no predictions returned. When I disable GPU and use CPU, I get a good license read.

Here is my version that didn't work.

{
"Modules": {

"ALPR": {
"Name": "License Plate Reader",
"Version": "2.7.5",

/ Publishing info
"Description": "Detects and readers single-line and multi-line licence plates using YOLO object detection and the PaddleOCR toolkit",
"Category": "Computer Vision",
"Platforms": [ "all" ],
"License": "SSPL",
"LicenseUrl": "Server Side Public License (SSPL)",

/ Launch instructions
"AutoStart": true,
"FilePath": "ALPR_adapter.py",
"Runtime": "python3.8",
"RuntimeLocation": "Local", / Can be Local or Shared
"Queue": "alpr_queue", / default is lower(module_id) + '_queue'

"EnvironmentVariables": {
"MIN_COMPUTE_CAPABILITY": "7",
"MIN_CUDNN_VERSION": "7",

"PLATE_CONFIDENCE": 0.7, / Confidence required in detecting a plate in the first place
"PLATE_ROTATE_DEG": 0, / If non-zero, rotate plate before OCR (+ve = counterclockwise)
"AUTO_PLATE_ROTATE": true,
"PLATE_RESCALE_FACTOR": 2,
"OCR_OPTIMIZATION": true,
"OCR_OPTIMAL_CHARACTER_HEIGHT": 60,
"OCR_OPTIMAL_CHARACTER_WIDTH": 36
},

/ GPU options
"InstallGPU": false, / PaddlePaddle-GPU only installs easily on Windows (though with issues on older cards)
"EnableGPU": true, / Will be coerced to false if InstallGPU = false
"AcceleratorDeviceName": null, / = default
"Parallelism": 0, / 0 = Default (number of CPUs - 1)
"HalfPrecision": "enable", / 'Force', 'Enable', 'Disable': whether to force on, allow, or disable half-precision ops
"PostStartPauseSecs": 1, / Generally 1 if using GPU, 0 for CPU


/ Which server version is compatible with each version of this module.
"ModuleReleases": [
{ "ModuleVersion": "1.0", "ServerVersionRange": [ "1.0", "2.0.8" ], "ReleaseDate": "2022-11-01" },
{ "ModuleVersion": "2.1", "ServerVersionRange": [ "2.0.9", "2.0.9" ], "ReleaseDate": "2022-12-01" },
{ "ModuleVersion": "2.2", "ServerVersionRange": [ "2.1", "2.1.12" ], "ReleaseDate": "2023-03-20" },
{ "ModuleVersion": "2.3", "ServerVersionRange": [ "2.1", "2.1.12" ], "ReleaseDate": "2023-04-20", "ReleaseNotes": "Updated module settings", "Importance": "Minor" },
{ "ModuleVersion": "2.4", "ServerVersionRange": [ "2.1", "2.1.12" ], "ReleaseDate": "2023-05-10", "ReleaseNotes": "PaddlePaddle install more reliable", "Importance": "Minor" },
{ "ModuleVersion": "2.5", "ServerVersionRange": [ "2.1", "2.1.12" ], "ReleaseDate": "2023-06-04", "ReleaseNotes": "Updated PaddlePaddle" },
{ "ModuleVersion": "2.6", "ServerVersionRange": [ "2.2", "2.2.4" ], "ReleaseDate": "2023-09-09", "ReleaseNotes": "Updated installer" },
{ "ModuleVersion": "2.7", "ServerVersionRange": [ "2.3.0", "2.3.0" ], "ReleaseDate": "2023-10-01", "ReleaseNotes": "Updated to match new installer SDK. Now works on Raspberry Pi." },
{ "ModuleVersion": "2.7.1", "ServerVersionRange": [ "2.3.1", "2.3.5" ], "ReleaseDate": "2023-10-10", "ReleaseNotes": "Updated to match new installer SDK." },
{ "ModuleVersion": "2.7.2", "ServerVersionRange": [ "2.3.1", "2.4.0" ], "ReleaseDate": "2023-10-10", "ReleaseNotes": "LibSSL install correction." },
{ "ModuleVersion": "2.7.3", "ServerVersionRange": [ "2.3.5", "2.4.0" ], "ReleaseDate": "2023-11-06", "ReleaseNotes": "Installer updates", "Importance": "Minor" },
{ "ModuleVersion": "2.7.4", "ServerVersionRange": [ "2.4.1", "2.4.1" ], "ReleaseDate": "2023-12-06", "ReleaseNotes": "Updated modulesettings schema, new route", "Importance": "Minor" },
{ "ModuleVersion": "2.7.5", "ServerVersionRange": [ "2.4.2", "" ], "ReleaseDate": "2023-12-09", "ReleaseNotes": "Installer updates", "Importance": "Minor" }
],

"RouteMaps": [
{
"Name": "License Plate Reader",
"Route": "vision/alpr",
"Method": "POST",
"Command": "alpr",
"Description": "Detects and reads the characters in license plates detected within an image",
"Inputs": [
{
"Name": "upload",
"Type": "File",
"Description": "The image to ALPR."
}
],

"Outputs": [
{
"Name": "success",
"Type": "Boolean",
"Description": "True if successful."
},
{
"Name": "message",
"Type": "String",
"Description": "A summary of the inference operation."
},
{
"Name": "error",
"Type": "String",
"Description": "(Optional) An description of the error if success was false."
},
{
"Name": "predictions",
"Type": "Object[]",
"Description": "An array of objects with the x_max, x_min, max, y_min bounds of the plate, label, the plate chars and confidence."
},
{
"Name": "count",
"Type": "Integer",
"Description": "The number of objects found."
},
{
"Name": "command",
"Type": "String",
"Description": "The command that was sent as part of this request. Can be detect, list, status."
},
{
"Name": "moduleId",
"Type": "String",
"Description": "The Id of the module that processed this request."
},
{
"Name": "executionProvider",
"Type": "String",
"Description": "The name of the device or package handling the inference. eg CPU, GPU, TPU, DirectML."
},
{
"Name": "canUseGPU",
"Type": "Boolean",
"Description": "True if this module can use the current GPU if one is present."
},
{
"Name": "inferenceMs",
"Type": "Integer",
"Description": "The time (ms) to perform the AI inference."
},
{
"Name": "processMs",
"Type": "Integer",
"Description": "The time (ms) to process the image (includes inference and image manipulation operations)."
},
{
"Name": "analysisRoundTripMs",
"Type": "Integer",
"Description": "The time (ms) for the round trip to the analysis module and back."
}
]
},
{
"Name": "License Plate Reader, Legacy route",
"Route": "image/alpr",
"Method": "POST",
"Command": "alpr",
"Description": "Detects the characters in license plates detected within an image",
"Inputs": [
{
"Name": "upload",
"Type": "File",
"Description": "The image to ALPR."
}
],

"Outputs": [
{
"Name": "success",
"Type": "Boolean",
"Description": "True if successful."
},
{
"Name": "message",
"Type": "String",
"Description": "A summary of the inference operation."
},
{
"Name": "error",
"Type": "String",
"Description": "(Optional) An description of the error if success was false."
},
{
"Name": "predictions",
"Type": "Object[]",
"Description": "An array of objects with the x_max, x_min, max, y_min bounds of the plate, label, the plate chars and confidence."
},
{
"Name": "count",
"Type": "Integer",
"Description": "The number of objects found."
},
{
"Name": "command",
"Type": "String",
"Description": "The command that was sent as part of this request. Can be detect, list, status."
},
{
"Name": "moduleId",
"Type": "String",
"Description": "The Id of the module that processed this request."
},
{
"Name": "executionProvider",
"Type": "String",
"Description": "The name of the device or package handling the inference. eg CPU, GPU, TPU, DirectML."
},
{
"Name": "canUseGPU",
"Type": "Boolean",
"Description": "True if this module can use the current GPU if one is present."
},
{
"Name": "inferenceMs",
"Type": "Integer",
"Description": "The time (ms) to perform the AI inference."
},
{
"Name": "processMs",
"Type": "Integer",
"Description": "The time (ms) to process the image (includes inference and image manipulation operations)."
},
{
"Name": "analysisRoundTripMs",
"Type": "Integer",
"Description": "The time (ms) for the round trip to the analysis module and back."
}
]
}
]
}
}
}
 

fenderman

Staff member
Joined
Mar 9, 2014
Messages
36,907
Reaction score
21,287
Try using the Object Detection (YOLOv5 .NET) module instead of the Object Detection (YOLOv5 6.2) 1.7.5 module. The Object Detection (YOLOv5 .NET) module will use the iGPU.
Thanks. I am using the yolov5 .net. However it still shows CPU on the dashboard even after hundreds of triggers. I had this issue with 2.0.8 as well on other systems (2.0.8 otherwise works great). My understanding was that once ai processed its first image with yolov5 .net, the dash would display gpu. Otherwise its was a really smooth install and working perfectly.
Your work on this project along with the others is fantastic and appreciated!
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,224
Reaction score
4,277
Location
Brooklyn, NY
So replacing my modulesettings.json with yours has returned the GPU option.

However, when I test LPR using CP.AI Explorer I get no predictions returned. When I disable GPU and use CPU, I get a good license read.

Here is my version that didn't work.

{
"Modules": {

"ALPR": {
"Name": "License Plate Reader",
"Version": "2.7.5",

/ Publishing info
"Description": "Detects and readers single-line and multi-line licence plates using YOLO object detection and the PaddleOCR toolkit",
"Category": "Computer Vision",
"Platforms": [ "all" ],
"License": "SSPL",
"LicenseUrl": "Server Side Public License (SSPL)",

/ Launch instructions
"AutoStart": true,
"FilePath": "ALPR_adapter.py",
"Runtime": "python3.8",
"RuntimeLocation": "Local", / Can be Local or Shared
"Queue": "alpr_queue", / default is lower(module_id) + '_queue'

"EnvironmentVariables": {
"MIN_COMPUTE_CAPABILITY": "7",
"MIN_CUDNN_VERSION": "7",

"PLATE_CONFIDENCE": 0.7, / Confidence required in detecting a plate in the first place
"PLATE_ROTATE_DEG": 0, / If non-zero, rotate plate before OCR (+ve = counterclockwise)
"AUTO_PLATE_ROTATE": true,
"PLATE_RESCALE_FACTOR": 2,
"OCR_OPTIMIZATION": true,
"OCR_OPTIMAL_CHARACTER_HEIGHT": 60,
"OCR_OPTIMAL_CHARACTER_WIDTH": 36
},

/ GPU options
"InstallGPU": false, / PaddlePaddle-GPU only installs easily on Windows (though with issues on older cards)
"EnableGPU": true, / Will be coerced to false if InstallGPU = false
"AcceleratorDeviceName": null, / = default
"Parallelism": 0, / 0 = Default (number of CPUs - 1)
"HalfPrecision": "enable", / 'Force', 'Enable', 'Disable': whether to force on, allow, or disable half-precision ops
"PostStartPauseSecs": 1, / Generally 1 if using GPU, 0 for CPU


/ Which server version is compatible with each version of this module.
"ModuleReleases": [
{ "ModuleVersion": "1.0", "ServerVersionRange": [ "1.0", "2.0.8" ], "ReleaseDate": "2022-11-01" },
{ "ModuleVersion": "2.1", "ServerVersionRange": [ "2.0.9", "2.0.9" ], "ReleaseDate": "2022-12-01" },
{ "ModuleVersion": "2.2", "ServerVersionRange": [ "2.1", "2.1.12" ], "ReleaseDate": "2023-03-20" },
{ "ModuleVersion": "2.3", "ServerVersionRange": [ "2.1", "2.1.12" ], "ReleaseDate": "2023-04-20", "ReleaseNotes": "Updated module settings", "Importance": "Minor" },
{ "ModuleVersion": "2.4", "ServerVersionRange": [ "2.1", "2.1.12" ], "ReleaseDate": "2023-05-10", "ReleaseNotes": "PaddlePaddle install more reliable", "Importance": "Minor" },
{ "ModuleVersion": "2.5", "ServerVersionRange": [ "2.1", "2.1.12" ], "ReleaseDate": "2023-06-04", "ReleaseNotes": "Updated PaddlePaddle" },
{ "ModuleVersion": "2.6", "ServerVersionRange": [ "2.2", "2.2.4" ], "ReleaseDate": "2023-09-09", "ReleaseNotes": "Updated installer" },
{ "ModuleVersion": "2.7", "ServerVersionRange": [ "2.3.0", "2.3.0" ], "ReleaseDate": "2023-10-01", "ReleaseNotes": "Updated to match new installer SDK. Now works on Raspberry Pi." },
{ "ModuleVersion": "2.7.1", "ServerVersionRange": [ "2.3.1", "2.3.5" ], "ReleaseDate": "2023-10-10", "ReleaseNotes": "Updated to match new installer SDK." },
{ "ModuleVersion": "2.7.2", "ServerVersionRange": [ "2.3.1", "2.4.0" ], "ReleaseDate": "2023-10-10", "ReleaseNotes": "LibSSL install correction." },
{ "ModuleVersion": "2.7.3", "ServerVersionRange": [ "2.3.5", "2.4.0" ], "ReleaseDate": "2023-11-06", "ReleaseNotes": "Installer updates", "Importance": "Minor" },
{ "ModuleVersion": "2.7.4", "ServerVersionRange": [ "2.4.1", "2.4.1" ], "ReleaseDate": "2023-12-06", "ReleaseNotes": "Updated modulesettings schema, new route", "Importance": "Minor" },
{ "ModuleVersion": "2.7.5", "ServerVersionRange": [ "2.4.2", "" ], "ReleaseDate": "2023-12-09", "ReleaseNotes": "Installer updates", "Importance": "Minor" }
],

"RouteMaps": [
{
"Name": "License Plate Reader",
"Route": "vision/alpr",
"Method": "POST",
"Command": "alpr",
"Description": "Detects and reads the characters in license plates detected within an image",
"Inputs": [
{
"Name": "upload",
"Type": "File",
"Description": "The image to ALPR."
}
],

"Outputs": [
{
"Name": "success",
"Type": "Boolean",
"Description": "True if successful."
},
{
"Name": "message",
"Type": "String",
"Description": "A summary of the inference operation."
},
{
"Name": "error",
"Type": "String",
"Description": "(Optional) An description of the error if success was false."
},
{
"Name": "predictions",
"Type": "Object[]",
"Description": "An array of objects with the x_max, x_min, max, y_min bounds of the plate, label, the plate chars and confidence."
},
{
"Name": "count",
"Type": "Integer",
"Description": "The number of objects found."
},
{
"Name": "command",
"Type": "String",
"Description": "The command that was sent as part of this request. Can be detect, list, status."
},
{
"Name": "moduleId",
"Type": "String",
"Description": "The Id of the module that processed this request."
},
{
"Name": "executionProvider",
"Type": "String",
"Description": "The name of the device or package handling the inference. eg CPU, GPU, TPU, DirectML."
},
{
"Name": "canUseGPU",
"Type": "Boolean",
"Description": "True if this module can use the current GPU if one is present."
},
{
"Name": "inferenceMs",
"Type": "Integer",
"Description": "The time (ms) to perform the AI inference."
},
{
"Name": "processMs",
"Type": "Integer",
"Description": "The time (ms) to process the image (includes inference and image manipulation operations)."
},
{
"Name": "analysisRoundTripMs",
"Type": "Integer",
"Description": "The time (ms) for the round trip to the analysis module and back."
}
]
},
{
"Name": "License Plate Reader, Legacy route",
"Route": "image/alpr",
"Method": "POST",
"Command": "alpr",
"Description": "Detects the characters in license plates detected within an image",
"Inputs": [
{
"Name": "upload",
"Type": "File",
"Description": "The image to ALPR."
}
],

"Outputs": [
{
"Name": "success",
"Type": "Boolean",
"Description": "True if successful."
},
{
"Name": "message",
"Type": "String",
"Description": "A summary of the inference operation."
},
{
"Name": "error",
"Type": "String",
"Description": "(Optional) An description of the error if success was false."
},
{
"Name": "predictions",
"Type": "Object[]",
"Description": "An array of objects with the x_max, x_min, max, y_min bounds of the plate, label, the plate chars and confidence."
},
{
"Name": "count",
"Type": "Integer",
"Description": "The number of objects found."
},
{
"Name": "command",
"Type": "String",
"Description": "The command that was sent as part of this request. Can be detect, list, status."
},
{
"Name": "moduleId",
"Type": "String",
"Description": "The Id of the module that processed this request."
},
{
"Name": "executionProvider",
"Type": "String",
"Description": "The name of the device or package handling the inference. eg CPU, GPU, TPU, DirectML."
},
{
"Name": "canUseGPU",
"Type": "Boolean",
"Description": "True if this module can use the current GPU if one is present."
},
{
"Name": "inferenceMs",
"Type": "Integer",
"Description": "The time (ms) to perform the AI inference."
},
{
"Name": "processMs",
"Type": "Integer",
"Description": "The time (ms) to process the image (includes inference and image manipulation operations)."
},
{
"Name": "analysisRoundTripMs",
"Type": "Integer",
"Description": "The time (ms) for the round trip to the analysis module and back."
}
]
}
]
}
}
}
Did you reboot the PC, this is import for the change that I made with the file.
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,224
Reaction score
4,277
Location
Brooklyn, NY
Thanks. I am using the yolov5 .net. However it still shows CPU on the dashboard even after hundreds of triggers. I had this issue with 2.0.8 as well on other systems (2.0.8 otherwise works great). My understanding was that once ai processed its first image with yolov5 .net, the dash would display gpu. Otherwise its was a really smooth install and working perfectly.
Your work on this project along with the others is fantastic and appreciated!
The issue may be the iGPU driver, it needs to be DirectX 12 compatible. You can check if it is DirectX 12 compatible by running dxdiag
1702782937613.png
 
Top