{"id":28509550,"url":"https://github.com/snap-stanford/virel","last_synced_at":"2025-08-12T17:42:11.328Z","repository":{"id":41256861,"uuid":"508887102","full_name":"snap-stanford/ViRel","owner":"snap-stanford","description":"ViRel: Unsupervised Visual Relations Discovery with Graph-level Analogy","archived":false,"fork":false,"pushed_at":"2024-08-10T04:22:11.000Z","size":747,"stargazers_count":10,"open_issues_count":3,"forks_count":5,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-07-03T01:34:51.969Z","etag":null,"topics":["graph","graph-neural-networks","machine-learning","reasoning","representation-learning","unsupervised-learning"],"latest_commit_sha":null,"homepage":"http://snap.stanford.edu/virel/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snap-stanford.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-06-30T00:46:56.000Z","updated_at":"2025-04-25T14:24:08.000Z","dependencies_parsed_at":"2025-07-03T01:42:18.795Z","dependency_job_id":null,"html_url":"https://github.com/snap-stanford/ViRel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/snap-stanford/ViRel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snap-stanford%2FViRel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snap-stanford%2FViRel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snap-stanford%2FViRel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snap-stanford%2FViRel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snap-stanford","download_url":"https://codeload.github.com/snap-stanford/ViRel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snap-stanford%2FViRel/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270108495,"owners_count":24528760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graph","graph-neural-networks","machine-learning","reasoning","representation-learning","unsupervised-learning"],"created_at":"2025-06-08T22:09:02.242Z","updated_at":"2025-08-12T17:42:11.284Z","avatar_url":"https://github.com/snap-stanford.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ViRel: Unsupervised Visual Relations Discovery with Graph-level Analogy\n\n[Paper](https://arxiv.org/abs/2207.00590) | [Poster](https://github.com/snap-stanford/virel/blob/master/poster.pdf) | [Project Page](http://snap.stanford.edu/virel/)\n\nThis is the official repo for [ViRel: Unsupervised Visual Relations Discovery with Graph-level Analogy](https://arxiv.org/abs/2207.00590) (Zeng et al. ICML 2022 Beyond Bayes Workshop). ViRel is a method for unsupervised discovery and learning of visual relations with graph-level analogy.\n\n\nAbstract:\n\nWe introduce Visual Relations with graph-level analogy (ViRel), a method for unsupervised discovery and learning of visual relations with graph-level analogy. In a grid-world based dataset that test visual relation reasoning, it achieves above 95% accuracy in unsupervised relation classification, discovers the relation graph structure for most tasks, and further generalizes to unseen tasks with more complicated relational structures.\n\n\nInstallation\n==========================================================================\nFirst clone the directory. Then run the following command to initialize the submodules:\n\n```bash\ngit submodule init; git submodule update\n```\n(If you encounter a \"no permission\" error, you may need to [add a new SSH key to your GitHub account](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account).)\n\nThis repository also has the following dependencies:\n\n- `PyTorch \u003chttps://pytorch.org/\u003e` \u003e= 1.9.1\n- `pytorch-geometric \u003chttps://github.com/rusty1s/pytorch_geometric\u003e` \u003e= 2.0.1\n- networkx \u003e= 2.6.3\n\nThe included `environment.yml` file can be used to create a conda environment with all dependencies installed:\n\n```bash\nconda env create -f environment.yml\nconda activate virel\n```\n\n# Dataset\nThe dataset files can be generated using the BabyARC engine in the `BabyARC` submodule.\nA example generated dataset can be downloaded from [here](https://drive.google.com/drive/folders/1i-PvyqCycKpPwrtGmQPFkXv9rFGrzOs9?usp=sharing) for the 3 object, 1 distractor object setting.\n\n# Running\nTo run the code, use the following command:\n\n```bash\npython relation_analogy.py\n```\n\nTo specify the hyperparameters, pass in the path to the .yaml file config, such as:\n\n```bash\npython relation_analogy.py --yaml config/main1.yaml\n```\nMore example yaml config files can be found in the `config` subdirectory.\n\nThe hyperparameters can also be passed in via command line, see `get_default_args` in `args.py` for all possible args to pass in. If an arg is not passed in, the default value will be used in `get_default_args`. Specifying an arg in the .yaml file will take precedence over passing in command line values.\n\n# Citation\nIf you find our work and/or our code useful, please cite us via:\n\n```bibtex\n@inproceedings{zeng2022virel,\n      title={ViRel: Unsupervised Visual Relations Discovery with Graph-level Analogy}, \n      author={Zeng, Daniel and Wu, Tailin and Leskovec, Jure},\n      year={2022},\n      eprint={2207.00590},\n      archivePrefix={arXiv},\n      primaryClass={cs.CV}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnap-stanford%2Fvirel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnap-stanford%2Fvirel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnap-stanford%2Fvirel/lists"}