GithubHelp home page GithubHelp logo

dhunteroy / deep-stack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jensborrisholt/deep-stack

0.0 0.0 0.0 864 KB

How to use the Deep Stack server from Delphi

License: Apache License 2.0

Pascal 100.00%

deep-stack's Introduction

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:

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

 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:

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.

deep-stack's People

Contributors

jensborrisholt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.