SlideShare uma empresa Scribd logo
1 de 122
Baixar para ler offline
Recognize Godzilla
by
Recoginize Godzilla
DEMO
:
: HTML CSS
: B
(´ ω )
Recognize Godzilla
1954 29
https://ja.wikipedia.org/wiki/
:
http://www.asahi.com/articles/ASJ8X42B7J8XPUTB
001.html
INPUT
Not OUTPUT
T
LT
OpenCV
GE○ TUTAY○ Mac
Hulu
(´ )
1,000 / ( )
Selenium
SeleniumHQ
Selenium Python
URL
1
Ubuntu
Flash
(´ ω )
Google Chrome, Firefox
=> Mac Pro
Python => Selenium Firefox
=> (´ ω )
Firefox 48 selenium-webdriver
=> Firefox 47.x
=> 5GB
=>
4 180GB^^;
=> 31
=> HDD
1 => 4
(´ ω )
Python
Python web driver
API
Python Selenium
Plugin JavaScript
Selenium
Plugin
1. html canvas
2.
(^o^)
screencapture
Cmd+Shift+4“
“
Python OSS
pyscreencapture
python Selenium
screencapture
(´ )
32px x 32px
1.
2.
1x25, 2x4, 3x1, 4x1, 5x1
1 = 192px
x 192px
3. 32px x 32px
( 6 shift orz)
trimming.py
def trimming(image_path):
#
x = 334
y = 276
#
width = 1892
height = 1066
src = cv2.imread(image_path, 1)
dst = src[y:y + height, x:x + width]
file_name = re.sub('(godzilla[0-9]+.jpg)',
'trimming_1',
image_path)
cv2.imwrite(file_name, dst)
cutout.py
def cutout_square(img, image_path,
full_path, pixel_size, loop_count,
x_start_point, y_start_point, image_prefix):
for x in range(loop_count):
for y in range(loop_count):
x_start = x_start_point + (pixel_size * x)
x_end = x_start + pixel_size
y_start = y_start_point + (pixel_size * y)
y_end = y_start + pixel_size
dist = img[y_start:y_end, x_start:x_end]
resize_image = resize.to_target_pixel(dist)
if type(resize_image).__module__ == 
np.__name__:
write_image(resize_image,
image_prefix,
full_path)
else:
print(image_path)
resize.py
def to_target_pixel(image, pixel_size=32):
height = image.shape[0]
width = image.shape[1]
try:
resize_size_list = (
int(height / (height / pixel_size)),
int(width / (width/ pixel_size)))
return cv2.resize(image, resize_size_list)
except:
return False
(※ github )
ls Finder
=> cp mv too many arguments
=>
=> 5
=> (1 * 25) * (shift ) 5 * ( ) 20,000 ≒
2,500,000
=> ↑
=> (´ ω )
find xargs
$ find ${DIRECTORY} -name ${FIND_PARAM} -maxdepth 1 
-print0 | xargs -0 -J {} mv {} ${MV_DIRECTORY}
${DIRECTORY}
${FIND_PARAM}
${MV_DIRECTORY}
1x25
2x4
1x3, 1x4 shift
1x5
32px x 32px
(´ ω )
=>
=>
=>
3500 2017/03/16
500
=>
(^o^)
3
(´ ω )
※
0:00(20176/03/17)
GO
1000
ω ⊃ !!
facebook
github clone
python
$ python increase_picture.py ${IMAGE_FILE}
find
$ find ${IMG_FILES} -maxdepth 1 -exec 
increase_picture.py {} ;
>>> datasets.shape
(41688, 1, 3072)
>>> labels.shape
(41688, 1)
41,688
(is("INPUT")) ? " " : " "
keras
CIFAR-10
The CIFAR-10 dataset
[1, 3072] numpy
3072
32px * 32px * 3(RGB) = 3072
RGB R G B
[[0, 0]] <-
0
1
cifar-10 10 0 9
2 0 1
keras
# (?)
batch_size = 32
# ! 10 2
nb_classes = 2
# (?)
nb_epoch = 4
# (?)
nb_filter = 10
# input image dimensions. img_rows = height, img_cols = width
img_rows, img_cols = 32, 32
# the CIFAR10 images are RGB
img_channels = 3
model.evaluate(X_test, Y_test)
> [0.6990031684412652, 0.4959700633390145]
°ω°
°ω°
# json
# yaml
json_string = model.to_json()
open(os.path.join('./model/', 'model.json'), 'w').write(json_str
#
model.save_weights(os.path.join('./model/','model_weights.hdf5'
bottle
※
※
DEMO
(´ ω )
etc
Data Set
hulu seleniu
keras OpenCV
Recognize Godzilla

Mais conteúdo relacionado

Mais procurados

"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!..."A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
akaptur
 
Bytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreterBytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreter
akaptur
 
How to write rust instead of c and get away with it
How to write rust instead of c and get away with itHow to write rust instead of c and get away with it
How to write rust instead of c and get away with it
Flavien Raynaud
 

Mais procurados (19)

"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!..."A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
 
Bytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreterBytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreter
 
Parallel Computing in R
Parallel Computing in RParallel Computing in R
Parallel Computing in R
 
Ernst kuilder (Nelen & Schuurmans) - De waterkaart van Nederland: technisch g...
Ernst kuilder (Nelen & Schuurmans) - De waterkaart van Nederland: technisch g...Ernst kuilder (Nelen & Schuurmans) - De waterkaart van Nederland: technisch g...
Ernst kuilder (Nelen & Schuurmans) - De waterkaart van Nederland: technisch g...
 
A tour of Python
A tour of PythonA tour of Python
A tour of Python
 
1 seaborn introduction
1 seaborn introduction 1 seaborn introduction
1 seaborn introduction
 
Clojure night
Clojure nightClojure night
Clojure night
 
Flink Forward Berlin 2017: Max Kiessling, Martin Junghanns - Cypher-based Gra...
Flink Forward Berlin 2017: Max Kiessling, Martin Junghanns - Cypher-based Gra...Flink Forward Berlin 2017: Max Kiessling, Martin Junghanns - Cypher-based Gra...
Flink Forward Berlin 2017: Max Kiessling, Martin Junghanns - Cypher-based Gra...
 
Queue in swift
Queue in swiftQueue in swift
Queue in swift
 
JavaScript @ CTK
JavaScript @ CTKJavaScript @ CTK
JavaScript @ CTK
 
Grokking TechTalk #16: Maybe functor in javascript
Grokking TechTalk #16: Maybe functor in javascriptGrokking TechTalk #16: Maybe functor in javascript
Grokking TechTalk #16: Maybe functor in javascript
 
Go Containers
Go ContainersGo Containers
Go Containers
 
Golang勉強会
Golang勉強会Golang勉強会
Golang勉強会
 
All You Need is Fold in the Key of C#
All You Need is Fold in the Key of C#All You Need is Fold in the Key of C#
All You Need is Fold in the Key of C#
 
2015 555 kharchenko_ppt
2015 555 kharchenko_ppt2015 555 kharchenko_ppt
2015 555 kharchenko_ppt
 
How to write rust instead of c and get away with it
How to write rust instead of c and get away with itHow to write rust instead of c and get away with it
How to write rust instead of c and get away with it
 
Jan 2012 HUG: RHadoop
Jan 2012 HUG: RHadoopJan 2012 HUG: RHadoop
Jan 2012 HUG: RHadoop
 
A, B, C. 1, 2, 3. Iterables you and me - Willian Martins (ebay)
A, B, C. 1, 2, 3. Iterables you and me - Willian Martins (ebay)A, B, C. 1, 2, 3. Iterables you and me - Willian Martins (ebay)
A, B, C. 1, 2, 3. Iterables you and me - Willian Martins (ebay)
 
Haskell
HaskellHaskell
Haskell
 

Destaque

Destaque (14)

Webの作り方
Webの作り方Webの作り方
Webの作り方
 
Búsqueda en bases de datos y creación de bibliografía
Búsqueda en bases de datos y creación de bibliografíaBúsqueda en bases de datos y creación de bibliografía
Búsqueda en bases de datos y creación de bibliografía
 
Evaluation Question 2 - 'How effective is the combination of your main produc...
Evaluation Question 2 - 'How effective is the combination of your main produc...Evaluation Question 2 - 'How effective is the combination of your main produc...
Evaluation Question 2 - 'How effective is the combination of your main produc...
 
Guia de estudos.2ano
Guia de estudos.2anoGuia de estudos.2ano
Guia de estudos.2ano
 
Income tax
Income taxIncome tax
Income tax
 
Bhartiya The Leela Residences Brochure - Zricks.com
Bhartiya The Leela Residences Brochure - Zricks.comBhartiya The Leela Residences Brochure - Zricks.com
Bhartiya The Leela Residences Brochure - Zricks.com
 
Unifi'd Ownage
Unifi'd OwnageUnifi'd Ownage
Unifi'd Ownage
 
Follow the Successful Crowd: Raising MOOC Completion Rates through Social Com...
Follow the Successful Crowd: Raising MOOC Completion Rates through Social Com...Follow the Successful Crowd: Raising MOOC Completion Rates through Social Com...
Follow the Successful Crowd: Raising MOOC Completion Rates through Social Com...
 
スタートアップを陰ながら支えるときに心がけるべき5ヶ条
スタートアップを陰ながら支えるときに心がけるべき5ヶ条スタートアップを陰ながら支えるときに心がけるべき5ヶ条
スタートアップを陰ながら支えるときに心がけるべき5ヶ条
 
Vue.js でタイマーを作る
Vue.js でタイマーを作るVue.js でタイマーを作る
Vue.js でタイマーを作る
 
「自動家は見た! 〜自動化の現場の真実〜」-システムテスト自動化カンファレンス2015「.reviewrc(おいしが)」発表枠 #stac2015
「自動家は見た! 〜自動化の現場の真実〜」-システムテスト自動化カンファレンス2015「.reviewrc(おいしが)」発表枠 #stac2015 「自動家は見た! 〜自動化の現場の真実〜」-システムテスト自動化カンファレンス2015「.reviewrc(おいしが)」発表枠 #stac2015
「自動家は見た! 〜自動化の現場の真実〜」-システムテスト自動化カンファレンス2015「.reviewrc(おいしが)」発表枠 #stac2015
 
テストを書こう、Unity編
テストを書こう、Unity編テストを書こう、Unity編
テストを書こう、Unity編
 
Vue.js with Go
Vue.js with GoVue.js with Go
Vue.js with Go
 
Programas asistenciales
Programas asistencialesProgramas asistenciales
Programas asistenciales
 

Semelhante a Recognize Godzilla

Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
 
Writing MySQL User-defined Functions in JavaScript
Writing MySQL User-defined Functions in JavaScriptWriting MySQL User-defined Functions in JavaScript
Writing MySQL User-defined Functions in JavaScript
Roland Bouman
 
A gentle introduction to functional programming through music and clojure
A gentle introduction to functional programming through music and clojureA gentle introduction to functional programming through music and clojure
A gentle introduction to functional programming through music and clojure
Paul Lam
 

Semelhante a Recognize Godzilla (20)

Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Python于Web 2.0网站的应用 - QCon Beijing 2010
Python于Web 2.0网站的应用 - QCon Beijing 2010Python于Web 2.0网站的应用 - QCon Beijing 2010
Python于Web 2.0网站的应用 - QCon Beijing 2010
 
Goptuna Distributed Bayesian Optimization Framework at Go Conference 2019 Autumn
Goptuna Distributed Bayesian Optimization Framework at Go Conference 2019 AutumnGoptuna Distributed Bayesian Optimization Framework at Go Conference 2019 Autumn
Goptuna Distributed Bayesian Optimization Framework at Go Conference 2019 Autumn
 
Java VS Python
Java VS PythonJava VS Python
Java VS Python
 
Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)
 
Functional Programming inside OOP? It’s possible with Python
Functional Programming inside OOP? It’s possible with PythonFunctional Programming inside OOP? It’s possible with Python
Functional Programming inside OOP? It’s possible with Python
 
Php 7 evolution
Php 7 evolutionPhp 7 evolution
Php 7 evolution
 
Rapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and MingRapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and Ming
 
The secrets of inverse brogramming
The secrets of inverse brogrammingThe secrets of inverse brogramming
The secrets of inverse brogramming
 
PHP 7 – What changed internally? (Forum PHP 2015)
PHP 7 – What changed internally? (Forum PHP 2015)PHP 7 – What changed internally? (Forum PHP 2015)
PHP 7 – What changed internally? (Forum PHP 2015)
 
Writing MySQL User-defined Functions in JavaScript
Writing MySQL User-defined Functions in JavaScriptWriting MySQL User-defined Functions in JavaScript
Writing MySQL User-defined Functions in JavaScript
 
Modern technologies in data science
Modern technologies in data science Modern technologies in data science
Modern technologies in data science
 
League of Graphs
League of GraphsLeague of Graphs
League of Graphs
 
ITT 2015 - Saul Mora - Object Oriented Function Programming
ITT 2015 - Saul Mora - Object Oriented Function ProgrammingITT 2015 - Saul Mora - Object Oriented Function Programming
ITT 2015 - Saul Mora - Object Oriented Function Programming
 
A gentle introduction to functional programming through music and clojure
A gentle introduction to functional programming through music and clojureA gentle introduction to functional programming through music and clojure
A gentle introduction to functional programming through music and clojure
 
PHP 7 – What changed internally? (PHP Barcelona 2015)
PHP 7 – What changed internally? (PHP Barcelona 2015)PHP 7 – What changed internally? (PHP Barcelona 2015)
PHP 7 – What changed internally? (PHP Barcelona 2015)
 
Kotlin+MicroProfile: Enseñando trucos de 20 años a un nuevo lenguaje
Kotlin+MicroProfile: Enseñando trucos de 20 años a un nuevo lenguajeKotlin+MicroProfile: Enseñando trucos de 20 años a un nuevo lenguaje
Kotlin+MicroProfile: Enseñando trucos de 20 años a un nuevo lenguaje
 
The Ring programming language version 1.5.2 book - Part 45 of 181
The Ring programming language version 1.5.2 book - Part 45 of 181The Ring programming language version 1.5.2 book - Part 45 of 181
The Ring programming language version 1.5.2 book - Part 45 of 181
 
Ruby is an Acceptable Lisp
Ruby is an Acceptable LispRuby is an Acceptable Lisp
Ruby is an Acceptable Lisp
 
java 8 Hands on Workshop
java 8 Hands on Workshopjava 8 Hands on Workshop
java 8 Hands on Workshop
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Recognize Godzilla