It is the last day of the Advent calendar. Hooray Yesterday, @starcoop shared the flow of investigating the cause of the error in The story of a 503 error on Heroku open!
Today is the story app times.
A story app for smart people, smart people, and people who are confused pic.twitter.com/DQmATnSIKy
& mdash; Nakamoto (@yashinawa_retai) December 25, 2020
"The more you look at things and the more you associate with them, the smarter you are", so I tried it because it seems like a mock. In addition, the right of the character? I was scared, so I replaced it with an emoji.
As an element
--Web application - FastAPI - Vue.js --Object detection - PyTorch - VGG16(ImageNet) --Knowledge graph - ConceptNet --Graph database - Neo4j
Will appear. As a flow
it's dark.
Make a note of what it was like.
FastAPI
A little stumbling block is how to receive and process the uploaded image file. I referred to here. How to convert the uploaded image to Numpy array? #2376
When making a mock with FastAPI (it will be my own quote), I think it is easy to have index.html read. You can easily use a built front or a light one using a CDN. Static file in Fast API, index.html setting (fix WebSocket Chat example)
Vue.js
The UI used Vuerify. Both Vue.js and Vuetify used CDNs in index.html Peraichi rather than in the front.
PyTorch
There is no big reason, but I like how to write when using GPU and I often use PyTorch.
VGG16(ImageNet)
This time I used the pretrained model. TORCHVISION.MODELS
As with Hugging Face, which processes natural language, it's very guilty to be able to move deep things. However, be aware that the conditions must be the same as when learning. This site is always very helpful. PyTorch (7) VGG16 --A Breakthrough on Artificial Intelligence
I used the knowledge graph to follow the association. The first proposal considered Microsoft's Concept-Graph, but only for academic use. So I decided to use ConceptNet.
ConceptNet
Many relationships such as Synonym as well as IsA are stored. I think it's fun just to play a little on the Official Page.
WebAPI is also open to the public, but I decided to download it and store it in the database. The GitHub Wiki is extensive. commonsense/conceptnet5
Also, although it is not an exact method, each Node also holds a Language, so you can follow the Synonym relationship and get a "banana" (ja) from "banana" (en). As we'll see later, sometimes things don't work.
I chose Neo4j because I wanted to touch it.
Neo4j
The documentation is easy to understand, and there are also Docker and Docker-Compose materials. How-To: Run Neo4j in Docker
The storage method of ConceptNet and Concept-Graph mentioned above is also shared. Non-Text Discovery with ConceptNet as a Neo4j Database [Community Post]
In addition, Neo4j's management screen WebUI has a tutorial on relationship graphs related to movies, such as "I co-starred with actor A's co-star" but "I'm not an actor A's co-star" We also handle. It's fun.
Instead of riding on the shoulders of giants, I felt like I was fighting on horseback by using datasets and pre-learned models. However, in fact, when I converted "banana" to Japanese, I chose "Amabu" and couldn't trace the relationship so much, or I'm making fine adjustments, so I'm planning to update it including the code.
It's an impression that I finished the race, but I'm glad that many juniors participated, so please do your best. Thank you to all the Advent Calendar participants! I'll eat cake ~~
Recommended Posts