Skip to content

Commit

Permalink
hive: more tweaks to 'sexual' labeling
Browse files Browse the repository at this point in the history
  • Loading branch information
bnewbold committed Apr 6, 2024
1 parent c9117c4 commit a7ee56e
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions automod/visual/hiveai_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func summarizeSexualLabels(cl []HiveAIResp_Class) string {
}

// first check if porn...
for _, pornClass := range []string{"yes_sexual_activity", "animal_genitalia_and_human", "yes_realistic_nsfw"} {
for _, pornClass := range []string{"yes_sexual_activity", "animal_genitalia_and_human"} {
if scores[pornClass] >= threshold {
return "porn"
}
Expand All @@ -115,34 +115,29 @@ func summarizeSexualLabels(cl []HiveAIResp_Class) string {
}
}

// then check for sexual suggestive (which may include nudity)...
for _, sexualClass := range []string{"yes_sexual_intent", "yes_sex_toy"} {
if scores[sexualClass] >= threshold {
return "sexual"
// then check for sexual suggestive: intent/NSFW in combination with underwear / sex toy / etc...
if scores["yes_sexual_intent"] >= threshold || scores["yes_realistic_nsfw"] >= threshold {
for _, underwearClass := range []string{"yes_male_underwear", "yes_female_underwear", "yes_sex_toy", "yes_male_nudity", "yes_female_nudity", "yes_undressed"} {
if scores[underwearClass] >= threshold {
return "sexual"
}
}
}

// special case for bondage examples
if scores["yes_undressed"] >= threshold {
// special case for bondage examples
if scores["yes_sex_toy"] > 0.75 {
return "sexual"
}
}

// then non-sexual nudity...
// then finally non-sexual nudity...
for _, nudityClass := range []string{"yes_male_nudity", "yes_female_nudity", "yes_undressed"} {
if scores[nudityClass] >= threshold {
return "nudity"
}
}

// then finally flag remaining "underwear" images in to sexually suggestive
// (after non-sexual content already labeled above)
for _, underwearClass := range []string{"yes_male_underwear", "yes_female_underwear"} {
if scores[underwearClass] >= threshold {
return "sexual"
}
}

return ""
}

Expand Down

0 comments on commit a7ee56e

Please sign in to comment.