{"id":13737967,"url":"https://github.com/rowanz/merlot_reserve","last_synced_at":"2025-05-08T15:32:11.588Z","repository":{"id":41451200,"uuid":"442903710","full_name":"rowanz/merlot_reserve","owner":"rowanz","description":"Code release for \"MERLOT Reserve: Neural Script Knowledge through Vision and Language and Sound\"","archived":false,"fork":false,"pushed_at":"2022-06-01T18:21:15.000Z","size":4778,"stargazers_count":137,"open_issues_count":9,"forks_count":32,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-11-15T06:32:57.946Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rowanz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-29T22:19:21.000Z","updated_at":"2024-09-23T08:07:59.000Z","dependencies_parsed_at":"2022-08-31T18:31:11.910Z","dependency_job_id":null,"html_url":"https://github.com/rowanz/merlot_reserve","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rowanz%2Fmerlot_reserve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rowanz%2Fmerlot_reserve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rowanz%2Fmerlot_reserve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rowanz%2Fmerlot_reserve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rowanz","download_url":"https://codeload.github.com/rowanz/merlot_reserve/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253096293,"owners_count":21853571,"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","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":[],"created_at":"2024-08-03T03:02:07.409Z","updated_at":"2025-05-08T15:32:08.144Z","avatar_url":"https://github.com/rowanz.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# merlot_reserve\nCode release for \"MERLOT Reserve: Neural Script Knowledge through Vision and Language and Sound\"\n\nMERLOT Reserve (in submission) is a model for learning joint representations of vision, language, and sound from YouTube. The learned model can be used in a zero-shot or finetuned setting, where it does well on tasks like VCR and TVQA.\n\nVisit our project page at [rowanzellers.com/merlotreserve](https://rowanzellers.com/merlotreserve) or read the [full paper](#) to learn more.\n\n![](https://i.imgur.com/Z9iEsLZ.png \"MERLOT Reserve Teaser\")\n\n## What's here\n\nWe are releasing the following:\n* JAX code, and model checkpoints, for the MERLOT model\n* Code for pretraining the model\n* Code for finetuning the model on VCR and TVQA\n* Code for doing zero-shot inference with the model\n\n## Environment and setup\n\nThere are two different ways to run MERLOT Reserve:\n\n* *Pretraining on videos* You'll need a TPU Pod VM for this. This step shouldn't be necessary for most people, as we have released model checkpoints.\n* *Finetuning on VCR or TVQA* I've done this on a TPU v3-8 VM. This should be possible on GPU(s), but I haven't tested this on such hardware.\n* *Zero-shot inference* I've ran this on a GPU (even an older, Titan X from 2016 works.)\n\n### Installation on a GPU Machine\nInstall Cuda 11.4 (I used [this link](https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda-repo-ubuntu1804-11-4-local_11.4.2-470.57.02-1_amd64.deb)) and [CUDNN 8.2](https://developer.nvidia.com/rdp/cudnn-download). You might have to add something like this to your `PATH`:\n\n`export LD_LIBRARY_PATH=/usr/local/cuda/lib64`\n\nCreate the environment:\n```bash\nconda create --name mreserve python=3.8 \u0026\u0026 conda activate mreserve\nconda install -y python=3.8 tqdm numpy pyyaml scipy ipython cython typing h5py pandas matplotlib\n\n# Install jax\npip install jax[cuda11_cudnn82] -f https://storage.googleapis.com/jax-releases/jax_releases.html\n# If doing this on TPUs instead of locally...\n# pip install \"jax[tpu]\u003e=0.2.18\" -f https://storage.googleapis.com/jax-releases/libtpu_releases.html\n\n# This is needed sometimes https://stackoverflow.com/questions/66060487/valueerror-numpy-ndarray-size-changed-may-indicate-binary-incompatibility-exp\npip uninstall numpy\npip install numpy==1.19.5\n\npip install -r requirements.txt\n```\n\nYou can then try out the interactive script at [demo/demo_video.py](demo/demo_video.py). It will handle downloading the model checkpoint for you.\n\n### Installation on a Cloud TPU VM\n\nSee the instructions in [pretrain/](pretrain/) to set up your environment on a TPU v3-8 VM.\n\n## Checkpoints\n\nThese should get auto-downloaded if you use `PretrainedMerlotReserve` in [mreserve/modeling.py](mreserve/modeling.py). All are flax checkpoint files:\n\n```bash\n# pretrained checkpoints\ngs://merlotreserve/ckpts/base\ngs://merlotreserve/ckpts/base_resadapt\ngs://merlotreserve/ckpts/large\ngs://merlotreserve/ckpts/large_resadapt\n\n# finetuned checkpoints\ngs://merlotreserve/vcr_ckpts/vcr_finetune_base\ngs://merlotreserve/vcr_ckpts/vcr_finetune_large\n\ngs://merlotreserve/tvqa_ckpts/tvqa_finetune_base\ngs://merlotreserve/tvqa_ckpts/tvqa_finetune_large\n\n# TVQA Data\ngs://merlotreserve/finetune_data/tvqa/\n\n# VCR data\ngs://merlotreserve/finetune_data/vcr/\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frowanz%2Fmerlot_reserve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frowanz%2Fmerlot_reserve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frowanz%2Fmerlot_reserve/lists"}