File size: 3,753 Bytes
8f3a4e5 968d2c9 8f3a4e5 968d2c9 8f3a4e5 2e38275 968d2c9 2e38275 8f3a4e5 968d2c9 8f3a4e5 968d2c9 8f3a4e5 968d2c9 8f3a4e5 2e38275 968d2c9 2e38275 8f3a4e5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "9f0e1e4b-e36a-4dfe-adfd-6f99fb1d39f6",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"from app import animate_images, AudioInput, SpotifyApi"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "98b2afd2",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Fetching Space from: https://huggingface.co/spaces/runwayml/stable-diffusion-v1-5\n",
"Gradio Blocks instance: 3 backend functions\n",
"-------------------------------------------\n",
"fn_index=0\n",
" inputs:\n",
" |-dataset\n",
" outputs:\n",
" |-textbox\n",
" |-gallery\n",
"fn_index=1\n",
" inputs:\n",
" |-textbox\n",
" outputs:\n",
" |-gallery\n",
"fn_index=2\n",
" inputs:\n",
" |-textbox\n",
" outputs:\n",
" |-gallery\n"
]
}
],
"source": [
"\n",
"import gradio as gr\n",
"stable_diffusion = gr.Blocks.load(name=\"spaces/runwayml/stable-diffusion-v1-5\")\n",
"gallery_dir = stable_diffusion(\"hi\", fn_index=0)\n",
"\n",
"print(stable_diffusion)\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "778fa4aa-cc12-4c33-a866-47ddcedcaf5f",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING:spodcast.podcast:Downloaded Hello Internet: Nine Ladies Dancing\n"
]
}
],
"source": [
"def test_spotify_downloads():\n",
" url = \"https://open.spotify.com/episode/3Ev4jlIjT8IVih1Oxidhqf?si=54a95e8fb07640c5\"\n",
" api = SpotifyApi(url=url)\n",
" api.download_episode()\n",
" api.download_image()\n",
" api.get_title()\n",
"\n",
"test_spotify_downloads()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "237e3903",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<moviepy.video.VideoClip.ImageClip at 0x7f5951ec8700>"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from moviepy.editor import ImageClip\n",
"\n",
"ImageClip(img=\"/notebooks/stablepod/temp/1ae3a379.jpg\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "de461d9b-bfbb-4d2d-b35e-fc3889494991",
"metadata": {},
"outputs": [],
"source": [
"def get_test_image_paths():\n",
" gallery_dir = \"temp/images\"\n",
" return [os.path.join(gallery_dir, img) for img in os.listdir(gallery_dir)][:2]\n",
"\n",
"get_test_image_paths()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "99df13fd-bd5d-4964-9300-016fcf7625e6",
"metadata": {},
"outputs": [],
"source": [
"def get_test_audio_paths():\n",
" audio_path = \"temp/audio.mp3\"\n",
" audio_input = AudioInput(audio_path, 10, 10)\n",
" return audio_input\n",
"\n",
"get_test_audio_paths()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.9.13 ('stablepod-9sY-ATvg')",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
},
"vscode": {
"interpreter": {
"hash": "da5cbbacbb5b0f4f981824ef371d6caff76d7da138a6d755a2c960f48ddcd478"
}
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|