CodeProject.AI Version 2.5

It is python ultralytics. I did bump the image size to 800 since my images are 1280x720 and most of my substreams are the same resolution as well. My batch size is 22 which uses around 22GB of RAM.

Ultralytics YOLOv8.2.40 Python-3.12.6 torch-2.4.1+cu121 CUDA:0 (NVIDIA GeForce RTX 3090, 24575MiB)
engine\trainer: task=detect, mode=train, model=models/ipcamv8.yaml, data=data.yaml, epochs=10, time=None, patience=100, batch=22, imgsz=800, save=True, save_period=-1, cache=False, device=0, workers=8, project=None, name=train2, exist_ok=False, pretrained=True, optimizer=auto, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=None, amp=True, fraction=1.0, profile=False, freeze=None, multi_scale=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, vid_stride=1, stream_buffer=False, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, embed=None, show=False, save_frames=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, show_boxes=True, line_width=None, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=False, opset=None, workspace=4, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, label_smoothing=0.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, bgr=0.0, mosaic=1.0, mixup=0.0, copy_paste=0.0, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=runs\detect\train2
....
Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size
1/10 21.5G 2.565 3.498 2.907 68 800: 100%|██████████| 1865/1865 [19:40<00:00, 1.58it/s]
Class Images Instances Box(P R mAP50 mAP50-95): 100%|██████████| 75/75 [01:26<00:00, 1.15s/it]
all 3288 15101 0.15 0.114 0.0875 0.0397
When training does your GPU Utilization % go up. Also what model size are you using? I normally use model=yolov8s.yaml. Below is what I use to start the training

yolo train data=plate.yaml model=yolov8s.yaml epochs=300 imgsz=640 cache=True batch=-1 patience=10 workers=8
 
Last edited:
When training does your GPU Utilization % go up. Also what model size are you using? I normally use model=yolov8s.yaml. Below is what I use to start the training

yolo train data=plate.yaml model=yolov8s.yaml epochs=300 imgsz=640 cache=True batch=-1 patience=10 workers=8

Yes GPU Utilization is 100%. I was using a custom yaml basically equivalent to large model with 800 image size because I had some larger pictures. Using the yolov8m.yaml and going back to 640 image size lets me set batch size to 50 and that appears to be using 20GB of 24 and brings the epoch time to around 6 minutes.
 
Yes GPU Utilization is 100%. I was using a custom yaml basically equivalent to large model with 800 image size because I had some larger pictures. Using the yolov8m.yaml and going back to 640 image size lets me set batch size to 50 and that appears to be using 20GB of 24 and brings the epoch time to around 6 minutes.
For the medium model 6 minutes looks normal. Try the below settings, cache=True will help with the speed, batch=-1 will automatically adjust the batch size to maximize your GPU memory, patience=10 will stop the training early if the model does not improve for 10 epochs

epochs=300 imgsz=640 cache=True batch=-1 patience=10 workers=8
 
  • Like
Reactions: actran
I look forward to some progress on this front, as we don't need the 80 labels in the CoCo dataset.
Good luck to all trying to trim this down.

Sent from my iPlay_50 using Tapatalk
 
FWIW, I’ve been working on a model larger than @MikeLud1 ‘s for a few months, with additional classes for things like packages, license plates, and fire. I’m currently on the fourth iteration. I’ve been using the package ‘fiftyone’ to curate the dataset sourced from a bunch of different sources. So far it’s not as accurate as I’d like, but I’m still working on it. 70 GB of training images on each iteration and working on getting a better label set.

There aren’t any training sets online with labeled IPCam images, so it would be great if anyone would send me theirs (or upload to Roboflow and send me a link). The closest I have are images from hunter’s trail cameras.
 
Last edited:
For the medium model 6 minutes looks normal. Try the below settings, cache=True will help with the speed, batch=-1 will automatically adjust the batch size to maximize your GPU memory, patience=10 will stop the training early if the model does not improve for 10 epochs

epochs=300 imgsz=640 cache=True batch=-1 patience=10 workers=8

I added the patience=10 previously. When I do batch=-1 it is only using around 60% of my GPU memory. I need 50GB of available RAM to turn on cache so I am going to fill the other 2 slots and that will hopefully be here Saturday. I donated 64GB of RAM from this computer to a proxmox host and never replaced it apparently.
 
I added the patience=10 previously. When I do batch=-1 it is only using around 60% of my GPU memory. I need 50GB of available RAM to turn on cache so I am going to fill the other 2 slots and that will hopefully be here Saturday. I donated 64GB of RAM from this computer to a proxmox host and never replaced it apparently.
You can specify the percentage to use for the batch, I would try 0.85 or 0.90. For cache you can use the disk. Below is a link to all the training argument

1726176451678.png
1726176503764.png

 
You can specify the percentage to use for the batch, I would try 0.85 or 0.90. For cache you can use the disk. Below is a link to all the training argument

View attachment 202991
View attachment 202992


Update = From what I can tell whatever setting you start the training with is used for any resumes.

yolo task=detect mode=train model=runs/detect/train3/weights/last.pt data=data.yaml epochs=200 imgsz=640 batch=50 patience=10 device=0 cache=disk resume=True
Ultralytics YOLOv8.2.92 Python-3.12.6 torch-2.4.1+cu121 CUDA:0 (NVIDIA GeForce RTX 3090, 24575MiB)
engine\trainer: task=detect, mode=train, model=runs\detect\train3\weights\last.pt, data=data.yaml, epochs=200, time=None, patience=10, batch=50, imgsz=640, save=True, save_period=-1, cache=False, device=0, workers=8, project=None, name=train3, exist_ok=False, pretrained=True, optimizer=auto, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=runs\detect\train3\weights\last.pt, amp=True, fraction=1.0, profile=False, freeze=None, multi_scale=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, vid_stride=1, stream_buffer=False, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, embed=None, show=False, save_frames=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, show_boxes=True, line_width=None, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=False, opset=None, workspace=4, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.0, box=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, label_smoothing=0.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, bgr=0.0, mosaic=1.0, mixup=0.0, copy_paste=0.0, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=runs\detect\train3

My current training run I tried disk in the command but it still resulted in False in the training.
 
Last edited:
OK I'm sure it's been posted but I can't seem to find it. I just installed for the first time. I see multiple posts to unchecking Auto start/stop with Blue Iris. OK great, do I need to do something else? Or is the service starting on windows boot?

I also had some issue where the Yolo model was not autostarting, I edited the modulesettings.json to set autostart to true. Is that it?

Is there some basic setup guide to follow? Just feel like this stuff is historical knowledge that I don't have and the early users just know about..
 
OK I'm sure it's been posted but I can't seem to find it. I just installed for the first time. I see multiple posts to unchecking Auto start/stop with Blue Iris. OK great, do I need to do something else? Or is the service starting on windows boot?

I also had some issue where the Yolo model was not autostarting, I edited the modulesettings.json to set autostart to true. Is that it?

Is there some basic setup guide to follow? Just feel like this stuff is historical knowledge that I don't have and the early users just know about..
CodeProject.AI will startup as a service so unchecking Auto start/stop with Blue Iris. The issue with modulesettings.json not being updated is fixed in version 2.8.0
 
If any of you could take a look at this short 2:00 video I created of the problem I am having with CPAI, I would appreciate it.

Upgrade CPAI to 2.8.0 or 2.6.5

The problem is the same with either version after I have been running 1.6.8 for a year or more. I decided to upgrade following @MikeLud1's upgrade guide.

I am wondering if I am going to have to reinstall Windows and cut my losses or if there is an easy fix.
 
If any of you could take a look at this short 2:00 video I created of the problem I am having with CPAI, I would appreciate it.

Upgrade CPAI to 2.8.0 or 2.6.5

The problem is the same with either version after I have been running 1.6.8 for a year or more. I decided to upgrade following @MikeLud1's upgrade guide.

I am wondering if I am going to have to reinstall Windows and cut my losses or if there is an easy fix.

Did you delete everything before reinstalling? Also I do notice in the logs it shows "no cuDNN found" at 0:25.
 
When I upgraded, I lost all my custom models. Ugh. How do I get the one listed in the screen shot back or some custom models that I can choose from?. It keeps asking me to restart AI to get custom models when I check the box but nothing happens
 

Attachments

  • Capture2.PNG
    Capture2.PNG
    51.2 KB · Views: 19
When I upgraded, I lost all my custom models. Ugh. How do I get the one listed in the screen shot back or some custom models that I can choose from?. It keeps asking me to restart AI to get custom models when I check the box but nothing happens
Restart Blue Iris service and the custom model list will update. Also uncheck Auto start/stop with Blue Iris:

1727563265609.png
 
When I upgraded, I lost all my custom models. Ugh. How do I get the one listed in the screen shot back or some custom models that I can choose from?. It keeps asking me to restart AI to get custom models when I check the box but nothing happens
MikeLud's ipcam models: CodeProject.AI-Custom-IPcam-Models/PT Models at main · MikeLud/CodeProject.AI-Custom-IPcam-Models
ActionNET: Release DeepStack Action Detection - Custom Model v2 · OlafenwaMoses/DeepStack_ActionNET

Place the .pt files in "C:\Program Files\CodeProject\AI\modules\ObjectDetectionYOLOv5-6.2\custom-models" (or whichever module you are using's sub directory). Then restart Code Project and then restart the Blue Iris service and they should show back up.
 
MikeLud's ipcam models: CodeProject.AI-Custom-IPcam-Models/PT Models at main · MikeLud/CodeProject.AI-Custom-IPcam-Models
ActionNET: Release DeepStack Action Detection - Custom Model v2 · OlafenwaMoses/DeepStack_ActionNET

Place the .pt files in "C:\Program Files\CodeProject\AI\modules\ObjectDetectionYOLOv5-6.2\custom-models" (or whichever module you are using's sub directory). Then restart Code Project and then restart the Blue Iris service and they should show back up.

There are built in models too, correct?
 
There are built in models too, correct?
The builtin models are the full pre-trained YOLO models with 80 classes and when you set nano, small, medium, etc that corresponds to the model size used. The links there are for v8, but its the same for v5 regarding model sizes and classes. The larger model sizes use more compute and more time to inference although they are usually much more accurate. I find the 'small' model sizes to be ideal for fast inference and accuracy. Nano sacrifices a good bit of accuracy but it is still pretty good.
 
Yolo5 .NET installed properly but I get this error when 6.2 tried to install.

11:56:27:Started Object Detection (YOLOv5 6.2) module
11:56:29:detect_adapter.py: Traceback (most recent call last):
11:56:29:detect_adapter.py: File "C:\Program Files\CodeProject\AI\modules\ObjectDetectionYOLOv5-6.2\detect_adapter.py", line 19, in
11:56:29:detect_adapter.py: from codeproject_ai_sdk import JSON, ModuleRunner, LogMethod, LogVerbosity, RequestData
11:56:29:detect_adapter.py: ModuleNotFoundError: No module named 'codeproject_ai_sdk'
11:56:29:Module ObjectDetectionYOLOv5-6.2 has shutdown

Do I need 6.2?