{
  "schemaVersion": "1.0",
  "frozenAt": "2026-10-02T14:55:23.654251+00:00",
  "status": "frozen_before_product_inference_not_executed",
  "product": "Rembg",
  "productId": "product:rembg",
  "definitionBoundary": "Only the original two cases below are defined; source/runtime preparation and fixture rendering are not product execution. Synthetic geometric objects test this finite setup, not all natural product photos or commercial readiness.",
  "nativeConfiguration": {
    "edition": "rembg 2.0.85",
    "fixedCommit": "202e42649a8492a7c49f808de36608a7d1cbbfe3",
    "serverCommand": "rembg s --host 127.0.0.1 --port <task-owned-free-port> --log_level info --threads 1",
    "surface": "Official native HTTP server POST /api/remove; UI operation is not part of either case.",
    "query": {
      "extras": "{\"putalpha\":true}"
    },
    "form": {
      "model": "u2netp",
      "a": "false",
      "af": "240",
      "ab": "10",
      "ae": "10",
      "om": "false",
      "ppm": "false",
      "dc": "false",
      "vm": "false"
    },
    "fileField": "file",
    "inference_task": "image-segmentation",
    "usage": "Token usage is not applicable to image-segmentation inference; record wall time, model bytes/hash and observed process resources.",
    "state": {
      "REMBG_HOME": "<task-owned-model-root>",
      "U2NET_HOME": "<same-task-owned-model-root>",
      "precedence": "U2NET_HOME wins when set, and also closes legacy ~/.u2net fallback. Both variables are process-local; no global user configuration is changed."
    },
    "restrictions": [
      "Only the frozen local input PNG bytes are uploaded.",
      "No URL-fetch route, cloud backend, withoutbg, BRIA weights, custom model path or external image service.",
      "No model/source edits and no direct ONNX-only execution.",
      "Do not set MODEL_CHECKSUM_DISABLED. Retain native MD5 verification and compute downloaded model SHA256 independently.",
      "No replacing a model, input, surface, parameter or threshold after inference; a separately identified follow-up case is required."
    ]
  },
  "metricDefinitions": {
    "foregroundThreshold": 128,
    "iou": "sum(predicted foreground AND reference foreground) / sum(predicted foreground OR reference foreground); denominator must be nonzero.",
    "foregroundCoreThreshold": 245,
    "backgroundThreshold": 10,
    "coreErosion": "Exact integer disk dx^2+dy^2 <=16 (radius 4 pixels).",
    "backgroundRegion": "Complement of the reference foreground dilated by the same radius-4 disk.",
    "rgbComparison": "Exact equality of all 512x512x3 source and output RGB values, independent of output alpha."
  },
  "fixtureAuthor": "New uAgentKit task-owned synthetic raster drawings; no user image was edited and no generative model was used.",
  "assets": [
    {
      "path": "fixtures/bottle-input.png",
      "bytes": 2491,
      "sha256": "aa2a54b7a4398c6b4034d835288cbea9c5cba1e688391416c659923ae0f96a92",
      "width": 512,
      "height": 512,
      "channels": 3
    },
    {
      "path": "fixtures/bottle-reference-mask.png",
      "bytes": 956,
      "sha256": "eda3c5ed93ac4ad1713a2e8060ea3dcc638d4282bb8aa61bfe6e70c19bc50d06",
      "width": 512,
      "height": 512,
      "channels": 1
    },
    {
      "path": "fixtures/bottle-core-mask.png",
      "bytes": 936,
      "sha256": "23d633889cb0498c9f750a738e365b365028f2fba0e25821f6cedc8231e1c464",
      "width": 512,
      "height": 512,
      "channels": 1
    },
    {
      "path": "fixtures/bottle-background-mask.png",
      "bytes": 1293,
      "sha256": "2d0fbce5fd341a910c08ab16d7c1388e5f8a727797ec1e1b00a8dd82640b6a7f",
      "width": 512,
      "height": 512,
      "channels": 1
    },
    {
      "path": "fixtures/mug-input.png",
      "bytes": 2342,
      "sha256": "07f11db8c2f6205c7d0bd53e687f21cab2723c010eca00e25c02a69064782f96",
      "width": 512,
      "height": 512,
      "channels": 3
    },
    {
      "path": "fixtures/mug-reference-mask.png",
      "bytes": 977,
      "sha256": "2973236777c2d43322f4c5779084ef024137cfbd19db04cf2fd7d32378e7cd7e",
      "width": 512,
      "height": 512,
      "channels": 1
    },
    {
      "path": "fixtures/mug-body-core-mask.png",
      "bytes": 754,
      "sha256": "c32e1cd5c7cc33e46c7d197fc88a0318d44dda7936a358956a1457e55ef12a0b",
      "width": 512,
      "height": 512,
      "channels": 1
    },
    {
      "path": "fixtures/mug-handle-core-mask.png",
      "bytes": 657,
      "sha256": "38ff9d066b0d7512bd06d949db1eb6d8121a4f7b7a44b8546bde97fe8773f619",
      "width": 512,
      "height": 512,
      "channels": 1
    },
    {
      "path": "fixtures/mug-hole-mask.png",
      "bytes": 506,
      "sha256": "aa029eb256e5fa4d19abfafb75b28c84c9b8cd5e01e2b893aa5ad06758c85af0",
      "width": 512,
      "height": 512,
      "channels": 1
    },
    {
      "path": "fixtures/mug-background-mask.png",
      "bytes": 1372,
      "sha256": "0736286d100f1635505a35d411bbc7aaa2ba1a7e59417a5a70053e941c0a5651",
      "width": 512,
      "height": 512,
      "channels": 1
    }
  ],
  "cases": [
    {
      "id": "rembg-primary",
      "title": "Native product-image background removal with exact color and silhouette checks",
      "input": "The frozen synthetic 512x512 RGB bottle-input.png shows one teal bottle, one black cap and a cream label with three dark marks on a light gray background. Independently drawn bottle-reference-mask.png, eroded bottle-core-mask.png and dilated-complement bottle-background-mask.png are evaluator assets, not model inputs. No real merchant image, user data or third-party photo is present.",
      "instruction": "Through the complete official rembg 2.0.85 native HTTP server, upload only bottle-input.png to POST /api/remove with multipart model=u2netp, a=false, af=240, ab=10, ae=10, om=false, ppm=false, dc=false, vm=false, and query extras={\"putalpha\":true}. Produce a transparent PNG retaining the complete original bottle, cap, label colors and 512x512 dimensions. Do not send any image to a cloud service or fetch a URL.",
      "steps": [
        "Before product inference, freeze original fixture and reference-mask hashes, complete case definitions, numeric thresholds, official package/model edition, native server parameters and process-local state roots.",
        "Start the complete official rembg s runtime on one task-owned loopback port. Retain startup receipt and exact multipart POST request with frozen query/form settings; do not call ONNX Runtime or rembg.remove directly.",
        "Save the unedited native HTTP status, headers and response PNG bytes, model checksum/SHA256, wall time and any native error. A failed or non-image response remains the actual result.",
        "Compute image/alpha metrics against the pre-existing independent masks, compare RGB and input hashes, then record every condition as passed, failed or unverifiable without repairing the product output."
      ],
      "expected": "The unedited native response is a 512x512 RGBA PNG with nontrivial transparency and unchanged per-pixel source RGB. Alpha threshold 128 matches the independently drawn bottle mask with IoU at least 0.90; at least 95% of the frozen foreground core has alpha >=245 and at least 95% of the frozen background region has alpha <=10. The original input hash remains unchanged.",
      "passConditions": [
        "The native server returns HTTP 200 and a decodable 512x512 RGBA PNG with minimum alpha <=10 and maximum alpha >=245; bottle-input.png retains its frozen SHA256.",
        "The binary foreground formed by output alpha >=128 has intersection-over-union >=0.90 with the frozen bottle-reference-mask.png, using every image pixel and no excluded edge failures.",
        "At least 95% of bottle-core-mask.png pixels have output alpha >=245, and at least 95% of bottle-background-mask.png pixels have output alpha <=10; report both fractions separately.",
        "Every output RGB pixel exactly matches the corresponding original bottle-input.png RGB pixel under the frozen native putalpha=true configuration, including the original cap and label marks."
      ],
      "failureConditions": [
        "The actual response is missing, an error or invalid PNG, changes image dimensions or source bytes, has no useful transparency, or any frozen alpha/IoU/RGB condition fails.",
        "The operator repairs the output, changes input/model/thresholds, silently substitutes a direct ONNX/library path or UI result, disables model checksum checks, or uses BRIA/cloud inference."
      ]
    },
    {
      "id": "rembg-boundary",
      "title": "Low-contrast mug and handle-hole segmentation boundary",
      "input": "The distinct frozen synthetic 512x512 RGB mug-input.png contains a near-white mug on a light gray background, a narrow handle with a real background-colored hole and one dark body stripe. Independent full-reference, eroded-body-core, eroded-handle-core, inset-hole and dilated-complement-background masks were rendered before inference. Only mug-input.png is uploaded; the masks remain evaluation references.",
      "instruction": "Run the same complete official rembg 2.0.85 native HTTP multipart route and exact u2netp/query/form parameters as the primary case, now uploading only mug-input.png. Preserve the mug body, dark stripe and narrow handle rim, remove the background visible through the handle hole, retain original RGB and 512x512 dimensions, and save the unedited native PNG or error. Do not compensate for weak segmentation by changing the model, drawing a new mask or adding a background.",
      "steps": [
        "Before product inference, freeze original fixture and reference-mask hashes, complete case definitions, numeric thresholds, official package/model edition, native server parameters and process-local state roots.",
        "Start the complete official rembg s runtime on one task-owned loopback port. Retain startup receipt and exact multipart POST request with frozen query/form settings; do not call ONNX Runtime or rembg.remove directly.",
        "Save the unedited native HTTP status, headers and response PNG bytes, model checksum/SHA256, wall time and any native error. A failed or non-image response remains the actual result.",
        "Compute image/alpha metrics against the pre-existing independent masks, compare RGB and input hashes, then record every condition as passed, failed or unverifiable without repairing the product output."
      ],
      "expected": "The native response is an unedited 512x512 RGBA PNG with exact source RGB and an unchanged source file. Alpha >=128 has IoU >=0.90 against mug-reference-mask.png. At least 95% of mug-body-core-mask.png and at least 90% of mug-handle-core-mask.png retain alpha >=245. At least 95% of mug-hole-mask.png and at least 95% of mug-background-mask.png have alpha <=10. All four regional fractions and IoU are reported; partial subject loss or a filled hole remains an observed failure.",
      "passConditions": [
        "The native server returns HTTP 200 and a decodable 512x512 RGBA PNG; every output RGB pixel equals mug-input.png RGB, and the original mug-input.png SHA256 is unchanged.",
        "The output foreground defined by alpha >=128 has intersection-over-union >=0.90 with the complete frozen mug-reference-mask.png, including the real handle hole and thin rim.",
        "At least 95% of mug-body-core-mask.png pixels and at least 90% of mug-handle-core-mask.png pixels have alpha >=245; report body and handle preservation separately.",
        "At least 95% of mug-hole-mask.png pixels and at least 95% of mug-background-mask.png pixels have alpha <=10; report hole and exterior-background removal separately."
      ],
      "failureConditions": [
        "The native response fails any fixed dimension/RGB/input-integrity/IoU/regional-alpha condition, loses part of the handle, preserves the hole as foreground or invents a repaired cutout.",
        "The operator replaces u2netp, tunes thresholds after observing output, changes the original fixture or native HTTP surface, manually repairs the mask, or hides a failed region behind an overall score."
      ]
    }
  ],
  "productInferenceRequestsExecuted": 0
}
