https://github.com/capjamesg/visionscript

A high-level programming language for using computer vision.

https://github.com/capjamesg/visionscript

Science Score: 18.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.8%) to scientific vocabulary

Keywords

computer-vision programming-languages visionscript

Keywords from Contributors

projection interactive annotation generic yolov5 transformers sequences archival ecosystem-modeling observability
Last synced: 5 months ago · JSON representation ·

Repository

A high-level programming language for using computer vision.

Basic Info
Statistics
  • Stars: 344
  • Watchers: 7
  • Forks: 18
  • Open Issues: 6
  • Releases: 0
Archived
Topics
computer-vision programming-languages visionscript
Created over 2 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Contributing License Citation

README.md

VisionScript logo

VisionScript

VisionScript is an abstract programming language for doing common computer vision tasks, fast.

VisionScript is built in Python, offering a simple syntax for running object detection, classification, and segmentation models. Read the documentation.

View the demo.

Get Started 🚀

First, install VisionScript:

bash pip install visionscript

You can then run VisionScript using:

bash visionscript

This will open a VisionScript REPL in which you can type commands.

Run a File 📁

To run a VisionScript file, use:

bash visionscript ./your_file.vic

Use VisionScript in a Notebook 📓

VisionScript offers an interactive web notebook through which you can run VisionScript code.

To use the notebook, run:

bash visionscript --notebook

This will open a notebook in your browser. Notebooks are ephermal. You will need to copy your code to a file to save it.

Quickstart 🚀

Find people in an image using object detection

Load["./photo.jpg"] Detect["person"] Say[]

Find people in all images in a folder using object detection

In["./images"] Detect["person"] Say[]

Replace people in a photo with an emoji

Load["./abbey.jpg"] Size[] Say[] Detect["person"] Replace["emoji.png"] Save["./abbey2.jpg"]

Classify an image

Load["./photo.jpg"] Classify["apple", "banana"]

Installation 👷

To install VisionScript, clone this repository and run pip install -r requirements.txt.

Then, make a file ending in .vic in which to write your VisionScript code.

When you have written your code, run:

bash visionscript ./your_file.vic

Run in debug mode

Running in debug mode shows the full Abstract Syntax Tree (AST) of your code.

bash visionscript ./your_file.vic --showtree=True

Debug mode is useful for debugging code while adding new features to the VisionScript language.

Inspiration 🌟

The inspiration behind this project was to build a simple way of doing one-off tasks.

Consider 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:

In["./images"] Classify["cat", "dog"] Say[]

VisionScript is not meant to be a full programming language for all vision tasks, rather an abstract way of doing common tasks.

VisionScript is ideal if you are new to concepts like "classify" and "segment" and want to explore what they do to an image.

Syntax

The 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:

Statement[argument1, argument2, ...]

This is the same format as the Wolfram Language.

Lexical Inference and Memory

An (I think!) unique feature in VisionScript compared to other languages is lexical inference.

You don't need to declare variables to store images, etc. Rather, you can let VisionScript do the work. Consider this example:

Load["./photo.jpg"] Size[] Say[]

Here, 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.

Indeed, Size[] and Say[] don't accept any arguments.

Developer Setup 🛠

If you want to add new features or fix bugs in the VisionScript language, you will need to set up a developer environment.

To do so, clone the language repository:

bash git clone https://github.com/capjamesg/VisionScript

Then, install the required dependencies and VisionScript:

bash pip install -r requirements.txt pip install -e .

Now, you can run VisionScript using:

bash visionscript

Supported Models 📚

VisionScript provides abstract wrappers around:

  • CLIP by OpenAI (Classification)
  • Ultralytics YOLOv8 (Object Detection Training, Segmentation Training)
  • FastSAM by CASIA-IVA-Lab. (Segmentation)
  • GroundedSAM (Object Detection, Segmentation)
  • BLIP (Caption Generation)
  • ViT (Classification Training)

License 📝

This project is licensed under an MIT license.

Owner

  • Name: James
  • Login: capjamesg
  • Kind: user
  • Location: Scotland
  • Company: @Roboflow

from words, wonder.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - given-names: James (capjamesg)
title: "VisionScript"
version: 0.0.02
date-released: 2023-07-08

GitHub Events

Total
  • Watch event: 4
  • Fork event: 1
Last Year
  • Watch event: 4
  • Fork event: 1

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 123
  • Total Committers: 4
  • Avg Commits per committer: 30.75
  • Development Distribution Score (DDS): 0.057
Past Year
  • Commits: 2
  • Committers: 1
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
capjamesg j****g@j****g 116
James 3****g 4
dependabot[bot] 4****] 2
Mahimai Raja J m****3@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 6
  • Total pull requests: 6
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 10 days
  • Total issue authors: 4
  • Total pull request authors: 3
  • Average comments per issue: 4.17
  • Average comments per pull request: 0.17
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • mahimairaja (3)
  • VedantMadane (1)
  • atejada (1)
  • mostafaksh78 (1)
Pull Request Authors
  • mahimairaja (3)
  • dependabot[bot] (2)
Top Labels
Issue Labels
bug (3) enhancement (1)
Pull Request Labels
dependencies (2)