|
Chris
On the main Code Project page.
In the Guides, Help, FAQ section.
"Installing on Linux" and
"Installing on Mac OS"
Those two links seem to be broken.
404
|
|
|
|
|
Fixed.
cheers
Chris Maunder
|
|
|
|
|
I just started to wonder if you guys were going to drop support for the Ubuntu app.
|
|
|
|
|
After all that pain in setting up my Debian box? No way!
Longer answer: Linux is where I see a lot of AI work being done. It's core to us.
cheers
Chris Maunder
|
|
|
|
|
Maybe I downloaded a corrupt installer zip file.
On my Ubuntu machine, if I right click on the unzipped deb file, Open with other application, Software Install, I get "Loading application details..." for about a half hour.
If I install it using dpkg -i <filename>, it seems to install, but at the end, the "pushd" and "popd" piece, I get "pushd" not found. Maybe have to run in a bash shell, I read that you can't run those from the Ubuntu command line, they are components of bash.
|
|
|
|
|
I finally got the entire install to work.
The key is to run the entire thing as root. I.e. do sudo -i to change to the root user. then do dpkg -i <filename>,
then run the pushd and popd piece as root.
Then you need to run as root systemctl enable codeproject.ai-server reboot the machine and the AI-Server will start and begin installing the modules.
Apparently just running as sudo will not find the bash shell, but it appears when you are running as root.
It says it is still installing YOLOv5.NET. I will see how this goes, and report back.
|
|
|
|
|
Yep, you need to sudo (for now).
YOLO .NET should be good now.
cheers
Chris Maunder
|
|
|
|
|
Wait. now the server shows "Offline"
Stuck while installing YOLOv5.NET.
|
|
|
|
|
Boy, this is fun!
1. Somehow, CPAI is using the old port 5000. Frigate will not start, since it also uses port 5000. So, go to serversettings .json and change the use port 5000 to false. (Sorry don't remember the name). But /etc/codeproject/serversettings.json is an empty file.
So check where is the actual serversettings.json file.
Server version: 2.6.2
System: Linux
Operating System: Linux (Ubuntu 22.04)
CPUs: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz (Intel)
1 CPU x 4 cores. 4 logical processors (x64)
GPU (Primary): HD Graphics 530 (rev 06) (Intel Corporation)
System RAM: 8 GiB
Platform: Linux
BuildConfig: Release
Execution Env: Native
Runtime Env: Production
Runtimes installed:
.NET runtime: 7.0.17
.NET SDK: Not found
Default Python: 3.10.12
Go: Not found
NodeJS: Not found
Rust: Not found
Video adapter info:
HD Graphics 530 (rev 06):
Driver Version
Video Processor
System GPU info:
GPU 3D Usage 0%
GPU RAM Usage 0
Global Environment variables:
CPAI_APPROOTPATH = <root>
CPAI_PORT = 32168
Module 'Object Detection (YOLOv5 6.2)' 1.9.1 (ID: ObjectDetectionYOLOv5-6.2)
Valid: True
Module Path: <root>/modules/ObjectDetectionYOLOv5-6.2
AutoStart: True
Queue: objectdetection_queue
Runtime: python3.8
Runtime Loc: Shared
FilePath: detect_adapter.py
Start pause: 1 sec
Parallelism: 0
LogVerbosity:
Platforms: all,!raspberrypi,!jetson
GPU Libraries: installed if available
GPU Enabled: enabled
Accelerator:
Half Precis.: enable
Environment Variables
APPDIR = <root>/modules/ObjectDetectionYOLOv5-6.2
CUSTOM_MODELS_DIR = <root>/modules/ObjectDetectionYOLOv5-6.2/custom-models
MODELS_DIR = <root>/modules/ObjectDetectionYOLOv5-6.2/assets
MODEL_SIZE = Medium
USE_CUDA = True
YOLOv5_AUTOINSTALL = false
YOLOv5_VERBOSE = false
Status Data:
Started: 16 Apr 2024 8:26:38 AM Central Standard Time
LastSeen: Not seen
Status: Started
Requests: 0 (includes status calls)
Installation Log
2024-04-16 07:51:04: Setting verbosity to quiet
2024-04-16 07:51:05: Installing CodeProject.AI Analysis Module
2024-04-16 07:51:05: ======================================================================
2024-04-16 07:51:05: CodeProject.AI Installer
2024-04-16 07:51:05: ======================================================================
2024-04-16 07:51:05: 514.00 GiB of 843.02 GiB available on linux
2024-04-16 07:51:05: Installing xz-utils...
2024-04-16 07:51:05: WARNING: WARNING: aptapt does not have a stable CLI interface. does not have a stable CLI interface. Use with caution in scripts.Use with caution in scripts.
2024-04-16 07:51:06: stty: 'standard input': Inappropriate ioctl for device
2024-04-16 07:51:06: General CodeProject.AI setup
2024-04-16 07:51:06: Setting permissions on downloads folder...done
2024-04-16 07:51:06: Setting permissions on modules download folder...done
2024-04-16 07:51:06: Setting permissions on models download folder...done
2024-04-16 07:51:06: Setting permissions on runtimes folder...done
2024-04-16 07:51:06: Setting permissions on persisted data folder...done
2024-04-16 07:51:06: GPU support
2024-04-16 07:51:06: CUDA (NVIDIA) Present: No
2024-04-16 07:51:06: ROCm (AMD) Present: No
2024-04-16 07:51:06: MPS (Apple) Present: No
2024-04-16 07:51:06: Reading module settings.......done
2024-04-16 07:51:06: Processing module ObjectDetectionYOLOv5-6.2 1.9.1
2024-04-16 07:51:06: Installing Python 3.8
2024-04-16 07:51:06: Python 3.8 is already installed
2024-04-16 07:51:10: W: https:
2024-04-16 07:51:15: Ensuring PIP in base python install... done
2024-04-16 07:51:16: Upgrading PIP in base python install... done
2024-04-16 07:51:16: Installing Virtual Environment tools for Linux...
2024-04-16 07:51:17: Searching for python3-pip python3-setuptools python3.8...All good.
2024-04-16 07:51:17: stty: 'standard input': Inappropriate ioctl for device
2024-04-16 07:51:21: Creating Virtual Environment (Shared)... done
2024-04-16 07:51:21: Checking for Python 3.8...(Found Python 3.8.19) All good
2024-04-16 07:51:24: Upgrading PIP in virtual environment... done
2024-04-16 07:51:26: Installing updated setuptools in venv... done
2024-04-16 07:51:51: Downloading Standard YOLO models...Expanding... done.
2024-04-16 07:51:51: Moving contents of models-yolo5-pt.zip to assets...done.
2. And like others are seeing, the server keeps going offline. I cannot even use the explorer to test with an image from the TestData.
I will run Find to see if I can find the actual <root> directory (CPAI_APPROOTPATH) on my machine. (Is that a variable in the machine path?)
I have checked to verify that this is not the Docker image that is running. It is not.
|
|
|
|
|
Port 5000: in /server/appsettings.json there's an entry "DisableLegacyPort". Set this to "true" to stop CodeProject.AI trying to use port 5000.
Stop/start. A suggested fix is:
Try editing /etc/systemd/system/codeproject.ai-server.service to replace "Type=notify" with "Type=simple", then run 'systemctl daemon-reload' followed by 'systemctl restart codeproject.ai-server'
cheers
Chris Maunder
|
|
|
|
|
Well; I must be getting confused in my old age.
I had appsettings.json open in VSC with the change, but I didn't save it??? Duh!
Also changing type to simple from notify seems to have corrected the restarting.
I did have to uninstall and reinstall the YOLOv5 6.2 module to get it to work, but both YOLOv5 6.2 and YOLOv5.NET seem to be working now. (at least with testing with the explorer).
I might take a chance and point Blue Iris to it and see what happens.
Thanks for the help with my confusion.
|
|
|
|
|
The latest 2.6.4 Ubuntu now includes that fix
cheers
Chris Maunder
|
|
|
|
|
Well the only serversettings.json file is the empty one that is in /etc/codeproject. Checking for an enviornment variable called CPAI_APPROOT yields nothing. Root directory has nothing of interest.
root@Ubuntu:/# find / -name serversettings.json
/etc/codeproject/ai/serversettings.json
find: ‘/proc/2879/task/2879/net’: Invalid argument
find: ‘/proc/2879/net’: Invalid argument
find: ‘/proc/20008’: No such file or directory
find: ‘/proc/20009’: No such file or directory
find: ‘/proc/20015’: No such file or directory
find: ‘/run/user/1000/gvfs’: Permission denied
find: ‘/run/user/1000/doc’: Permission denied
Taking a break. Done for now.
|
|
|
|
|
We don't display root dir in settings because we ask people to paste them here, which is a bit of a privacy issue if we're inadvertently publishing things others aren't meant to see.
root will be /usr/bin/codeproject.ai-server-x.y.z (version)
cheers
Chris Maunder
|
|
|
|
|
|
Hey,
Platform: Windows
Server Version: 2.6.2
When making a call to "/v1/vision/custom/list" I'm only getting back a 404 result. The reason why I've looked inti it is that AgentDVR uses this endpoint to list available models in it's "Object Detection" dialog.
Is it intentional that this endpoint does no longer exist?
Nils
modified 16-Apr-24 11:59am.
|
|
|
|
|
Which object detection module are you using?
|
|
|
|
|
I'm using "Object Detection (Coral)"
Nils
|
|
|
|
|
Thanks for letting us know. This will be corrected in the next release of this module (very soon)
cheers
Chris Maunder
|
|
|
|
|
it works again with the latest version (2.2.2) - thank you!
|
|
|
|
|
Hi, I recently started using the Face Processing function with AgentDVR and I'm curious if there's a way to train the face processing AI with many similar faces to increase accuracy. Could you also tell me where the data is saved after I register a face? I'm planning to build a database/face recognition system using CodeProject AI and Agent DVR, but I need a better understanding of how it works.
Previously, I built a database for License Plate Recognition (LPR) with AgentDVR. In this setup, ALPR identifies the plate and plate number, then sends the detected plate data back to AgentDVR. The process is straightforward: once AgentDVR receives the plate data from CPAI, it extracts the data along with additional information in a specific format and passes it to a Python script (via a .bat file). This script processes the data and inserts it into a database (.db file). In the database, entries like "my own car" or "my friend's car" are tagged, and it runs its own checks (by Flask and JavaScript) so that on the client side, users can access a Flask-based webpage that retrieves data from the database, allowing them to review the results. This setup forms the basic framework of how AgentDVR, CPAI, Python, the database, and Flask work together.
However, I'm trying to build something similar for Face Processing, but it seems to be embedded within CodeProject AI, so it's not the same as the ALPR concept I mentioned above, which presents a bit more of a challenge.
I can create a system for my own use, but if I want to share it with my friend, I need to make it more user-friendly. He might face some challenges as he would need to use CPAI's Explorer to delete faces one by one and then add them individually. Additionally, if he forgets which person's face was registered, he won't be able to see it in the explorer, which can be challenging at times.
I'm new to this area and still exploring possibilities and ways to do this, so some questions might not make sense to those more experienced.
With that said, any ideas or assistance would be appreciated. Thank you in advance. Note: I'm doing this for non-profit purposes.
|
|
|
|
|
From what I understand, face processing is not currently a core competency of CPAI, but I’d love for that to change. Look through the existing module and either improve it or greenfield something better.
|
|
|
|
|
Yea, I think some love needs to be given for Face Processing. My main goal with BI and CPAI was to have the alerts setup, have it capture the alert for person vehicle and send to our phones, but if it detects my roommate or me, it still alerts, just not send to phones. The work around I have currently is to use the geofence and have it not alert in certain areas based on if someone is home. That is not ideal, but it keeps alerts from gong to the phone in most cases when someone is at home. The downdrop is if there is someone else in those zones, say the back porch, it will not alert us by phone. I have tried everything configuration possible on the faces from 5 pictures of each to 100 pictures of each of us and CPAI is just very very spotty at best. There can be a different pic of each of us and 1 time cpai will detect the pic as me, but the next time it will detect it as my roommate. I really hope some love is giving to this module instead of adding all these other models that have nothing to do with detection.
|
|
|
|
|
The ALPR module uses plate detection to find a plate then OCR to extract the digits and text which it then sends back. The Face module uses a face detector (just a YOLOv5 model) and then extracts embeddings which it then stores in a database.
I think what you're after is for the module to return the embeddings, which you can then do with as you please (including building a database you can share).
That's an easy fix if that's what you're after.
cheers
Chris Maunder
|
|
|
|
|
Thank you, Chris. I did a bit of homework on this. That sounds good, to return the embeddings. I see a few possibilities here:
1. Make CPAI's Face Processing registered face database available so it can be managed by the user. I don't know if that is possible or not. But with that, I will be able to simply use the result of the Face Processing for my database.
Also, I have a question if I can train the face processing with multiple faces of the same person? My thought would be the same name but several different embeddings in the database.
Or,
2. The face processing returns the embeddings to the AgentDVR, and then AgentDVR sends it to a Python script so whatever the user wants can be done. However, I don't know if AgentDVR is able to accept the embedding or not. I know with ALPR, the plate number result falls under "{AI}". Here are the strings that AgentDVR supports on export: "{ID}, {OT}, {FILENAME}, {CURRENT_RECORDING}, {MSG}, {NAME}, {GROUPS}, {LOCATION}, {AI} (AI-detected objects), {AIJSON}, {BASE64IMAGE}, {ZONE}", and I don't know which one embedding will fall under.
Overall, I feel option 1 might be easier for me (because I will have less work). Option 2 seems to be more complicated.
Which one can you do or prefer?
|
|
|
|
|