C# Models And Configuration
This page covers the request, response, and configuration models that C# SDK users work with directly.
Construction Style
Build most request and configuration objects by creating the class first and then assigning properties.
var region = new EOIRegion
{
Name = "Front Gate",
Polygon = new[]
{
new EOIVertex(0, 0),
new EOIVertex(1920, 0),
new EOIVertex(1920, 1080),
new EOIVertex(0, 1080),
},
DetectionConfigs = new[]
{
new EOIDetectionConfig
{
ClassName = "vehicle",
ClassThreshold = 30,
ObjectDescriptions = new[]
{
new EOIObjectDescription
{
Text = "white delivery truck",
Threshold = 75,
Alert = true,
},
new EOIObjectDescription
{
Text = "road and buildings",
BackgroundPrompt = true,
},
},
DetectionConditions = new[]
{
new EOIDetectionCondition
{
Type = "count_greater_than",
Count = 0,
},
},
},
},
};
Detection And Stream Models
The main classes used to build image, video, and stream requests are:
EOIRegionEOIVertexEOIDetectionConfigEOIObjectDescriptionEOIDetectionConditionEOIMotionDetectionEOILineEOINotificationEOIRecordingEOIEffects
Useful notes:
EOIRegion.Enableddefaults totrueEOIDetectionConfig.DetectionConditionsmaps to the JSON fieldconditionsEOIObjectDescription.BackgroundPromptmarks text that describes the scene backgroundEOINotification.IncludeImagecontrols whether an image is included with alertsEOIMotionDetection.NoMotionDetection()returns a disabled motion-detection configuration
Request Models
Image And Stream Requests
| Class | Purpose | Important Fields |
|---|---|---|
EOIProcessImageInputs | Process one base64 image | Base64Image, Regions, ReturnImage, Effects |
EOIAddStreamInputs | Register a stream for monitoring | StreamUrl, Name, FrameRate, Regions, Lines, Notification, Recording, Effects, IndexForSearch, SearchIndexTypes |
EOIMonitorStreamInputs | Start monitoring a stream | StreamUrl, DurationSeconds |
EOIRemoveStreamInputs | Remove a registered stream | StreamUrl |
EOIGetStreamDetailsInputs | Request one stream record | StreamUrl |
EOIGetLastDetectionInfoInputs | Request the last detection for a stream | StreamUrl |
EOIVideoFrameInputs | Request the latest frame for a stream | StreamUrl |
EOIProcessVideoInputs | Submit a video-processing job | Name, InputVideoPath, RotateVideo, OutputVideoPath, FrameRate, Regions, Lines, RealTime, StartSeconds, EndSeconds, VideoStartLocalTime, Mode, BaseImagePath, Plugins, Validation, IndexForSearch, SearchIndexTypes, Recording, Effects |
EOIUpdateConfigInputs | Wrap a configuration payload for /update_config | Body |
Search Requests
EOISearchInputs is the shared base class for archive and live search.
Common fields:
ClassNameSearchTypeObjectDescriptionSimilarityFaceMatchTypeFacePersonIdFaceGroupIdAlertThresholdStreamList
Derived classes:
| Class | Adds |
|---|---|
EOIArchiveSearchInputs | StartDateTime, EndDateTime |
EOILiveSearchInputs | DurationSeconds, Notification |
EOIUpdateLiveSearchInputs | SearchId |
Supported search modes include:
natural_languageface_recognitionsimilarityclass_name
Face Recognition Requests
| Class | Purpose | Important Fields |
|---|---|---|
EOIAddFacerecGroupInputs | Create a face recognition group | GroupId, GroupName, GroupDescription |
EOIAddFacerecPersonInputs | Create a person profile | PersonId, PersonDisplayName, PersonGroups, PersonImages |
EOIAddFacerecPeopleInputs | Import people in bulk from a file | FilePath |
EOIAddFacerecPersonImage | One image attached to a person | Image, FilePath, CaptureTime |
EOIAddFacerecPersonInputs.AddImageBase64(...) appends an image and stores the capture time in UTC.
Face Recognition And Similarity Models
| Class | Fields |
|---|---|
EOIFaceRecognitionConfig | MatchType, MatchThreshold, Person, Group |
EOISimilarityConfig | Images |
EOISimilarityImage | SeedId, Image, Alert, Threshold |
EOIFaceDetectionObject | matched person/group metadata and image data |
EOISimilarityDetectionObject | similarity confidence |
Supported face recognition match types are:
persongroupall_faces
Video Validation
Use EOIValidation and EOIValidationTrigger with EOIProcessVideoInputs.Validation.
Fields:
EOIValidation.TriggersEOIValidationTrigger.ClassNameEOIValidationTrigger.StartSecondsEOIValidationTrigger.EndSeconds
Response And Result Models
| Class | What It Represents |
|---|---|
EOIStreamInfo | stream details returned by stream endpoints |
EOIImageDetection | one image-processing detection result |
EOIVideoDetection | one video or monitored-stream detection result |
EOIDetectionObject | one detected object with class, prompt, face, or similarity metadata |
EOISearchResult | one archive-search result |
EOILastDetectionInfo | notification-side last-detection metadata |
EOIBoundingBox | object bounds |
EOIFacerecGroup | face-recognition group summary |
EOIFacerecImage | one stored face-recognition image |
EOISearchFacerecNamesResult | one face-recognition name match |
Useful helpers on detection and stream models include:
EOIDetectionCondition.GetMaxConfidenceObject()EOIImageDetection.GetDetectedObjects()EOIImageDetection.GetObjectByDescription(...)EOIVideoDetection.GetDetectedObjects()EOIVideoDetection.GetObjectByDescription(...)EOIDetectionObject.GetConfidenceForDescription(...)EOIDetectionObject.GetMaxConfidenceDescription()EOIStreamInfo.IsMonitoringEOIStreamInfo.IsAlerting
Utility Helpers
EOIAPIUtils.GetMinimumRegionSize() returns the minimum supported region size. The current helper returns 224 x 224.
Validation Rules
The SDK validates requests before they are sent.
Key rules enforced by EOIValidator include:
- stream URLs must be present
- stream names, region names, and line names must be at least 3 characters
- polygons must contain at least 3 vertices
- lines must contain at least 2 vertices
- vertex coordinates cannot be negative
- supported object classes are
person,vehicle,bag,animal, andunknown ObjectSizemust be at least100when specified- stream and video
FrameRatemust be at least1 - motion detection threshold must be at least
10 - live search
AlertThresholdmust be greater than0and less than100 SearchIdfor live-search updates must be-1or greater than0- archive search dates must be valid ISO date-times on or after
2020-01-01T00:00:00Z - face-recognition IDs and names must be present for the selected match mode
- group descriptions must be at least 10 characters
- similarity requests must include at least one valid seed image
- if
IndexForSearchistrue,SearchIndexTypesmust be provided