3 ms·
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"]] G
by zerojames 3y ago
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!)
- tgv 3y agoI don't know where I got the term "implicit state" from. It might have been an article or a discussion or even a spontaneous thought. > it may be more intuitive for a beginner It keeps things simple, true, but the conceptual leap is bigger when it no longer suffices. But that's a bit of a luxury problem. I'll be keeping an eye out on your repo.