Richmond and Sunset are very similar in terms of safety. As other commenters noted, the best way to get an object view of crime rates through the city is a crime map like the one the city offers here:
http://www.sf-police.org/index.aspx?page=1618 (you must "agree" to the terms before going to the map).
If you are thinking of moving to one of these two neighborhoods, since their safety is similar, I'd consider other factors such as schools, walkability, parking, shops and restaurants, public transportation, and commute times (of course this all depends on your personal needs). Ultimately, between these two locations, it's all going to come down to what makes you feel most at home.
Let me know if you'd like to discuss this further!
Downing & Co Real Estate Services