I like to go back to the basics -- supply & demand. There are fewer single family residences in San Francisco than condos while the demand remains high for single family residences, thus appreciation will increase greater with single family homes. It's a good time to buy and there are alot of nice neighbors out there for the price range that you are looking in. I would be more than happy to help guide you in this exciting process.
A home is always a better investment -- it really depends on the area and the home itself. (That being said, I own a condominium and love it. South Beach and Mission Bay are very hot, trendy areas with all the new construction of condos, office buildings and the University of California, the new restaurants, and the "city within a city" development plan. But because there is a plethora of condos available for purchase, many developers are giving rebates of some sort to lure buyers, which can include a year's worth of HOA dues credited or upgrades in appliances, hardwood floors,etc. Please keep in mind a home requires a lot of work in the upkeep and in a condominium complex the work is done for you. So you need to decide what is more important to you and move forward from that point. I would be pleased to further discuss this with you.
Doug is right, the best hold value would be in a single family home in the areas (or others like) you specified. In fact, there are several nice homes on the market (min 2/2) under $1 mil in those neighb orhoods! Call or email me for the address as some are open this weekend. My contact info is at my website below.
Hope this helps!