{"id":15627676,"url":"https://github.com/capjamesg/visionscript","last_synced_at":"2025-07-30T04:32:57.289Z","repository":{"id":178626797,"uuid":"662148552","full_name":"capjamesg/visionscript","owner":"capjamesg","description":"A high-level programming language for using computer vision.","archived":false,"fork":false,"pushed_at":"2024-04-11T10:08:24.000Z","size":14522,"stargazers_count":342,"open_issues_count":6,"forks_count":20,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-11-22T11:07:13.472Z","etag":null,"topics":["computer-vision","programming-languages","visionscript"],"latest_commit_sha":null,"homepage":"https://visionscript.dev/","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/capjamesg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-07-04T13:08:35.000Z","updated_at":"2024-06-29T21:06:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"77205990-6e15-4ebf-9fe2-2f376b62fefe","html_url":"https://github.com/capjamesg/visionscript","commit_stats":null,"previous_names":["capjamesg/visualscript"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2Fvisionscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2Fvisionscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2Fvisionscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2Fvisionscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capjamesg","download_url":"https://codeload.github.com/capjamesg/visionscript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228088846,"owners_count":17867481,"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":["computer-vision","programming-languages","visionscript"],"created_at":"2024-10-03T10:18:37.953Z","updated_at":"2024-12-04T10:06:26.209Z","avatar_url":"https://github.com/capjamesg.png","language":"Python","readme":"![VisionScript logo](https://visionscript.dev/assets/full_logo.svg)\n\n# VisionScript\n\n[VisionScript](https://visionscript.dev) is an abstract programming language for doing common computer vision tasks, fast.\n\nVisionScript is built in Python, offering a simple syntax for running object detection, classification, and segmentation models. [Read the documentation](https://visionscript.dev/docs/).\n\n[View the demo](https://vimeo.com/856043804).\n\n## Get Started 🚀\n\nFirst, install VisionScript:\n\n```bash\npip install visionscript\n```\n\nYou can then run VisionScript using:\n\n```bash\nvisionscript\n```\n\nThis will open a VisionScript REPL in which you can type commands.\n\n### Run a File 📁\n\nTo run a VisionScript file, use:\n\n```bash\nvisionscript ./your_file.vic\n```\n\n### Use VisionScript in a Notebook 📓\n\nVisionScript offers an interactive web notebook through which you can run VisionScript code.\n\nTo use the notebook, run:\n\n```bash\nvisionscript --notebook\n```\n\nThis will open a notebook in your browser. Notebooks are ephermal. You will need to copy your code to a file to save it.\n\n## Quickstart 🚀\n\n### Find people in an image using object detection\n\n```\nLoad[\"./photo.jpg\"]\nDetect[\"person\"]\nSay[]\n```\n\n### Find people in all images in a folder using object detection\n\n```\nIn[\"./images\"]\n    Detect[\"person\"]\n    Say[]\n```\n\n### Replace people in a photo with an emoji\n\n```\nLoad[\"./abbey.jpg\"]\nSize[]\nSay[]\nDetect[\"person\"]\nReplace[\"emoji.png\"]\nSave[\"./abbey2.jpg\"]\n```\n\n### Classify an image\n\n```\nLoad[\"./photo.jpg\"]\nClassify[\"apple\", \"banana\"]\n```\n\n## Installation 👷\n\nTo install VisionScript, clone this repository and run `pip install -r requirements.txt`.\n\nThen, make a file ending in `.vic` in which to write your VisionScript code.\n\nWhen you have written your code, run:\n\n```bash\nvisionscript ./your_file.vic\n```\n\n### Run in debug mode\n\nRunning in debug mode shows the full Abstract Syntax Tree (AST) of your code.\n\n```bash\nvisionscript ./your_file.vic --showtree=True\n```\n\nDebug mode is useful for debugging code while adding new features to the VisionScript language.\n\n## Inspiration 🌟\n\nThe inspiration behind this project was to build a simple way of doing one-off tasks.\n\nConsider a scenario where you want to run zero-shot classification on a folder of images. With VisionScript, you can do this in three lines of code:\n\n```\nIn[\"./images\"]\n    Classify[\"cat\", \"dog\"]\n    Say[]\n```\n\nVisionScript is not meant to be a full programming language for all vision tasks, rather an abstract way of doing common tasks.\n\nVisionScript is ideal if you are new to concepts like \"classify\" and \"segment\" and want to explore what they do to an image.\n\n### Syntax\n\nThe syntax is inspired by both Python and the Wolfram Language. VisionScript is an interpreted language, run line-by-line like Python. Statements use the format:\n\n```\nStatement[argument1, argument2, ...]\n```\n\nThis is the same format as the Wolfram Language.\n\n### Lexical Inference and Memory\n\nAn (I think!) unique feature in VisionScript compared to other languages is lexical inference.\n\nYou don't need to declare variables to store images, etc. Rather, you can let VisionScript do the work. Consider this example:\n\n```\nLoad[\"./photo.jpg\"]\nSize[]\nSay[]\n```\n\nHere, `Size[]` and `Say[]` do not have any arguments. Rather, they use the last input. Wolfram Alpha has a feature to get the last input using `%`. VisionScript uses the same concept, but with a twist.\n\nIndeed, `Size[]` and `Say[]` don't accept any arguments.\n\n## Developer Setup 🛠\n\nIf you want to add new features or fix bugs in the VisionScript language, you will need to set up a developer environment.\n\nTo do so, clone the language repository:\n\n```bash\ngit clone https://github.com/capjamesg/VisionScript\n```\n\nThen, install the required dependencies and VisionScript:\n\n```bash\npip install -r requirements.txt\npip install -e .\n```\n\nNow, you can run VisionScript using:\n\n```bash\nvisionscript\n```\n\n## Supported Models 📚\n\nVisionScript provides abstract wrappers around:\n\n- [CLIP](https://github.com/openai/clip) by OpenAI (Classification)\n- [Ultralytics YOLOv8](https://github.com/ultralytics/ultralytics) (Object Detection Training, Segmentation Training)\n- [FastSAM](https://github.com/CASIA-IVA-Lab/FastSAM) by CASIA-IVA-Lab. (Segmentation)\n- [GroundedSAM](https://docs.autodistill.com/base_models/groundedsam/) (Object Detection, Segmentation)\n- [BLIP](https://github.com/salesforce/BLIP) (Caption Generation)\n- [ViT](https://github.com/autodistill/autodistill-vit) (Classification Training)\n\n## License 📝\n\nThis project is licensed under an [MIT license](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapjamesg%2Fvisionscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapjamesg%2Fvisionscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapjamesg%2Fvisionscript/lists"}