かの有名なあの東方二次創作ソング、「bad apple!」のMVをPythonでやってみたって話

Overview

bad apple!!

bad apple!のスクショ

内容

このプログラムは、bad apple!(feat. nomico)のPVをPythonを用いて再現しよう!という内容です。 実はYoutube並びにGithub上に似たようなプログラムがあったしなんならそっちの方が結構良かったりするんですが、一応公開しますw

使い方

  • このプログラムをダウンロードします。上部の「Code」という緑のボタンから「Download ZIP」を選択、その後解凍します

  • まず、badapple.pyと同じ階層に、badapple.mp3とbadapple.mp4を置きます(既に用意はしてますが、著作権とかの問題があり次第削除します)

  • badapple.pyを普通に動作させます

  • データ生成が完了したらエンターキーを押して、楽しみます

データの保存について

v.1.1.0から、各フレームを表現する文字列(以下、ドットファイル)が保存できるようになりました。
これによって、いちいち待つことなく、すぐに再生することが可能になります。

使い方

  • まず、選択肢の「2」を選ぶ

  • 現在の設定に合わせたドットファイルを、badapple.pyと同じ階層にあるdotsフォルダの中に生成

  • その後、選択肢の「3」を選ぶ

  • 先ほど生成したファイル名を入力し、再生

  • 楽しむ

注意

ドットファイルはテキストファイル(txt)で保存されますが、なんと一つのファイルあたり100MBは超えます。というか私の時は300MB超えました。なので、容量には充分注意をして、生成しまくらないようにしてください。

あと、そのテキストファイルを生で見ようとすると重くなるので、あまり直視しないようにお願いします。

自動フレーム調整機能について

v.1.1.0から、自動で、fpsに合わせたフレーム調整を行うことができます。これにより、ある程度高画質なドットファイルでも、少しカクカクするかもしれませんが再生することができるようになりました。
なお、この機能は完璧なものではありません。遅れるもんは遅れます。抗えません。無駄な抵抗をせず、画質を落としましょう。

なお、再生時に「debug_fps」と入力すると、現在のfpsと、通常のfpsに合わせて調整するフレーム数をみることができますが、これをONにするとfps落ちるので、なんかおかしいという時のみ活用してください。

Q&A

  1. サイズが収まらない
    申し訳ありませんが、badapple.py内の「CUSTOM」というコメントがある箇所の数値を調整してください

  2. 音とズレる
    1番と同様、badapple.py内の「CUSTOM」というコメントがある箇所の数値を調整してください。
    原因は多分、描画するときの処理時間があるからだと思いますので、描画するときの文字数を減らすなどの対策を行うと良いかもしれません

  3. ウインドウが自動的に閉じない
    ウインドウを閉じる方法がよくわからなかったので、申し訳ありませんが手動でウインドウを閉じてください

  4. エラー吐きまくってる
    ライブラリのインストールをしていないのかもしれません。
    この作品では、

  • openCV
  • pygame
  • fpstimer
  • tkinter
  • screeninfo

が必要です。

  1. どう足掻いてもズレる
    他のアプリのウインドウをできるだけ閉じることをお勧めします。また、なぜか1回目はズレるんですが、2回目は普通になる時が結構あるので、何回か試してみるのもいいかもしれません。

  2. ウインドウを動かそうとするとズレる
    仕方ないものです。

  3. 特にない
    bad apple!!を楽しんでください

感想

小さい頃から、bad apple!!のPVのアレンジ(?)をめちゃくちゃ見てて、「うわぁ、こういうのやりたいなぁ」と思ってたので、どんな形であれ自分の手でアレンジができたのは本当に嬉しいです。もちろん、改善すべき点なんてあげればキリがないんですが、今はもうちょっとだけ幻想入りさせてもらいます。。。

そもそも、「bad apple!!」とは?

元々は、東方旧作の弾幕STGシリーズ、「東方幻想郷」の3面ステージの道中BGM。
それをnomicoがカバーした「bad apple!! feat. nomico」と、そのPVが爆発的人気を誇り、今や東方projectの顔とも呼べる曲となった。
また、PVが影絵なので、二値化できる作品であり、それを利用して今回のプログラムの他にも様々なオリジナリティのあるアレンジが公開されている。このプログラムでも、PythonのopenCVを用いて動画を二値化しているが、その処理を施しても違和感のない仕上がりとなっている。

実は、PVに関しては絵コンテから、神様が影絵へと変化させたのだが、影絵の元である絵コンテでは、最後に出てくる霊夢、魔理沙は旧作のキャラクターとなっている。

You might also like...
A super easy, but really really bad DBMS

Dumb DB Are you looking for a reliable database management system? Then you've come to the wrong place. This is a very small database management syste

A discord token nuker With loads of options that will screw an account up real bad
A discord token nuker With loads of options that will screw an account up real bad

A discord token nuker With loads of options that will screw an account up real bad, also has inbuilt massreport, GroupChat Spammer and Token/Password/Creditcard grabber and so much more!

Kellogg bad | Union good | Support strike funds

KelloggBot Credit to SeanDaBlack for the basis of the script. req.py is selenium python bot. sc.js is a the base of the ios shortcut [COMING SOON] Set

Python script to commit to your github for a perfect commit streak. This is purely for education purposes, please don't use this script to do bad stuff.

Daily-Git-Commit Commit to repo every day for the perfect commit streak Requirments pip install -r requirements.txt Setup Download this repository. Cr

Instagram-Reports is a tool made to ban any scam or bad person

ABOUT TOOL : Instagram-Reports is a tool made to ban any scam or bad person. Installation : sudo apt-get update -y sudo apt-get upgrade -y apt insta

Some Discord bot block bad words, with this simple hacking tool you will be able to bypass blacklisted words
Some Discord bot block bad words, with this simple hacking tool you will be able to bypass blacklisted words

DISCORD-BAD-WORD-BYPASS-2022 DISCORD BLACKLISTED WORDS HACKING/BYPASS (EDUCATIONAL PURPOSES ONLY) bypass discord blacklisted words. Description Some D

A very bad wordle solver to help me solve the daily wordle

Wordle Solver A very bad wordle solver to help me solve the daily wordle on https://www.powerlanguage.co.uk/wordle/ TODO list take into account letter

A discord token nuker With loads of options that will screw an account up real bad, also has inbuilt massreport, GroupChat Spammer and Token/Password/Creditcard grabber and so much more!
A discord token nuker With loads of options that will screw an account up real bad, also has inbuilt massreport, GroupChat Spammer and Token/Password/Creditcard grabber and so much more!

Installation | Important | Changelogs | Discord NOTE: Hazard is not finished! You can expect bugs, crashes, and non-working functions. Please make an

About A python based Apple Quicktime protocol,you can record audio and video from real iOS devices

介绍 本应用程序使用 python 实现,可以通过 USB 连接 iOS 设备进行屏幕共享 高帧率(30〜60fps) 高画质 低延迟(200ms) 非侵入性 支持多设备并行 Mac OSX 安装 python =3.7 brew install libusb pkg-config 如需使用 g

OHLC Average Prediction of Apple Inc. Using LSTM Recurrent Neural Network
OHLC Average Prediction of Apple Inc. Using LSTM Recurrent Neural Network

Stock Price Prediction of Apple Inc. Using Recurrent Neural Network OHLC Average Prediction of Apple Inc. Using LSTM Recurrent Neural Network Dataset:

Research shows Google collects 20x more data from Android than Apple collects from iOS. Block this non-consensual telemetry using pihole blocklists.

pihole-antitelemetry Research shows Google collects 20x more data from Android than Apple collects from iOS. Block both using these pihole lists. Proj

Unofficial PyTorch implementation of Attention Free Transformer (AFT) layers by Apple Inc.
Unofficial PyTorch implementation of Attention Free Transformer (AFT) layers by Apple Inc.

aft-pytorch Unofficial PyTorch implementation of Attention Free Transformer's layers by Zhai, et al. [abs, pdf] from Apple Inc. Installation You can i

Orthrus is a macOS agent that uses Apple's MDM to backdoor a device using a malicious profile.

Orthrus is a macOS agent that uses Apple's MDM to backdoor a device using a malicious profile. It effectively runs its own MDM server and allows the operator to interface with it using Mythic.

Convert Apple NeuralHash model for CSAM Detection to ONNX.

Apple NeuralHash is a perceptual hashing method for images based on neural networks. It can tolerate image resize and compression.

Find target hash collisions for Apple's NeuralHash perceptual hash function.💣
Find target hash collisions for Apple's NeuralHash perceptual hash function.💣

neural-hash-collider Find target hash collisions for Apple's NeuralHash perceptual hash function. For example, starting from a picture of this cat, we

Applicator Kit for Modo allow you to apply Apple ARKit Face Tracking data from your iPhone or iPad to your characters in Modo.

Applicator Kit for Modo Applicator Kit for Modo allow you to apply Apple ARKit Face Tracking data from your iPhone or iPad with a TrueDepth camera to

Demonstrates iterative FGSM on Apple's NeuralHash model.
Demonstrates iterative FGSM on Apple's NeuralHash model.

apple-neuralhash-attack Demonstrates iterative FGSM on Apple's NeuralHash model. TL;DR: It is possible to apply noise to CSAM images and make them loo

Fast, simple API for Apple firmwares.

Loyal Fast, Simple API for fetching Apple Firmwares. The API server is closed due to some reasons. Wait for v2 releases. Features Fetching Signed IPSW

IDA loader for Apple's iBoot, SecureROM and AVPBooter
IDA loader for Apple's iBoot, SecureROM and AVPBooter

IDA iBoot Loader IDA loader for Apple's iBoot, SecureROM and AVPBooter Installation Copy iboot-loader.py to the loaders folder in IDA directory. Credi

Releases(v.1.2.0)
  • v.1.2.0(Aug 30, 2021)

    バージョン1.2.0リリース

    更新内容

    • バグモードの追加(下の画像参照)
    • 自動的に文字のサイズを調整
    • 白い部分と黒い部分の文字を自由に設定可能(下の画像参照)
    • 終了時に自動的にウインドウを閉じる
    • その他細かいところの修正

    資料

    バグモード

    白い部分と黒い部分の設定例

    Source code(tar.gz)
    Source code(zip)
  • v.1.1.0(Aug 27, 2021)

  • v.1.0.0(Aug 27, 2021)

Owner
赤紫
自分で作ったwebアプリのコードを中心に、適当にアップしていく予定
赤紫
OpenCV-Erlang/Elixir bindings

evision [WIP] : OS : arch Build Status Ubuntu 20.04 arm64 Ubuntu 20.04 armv7 Ubuntu 20.04 s390x Ubuntu 20.04 ppc64le Ubuntu 20.04 x86_64 macOS 11 Big

Cocoa 194 Jan 05, 2023
Here use convulation with sobel filter from scratch in opencv python .

Here use convulation with sobel filter from scratch in opencv python .

Tamzid hasan 2 Nov 11, 2021
A Tensorflow model for text recognition (CNN + seq2seq with visual attention) available as a Python package and compatible with Google Cloud ML Engine.

Attention-based OCR Visual attention-based OCR model for image recognition with additional tools for creating TFRecords datasets and exporting the tra

Ed Medvedev 933 Dec 29, 2022
ARU-Net - Deep Learning Chinese Word Segment

ARU-Net: A Neural Pixel Labeler for Layout Analysis of Historical Documents Contents Introduction Installation Demo Training Introduction This is the

128 Sep 12, 2022
textspotter - An End-to-End TextSpotter with Explicit Alignment and Attention

An End-to-End TextSpotter with Explicit Alignment and Attention This is initially described in our CVPR 2018 paper. Getting Started Installation Clone

Tong He 323 Nov 10, 2022
Demo for the paper "Overlap-aware low-latency online speaker diarization based on end-to-end local segmentation"

Streaming speaker diarization Overlap-aware low-latency online speaker diarization based on end-to-end local segmentation by Juan Manuel Coria, Hervé

Juanma Coria 185 Jan 01, 2023
nofacedb/faceprocessor is a face recognition engine for NoFaceDB program complex.

faceprocessor nofacedb/faceprocessor is a face recognition engine for NoFaceDB program complex. Tech faceprocessor uses a number of open source projec

NoFaceDB 3 Sep 06, 2021
This tool will help you convert your text to handwriting xD

So your teacher asked you to upload written assignments? Hate writing assigments? This tool will help you convert your text to handwriting xD

Saurabh Daware 4.2k Jan 07, 2023
An organized collection of tutorials and projects created for aspriring computer vision students.

A repository created with the purpose of teaching students in BME lab 308A- Hanoi University of Science and Technology

Givralnguyen 5 Nov 24, 2021
Image augmentation library in Python for machine learning.

Augmentor is an image augmentation library in Python for machine learning. It aims to be a standalone library that is platform and framework independe

Marcus D. Bloice 4.8k Jan 04, 2023
computer vision, image processing and machine learning on the web browser or node.

Image processing and Machine learning labs   computer vision, image processing and machine learning on the web browser or node note Fast Fourier Trans

ryohei tanaka 487 Nov 11, 2022
Fatigue Driving Detection Based on Dlib

Fatigue Driving Detection Based on Dlib

5 Dec 14, 2022
Detecting Text in Natural Image with Connectionist Text Proposal Network (ECCV'16)

Detecting Text in Natural Image with Connectionist Text Proposal Network The codes are used for implementing CTPN for scene text detection, described

Tian Zhi 1.3k Dec 22, 2022
Handwritten Text Recognition (HTR) system implemented with TensorFlow.

Handwritten Text Recognition with TensorFlow Update 2021: more robust model, faster dataloader, word beam search decoder also available for Windows Up

Harald Scheidl 1.5k Jan 07, 2023
A python scripts that uses 3 different feature extraction methods such as SIFT, SURF and ORB to find a book in a video clip and project trailer of a movie based on that book, on to it.

A python scripts that uses 3 different feature extraction methods such as SIFT, SURF and ORB to find a book in a video clip and project trailer of a movie based on that book, on to it.

tooraj taraz 3 Feb 10, 2022
Code for generating synthetic text images as described in "Synthetic Data for Text Localisation in Natural Images", Ankush Gupta, Andrea Vedaldi, Andrew Zisserman, CVPR 2016.

SynthText Code for generating synthetic text images as described in "Synthetic Data for Text Localisation in Natural Images", Ankush Gupta, Andrea Ved

Ankush Gupta 1.8k Dec 28, 2022
A tensorflow implementation of EAST text detector

EAST: An Efficient and Accurate Scene Text Detector Introduction This is a tensorflow re-implementation of EAST: An Efficient and Accurate Scene Text

2.9k Jan 02, 2023
A simple demo program for using OpenCV on Android

Kivy OpenCV Demo A simple demo program for using OpenCV on Android Build with: buildozer android debug deploy run Run (on desktop) with: python main.p

Andrea Ranieri 13 Dec 29, 2022
Face_mosaic - Mosaic blur processing is applied to multiple faces appearing in the video

動機 face_recognitionを使用して得られる顔座標は長方形であり、この座標をそのまま用いてぼかし処理を行った場合得られる画像は醜い。 それに対してモ

Yoshitsugu Kesamaru 6 Feb 03, 2022
TableBank: A Benchmark Dataset for Table Detection and Recognition

TableBank TableBank is a new image-based table detection and recognition dataset built with novel weak supervision from Word and Latex documents on th

844 Jan 04, 2023