Composite metrics
Overview
Section titled “Overview”composites combines several CV findings into partner-defined scores, such as an overall skin score with sub-scores like “hydration” or “clarity”. The scores form a tree: each leaf reads one CV finding, and each composite node is the weighted mean of its children.
The Revieve API builds the composites from the CV results after the analysis. The CV does not compute them, so they don’t depend on the CV version, but their values move whenever the underlying CV findings change.
component: compositesrequest: query: "components=composites,<the components your tree's leaves need>"response_path: "composites" # top-level key, next to results[]value_range: [0, 100] # integer, 100 = best; null when nothing under a node could be scoredrequires: a composite tree configured by Revieve for your partner IDRequesting composites
Section titled “Requesting composites”Add composites to components, together with the CV components your tree’s leaves read:
?components=composites,acne,redness,texture,wrinkles,pore_dilationcomposites itself is not a CV component, and the API doesn’t add CV components on the tree’s behalf:
- If
compositesis the only token, the CV runs its default set.hairand theredness_absolute/*_adjustedvariants are not in the default set. - Otherwise the CV computes only the components you list, so list every component a leaf needs. A leaf whose finding is not in the response counts as missing.
Response shape
Section titled “Response shape”{ "message": "OK", "results": [ /* unchanged CV findings */ ], "composites": { "root": { "id": "skin_score", "value": 72, "children": [ { "id": "clarity", "value": 75, "children": [ { "metric": "acne", "value": 80 }, { "metric": "redness", "value": 70 } ] }, { "metric": "wrinkles", "value": 69 } ] }, "missing": [] }}- Composite node — has
id(snake_case, defined in your tree),valueandchildren. - Leaf — has
metric(a name from the table below) andvalue. - Depth — at most three levels: the root, composites directly under it, and leaves. A leaf can also sit directly under the root. A composite never contains another composite.
missing— the leaf metrics that could not be scored for this image. Composites that contain them are averaged over their remaining children; a composite whose children are all missing hasvalue: null.
Weights are partner configuration and are not in the response.
Scores differ from results
Section titled “Scores differ from results”The two scales are different on purpose:
results[] | composites | |
|---|---|---|
| Range | 0..1 (float) | 0..100 (integer) |
| Direction | Higher = more of the measured thing (e.g. more acne) | Higher = better, always |
| Example | acne value: 0.2 | acne leaf value: 80 |
A leaf is its CV finding’s value × 100, rounded, and oriented so that 100 is best: Revieve has decided for each metric whether the CV value needs flipping to 100 − x, so you can read every leaf the same way. darkSpots read from raw dark_spots is additionally rescaled to match how Revieve’s apps display dark spots. A composite’s value is the weighted mean of its children, rounded.
results[] itself is unchanged when you request composites.
Leaf metrics
Section titled “Leaf metrics”Leaf names are camelCase names from a fixed list, not the CV description strings:
Leaf metric | Reads CV finding |
|---|---|
hyperpigmentation | hyperpigmentation |
melasma | melasma |
freckles | freckles |
darkSpots | dark_spots_adjusted, else dark_spots |
wrinkles | wrinkles |
redness | redness_absolute, else redness |
texture | texture |
acne | acne |
smoothness | smoothness |
skinShine | Skin shine (the shine component) |
radiance | radiance_adjusted, else radiance |
dullSkin | dull_skin |
unevenSkinTone | uneven_skin_tone |
eyebags | eyes — eyebags sum measure |
darkcircles | eyes — dark circles sum measure |
poreDilation | pore_dilation |
skinSagging | skin_sagging |
skinFirmness | skin_firmness |
hairVolume | hair — Hair volume sum measure |
Where a leaf lists two findings, it uses the first one present in the response. So darkSpots, redness and radiance use the alternative score only when you request it.
Edge cases
Section titled “Edge cases”- When a leaf counts as missing — its finding is not in the response, failed, or has no valid
0..1value (e.g.-1ornull). A finding with local image warnings still counts, except pore dilation, which counts as missing on a warning unless your tree is set up to keep it. - Global errors — when the whole analysis fails (
message: "Error"),resultsis null, every leaf is missing and the rootvalueisnull.
Related
Section titled “Related”- Choosing metrics — the CV findings the leaves read, and how they relate to each other.
- Interpreting results — the rest of the response.
- Status codes — the
local_warnings[]codes a finding can carry.