Skip to main content

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:

  • EOIRegion
  • EOIVertex
  • EOIDetectionConfig
  • EOIObjectDescription
  • EOIDetectionCondition
  • EOIMotionDetection
  • EOILine
  • EOINotification
  • EOIRecording
  • EOIEffects

Useful notes:

  • EOIRegion.Enabled defaults to true
  • EOIDetectionConfig.DetectionConditions maps to the JSON field conditions
  • EOIObjectDescription.BackgroundPrompt marks text that describes the scene background
  • EOINotification.IncludeImage controls whether an image is included with alerts
  • EOIMotionDetection.NoMotionDetection() returns a disabled motion-detection configuration

Request Models

Image And Stream Requests

ClassPurposeImportant Fields
EOIProcessImageInputsProcess one base64 imageBase64Image, Regions, ReturnImage, Effects
EOIAddStreamInputsRegister a stream for monitoringStreamUrl, Name, FrameRate, Regions, Lines, Notification, Recording, Effects, IndexForSearch, SearchIndexTypes
EOIMonitorStreamInputsStart monitoring a streamStreamUrl, DurationSeconds
EOIRemoveStreamInputsRemove a registered streamStreamUrl
EOIGetStreamDetailsInputsRequest one stream recordStreamUrl
EOIGetLastDetectionInfoInputsRequest the last detection for a streamStreamUrl
EOIVideoFrameInputsRequest the latest frame for a streamStreamUrl
EOIProcessVideoInputsSubmit a video-processing jobName, InputVideoPath, RotateVideo, OutputVideoPath, FrameRate, Regions, Lines, RealTime, StartSeconds, EndSeconds, VideoStartLocalTime, Mode, BaseImagePath, Plugins, Validation, IndexForSearch, SearchIndexTypes, Recording, Effects
EOIUpdateConfigInputsWrap a configuration payload for /update_configBody

Search Requests

EOISearchInputs is the shared base class for archive and live search.

Common fields:

  • ClassName
  • SearchType
  • ObjectDescription
  • Similarity
  • FaceMatchType
  • FacePersonId
  • FaceGroupId
  • AlertThreshold
  • StreamList

Derived classes:

ClassAdds
EOIArchiveSearchInputsStartDateTime, EndDateTime
EOILiveSearchInputsDurationSeconds, Notification
EOIUpdateLiveSearchInputsSearchId

Supported search modes include:

  • natural_language
  • face_recognition
  • similarity
  • class_name

Face Recognition Requests

ClassPurposeImportant Fields
EOIAddFacerecGroupInputsCreate a face recognition groupGroupId, GroupName, GroupDescription
EOIAddFacerecPersonInputsCreate a person profilePersonId, PersonDisplayName, PersonGroups, PersonImages
EOIAddFacerecPeopleInputsImport people in bulk from a fileFilePath
EOIAddFacerecPersonImageOne image attached to a personImage, FilePath, CaptureTime

EOIAddFacerecPersonInputs.AddImageBase64(...) appends an image and stores the capture time in UTC.

Face Recognition And Similarity Models

ClassFields
EOIFaceRecognitionConfigMatchType, MatchThreshold, Person, Group
EOISimilarityConfigImages
EOISimilarityImageSeedId, Image, Alert, Threshold
EOIFaceDetectionObjectmatched person/group metadata and image data
EOISimilarityDetectionObjectsimilarity confidence

Supported face recognition match types are:

  • person
  • group
  • all_faces

Video Validation

Use EOIValidation and EOIValidationTrigger with EOIProcessVideoInputs.Validation.

Fields:

  • EOIValidation.Triggers
  • EOIValidationTrigger.ClassName
  • EOIValidationTrigger.StartSeconds
  • EOIValidationTrigger.EndSeconds

Response And Result Models

ClassWhat It Represents
EOIStreamInfostream details returned by stream endpoints
EOIImageDetectionone image-processing detection result
EOIVideoDetectionone video or monitored-stream detection result
EOIDetectionObjectone detected object with class, prompt, face, or similarity metadata
EOISearchResultone archive-search result
EOILastDetectionInfonotification-side last-detection metadata
EOIBoundingBoxobject bounds
EOIFacerecGroupface-recognition group summary
EOIFacerecImageone stored face-recognition image
EOISearchFacerecNamesResultone 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.IsMonitoring
  • EOIStreamInfo.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, and unknown
  • ObjectSize must be at least 100 when specified
  • stream and video FrameRate must be at least 1
  • motion detection threshold must be at least 10
  • live search AlertThreshold must be greater than 0 and less than 100
  • SearchId for live-search updates must be -1 or greater than 0
  • 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 IndexForSearch is true, SearchIndexTypes must be provided