An alignment check needs recognizable details that it can find in both the original room photo and the staged version. In StagingBench, an independent benchmark of AI virtual staging tools, the two originals with the fewest detected keypoints accounted for 22 of the 29 alignment failures. Across the 10 rooms, the Spearman correlation between original keypoint count and alignment success rate was 0.4488.
What a keypoint gives you
A keypoint marks a location with a local pattern that an image comparison can try to recognize again. A corner where a window frame meets a sill can supply such a pattern. So can a junction in a tiled floor or a distinctive mark in wood grain. A broad wall with even paint and soft light offers fewer changes in intensity for the detector to pick up.
The benchmark uses SIFT keypoints. The count here comes from the original photo, so it stays the same across all runs for that room. It describes the pool of candidate locations available on the original side of the comparison. A detail also needs to be recognizable in the staged version to help align the pair. A chair placed in front of a corner, for instance, can hide a feature that was easy to detect in the empty room.
Compare rooms by their success rates
Each tuple gives the room ID, original keypoint count, number of successful alignments, and number of completed runs. The script divides successes by completed runs. That gives room 08 credit for all 12 of its completed runs aligning and gives rooms with 13 completed runs their own denominator. The calculation uses the full rates before formatting the percentages for display.
Spearman correlation compares the order of the keypoint counts with the order of the success rates. Equal values share the average of the ranks they would occupy. The helper sorts distinct values, counts how many positions each value occupies, and assigns their midpoint. It returns the ranks in the original order so each room still has its own keypoint rank paired with its own success rank.
from collections import Counter
from statistics import correlation
rooms = [
("01", 276, 13, 13), ("02", 577, 12, 13),
("03", 366, 12, 13), ("04", 164, 4, 13),
("05", 550, 13, 13), ("06", 659, 11, 13),
("07", 1016, 12, 13), ("08", 736, 12, 12),
("09", 5, 0, 13), ("10", 508, 11, 13),
]
def average_ranks(values):
counts = Counter(values)
rank_by_value = {}
first_rank = 1
for value, count in sorted(counts.items()):
rank_by_value[value] = first_rank + (count - 1) / 2
first_rank += count
return [rank_by_value[value] for value in values]
keypoints = [count for _, count, _, _ in rooms]
rates = [aligned / runs for _, _, aligned, runs in rooms]
spearman = correlation(average_ranks(keypoints), average_ranks(rates))
for room, count, aligned, runs in rooms:
print(f"Room {room}: {count} keypoints, {aligned}/{runs} aligned ({aligned / runs:.2%})")
print(f"Spearman correlation: {spearman:.4f}")
by_keypoints = sorted(rooms, key=lambda row: row[1])
print("Rooms by keypoints: " + ", ".join(room for room, _, _, _ in by_keypoints))
fewest = by_keypoints[:2]
failures = sum(runs - aligned for _, _, aligned, runs in fewest)
total_failures = sum(runs - aligned for _, _, aligned, runs in rooms)
print(f"Failures in the two rooms with the fewest keypoints: {failures}/{total_failures}")
Here is the actual output from running the script.
Room 01: 276 keypoints, 13/13 aligned (100.00%)
Room 02: 577 keypoints, 12/13 aligned (92.31%)
Room 03: 366 keypoints, 12/13 aligned (92.31%)
Room 04: 164 keypoints, 4/13 aligned (30.77%)
Room 05: 550 keypoints, 13/13 aligned (100.00%)
Room 06: 659 keypoints, 11/13 aligned (84.62%)
Room 07: 1016 keypoints, 12/13 aligned (92.31%)
Room 08: 736 keypoints, 12/12 aligned (100.00%)
Room 09: 5 keypoints, 0/13 aligned (0.00%)
Room 10: 508 keypoints, 11/13 aligned (84.62%)
Spearman correlation: 0.4488
Rooms by keypoints: 09, 04, 01, 03, 10, 05, 02, 06, 08, 07
Failures in the two rooms with the fewest keypoints: 22/29
Where the count helps explain the result
Room 09 had five keypoints and no successful alignments. Room 04 had 164 keypoints and four successful alignments out of 13. Reading those rows together shows where the failures concentrated. Reading farther down the list shows where the pattern becomes less consistent. Room 01 aligned on all 13 runs with 276 keypoints. Room 07 had the most keypoints, at 1,016, and aligned on 12 of 13 runs.
A count also leaves out where the features are in the frame. A group of points around a single window and points spread across several parts of the room can contribute equally to the total. If the staged image obscures that window, a cluster there may offer less usable evidence than the same number of points spread across features that stay visible. The totals alone cannot show whether that happened in a particular room.
There are only 10 rooms behind the correlation, with one rate per room. The coefficient describes this set of photographs and runs. A new photo can have a similar count and put those features in different parts of the view. Estimating how often a given keypoint count leads to successful alignment would require more original photos across the range of counts.
Top comments (0)