I was addicted to Onuma when I was developing a product to participate in a hackathon, so I will write an article. I'm tracing the memory of about half a year ago, so it may be missing here and there. Also, please note that details such as creating an aws account and installing aws cli will not be described.
・ MacOS Catalina
$ sw_vers
ProductName: macOS
ProductVersion: 11.1
BuildVersion: 20C69
When the facial expression is recognized by the ios camera, take a picture and upload it to AWS S3. Triggered by the completion of uploading, the lmada function starts running and passes the uploaded image to the facial expression recognition API called AWS Recognition. Then, save the numerical value of the facial expression returned from the API in firebase. I was trying to make a product in which the browser acquires the saved information and displays it as a graph.
① AWS confing settings Since it was my first AWS, the setting of this part at the beginning was quite a demon. However, once you understand it, there is nothing here.
$ aws configure --profile user1
AWS Access Key ID [None]: {access key(Each one)}
AWS Secret Access Key [None]: {Secret access key(Each one)}
Default region name [None]: ap-northeast-1
Default output format [None]: json
(2) Description of lamda function * Source code will be omitted. There was a rainy day Onuma point here. I hit the API and got the data that quantified the facial expression, but the firebase admin SDK was not reflected well and I could not save the data.
A deadly battle that lasts for several hours. (Please stop fighting for death in a few hours. I wrote it after understanding this too.) At the end, it turned out that the cause was the lamda function, and the python runtime (the lamda function was written in python). (Because I was doing it) I only set it. However, the firebase admin SDK did not run well due to a runtime error due to some C code.
In the end, I was able to solve it by setting the lamda function to C language with a custom runtime.
At this point, all you have to do is get the data stored in the firestore from your browser, so it's easy.
I thought **, but ** I seemed to be addicted to the swamp related to API (the teammate who was in charge), and it was quite tough.
At first glance, APIs and external libraries are magical, but when you actually use them, they are unfamiliar, so I think you may get stuck in a swamp. (It may be common sense for active engineers, but it was magical for me who is inexperienced) The teacher is better, "I can not use it unless I can make an external library by myself. That's exactly what I remembered now, and I thought it was necessary to understand the specifications by looking at github and the source code, and to be able to think about the cause of the error.
Also, when I touched AWS for the first time this time, I felt like I was itching to "touch AWS", but my teacher said, "You probably don't understand 1% of AWS yet. Yo. " It feels scary.
In conclusion, it was fun so I would like to play with AWS more.
Thank you for visiting.
Recommended Posts