はじめに
チョコレートプラネットの6秒クッキングという企画が大好きなので、うまくレシピ化できないかなあと考えていたところ、料理画像からレシピを自動生成するAIの文献を見つけたので、ソースコードをダウンロードして試してみました。
画像からこんな感じでレシピ文が出力されるらしい。すごくないですか?
これで私も6秒クッキングできるぞ(わくわく)
動作環境
- Python 3.6.8
- https://github.com/facebookresearch/inversecooking
事前準備
うわあ~~どれもおいしそうだ(????)
生成されたレシピ
出力としては、元画像から料理領域を検出した画像と料理名(Title)、材料(Ingredients)、レシピ文(Instructions)が得られます。
それでは早速やってみましょう。
からあげ
ちゃんと検出できていますね。それにしてもこれ火の通りが甘い気がします。気のせいかな。
レシピ文はどうでしょうか。
Title: Easy caramel sauce
Ingredients:
sugar, milk, cream
Instructions:
-In a medium saucepan, combine the sugar, milk and cream.
-Cook over medium heat, stirring constantly, until the mixture comes to a boil.
-Boil for 1 minute, stirring constantly.
-Remove from heat and stir in the caramel sauce.
-Serve warm.
Easy caramel sauce(絶対違う)
気を取り直して次いってみましょう。
ロコモコ
6秒史上まれにみる(?)大事故が起きてしまった回ですね。
う~~ん、これは元画像がよくなかったかな。
結構ちゃんとハンバーグっぽい部分が映ってると思うのですが、レシピはどうでしょうか。
Title: Garlic oil
Ingredients:
pepper, salt, oil, onion, clove
Instructions:
-Heat oil in a large skillet over medium heat.
-Add onion and garlic; cook and stir until onion is tender, about 5 minutes.
-Stir in salt and pepper.
Oh... "Garlic oil"...
もはや料理ですらなくなってしまいました。
ロコモコはちょっと期待していたのですが、うまくいきませんでした。
メンチカツ
キッチンジローもむしゃむしゃ食べていた成功作ですね。
Title: Fried rosettes
Ingredients:
oil, flour, salt, egg, baking_powder, sugar
Instructions:
-Heat oil in a deep-fryer or large saucepan to 375 degrees f (190 degrees c).
-In a medium bowl, mix together the flour, sugar, baking powder and salt.
-In a separate bowl, beat the egg whites until stiff peaks form.
-Dip the egg whites into the flour mixture, then into the egg whites.
-Fry the rosettes in the hot oil until golden brown, about 2 minutes.
-Drain on paper towels.
あああ~!揚げてるんだけどお菓子じゃないんだよ!!
でも調理法なんとなく合ってませんか?合ってないか。
フライドチキン
これは結構ちゃんとフライドチキンな見た目じゃないですか?うまくいきそう…!!!!
Title: Fried chicken
Ingredients:
pepper, chicken, salt, flour, oil, paprika, garlic, egg, breadcrumbs
Instructions:
-Mix flour, salt, pepper, paprika, garlic powder, and cayenne pepper in a shallow bowl.
-Beat egg in another shallow bowl.
-Dip chicken in egg, then in flour mixture.
-Heat oil in a large skillet over medium heat.
-Fry chicken in hot oil until golden brown, about 5 minutes per side.
うおおおおおおおおお
Yes!!!! Fried chicken!!!!
でも見てください。レシピの最後の1文。
Fry chicken in hot oil until golden brown, about 5 minutes per side.
6秒なんだよなあ。
あとチキンをぺしゃんこにする工程が入ってないですね(当たり前)
コーンスープ
これ、石鍋で作ったやつですよね。うまくいくでしょうか。
Title: Cafe latte
Ingredients:
milk, cream, coffee, sugar
Instructions:
-Combine all ingredients in a small saucepan.
-Heat over medium heat until steaming.
-Pour into a mug and serve.
んんん!!これほとんど合ってるのでは!?
カフェラテじゃないけど。あとsmall saucepanじゃなくて石鍋だけど。
ポテト
Title: Sesame salad dressing
Ingredients:
oil, soy_sauce, seeds, salt, vinegar, onion, sugar
Instructions:
-Combine all ingredients in a jar with a tight-fitting lid.
-Shake well.
なんか6秒クッキングの料理画像ってオイルとかドレッシングとか液体に認識されがちなのか…?
クッキー
さて、有終の美を飾れるか。最後の検証です。
・・・・・これマジで何?
Title: Peanut butter fudge
Ingredients:
water, milk, sugar, butter
Instructions:
-In a medium saucepan, combine sugar, water and milk.
-Bring to a boil, stirring constantly.
-Boil for 1 minute.
-Remove from heat and stir in peanut butter and butter.
-Pour into a greased 8x8 pan.
-Cool completely.
-Cut into squares.
fudgeとはキャンディの一種らしい。
これはレシピ作れなくても誰も怒らないよ。AIもびっくりだよ。
結論
6秒クッキングの調理法は常識に縛られない
参考リンク
「料理画像からレシピを生成するAI」を体験できるウェブアプリが登場
Inverse Cooking: Recipe Generation from Food Images
チョコレートプラネットチャンネル