SlideShare una empresa de Scribd logo
1 de 27
START
CONTINUE
蘇るアシッド伝説
プロローグ
AIの流行に乗ってPythonを始めた。しかし…
全然頭に入らないディープラーニングの基礎理論とか実装とチューニングとかこれ
で一体何ができるんだろうとか想像できないもしかしてもう自分はだめなのか?シ
ンギュラリティとかなんと2045年よりもずっと前に淘汰されてしまうのか?高校数
学とかちゃんとさぼらずやっておけばよかったんだよ一体何をしてたんだタイムマ
シンがあったら高校生の自分を小一時間説教するねああでもきっと耳を貸さないだ
ろうな耳を貸すくらいなら最初から勉強してるよなていうかこんな
こと考えてる時間があるなら勉強すりゃよくね?でも頭に何にも
入らないんだよなあってこれ最初から一歩も進んでないしホン
トに馬鹿なのか馬鹿なのか自分ていうかいまさらそんなこと
気づいたのかよそんなことよりKerasいじったほうが早くね?
でもよくわかんないから配列と偏微分をとかああもういやに
なるいい加減一歩踏み出せないのか?でもわかんないんだよな…
どうしたらいいのか。イノベーションを起こすには?
困った末にリンゴおじさんに救いを求めると…
LSDの摂取は、人生で
行ったことの中で最も
重要な経験のひとつだ。
私はドラッグなしでは
成功できなかっただろう。
それって犯罪じゃん
そこで健全なアシッド体験を実現することに
Pythonでヘッドマウントアシッドシミュレータを作ろう!
iPhone+Pythonista3でお手軽開発!のはずが…
iOS API
AVCaptureSession
AVCaptureSessionPreset*
AVCaptureDeviceInput
AVCaptureVideoDataOutput
Pythonista3
Scene
(エフェクト用パネル)
PNGファイル
glsl
ほぼObjective-Cなんですけど
それでも強引に表示させるところまではできた
でも5秒かそこらで止まる。もうちょっとちゃんとしないと!
ところでお前、誰よ?
自己紹介
名前:しらい つかさ
技術:Python初心者
好物:鯖缶(水煮)
ビール(しかし最近は激安ストロング
チューハイに敗北しつつある)
志向:どうしてもOOPで考えがち
「GLOBAL」という単語にピリピリしがち
で、アシッドシミュレータどうなった?
止まる原因を突き止めろ!
iOS API
AVCaptureSession
AVCaptureSessionPreset*
AVCaptureDeviceInput
AVCaptureVideoDataOutput
Pythonista3
Scene
(エフェクト用パネル)
PNGファイル
glsl
②処理タイミング
とかかなあ…
①ファイル化って
ちょっとなあ… 問題は2か所かな…あと機能改善もしたい
tempfile (①対策)
MemoryBufferedReader/Writerとして使えそう
Pythonの標準ライブラリらしい。
(リファレンスに出てきた)
OSによって若干内部挙動が異なるようだが、
・仮ディレクトリを生成して一時ファイルを扱う
・仮ディレクトリは実はメモリIO
・メモリが足りないとストレージにスワップ
・処理が終わると消える
ということらしい。
ui.View (②対策)
同期フローを整えて処理の衝突を回避
iOSのネイティブUIView
ラッパー(らしい)
Sceneはui.Viewにおけ
るパネルの一つなので、
Sceneを使うと暗黙的に
ui.Viewを作るようだ。
これを明示的バインドし
画面更新フローを整える。
ui.View
ここでiOS APIと連携し、
tempfileに定期的フレーム保存
Scene
ここでtempfileから
定期的にフレームを呼び出し
GLSLで加工して表示
GLSL (見た目をそれっぽく)
マルパクでパラメータをちょっと変更して実装
Sceneに設定できるシェー
ダー。
元々OpenGLを制御するため
の言語らしい。
Pythonistaのサンプルゲーム
「BrickBreaker」に
アシッド風GLSLがあったので、
それを拝借
sound(インタラクティブ化)
超簡易オーディオスペクトラムをミックスした感じ
周りの音を拾ってゆがみを変化させるようにした。
本当は動画と同じようにiOS APIにSessionとかある
かもしれないが、もう疲れたのでPythonistaの
soundコンポーネントを使うことにした。
動画と同じくtempfileに音配列をキャプチャして、
そこから情報をかすめ取る感じ(そのやり方がいい
かどうか知らないけど)
できあがり構成
図式化してみるとこんな感じ
(知識不足から記述が間違っていたものの補正も兼ねて)
objc_utils
AVCaptureSession
AVCaptureSessionPreset*
AVCaptureDeviceInput
AVCaptureVideoDataOutput
GLSL
ui.View
Scene
sound
tempfile
pngファイル
m4aファイル
ヤター!できたよん(*´з`)
たまーにクラッシュするがまずまずの動き
体験しようそうしよう
はたしてどこまで没入できるか
アシッド(LSD)体験をコモディ
ティ化したのがディスコ(いまはク
ラブと言うのか)
トラボルタのようにその世界に没入
し、イノベーションを起こせるか?
とりあえず箱
児童科学館で購入し
たスマホを取り付け
てYouTubeVR体験が
できるやつ。
娘に与えたが、単な
るボール紙のくせに
結構高かったけどす
ぐに飽きて放って
あったので再利用
…………。
ちょっと気持ち悪くなっただけでした。
ビールを足してみよう。
アシッドトリッパー兼サーバアドミニストレータ
飽きた。酔ったし。
一体何をしているんだい?危機感がないのかい?
もっと人の役に立つものを…。あ、そういえば!
アシッドシミュレータとか言ってこんなものでイノベーションが起こるわけないだ
ろていうかまじめに勉強しろよいい年して一体何をしてるんだそもそもアシッドと
かじゃなくてディープラーニングとかそっちの知見を深めたかったんじゃないのか
よこんなことやってるうちにも世界はめちゃめちゃすごいスピードで変わってい
くっていうのに単にビール飲んで酔い戯けただけじゃないのかちゃんと
線形代数とか微分とかやってないだろノートに書いて勉強しますとか
言っててもノートの最後までいかずに投げ出してるんだろ結局学
生の時と何も変わってないじゃないかタイムマシンで過去の自
分に説教するとかぬかしてる前に今の自分を説教したほうが
いいんじゃないのかだいたいからしてイノベーションとかな
んとかじゃなくてもっと人様の役に立つものを生み出すとか
そういう視点で取り組んだほうがまだ生産性があるんじゃない
のかい
ご清聴
あ り が と う
ございます

Más contenido relacionado

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

PYTHON QUEST