Wednesday, April 08, 2020

Pipal

Objective: Pi bot that recognizes faces and audio commands.

Phase 1:
Phase 2:
  • Audio input.
  • speech to text and google api for NLP.
Phase 3:
  • Train different actions for each person.
Phase 4:
  • Use lidar for depth.
Phase 5:
  • recognize action and correct.
  • cooking, drawing, singing, kolam.


Pre-requisites:
+ Get a Pi-4 with 4 GB ram
+ Get a pi cam

+ Install noobs for Raspbian 10 (it installs python 3.7.3 automatically).
+ Install OpenCV https://qengineering.eu/install-opencv-4.2-on-raspberry-pi-4.html
+ Install docker using the following coomand
$ curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
+Install Tensorflow
https://www.tensorflow.org/install/source_rpi

while setting the CI_DOCKER_EXTRA_PARAMS, update with the correct python version

CI_DOCKER_EXTRA_PARAMS="-e CI_BUILD_PYTHON=python3 -e CROSSTOOL_PYTHON_INCLUDE_PATH=/usr/include/python3.7" \
    tensorflow/tools/ci_build/ci_build.sh PI-PYTHON3 \
    tensorflow/tools/ci_build/pi/build_raspberry_pi.sh

if you get the following error:
ERRO[0000] failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial unix /var/run/docker.sock: connect: permission denied

open ci_build.sh and add
sudo docker instead of docker

Anyway, I was not able to successfully build Tensorflow 2.0.
Endedup going back to pip install, unfortunately https://www.tensorflow.org/install/pip does not have the correct whl file for pi4.
I endedup getting the correct whl from https://maker.pro/raspberry-pi/projects/how-to-set-up-the-machine-learning-software-tensorflow-on-raspberry-pi

below command did the trick:

wget https://github.com/lhelontra/tensorflow-on-arm/releases/download/v2.0.0/tensorflow-2.0.0-cp37-none-linux_armv7l.whl python3 -m pip install tensorflow-2.0.0-cp37-none-linux_armv7l.whl



Note1: Donot buy standard power supply(Output:5V-3000mA) for Pi-4. It doesn't give enough power for accessories. I had problems connecting to keyboard that pulls power from Pi.
I use Samsung phone charger(Output: 9V-1.67A or 5V-2.0A) since Pi4 takes USB-C power input.
Note2: Get a case with heatsink with fan as Pi gets heated easily (https://flirc.tv/more/raspberry-pi-4-case).

Useful links:
https://www.pyimagesearch.com/static/cv_dl_resource_guide.pdf
https://www.pyimagesearch.com/2017/09/11/object-detection-with-deep-learning-and-opencv/


Sunday, March 13, 2011

Have a cause!

Associate yourself to a cause!
It can be anything like fighting corruption or eradicating polio or even uplifting local school.
A life without a cause is pointless. This is the only way to make a better world and those things don't happen by itself. You cannot be detached from the world.
In one of my MBA class, we were asked to signup for some volunteering activity (we get credits for that). I signed up to teach 3rd grade students through Junior Achievement. That experience taught me about things outside my small world. We cannot shrink ourselves to our school-work-family-friends.

hobbies

Everyone should have a hobby!
In this rat race of life you need something to unwind your mind whenever you feel stressed. Otherwise, you will end up in depression.

patriotism in youth

Bottom line: NCC should be made compulsory in college.
This will make them realize where they belong if not to the extent of patriotism. Many countries make it compulsory for their youth to serve in their military for an year. It may be far fetched to ask in a country with a billion population but few hours of NCC in college will not affect the curriculum. This will bring lot of other positives in youth. They will start feeling that the country is theirs and will start to prevent bad things happening in front of them, if not, they will at least avoid having incessant strikes and be more responsible.

5000 years of civilization.

We have evolved so much since the beginning of civilization but still there is famine and war?
Shame on us.

Saturday, February 26, 2011

Is there god?

Questions is not whether there is god, it is whether we need one!

Friday, February 11, 2011

கவித்தாய்


கணவில் வந்தாய்
நினைவில் நின்றாய்
என்-வாழ்வில் வந்தாய்
எதிர்-காலம் வெண்றாய்
காவியக் கருவாய்
உயிரை ஈன்றாய்
இறையும் ஆன தாய்!

Sleeping beauty

Thursday, June 17, 2010

Socialist America and Capitalist India

USA is kicking BP's ass for the oil rig explosion in the gulf coast. Yesterday Obama met with BP execs and make them setup $20billion fund for damage claims. Although it is a much smaller money compared to their stock loss of $83billion since the oil spill started, it is a move forced by the US govt. What more? more drastic steps on future oil drilling there and other places. In India, Bhopal gas leak killed 20,000 people and the company Union carbide was not held responsible for the cleanup, they let their top guy Warren Anderson leave the country safely with the help of politicians. Eventhough the accident happend in 1984, it is not something that happend out of the blue. There were several safety issues years prior to that.
WTF moments:
* US owned Union carbide or its new avtar Dow chemicals is not expected to spend money on cleanups in return they will invest in India?
* Congress party says "Anybody questions Rajiv Gandhi in Bhopal accident is unpatriotic".
Every citizen has a right to question his leader. If he is not questioning, then alone he is unpatriotic. Secondly, it was questioned by opposition party who ran the govt before. Calling them unpatriotic is unpatriotic.
* Warren Anderson says, I was forgiven by the Indian govt.
* Congress party says "Prime ministers office was not involved in Anderson escapse".
* Congress party says "Anderson escape happened due to systemic failure".
* Then foreign secretary M K Rasgotra says "Then US president Ronald Regan spoke to Rajiv Gandhi".
* Congress party says "If we hadn't let Anderson go, mob would have killed him".
* Congress party says "We let him go on condition that he will be present for trials".
* Congress party says "Narendra Modi signed MoU with Dow Chemicals in 2008"
* Union carbide settled $470 million in 1989.
* USA says "Bhopal case is settled, we can't open it now and Anderson won't go to India"
* 26 Years later, still the plant is not cleaned up. The chemicals got into the earth, spoiled the water table.

Alright forget everything ever happened,
1. Who is responsible for bhopal plant cleanup? if state govt, do they have the infrastructure/money?
2. There are many dyeing and leather tanning industries in remote places which pollutes the neighbourhood. Could cause cancer to people who live there causing slow death, many of them are not even licensed. Will someone act on that?

Friday, June 11, 2010

Getting attestation from Indian Consulate needs Apostille.


Indian Consulated added a new requirement for the miscellaneous services like Power Of Attorney requests to them. It says,
  • All documents should be apostilled / attested by the Authentication Division in the State Department before submission of attestation at the consulate.
Traditionally we get the document attested from Indian consulate if we want to sign on a power of attorney to be executed in India. Doing it with the Indian Consulate proves that you live overseas. Since we won't be present in front of the consul, we sign in front of the Notary and submit the notorized document to the Indian Consulate. Apparently someone forged the notary in the past so, they added this new requirement to get the document apostilled on top of notary.

Apostille
Secretary of State office in the state capital is the authority responsible for certifying the authenticity of the signature of the Notary who signed the document. They will give their apostille seal mentioning that the Notary is valid. Usually this procedure takes few days for them to do and it depends on the state. Some states have expedited service by paying extra. Otherwise, it just cost around $20 per apostille seal.

Catch 22
We get the Notary if we can't be present at the place to sign a document. We sign it in front of the Notary instead. But these notaries are only recognized within that country. In 1961, several countries including India and USA signed a treaty called Hague convention. This says once a notary is apostilled by the state authority, it should be treated valid by all countries participating in the Hague convention. This means we don't even have to get it from Indian Consulate but not many organizations (mainly banks) recognize this apostille procedure and are strict in getting it signed from Indian Consulate where you live. And Indian Consulates needs it apostilled before it authenticates. Who will tell them that Indian Govt has signed a treaty so follow it!

Thursday, June 10, 2010

Legalize gambling?

Amit Verma in his Yahoo opinions - Viewfinder argues the need for legalizing gambling in India. His argument is, everyday - everyone is involved in decision making which he calls it gambling. The fact he is missing is that they are actually just changes we take.
Secondly, not everyone is educated and rational enough to decide whether to gamble or not. Agreed that govt should serve people, not rule them. If the govt legalize gambling, it will spoil many workers into gamblers (I know this well because I lived long enough in Nevada). So, sometimes govt should proactively control and form rules so as to protect its citizens. He also justifies the tax from gambling would cover the expenses of the NREGA. Ok, legalize gambling and next what? legalize brothels? where do we stop?
Before asking for legalizing anything, we must just see if someone has done it before and see whether it worked. I am not saying that gambling must be banned in Nevada aswell. Its just not for everyplace particularly for the whole nation particularly not for India which has different culture.
Long time ago, when I and my friend were walking, we were stopped by a missionary. She went on to speak about the need for god and stuff. My friend got mad and started fighting with the missionary pointing her that she is just trying to convert him. I told my friend, she is just doing her job. She may not be right in talking to you about her god but the fact is, there are missionaries is some jungle in Africa who have no values and eating human flesh. They are needed there but not to someone like you who belong to a culture which has over 3000 years of human values.
My point is, certain things belong to certain places.