[HN Gopher] Show HN: VisionScript, abstract programming language... ___________________________________________________________________ Show HN: VisionScript, abstract programming language for computer vision Hello! I'm James and I am working on VisionScript. With VisionScript, I want to empower people -- including everyone without any prior programming experience -- to build cool apps with vision. This weekend, I recorded a demo for VisionScript, in which I made apps that count how many cats are in an image and hides people in a video. Each app was < 10 lines of code. https://vimeo.com/856043804 VisionScript is built for the 10 year old inside of me who would have loved more visual programming languages with which to play. I want to show people the potential of programming and how you can make what you want with computers, whether it be a game that counts cats or an app that monitors how many birds flew past a tree. Those "wow" moments should come as soon as possible in one's learning experience. VisionScript is in active development. I started work on this project in July. There will likely be bugs; this is a passion project. Inspiration comes from Wolfram and Python. Behind the scenes, I am adopting what I am calling "lexical inference", which is to say there is a last state value on which functions infer; the language manages types and state. Author : zerojames Score : 59 points Date : 2023-08-21 18:48 UTC (4 hours ago) (HTM) web link (github.com) (TXT) w3m dump (github.com) | tgv wrote: | Looks cool. I'm not sure about the implicit state in the | language. It sort of worked for Hypercard, but not always. | | And can you iterate over multiple objects with the same label, | e.g. if you want to replace all faces by emoji? | zerojames wrote: | Thank you for your comment! Iteration is in the works right | now. | | I wrote this script at the weekend: | Load["./bus.jpg"] In[Detect["person"]] | Greyscale[] Endin Show[] | | In[] is our iterator (which came from "in a folder", which was | the original use). I'm adding data types. In the above program, | In[] is iterating over a Detection object. Behind the scenes, | each bounding box is selected, the nested statements (in this | case, Greyscale[] are evaluated), then any transformations are | applied to only the regions in the bounding box. | | Thus the impact is: 1. Load a file 2. | Find all the people 3. For each person, turn that | region greyscale 4. Show the resulting image | | My rationale for implicit state (I haven't heard that term | until now -- thank you!) is that it may be more intuitive for a | beginner. Maybe that will be wrong, but I'm eager to | experiment! | | (I am beyond elated to be on the front page of HN!) | | (edited to get the code snippet and list formatting right!) | rocauc wrote: | This is really powerful. Can't wait till there's the ability to | make custom detection blocks! | zerojames wrote: | I have been thinking about this! What would you like to be able | to do? | | On a separate note, one idea I had was to have rock paper | scissors as a quickstart. You could Use["rock paper scissors"] | to use that as a model; there could perhaps be a registry of | curated, fun models that people can play with out of the box | (aka ones good for classroom use). | bippihippi1 wrote: | huggingface integration? | janalsncm wrote: | This is really cool. I wonder if there's a way to extend Scratch | to include functionality like this. | zerojames wrote: | Thank you so much! Comments like this have really made my day. | | Scratch does have an "Extensions" feature, so perhaps it would | be possible (https://github.com/scratchfoundation/scratch- | vm/blob/develop...)! | ulrikhansen54 wrote: | How do you plan to expand the functionality? I've been looking | for a more modern alternative to OpenCV for a while - especially | replacements some of the aged object tracking functions, there's | been a wad of new stuff coming out that OpenCV has been slow to | implement. | zerojames wrote: | Great question! Development has been guided by my asking myself | -- and discussing with friends -- what problems I/we would like | to solve (or what would be fun!), then building for those use | cases. This is evident in the WIP DetectDistinctScenes[] | method. | | Example script: In["file.mov"] | Classify["building", "garden"] Endin | DetectDistinctFrames[] | | This method is more advanced than most. It uses CLIP behind the | scenes to detect when classifications change for more than N | frames in a video, and generates a list of timestamps you can | use to determine scene changes. | | I'm keen to build more specific functions for common CV tasks. | My code most certainly needs cleaned (the main lang.py is > 2k | LOCs right now) but I do have a contributing guide that you can | follow to add features should you be interested: | https://github.com/capjamesg/visionscript/blob/main/CONTRIBU... | symisc_devel wrote: | Shameless plug: take a look to our embedded computer vision | library SOD: https://sod.pixlab.io. It's a lightweight OpenCV | alternative targeting embedded devices with most of the modern | image processing algorithms already implemented including an | experimental Stable Diffusion implementation. ___________________________________________________________________ (page generated 2023-08-21 23:00 UTC)