code from ICCV paper: Network Principles for SfM: Disambiguating Repeated Structures with Local Context