I canâ€™t speak for 20th st and up, but I used to work around 16th and Folsom. While it was not the nicest area, i would not say it was bad. As a woman i can't say i felt very safe at night. There were some homeless hanging around but nothing crazy. However moving North from Folsom to Mission got pretty spotty - walking North felt unsafe even during the day time.
There is a Bart station at 16th and Mission and one of my coworkers told me they saw someone shooting up on the street. I don't know if there is truth to that but the area gives you that not so safe feeling and I have certainly seen people smoking pot on the curb. I'm not against it, but it does say something about what is going on around an area when people think it's cool to light up in broad day light.