{"id":51851012,"url":"https://github.com/gauenk/bist","last_synced_at":"2026-07-23T19:01:49.265Z","repository":{"id":285308487,"uuid":"957680223","full_name":"gauenk/bist","owner":"gauenk","description":"Bayesian-Inspired Space-Time Superpixels","archived":false,"fork":false,"pushed_at":"2026-02-20T18:48:21.000Z","size":52719,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-20T23:36:10.282Z","etag":null,"topics":["space-time","superpixel-segmentation","superpixels"],"latest_commit_sha":null,"homepage":"https://gauenk.github.io/bist_website/","language":"Cuda","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/gauenk.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-30T23:39:35.000Z","updated_at":"2026-02-20T18:48:26.000Z","dependencies_parsed_at":"2025-03-31T00:25:35.166Z","dependency_job_id":"677b299c-b006-40cf-bfe0-49fe9e01a4a6","html_url":"https://github.com/gauenk/bist","commit_stats":null,"previous_names":["gauenk/bist"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gauenk/bist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauenk%2Fbist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauenk%2Fbist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauenk%2Fbist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauenk%2Fbist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gauenk","download_url":"https://codeload.github.com/gauenk/bist/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauenk%2Fbist/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35813156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-23T02:00:06.683Z","response_time":57,"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":["space-time","superpixel-segmentation","superpixels"],"created_at":"2026-07-23T19:01:48.411Z","updated_at":"2026-07-23T19:01:49.246Z","avatar_url":"https://github.com/gauenk.png","language":"Cuda","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bayesian-Inspired Space-Time Superpixels (BIST)\n\nThis project presents Bayesian-inspired Space-Time Superpixels (BIST): a fast, state-of-the-art method to compute space-time superpixels. BIST is a novel extension of a single-image Bayesian method named BASS, and it is inspired by hill-climbing to a local mode of a Dirichlet-Process Gaussian Mixture Model (DP-GMM). The method is only Bayesian-inspired, rather than actually Bayesian, because it includes heuristic modifications to the theoretically correct sampler. Similar to existing methods, BIST can adapt the number of superpixels to an individual frame using split-merge steps. A key novelty is a new temporal coherence term in the split step, which reduces the chance of splitting propagated superpixels. This term enforces temporal coherence in propagated regions, and unconstrained adaptation in disoccluded regions. A hyperparameter determines the strength of this new term, which does not require special tuning to return consistent results across multiple videos. The wall-clock runtime of BIST is over twice as fast as BASS and over 30 times faster than the next fastest space-time superpixel method with open-source code.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"assets/kid-football.gif\" width=\"500\"\u003e\n\u003c/p\u003e\n\n## Installation\n\nBIST is written in C++/CUDA. The source code can be compiled into an executable binary file and/or a Python API.\n\n1. Clone the repository:\n    ```bash\n    git clone https://github.com/gauenk/bist.git\n    cd bist\n    ```\n\n2. Install the executable binary:\n    ```bash\n    mkdir build\n    cmake ..\n    make -j8\n    ```\n\n3. (and/or) Install the Python API:\n    ```bash\n    pip install -r requirements.txt\n    python -m pip install -e .\n    ```\n\n## Usage\n\n### Running the Compiled Binary\n\nTo run the compiled binary file, an example command is given below:\n\n```bash\n./bin/bist -d video_directory/ -f flow_directory/ -o output_directory/ -n 25 --iperc_coeff 4.0 --thresh_new 0.05 --read_video 1\n```\n\nThe example highlights important arguments such as io directories, initial superpixel size (n), the temporally coherent split step hyperparameter (iperc_coeff, or $\\gamma$), and the threshold to relabel a propogated superpixel as a new one (thresh_new, or $\\varepsilon_{\\text{new}}$). The last input (read_video) determines if the algorithm uses BIST (==1) or BASS (==0).\n\nWe've included two clips to validate the installation. One clip is from the [SegTrack v2 dataset](https://web.engr.oregonstate.edu/~lif/SegTrack2/dataset.html) and the other clip is from the [DAVIS](https://davischallenge.org/) dataset. Example commands to run BIST on these clips is given below:\n\n```bash\n./bin/bist -d data/examples/hummingbird/imgs/ -f data/examples/hummingbird/flows/ -o results/hummingbird/ -n 25 --iperc_coeff 4.0 --thresh_new 0.05 --read_video 1\n```\n\n```bash\n./bin/bist -d data/examples/kid-football/imgs/ -f data/examples/kid-football/flows/ -o results/kid-football/ -n 25 --iperc_coeff 4.0 --thresh_new 0.05 --read_video 1\n```\n\n### Using the Python API\n\nAn example script to use the BIST Python API is detailed below:\n\n```python\nimport bist\nimport torch as th\n\n# Read the video \u0026 optical flow\nvid = bist.utils.read_video(\"examples/kid-football/imgs\")\nflows = bist.utils.read_flows(\"examples/kid-football/flows\")\n# vid.shape = (T,H,W,C)\n# flows.shape = (T,H,W,2)\n\n# Run BIST\nkwargs = {\"n\":25,\"read_video\":True,\"iperc_coeff\":4.0,\"thresh_new\":thresh_new,'rgb2lab':True}\nspix = bist.run(vid,flows,**kwargs)\n\n# Mark the image with the superpixels\ncolor = th.tensor([0.0,0.0,1.0]) # color of border\nmarked = bist.get_marked_video(vid,spix,color)\n\n# Computer the superpixel-pooled video\npooled = bist.get_pooled_video(video,spix)\n\n# Save or display the denoised image\nbist.utils.save_spix(spix, 'results/kid-football',\"%05d.csv\")\nbist.utils.save_video(marked, 'results/kid-football',\"border_%05d.png\")\nbist.utils.save_video(pooled, 'results/kkid-football',\"pooled_%05d.png\")\n```\n\n_Note_: BIST uses *forward* optical flows. [The flow files for some sequences can be downloaded here](https://drive.google.com/drive/folders/1598mrD5gSSM-cYLeNOnLTeXDwE2zYCVU?usp=sharing), but they are too big to host them all.\n\n## Citation\n\nIf you find this work useful, please cite our paper:\n\n```bibtex\n@article{gauen2025bist,\n  title={Bayesian-Inspired Space-Time Superpixels},\n  author={Gauen, Kent W and Chan, Stanley H},\n  journal={prepint},\n  year={2025}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgauenk%2Fbist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgauenk%2Fbist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgauenk%2Fbist/lists"}