When placing an item frame on a wall, a comparator can be placed on the backside of the block the item frame is on to read a signal based on the presence and rotation of the item in the item frame. However, this does not work for item frames placed on the floor or ceiling.
This feature only works horizontally since comparators can only be oriented that way.