
This guide provides a quick onboarding walkthrough for integrating Feng-GUI’s predictive visual analytics into your platform. It outlines the standard processing lifecycle, clarifies key JSON-RPC protocol behaviors, and walks through a complete end-to-end implementation.
Typical Integration Lifecycle
Integrating visual intelligence into your application follows a straightforward four-step sequence:
- Supply Media: Provide the image or video to be analyzed. You can upload media directly into your Feng-GUI account storage using
ImageUpload/VideoUpload, or bypass storage entirely by passing a direct URL to an asset hosted on your own infrastructure. - Configure Areas of Interest (AOIs): Designate critical regions for granular measurement (such as logos, hero headlines, packaging elements, or CTAs). You can generate these automatically using machine-learning detection via
CreateAutoAOIs, or register exact pixel coordinates usingSetImageAOIs. - Execute Attention Analysis: Invoke
ImageAttention(orVideoAttention). During this call, configure the visual context usingViewTypeand assign an industry baseline usingViewDistance(which serves as the industry benchmark code). - Inspect Metrics & Retrieve Visual Reports: Call
GetImageInfoto query holistic cognitive metrics (Clarity, Focus, Balance, Memory, Emotion), examine per-AOI gaze statistics (Visibility, Time to First Fixation, Dwell Time), and retrieve rendered image reports (Heatmaps, Gaze plots, Focus/Opacity maps, and Aesthetics reports).
Implementation Notes
The Feng-GUI API is built on the JSON-RPC specification. Please keep the following architectural behaviors in mind:
The id Property
- Any Data Type & No Protocol Uniqueness Constraint: Under the JSON-RPC specification, the request
idcan be of any data type (integer, string, UUID, etc.). There is no server-side enforcement of uniqueness or maximum numeric value. - Echo Behavior: The server simply echoes back the exact
idvalue received in the request so that your client application can correlate requests with responses. - GET Shorthand Requests: When invoking methods via HTTP GET URL queries, the response will always return
"id": -1. This is expected standard behavior for the shorthand syntax.
Methods Returning result: null
- Configuration or management endpoints (such as
SetImageAOIs,CreateAutoAOIs,DeleteFile, andDeleteDirectory) perform actions without returning an explicit data object. - Upon success, these endpoints return
"result": nulland"error": null. Anullresult indicates that the operation succeeded without errors.
Universal ImageID (Images, Videos, Relative Paths, and URLs)
- Despite its name,
ImageIDserves as the primary asset identifier for both images and videos. ImageIDcan be provided either as:- A relative path inside your account storage (e.g.,
/hero_banner.pngor/subfolder/ad_test.mp4). - A full URL to the asset (e.g.,
https://service.feng-gui.com/users/USERNAME/files/images/hero_banner.pngor a publicly accessible URL on your own CDN/servers).
- A relative path inside your account storage (e.g.,
End-to-End Workflow Walkthrough
Step 1: Upload an Asset (or Pass a Direct URL)
Performance Tip: If your media is already hosted on your own CDN or publicly accessible web server, you can bypass the upload step completely and provide the direct URL directly in Step 3. This saves processing time and preserves account storage quota.
To upload base64-encoded media directly to your Feng-GUI account storage, invoke ImageUpload:
{
"id": 1,
"method": "ImageUpload",
"params": {
"FileName": "sample_banner.png",
"FileData": "BASE64_ENCODED_STRING"
}
}
Response: On success, result contains the filename stored in your account root (e.g., "sample_banner.png").
Step 2: Define Areas of Interest (AOIs)
AOIs allow you to compute dedicated gaze metrics (fixation count, time to first fixation, and visibility score) for specific elements within your design.
Option A: Auto-Detect AOIs (CreateAutoAOIs)
Automatically identifies key objects, faces, branding elements, and text blocks using machine learning:
{
"id": 2,
"method": "CreateAutoAOIs",
"params": {
"ImageID": "/sample_banner.png"
}
}
Response: Returns "result": null upon successful generation.
Option B: Set Custom AOIs (SetImageAOIs)
Register custom measurement coordinates by passing an escaped JSON array string:
{
"id": 3,
"method": "SetImageAOIs",
"params": {
"ImageID": "/sample_banner.png",
"AOIs": "[{\"id\":\"aoi_logo\",\"text\":\"Brand Logo\",\"shape\":\"rect\",\"left\":120,\"top\":50,\"width\":200,\"height\":90}]"
}
}
Response: Returns "result": null upon successful registration.
Step 3: Run Attention Analysis (ImageAttention)
Execute the predictive attention algorithm by submitting the image location alongside context and benchmark parameters:
{
"id": 4,
"method": "ImageAttention",
"params": {
"InputImage": "https://service.feng-gui.com/users/YOUR_USERNAME/files/images/sample_banner.png",
"ViewType": 1,
"ViewDistance": 31,
"AnalysisOptions": 0,
"OutputOptions": 0
}
}
Parameter Highlights:
InputImage: The full URL path of the image (either hosted on Feng-GUI or on your own server).ViewType: Defines the environmental viewing context (e.g., Desktop, Mobile, Packaging, Outdoor, Natural scene). Refer to the method reference for valid values.ViewDistance(Industry Benchmark Code): While historically designating physical viewing distance, this parameter specifies the Industry Benchmark ID (e.g., CPG sub-categories, Durables, Financial Services, Entertainment, Healthcare). Supplying an industry code benchmarks the design against domain-specific baselines. Consult the Industry Benchmark tables for category IDs.AnalysisOptions&OutputOptions: Set to0to execute all standard sub-algorithms (visual features, aesthetics, emotions, text, faces) and render all standard composite visual reports.
Step 4: Inspect Metrics & Retrieve Reports (GetImageInfo)
To retrieve complete design metrics, cognitive scores, and URLs for all generated visual reports at any time, query GetImageInfo:
{
"id": 5,
"method": "GetImageInfo",
"params": {
"ImageID": "/sample_banner.png"
}
}
Understanding the Output Payload:
- Visual Report URLs:
OutputImage: Merged primary attention heatmap overlay.OutputGazeplotReport: Scanpath tracking displaying visual fixation sequence and dwell order.OutputOpacityReport: Focus/clarity map revealing what viewers absorb in the first visual fixations.OutputAOIsReport: Visual bounding breakdown of all scored AOIs.OutputAestheticsReport: Memorability and aesthetic heat distribution report.
- Holistic Aesthetic & Cognitive Scores (0–100):
overall: Comprehensive visual performance score.clear: Visual clarity index (inversely correlated with visual clutter).focus: Direct visual fixation concentration versus scattered attention.balance: Compositional symmetry and weight distribution across canvas quadrants.exciting: Visual engagement and arousal potential.approach/withdraw: Predicted positive engagement vs. avoidance valence.memory: Visual memorability score predicting recall probability.
- Per-AOI Gaze Statistics (
result.AOIs):VisibilityScore: Percentage probability that the element will be noticed.TimeToFirstFixation: Latency (in milliseconds) before initial fixation lands on the area.FixationsBefore: Number of fixations landing elsewhere prior to noticing this region.FixationCount&FixationLength: Fixation volume and cumulative dwell time.- Low-level saliency breakdown:
intensity,orientation,colorRedGreen, andcolorBlueYellow.