Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

a touhou face recognizer

Name: Anonymous 2012-07-26 8:28

how difficult would it be to create a pipeline that can detect and recognize touhou faces in images?

I was thinking of building something very simple like this using opencv:
1. face detector that returns bounding boxes around possible faces. copying code from one of them generic face detector will probably do.

2. extract sift features from the cropped images in the bounding  boxes. again copying code will be the easiest way

3. use a svm trained on 250+ images for each touhou downloaded from danbooru or something to classify the sift features from the cropped images

Thats all I can think of for now. Any suggestions for improving this very basic pipeline would be helpful.

Name: Anonymous 2012-07-26 8:29

Surely the hats would be easier to recognise.

Name: 2 2012-07-26 8:34

Name: Anonymous 2012-07-26 8:36

op here
not every touhou has a hat, also we cant be certain they will be wearing the hat in the picture
also since each touhou has a hair/eye colors, maybe I can use histograms as features too.

Name: Anonymous 2012-07-26 8:41

>>2
yeah your right. In fact, if not the heart on her head, and her hair color, even I cant really tell which Touhou she is just by looking at her face

Name: Anonymous 2012-07-26 9:22

>>4
Every Touhou has a head ornament, NO EXCEPTIONS

Name: Anonymous 2012-07-26 10:02

Just have a script query http://iqdb.org/ for booru results then extract Touhou names from the image tags.

Name: >>7 2012-07-26 10:42

Like this:

require 'nokogiri'
require 'net/http'
require 'uri'
require 'open-uri'

touhous = []

doc = Nokogiri::HTML(open('http://danbooru.donmai.us/wiki/show?title=List_of_Touhou_Characters').read)
found_reimu = false

doc.css("a").each do |i|
  next unless i["href"] =~ /wiki.show/
  found_reimu ||= i["href"] =~ /reimu/
  next unless found_reimu
  touhous << URI.unescape(i["href"].split('=')[1])
end

image = ARGV[0]

response = Net::HTTP.post_form URI('http://iqdb.org/'), { "url" => image }
doc = Nokogiri::HTML(response.body)
tags = doc.css("img")[1]["alt"].split[3..-1]

raise "Image does not contain touhous!" unless tags.include? "touhou"

puts (tags & touhous)

Name: >>7 2012-07-26 10:48

If you're a sucker for pretty output, change that last line to:

puts (tags & touhous).map { |name| name.tr('_', ' ').split.map(&:capitalize).join(' ') }

Name: Anonymous 2012-07-26 11:41

>>8
Disgusting. Absolutely horrible.

Name: VIPPER 2012-07-26 11:51

>>9
'_'

Name: Anonymous 2012-07-26 12:31

>>10
What? Might be slow as balls, but it certainly is better than training a PC to recognize hats.

Name: >>7 2012-07-26 14:57

>>12
It could be a lot faster if I hardcode the Touhou list, but the iqdb POST request is still half of it. (And Ruby 1.9 is none of it, if that's what you mean.)

Name: >>7 2012-07-26 15:28

There.

require "nokogiri"
require "net/http"
require "uri"
require "open-uri"

response = Net::HTTP.post_form URI("http://iqdb.org/"), { url: ARGV[0] }
raise "image not found on iqdb" if response.body !~ /Best match/

# Extract tags from response
doc = Nokogiri::HTML(response.body)
tags = doc.css("img")[1]["alt"].split[3..-1]

# Look for touhous
touhous = DATA.read.split("\n")

(touhous & tags).each do |name|
  puts name.tr('_', ' ').split.map(&:capitalize).join(' ')
end

__END__
hakurei_reimu
hakurei_reimu_(classic)
kirisame_marisa
kirisame_marisa_(classic)
kirisame_marisa_(seihou)
genjii
shingyouku
yuugenmagan
elis_(touhou)
sariel
mima
kikuri_(touhou)
konngara
rika_(touhou)
meira
the_5_magic_stones
evil_eye_sigma
noroiko
rengeteki
ellen
kotohime
kana_anaberal
asakura_rikako
kitashirakawa_chiyuri
okazaki_yumemi
ruukoto
mimi-chan
orange_(touhou)
kurumi_(touhou)
elly
kazami_yuuka
kazami_yuuka_(classic)
mugetsu
gengetsu
sara_(touhou)
luize
yuki_(touhou)
mai_(touhou)
yumeko
shinki
alice_margatroid_(young)
rumia
ex-rumia
daiyousei
cirno
advent_cirno
cirno-nee
achi_cirno
ikazu_cirno
mizu_cirno
hong_meiling
ex-meiling
hong_meiling_(panda)
koakuma
patchouli_knowledge
izayoi_sakuya
inu_sakuya
remilia_scarlet
flandre_scarlet
letty_whiterock
chen
chen_(cat)
alice_margatroid
shanghai_doll
hourai_doll
lily_white
lunasa_prismriver
merlin_prismriver
lyrica_prismriver
konpaku_youmu
myon
saigyouji_yuyuko
saigyouji_yuyuko_(living)
yakumo_ran
yakumo_ran_(fox)
yakumo_yukari
saigyou_ayakashi
usami_renko
maribel_hearn
morichika_rinnosuke
mannosuke
tokiko_(touhou)
ibuki_suika
ibuki_suika_(watermelon)
wriggle_nightbug
princess_wriggle
mystia_lorelei
mystia_lorelei_(bird)
gothtia
kamishirasawa_keine
ex-keine
sukusuku_hakutaku
inaba_tewi
inaba_tewi_(bunny)
reisen_udongein_inaba
reisen_udongein_inaba_(bunny)
yagokoro_eirin
yagokoro
houraisan_kaguya
fujiwara_no_mokou
fujiwara_no_mokou_(young)
fujiwara_no_mokou_(phoenix)
luna_child
star_sapphire
sunny_milk
medicine_melancholy
su-san
onozuka_komachi
shameimaru_aya
shameimaru_aya_(crow)
shikieiki_yamaxanadu
lily_black
sunflower_fairy
hieda_no_akyuu
reisen
watatsuki_no_yorihime
watatsuki_no_toyohime
aki_shizuha
aki_minoriko
kagiyama_hina
kawashiro_nitori
kawashiro_nitori_(kappa)
inubashiri_momiji
inubashiri_momiji_(wolf)
mofuji
kochiya_sanae
yasaka_kanako
moriya_suwako
nagae_iku
hinanawi_tenshi
kisume
kurodani_yamame
mizuhashi_parsee
hoshiguma_yuugi
komeiji_satori
kaenbyou_rin
kaenbyou_rin_(cat)
zombie_fairy
reiuji_utsuho
reiuji_utsuho_(bird)
komeiji_koishi
nazrin
nazrin_(mouse)
tatara_kogasa
kumoi_ichirin
unzan
murasa_minamitsu
toramaru_shou
toramaru_shou_(tiger)
hijiri_byakuren
houjuu_nue
hisou_tensoku
namazu
goliath_doll
himekaidou_hatate
hata-tan
ibaraki_kasen
kasodani_kyouko
miyako_yoshika
kaku_seiga
soga_no_tojiko
mononobe_no_futo
toyosatomimi_no_miko
futatsuiwa_mamizou
futatsuiwa_mamizou_(tanuki)
hijiri_myouren
konpaku_youki
layla_prismriver
lord_tenma
satsuki_rin
vivit

Name: Anonymous 2012-07-26 16:47

Lush or Lush2 has native camera sampling and contrast detection features, as well as Lush is designed for complication scanning nets, mostly for AI navigation purposes, but the principles still apply.

Name: Anonymous 2012-07-26 17:06

>>8
image = ARGV[0]
wut? image is the command name?

Name: Anonymous 2012-07-26 17:15

>>16
ARGV contains arguments, NO EXCEPTIONS.

Name: Anonymous 2012-07-26 17:58

>>17
except argv[0] is the program/command name

Name: Anonymous 2012-07-26 18:06

>>18
Not in Ruby.

Name: Anonymous 2012-07-27 17:18

>>19
Wow, that's fucking stupid then.

Name: Anonymous 2013-09-01 23:09


There is a transfinite sequence of cardinal numbers:
    0, 1, 2, 3, ..., n; ℵ0, ℵ0, ℵ1, ... ℵα, ...

Don't change these.
Name: Email:
Entire Thread Thread List