Web APIs

Reference

Technical

I have been working through Daniel Shiffman’s Data, Libraries and APIs tutorials. Everything made perfect sense up to the point of using the OpenWeather API. I have spent an hour trying different methods of loading the JSON but none have worked. I have a key and can see the JSON in my browser but I can’t access it through p5 for some reason.

I checked the OpenWeather documentation and found that it is JSONP, although I’m still not really sure what that means, when I load in the JSON as a “jsonp” it still fails to get the data.

Critical

Art & The API- Jer Thorpe

“The specific function of modern didactic art has been to show that art does not reside in material entities, but in relations between people and between people and the components of their environment.” -Jack Burnham

This can be expanded to include those between people and software., as well as those between people and networks. -art resides within these relations

API- Application Programming Interface. API is a bridge that allows for computer programs to communicate.

Connect programs on different devices on differences OSs.

For every public-facing API at large companies there are dozens used internally.

Like mail services- a large company has a mail room that sorts external mail, they also have machines within that delivers the mail internally.

Twitter API- Lets third party apps communicated with machinery at Twitter HQ. Twitter left API open- allows other businesses to build products around Twitter- model is successful other companies have copied.

API can be built easily. Bridges between unrelated bodies of content.

Josh Begley- API allows access to information on every US drone strike

DroneStream- both these sites are now down.

“Out of Sight, Out of Mind” visualises the API Data

Change as data is changed.

Drone Twitter

What’s Wrong with Big Data- James Bridle


Workshops

19.11.2018

LoadAPI

Code above shows how to read data from an API and display it in the console.

DisplayFirstNamefromAPI.PNG

This code will access the data then select and show the first name.

printArrayofNames.PNG

This will access the data for 10 generated users, then display them all on screen.

AllKindsofDat.PNG

Afterwards, I changed the code to include the users’ age and phone number. Beside it is the value the US Dollar and Euro. It is red when the value has dropped and green when it increases.

20.11.18

Creating an object variable.PNG

Javasript allows you to make an object variable.

CallinganArraWithinAnObject.PNG

You are also able to nest arrays within arrays. You use dot notation to access data within this array.

We then created a sketch that will plot a line depending on the USD value of bitcoin at that moment.

Initial Ideas

I plan to look for interesting JSON APIs. then from there, I will build my piece. It is far easier to limit myself with the possibllities of an API and find an idea from there, than it is to come up with a specific idea, then try to find an API that will match it.

This long list of JSON APIs on GitHub was my first place to look.

I found a couple of interesting APIs:

Space Tracking

Due to the fact that there is plenty of open data on the ISS and other satellites, I thought it could be interesting to visualise this data. Although at the moment, it doesn’t have much critical depth, but this would give me the chance to work on more of a visual level, as I tend to focus more on the concept of my work.

Censorship

The ‘Purgo Malum’ API takes text data in it’s URL as an input and will censor any ‘profane’ words.

I originally thought I could feed the Purgo Malum API song lyrics from Lyrics.ovh API. I would need to find a way to get the user input for artist and song, then put it into the PurgoMalum URL, then display the data in the P5 sketch. To prevent errors, I could limit the users’ inputs to specific songs.

Other APIs, such as the Rijkmuseum API, can return an image of an artwork. I could create a sketch that takes random artworks, and asks the user to censor them.

This idea needs more research into other artists’ work and art censorship in general. I will also need to experiment with the APIs to find their potential.

Research

The Huffington Post article “A Brief History of Art Censorship” contains examples of artworks that have been censored over the past 5 centuries. It is surprisingly still prevalent today, and mostly exists when people misunderstand the artwork.

“Exhibit B”- Brett Bailey

“This controversial performance replicated the “human zoos” that existed in the 19th and 20th centuries, forcing viewers to confront a heinously racist moment in history head on. However, many accused the exhibition, which featured black actors in cages and chains, of being racist itself.

The piece was slated to run at London’s Barbican Centre, but was cancelled due to the “extreme” nature of the protests and threats made against the performers and staff. “We find it profoundly troubling that such methods have been used to silence artists and performers and that audiences have been denied the opportunity to see this important work,” a statement from the Barbican read.

“It has not been my intention to alienate people with this work,” Bailey wrote for The Guardian soon after. “To challenge perceptions and histories, yes. Explicitly to offend, no.”

“Dread” Scott Tyler

“Scott, an art student at the Chicago Institute of Arts, organized an installation in which viewers could not reach the photography book at the center of the show without stepping on an American flag laid out on the ground. As a result, some viewers were arrested for stepping on the flag, after a veteran alerted authorities of the work. (Scott himself was arrested for burning a flag in defiance of the Flag Protection Act in 1989 as well.)

Visitors were also encouraged to record their thoughts on the show, which ranged from “I feel you did something wrong and I feel you should be put in jail or have something done to you for this. I love my country and it hurts me to know that don’t” to “This flag I’m standing on stands for everything oppressive in this system — the murder of the Indians and all the oppresses around the world, including my brother, who was shot by a pig who kicked over his body to ‘make sure the n***** was dead.’ The pig was wearing the flag.”

The installation had its critics. President Bush called the work “disgraceful” and Bob Dole expressed: ”Now, I don’t know much about art, but I know desecration when I see it.” Tyler, only 24 at the time, received numerous death threats resulting from the piece.”

Things To Look Into…

https://www.artsy.net/gene/censorship

https://www.artsy.net/article/artsy-editorial-shanghai-biennale-boldly-tackles-censorship-consumerism-progress

https://www.artsy.net/article/artsy-editorial-70s-thai-magazines-turned-censorship-art-form

https://www.artsy.net/article/artsy-editorial-rise-artistic-censorship-college-campuses-worry-american-public

https://www.artsy.net/article/artsy-editorial-censorship-sick-stuff-rudy-giuliani-fight-shut-down-brooklyn-museum

Ai Weiwei

Ai Weiwei is a Chinese contemporary artist. He is critical of the Chinese government and has constantly had his work censored in an attempt to silence him.

He is most famous for his work is ‘Sunflower Seeds’

In an earthquake in 2008, several state schools collapsed killing thousands of students inside because the schools were not built up to the required standards. The Chinese government tried to supress the release of any information to the public.

Ai Weiwei gathered a team to find information on the collapse of the schools, they eventually made a list of 5219 students that had died in the earthquake. The Chinese government shut down their blog in attempt to stop the information from getting out.

In response, Weiwei created “Remembering”. The piece was contructed from 9000 schoolbags (9000 lives lost), arranged to spell out “She lived happily for seven years in this world” on the facade of the Munich Haus der Kunst. Describing his work, Weiwei says “it was about how, in Chinese society, with censorship and control, individuals can still take action to defend their very, very fragile rights.”

Shortly after, Weiwei was arrested, and held for 81 days without being charged.

remembering-backpacks-haus-der-kunst-munich-2009

Seemingly, unphased, he went on to produce “Straight”- which is in an arrangement of thousands of steel reinforcements recovered from the collapsed schools

 

Tom White

Perception Engines

Gathers the visual data that invokes a strong classifier response from a neural network, then constructs ink sketches from this visual data.

The neural network would see this object as a fan, whereas we would see an abstract series of strokes and lines. However, once you are told this is a fan, you can begin to see an image of a fan. This is a really interesting aspect about both human and machine perception- although very different, we can often alter our own perception to begin to understand how a machine sees images.

As an aside…

He makes a quick note of the artists creative role in this project.

” Using perception engines inverts the stereotypical creative relationship employed in human computer interaction. Instead of using the computer as a tool, the Drawing System module can be thought of a special tool that the neural network itself drives to make its own creative outputs. As the human artist, my main creative contribution is the design of a programming design system that allows the neural network to express itself effectively and with a distinct style.”

Essentially, this program is a creative tool, in the same way, a paintbrush is.

I’ve been thinking about whether AI artworks like this are art. I think the factor that makes art Art is intent. A Jackson Pollock painting would not be art if the splashes of paint weren’t controlled, or the paint lacked any reason to be placed where he wanted it (at least vaguely.)

And just as a Jackson Pollock piece has an element of uncertainty, a degree of control left to external forces such as the weight and viscosity of the paint, an AI artist must leave a certain amount of control to the AI.

Experimentation

Andrew wrote me some code that will place a ‘song’ variable into the URL, then return the lyrics on screen.

AndrewHopkinsSongLyric.PNG

I would need to find a way to get the user to choose their own song and artist before it searches the API for the lyrics.

I then adapted the code to allow the user to select an artist and a song. The API is then activated and the lyrics are shown on screen.

p5lyric

The sketch is very basic, but it is just to test how the user might interact with the sketch, so that the sketch has the correct info to speak to the API.

I have discovered that the lyric API exports the lyrics with spaces and new line tags. I would need to find a way to export this data into the profanity censor API URL without these symbols.

Thoughts

I think censorship is an interesting theme, but I don’t really have a strong opinion of it as I don’t really feel it is an issue. Yes it still happens, but with the internet, when an item is supressed by some authority, it only works to make the piece more popular.

To name a recent example, I haven’t been able to avoid the banned ‘Iceland’ advert about palm oil because it has been shared on social media so often.

David Hammon’s 1988 work “How Ya Like Me Now?” portrays Jesse Jackson as a white man. The work was smashed with a sledgehammer by angry protesters- arguably, making the work of art even better as now it was a symbol for the real anger this piece captures. Afterwards, the piece featured eight sledgehammers around it. Thammons_how_ya_wpa

So censorship, can increase the ‘value’ of an artwork. Is there anything I can do with this?

AI censorship- social media platforms now use AI to filter explicit content on their platforms (YouTube demonitisation). In fact companies have developed AI that can scan an image for violence, nudity, location, facial expression etc.

Google Vision API

Google Vision Demo

When I input an image of “Birth of Venus”, the vision API, it returned some interesting results.

This slideshow requires JavaScript.

It easily detects that this is in fact, “Birth of Venus”. It also suggests that the image is possibly racey, and for some reason it detects the location of lollapalooza?

Here are some other interesting examples of the API:

This slideshow requires JavaScript.

This slideshow requires JavaScript.

This slideshow requires JavaScript.

I could create a P5 sketch that shows whether creative images are Safe Search friendly or not- showing the somewhat terrifying implications of AI censorship.

P5 Sketch

TitianP5Test.PNG

I wrote a sketch that will read the pre-made Google Vision JSON data for this Titian painting, then if any of the ‘Adult’, ‘Racy’ or ‘Violence’ data isn’t equal to ‘VERY_UNLIKELY” then the painting is rejected.

proto1.gif

This starting page would include many different artworks.

I worry that there isn’t enough substance to this idea either.

I began to sketch out possible layouts.

Sketchbook1.jpg

 

ApprovedGoogleStampNoBorderRejected

Proto2.PNG

I made up some stamps, then put them into the p5 sketch.

Sketchbook2.jpg

VisualExample

I began to think of visuals for this sketch. I thought that it might be interesting to show them as if they were documents that might exist in an office. I thought of the 1984 scene where civilians work censoring newspapers. The workers don’t really put much thought into it, they either shred or update the news.


Development

I have had the idea to use the Rijkmuseum API to input the images into the Google Vision API. This might be difficult in practice as I may need an actual local file to input into Google Vision. However, I believe the Rijkmuseum give a url for the image so this may a possible input into Google Vision?

After looking deeper into the Cloud Vision API, I found that making requests is much more complex than normal APIs. The nearest javascript framework I could find in the documentation was node.js, and that appears to be completely different. I am going to have to settle with downloading the JSON code from the API example page then accessing it locally on my P5 sketch.

I started testing the API with a larger range of artist’s images…

This slideshow requires JavaScript.

I tested many more but I found that abstract or surreal paintings tend to confuse the AI behind Vision. Sometimes it would just give a “very unlikely” for all safesearch settings, but other times it would get a high score on other safesearch settings like “spoof” or “violence”.

I then selected the artworks I would feature in the p5 sketch and made a selection page.VisualExampleHome

I set about recreating this design in P5. To begin with, I wrote repetitive code to display each image. I simplified the code by using an object array, and a for loop.

This slideshow requires JavaScript.

I then wrote code that highlights the image when the mouse hovers over it and detects when it has been clicked.

WorkingHome.gif


Final

https://editor.p5js.org/inneswhite/embed/ryolV0TRX

This slideshow requires JavaScript.

My piece displays several famous artworks within an official looking document. The user selects an artwork, then the code searches for the data within a local JSON file. This JSON file contains the Cloud Vision API analysis of the image.

I focused on the Safe Search section of the JSON file, as this is likely what Google uses to determine whether they can show the image on users image search with safe search enabled.

If any of the images contain a category that is possible or likely, it is rejected and censored.

 

The aim of this piece is to investigate a new age of censorship. Before the internet, governments had the power to filter the content that its people consumed. Now any attempt of censorship makes the art work more popular.

Due to the vast amount of data on the web, it is impossible for humans to filter the content. However, algorithms are being trained to do this job instead. As anyone who does Interaction Design will know, machine-learning based algorithms are far from perfect, often making strange mistakes or taking in human biases.

If we trust these algorithms to filter our content, we risk losing important human artifacts, and perhaps pass on our freedom of creative consumption to those who are in control of the internet.

 

I worry that my final project doesn’t have enough context for the user to decipher its meaning as it is only two pages, with only one containing the Cloud API data. Hopefully the piece will make much more sense after explaining my process.


 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s