Click here to Skip to main content
15,391,068 members
Articles / Artificial Intelligence / Tensorflow
Article
Posted 16 Jan 2022

Stats

71.4K views
9.3K downloads
46 bookmarked

CodeProject.AI Server: AI the easy way.

Rate me:
Please Sign up or sign in to vote.
5.00/5 (22 votes)
21 Feb 20227 min read
Our fast, free, self-hosted Artificial Intelligence Server for any platform, any language
CodeProject.AI Server is a locally installed, self-hosted, fast, free and Open Source Artificial Intelligence server for any platform, any language. No off-device or out of network data transfer, no messing around with dependencies, and able to be used from any platform, any language. Runs as a Windows Service or a Docker container.

Image 1

What's New - 1.5.6

  1. nVidia GPU support! (For Windows only at this point). 
  2. Perf improvements to Python modules
  3. Work on the Python SDK to make creating modules easier
  4. Dev installers now drastically simplified for those creating new modules
  5. Added SuperResolution as a demo module

If you have a CUDA enabled nVidia card please ensure you have the CUDA drivers installed correctly. Mike Lud's image is worth a thousand word.

If you are upgrading then when the dashboard launches it might be necessary to force-reload (Ctrl+R on Windows) the dashboard to ensure you are viewing the latest version

Due to a bug in the previous Windows installers (v1.5.0 and below), those who have 1.5.0 or below currently installed will need to uninstall before upgrading to version 1.5.6. There are big scary notices and warnings in the new installer so you don't forget. We're so sorry.

The What and the Why

The 'What' is simple:

A locally installed, self-hosted, fast, free and Open Source Artificial Intelligence server that provides AI functionality for any app, any language. Install CodePrect.AI and you have an AI server. Done.

The 'Why'

  • AI programming is something every single developer should be aware of

    We wanted a fun project we could use to help teach developers and get them involved in AI. We'll be using CodeProject.AI Server as a focus for articles and exploration to make it fun and painless to learn AI programming

    We want your contributions!
  • AI coding examples have too many moving parts

    You need to install packages and languages and extensions to tools, and then updates and libraries (but version X, not version Y) and then you have to configure paths and...Oh, you want to run on Windows not Linux? In that case you need to... It's all too hard. There was much yelling at CodeProject.

    CodeProject.AI Server includes everything you need in a single installer. CodeProject.AI Server also provides an installation script that will setup your dev environment and get you debugging within a couple of clicks.
  • AI solutions often require the use of cloud services

    If you trust the cloud provider, or understand the billing structure, or can be assured you aren't sending sensitive data or won't go over the free tier this is fine. If you have a webcam inside your house, or can't work out how much AWS will charge, it's not so OK

    CodeProject.AI Server can be installed locally. Your machine, your network, no data needs to leave your device.

Supported Platforms

Image 2 Image 3 Image 4 Image 5 Image 6 Image 7 Image 8
Windows macOS macOS-arm64 Ubuntu Docker Visual Studio
2019+
Visual Studio
Code

Cut to the chase: how do I play with it?

1: Running and playing with the features

  1. Install and Run
    1. For a Windows Service, Download the latest version, install, and launch the shortcut to the server's dashboard on your desktop or open a browser to http://localhost:5000.

      If you wish to take advantage of a CUDA enabled nVidia GPU, please ensure you have the CUDA drivers installed before you install CodeProject.AI
       
    2. For a Docker Container for 64 Bit Linux run
      docker run -p 5000:5000 --name CodeProject.AI-Server -d -v <local directory>:/usr/share/CodeProject/AI codeproject/ai-server
      where <local directory> is some existing directory on the host machine such as
      1. C:\ProgramData\CodeProject/AI on Windows
      2. /usr/share/CodeProject/AI on Linux
  2. On the dashboard, at the bottom, is a link to the demo playground. Open that and play!

2: Running and debugging the code

  1. Clone the CodeProject CodeProject.AI Server repository.
  2. Make sure you have Visual Studio Code or Visual Studio 2019+ installed.
  3. Run the setup script in /Installers/Dev
  4. Debug the front-end server application (see notes below, but it's easy)

How do I use it in my application?

Here's an example of using the API for scene detection using a simple JavaScript call:

HTML
<html>
<body>
Detect the scene in this file: <input id="image" type="file" />
<input type="button" value="Detect Scene" onclick="detectScene(image)" />

<script>
function detectScene(fileChooser) {
    var formData = new FormData();
    formData.append('image', fileChooser.files[0]);

    fetch('http://localhost:5000/v1/vision/detect/scene', {
        method: "POST",
        body: formData
    })
    .then(response => {
        if (response.ok) response.json().then(data => {
            console.log(`Scene is ${data.label}, ${data.confidence} confidence`)
        });
    });
}
</script>
</body>
</html>

You can include the CodeProject.AI Server installer (or just a link to the latest version of the installer) in your own apps and installers and voila, you have an AI enabled app.

What does it include?

CodeProject.AI Server includes

  • A HTTP REST API Server. The server listens for requests from other apps, passes them to the backend analysis services for processing, and then passes the results back to the caller. It runs as a simple self contained web service on your device.
  • Backend Analysis services. The brains of the operation is in the analysis services sitting behind the front end API. All processing of data is done on the current machine. No calls to the cloud and no data leaving the device.
  • The Source Code, naturally.

What can it do?

CodeProject.AI Server can currently

  • Detect objects in images
  • Detect faces in images
  • Detect the type of scene represented in an image
  • Recognise faces that have been registered with the service
  • Perform detection on custom models

The development environment also provides modules that can 

  • Remove a background from an image
  • Blur a background from an image
  • Enhance the resolution of an image
  • Pull out the most important sentences in text to generate a text summary
  • Prove sentiment analysis on text

We will be constantly expanding the feature list.

Our Goals

  • To promote AI development and inspire the AI developer community to dive in and have a go. Artificial Intelligence is a huge paradigm change in the industry and all developers owe it to themselves to experiment in and familiarize themselves with the technology. CodeProject.AI Server was built as a learning tool, a demonstration, and a library and service that can be used out of the box.
  • To make AI development easy. It's not that AI development is that hard. It's that there are so, so many options. Our architecture is designed to allow any AI implementation to find a home in our system, and for our service to be callable from any language.
  • To focus on core use-cases. We're deliberately not a solution for everyone. Instead we're a solution for common day-to-day needs. We will be adding dozens of modules and scores of AI capabilities to our system, but our goal is always clarity and simplicity over a 100% solution.
  • To tap the expertise of the Developer Community. We're not experts but we know a developer or two out there who are. The true power of CodeProject.AI Server comes from the contributions and improvements from our AI community.

How to Guides

License

CodeProject.AI Server is licensed under the Server-Side Public License

Release Notes and Roadmap

Coming up

  • Further simplifications when adding modules
  • Massive simplification to the installers
  • Networking. 
  • More modules.
  • Chaining modules.

Previous versions

Release 1.6 Beta

  • nVidia GPU support for Windows
  • Perf improvements to Python modules
  • Work on the Python SDK to make creating modules easier
  • Dev installers now drastically simplified for those creating new modules
  • Added SuperResolution as a demo module

Release 1.5 Beta

  • Support for custom models

Release 1.3.x Beta

  • Refactored and improved setup and module addition system
  • Introduction of modulesettings.json files
  • New analysis modules

Release 1.2.x Beta

  • Support for Apple Silicon for development mode
  • Native Windows installer
  • Runs as Windows Service
  • Run in a Docker Container
  • Installs and Builds using VSCode in Linux (Ubuntu), macOS and Windows, as well as Visual Studio on Windows
  • General optimisation of the download payload sizes

Previous

  • We started with a proof of concept on Windows 10+ only. Installs we via a simple BAT script, and the code has is full of exciting sharp edges. A simple dashboard and playground are included. Analysis is currently Python code only
  • Version checks are enabled to alert users to new versions
  • A new .NET implementation scene detection using the YOLO model to ensure the codebase is platform and tech stack agnostic
  • Blue Iris integration completed

Share

About the Author

CodeProject
Software Developer CodeProject Solutions
Canada Canada
No Biography provided
Group type: Organisation

4 members


Comments and Discussions

 
QuestionHow do I get 1.5.6? Pin
Christopher Kron11hrs 43mins ago
MemberChristopher Kron11hrs 43mins ago 
AnswerRe: How do I get 1.5.6? Pin
Marc Paulin11hrs 38mins ago
MemberMarc Paulin11hrs 38mins ago 
GeneralRe: How do I get 1.5.6? Pin
Christopher Kron11hrs 34mins ago
MemberChristopher Kron11hrs 34mins ago 
AnswerIt's live! Pin
Chris Maunder10hrs 45mins ago
cofounderChris Maunder10hrs 45mins ago 
GeneralRe: It's live! Pin
Bob Kummer8hrs 45mins ago
MemberBob Kummer8hrs 45mins ago 
GeneralRe: It's live! Pin
Tinman Tinner5hrs 11mins ago
MemberTinman Tinner5hrs 11mins ago 
GeneralRe: It's live! Pin
Chris Maunder5hrs 11mins ago
cofounderChris Maunder5hrs 11mins ago 
GeneralRe: It's live! Pin
Tinman Tinner4hrs 34mins ago
MemberTinman Tinner4hrs 34mins ago 
GeneralRe: It's live! Pin
Chris Maunder4hrs 51mins ago
cofounderChris Maunder4hrs 51mins ago 
GeneralRe: It's live! Pin
Member 156838585hrs 11mins ago
MemberMember 156838585hrs 11mins ago 
GeneralRe: It's live! Pin
Chris Maunder5hrs 9mins ago
cofounderChris Maunder5hrs 9mins ago 
GeneralRe: It's live! Pin
Member 156838584hrs 43mins ago
MemberMember 156838584hrs 43mins ago 
GeneralRe: It's live! Pin
Chris Maunder4hrs 38mins ago
cofounderChris Maunder4hrs 38mins ago 
GeneralRe: It's live! Pin
Member 156838583hrs 3mins ago
MemberMember 156838583hrs 3mins ago 
GeneralRe: It's live! Pin
Marc Paulin6hrs 42mins ago
MemberMarc Paulin6hrs 42mins ago 
GeneralRe: It's live! Pin
Mike Lud6hrs 12mins ago
MemberMike Lud6hrs 12mins ago 
GeneralRe: It's live! Pin
Marc Paulin6hrs 2mins ago
MemberMarc Paulin6hrs 2mins ago 
GeneralRe: It's live! Pin
Chris Maunder5hrs 6mins ago
cofounderChris Maunder5hrs 6mins ago 
GeneralRe: It's live! Pin
Marc Paulin5hrs 3mins ago
MemberMarc Paulin5hrs 3mins ago 
GeneralRe: It's live! Pin
Chris Maunder5hrs ago
cofounderChris Maunder5hrs ago 
Bug(Fixed in 1.5.6) Face registration failing Pin
Member 157312008-Aug-22 5:12
MemberMember 157312008-Aug-22 5:12 
GeneralRe: Face registration failing Pin
Matthew Dennis18hrs 45mins ago
sysadminMatthew Dennis18hrs 45mins ago 
GeneralRe: Face registration failing Pin
Member 1573120017hrs 36mins ago
MemberMember 1573120017hrs 36mins ago 
GeneralRe: Face registration failing Pin
Matthew Dennis18hrs 41mins ago
sysadminMatthew Dennis18hrs 41mins ago 
GeneralRe: Face registration failing Pin
Member 1573120017hrs 23mins ago
MemberMember 1573120017hrs 23mins ago 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Flags: CompletedAdded to TODOFixed

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.