DEV Community

StagingBench Team
StagingBench Team

Posted on AI-assisted

How Many Line Pixels Support a Staged Room Score?

A drift score describes how much structure moved in a staged photo. The amount of line evidence behind it can vary from run to run. StagingBench, an independent benchmark of AI virtual staging tools, records the number of pixels found along structural lines in the original photo. Across 129 completed runs, 13 had zero such pixels. The median among runs with a positive count was 9,633 pixels.

Count the evidence before comparing scores

A line pixel is a pixel that belongs to a detected structural line. A visible doorframe can contribute many pixels along its outline, so the count measures the amount of detected line evidence in pixel units. It gives each run a quantity to read alongside drift. Two runs can report similar drift scores and have different amounts of line evidence available for that reading.

Each tuple below holds the tool ID, room ID, original structural line pixel count, and drift score. Room IDs stay as strings to preserve their leading zero. The literal keeps all 129 completed comparisons, including runs with zero line pixels. All 13 zero counts came from room 09. Keeping those runs visible makes it clear how often the line count was zero and where those cases occurred. The quartile calculation uses the 116 runs that have positive counts.

Group by line pixels

The script uses statistics.quantiles with n=4 and method="inclusive" to calculate the three boundaries. It uses line pixel counts to set the boundaries and then carries each run’s drift score into its assigned group. A run on a boundary stays in the lower of the two neighboring groups. That convention keeps equal counts together and explains why the groups can contain different numbers of runs.

The threshold at 20,160.25 pixels is fractional because the quantile calculation interpolates between observed counts. Every recorded line pixel count is a whole number. The boundary is a cut point used to assign runs to groups. The final two lines compare median drift for the groups at the low and high ends of the line pixel distribution. Lower drift means less measured movement.

from collections import Counter
from statistics import median, quantiles

rows = [
    ('T01', '01', 5837, 16.2), ('T01', '02', 5816, 32.9), ('T01', '03', 9146, 9.2),
    ('T01', '04', 9633, 40.1), ('T01', '05', 21434, 13.7), ('T01', '06', 14804, 43.4),
    ('T01', '07', 35016, 41.0), ('T01', '08', 20128, 11.6), ('T01', '09', 0, 13.1),
    ('T01', '10', 5943, 22.7), ('T02', '01', 6235, 11.0), ('T02', '02', 5816, 24.1),
    ('T02', '03', 9146, 21.7), ('T02', '04', 9633, 56.5), ('T02', '05', 21136, 21.4),
    ('T02', '06', 15472, 26.2), ('T02', '07', 35029, 35.1), ('T02', '08', 22032, 17.4),
    ('T02', '09', 0, 9.2), ('T02', '10', 6480, 28.0), ('T03', '01', 6235, 28.2),
    ('T03', '02', 5816, 30.6), ('T03', '03', 9146, 29.7), ('T03', '04', 9633, 29.0),
    ('T03', '05', 21434, 15.5), ('T03', '06', 14803, 21.1), ('T03', '07', 35016, 18.0),
    ('T03', '08', 15658, 12.6), ('T03', '09', 0, 14.9), ('T03', '10', 6108, 20.2),
    ('T04', '01', 6235, 27.1), ('T04', '02', 5816, 26.6), ('T04', '03', 9146, 33.5),
    ('T04', '04', 9633, 28.8), ('T04', '05', 21136, 22.5), ('T04', '06', 14731, 21.3),
    ('T04', '07', 35016, 24.4), ('T04', '08', 14950, 23.5), ('T04', '09', 0, 26.9),
    ('T04', '10', 6479, 26.6), ('T05', '01', 6235, 29.4), ('T05', '02', 5816, 6.1),
    ('T05', '03', 9146, 23.6), ('T05', '04', 9633, 61.5), ('T05', '05', 22003, 36.2),
    ('T05', '06', 14804, 57.3), ('T05', '07', 35016, 30.4), ('T05', '08', 10015, 22.0),
    ('T05', '09', 0, 11.4), ('T05', '10', 6479, 19.9), ('T06', '01', 6235, 18.1),
    ('T06', '02', 5816, 23.3), ('T06', '03', 9146, 21.0), ('T06', '04', 6109, 33.3),
    ('T06', '05', 19437, 14.8), ('T06', '06', 15316, 22.5), ('T06', '07', 34994, 35.2),
    ('T06', '08', 18155, 27.4), ('T06', '09', 0, 10.2), ('T06', '10', 5299, 21.2),
    ('T07', '01', 6280, 25.4), ('T07', '02', 5816, 33.6), ('T07', '03', 9146, 22.9),
    ('T07', '04', 9633, 50.4), ('T07', '05', 21434, 38.0), ('T07', '06', 15938, 34.9),
    ('T07', '07', 35699, 46.3), ('T07', '08', 17124, 38.7), ('T07', '09', 0, 20.4),
    ('T07', '10', 6479, 28.2), ('T08', '01', 6235, 11.4), ('T08', '02', 5816, 31.3),
    ('T08', '03', 9146, 26.3), ('T08', '04', 9267, 15.1), ('T08', '05', 21347, 34.9),
    ('T08', '06', 15472, 16.6), ('T08', '07', 35016, 23.5), ('T08', '08', 22032, 9.7),
    ('T08', '09', 0, 5.7), ('T08', '10', 6479, 24.5), ('T09', '01', 6076, 13.3),
    ('T09', '02', 5816, 11.6), ('T09', '03', 9146, 26.4), ('T09', '04', 9633, 10.4),
    ('T09', '05', 20294, 19.8), ('T09', '06', 14839, 26.0), ('T09', '07', 35016, 18.9),
    ('T09', '08', 21288, 7.8), ('T09', '09', 0, 23.3), ('T09', '10', 5777, 21.0),
    ('T10', '01', 6235, 10.6), ('T10', '02', 5816, 27.8), ('T10', '03', 9146, 7.5),
    ('T10', '04', 9629, 6.4), ('T10', '05', 21347, 7.8), ('T10', '06', 14803, 13.7),
    ('T10', '07', 35016, 9.7), ('T10', '08', 22032, 8.9), ('T10', '09', 0, 3.1),
    ('T10', '10', 6479, 17.0), ('T11', '01', 4917, 52.8), ('T11', '02', 5816, 27.1),
    ('T11', '03', 9146, 61.3), ('T11', '04', 9633, 54.5), ('T11', '05', 21347, 7.2),
    ('T11', '06', 16273, 9.7), ('T11', '07', 32036, 9.2), ('T11', '08', 16436, 35.5),
    ('T11', '09', 0, 7.7), ('T11', '10', 5583, 26.6), ('T12', '01', 5534, 18.9),
    ('T12', '02', 5816, 25.4), ('T12', '03', 9146, 19.1), ('T12', '04', 9629, 15.2),
    ('T12', '05', 21347, 8.0), ('T12', '06', 15345, 16.3), ('T12', '07', 35016, 42.1),
    ('T12', '09', 0, 11.8), ('T12', '10', 6005, 15.7), ('T13', '01', 6235, 12.7),
    ('T13', '02', 5816, 16.9), ('T13', '03', 9146, 4.0), ('T13', '04', 9633, 52.8),
    ('T13', '05', 20257, 18.8), ('T13', '06', 15472, 12.6), ('T13', '07', 35016, 7.3),
    ('T13', '08', 16262, 41.5), ('T13', '09', 0, 2.4), ('T13', '10', 6480, 57.4),
]

positive = [(pixels, drift) for _, _, pixels, drift in rows if pixels > 0]
pixel_counts = [pixels for pixels, _ in positive]
boundaries = quantiles(pixel_counts, n=4, method="inclusive")

quartiles = {number: [] for number in range(1, 5)}
for pixels, drift in positive:
    number = 1 + sum(pixels > boundary for boundary in boundaries)
    quartiles[number].append(drift)

counts = Counter({number: len(scores) for number, scores in quartiles.items()})
print(f"Runs with zero line pixels: {sum(pixels == 0 for _, _, pixels, _ in rows):.0f}")
print(f"Median positive line pixels: {median(pixel_counts):.2f}")
print("Line pixel quartile boundaries: " + ", ".join(f"{value:.2f}" for value in boundaries))
print("Runs per quartile: " + ", ".join(f"{counts[number]:.0f}" for number in quartiles))
print(f"Median drift in lowest quartile: {median(quartiles[1]):.2f}")
print(f"Median drift in highest quartile: {median(quartiles[4]):.2f}")
Enter fullscreen mode Exit fullscreen mode

Read the score with its evidence

This is the actual output from running the script.

Runs with zero line pixels: 13
Median positive line pixels: 9633.00
Line pixel quartile boundaries: 6235.00, 9633.00, 20160.25
Runs per quartile: 32, 33, 22, 29
Median drift in lowest quartile: 23.00
Median drift in highest quartile: 18.90
Enter fullscreen mode Exit fullscreen mode

The median drift was 4.10 points lower in the quartile with the most line pixels than in the quartile with the fewest. That is a comparison of groups in this benchmark. The runs reuse room photos, so room characteristics can influence which group a run falls into. Every completed run for room 02 recorded 5,816 line pixels and fell in the lowest quartile. Room 08 ranged from 10,015 to 22,032 line pixels, putting runs from the same room on both sides of the upper boundary. The quartile summaries reflect both the repeated rooms and the variation within rooms.

The count also has a practical limit. A long stretch of trim can contribute many pixels from a single feature. Another photo can supply a similar total across several window and door outlines. The two totals describe a similar amount of detected line evidence in pixels, while the architectural features represented can differ. The count alone gives no inventory of those features.

Few detected structural lines mean the score rests on little line evidence. A low drift reading in that situation describes the movement the benchmark measured, and the pixel count puts that reading in context. Keeping the room ID beside both values makes it possible to connect the summary back to the original comparison when a particular feature matters.

Top comments (0)