Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

Deep-Stack

How to use the Deep Stack server from Delphi

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

DeepStack AI Server DEMO

This is a demo showing how to use DeepStack AI Server, from Delphi.

Inorder for this demo to work it's a prerequisite that you have downloaded, installed and started DeepStack AI Server.

About DeepStack

DeepStack is an Open-Source AI API engine that serves pre-built models and custom models on multiple edge devices locally or on your private cloud. Click here to download your own copy.

For more information read about the project please goto their home page.

image

Inspiration

I got the inspiration for this watching Alister Christie video about it. You can watch the video by clicking on the image belowWatch the video here

The Code

While Alister Christie was hand parsing the JSON result I'm using my own tool Delphi-JsonToDelphiClass for autogenerating the code So instead of witeteing code like this:

pascal
var j := TJsonObject.ParseJsonValue(Response.ContentAsString);
var s := j.FindValue('Success');

if s.AsType<string> = 'false' then
begin
  ---
end;

My tool generates a simple class taking care of all the JSON stuff

pascal
 TObjectDetectionResult = class(TJsonDTO)
---
 published
   property Duration: Integer read FDuration write FDuration;
   property Predictions: TObjectList<TPredictions> read GetPredictions;
   property Success: Boolean read FSuccess write FSuccess;
 public
---   
 end;

And the use of it is even more simple:

pascal
var detectionResult := TObjectDetectionResult.Create;
detectionResult.AsJSON :=  Response.ContentAsString;

if detectionResult.Success then
begin
  ---
end;

Besides from this I've done some cleanup of the code.

It's all incluuded in this repo.

Json To Delphi

The tool Delphi-JsonToDelphiClass is of cause also to be found here on Github. An of cause it's free and open source.