You need to get out of SoMa. The rest of SF is pretty nice, there are definite hot zones like near Bayview but generally what you describe is just SF. I left to raise a family and one of the reasons was the homelessness BUT SF has always been like this and if it was not the homeless it was the gangs or other issues in different parts of the city. Try living in a different part of the city, it might change things up a bit.