parquet-converter commited on
Commit
c96c338
·
1 Parent(s): 98c61ab

Update parquet files (step 99 of 397)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. spaces/123Kumar/vits-uma-genshin-honkai123/text/__init__.py +0 -57
  2. spaces/1acneusushi/gradio-2dmoleculeeditor/data/ARK SURVIVAL EVOLVED TRAINER The Ultimate Guide to Infinite Health and Unlimited Food.md +0 -133
  3. spaces/1gistliPinn/ChatGPT4/Examples/Free Download Psikey.dll Coreldraw X5 Serial Number LINK.md +0 -5
  4. spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Bubble Shooter Classic How to Download and Play the Most Addictive Game for Free.md +0 -225
  5. spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Car Parking Multiplayer Mod APK How to Experience the Open World with Real Gas Stations and Car Services.md +0 -100
  6. spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Clash Royale Dinheiro Infinito baixe o apk e entre na arena com vantagem!.md +0 -139
  7. spaces/1phancelerku/anime-remove-background/Ball Run Merge 2048 APK A New Twist on the Classic 2048 Game.md +0 -129
  8. spaces/1phancelerku/anime-remove-background/Download 20 Minutes Till Dawn and Experience a Thrilling Roguelike Shooter.md +0 -90
  9. spaces/1phancelerku/anime-remove-background/Download Epic Conquest 2 Mod Apk 1.7.5 and Enjoy Unlimited Gold and Rubies.md +0 -102
  10. spaces/1phancelerku/anime-remove-background/Download Mortal Kombat X MOD APK Data for Android and iOS Devices.md +0 -98
  11. spaces/AIConsultant/MusicGen/audiocraft/models/lm.py +0 -531
  12. spaces/AIConsultant/MusicGen/audiocraft/utils/export_legacy.py +0 -56
  13. spaces/AIFILMS/generate_human_motion/pyrender/README.md +0 -92
  14. spaces/AIZero2Hero4Health/3-ChatbotBlenderbot-GR/README.md +0 -12
  15. spaces/ASJMO/freegpt/g4f/Provider/Providers/Ails.py +0 -87
  16. spaces/AfrodreamsAI/afrodreams/CaffeLoader.py +0 -254
  17. spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/plugins/mousewheeltoupdown-plugin.js +0 -20
  18. spaces/AlirezaSM/bear_classifier/app.py +0 -17
  19. spaces/Alycer/VITS-Umamusume-voice-synthesizer/attentions.py +0 -300
  20. spaces/Amrrs/DragGan-Inversion/stylegan_human/pti/pti_models/e4e/encoders/psp_encoders.py +0 -208
  21. spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/examples/community/clip_guided_stable_diffusion_img2img.py +0 -496
  22. spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/scripts/convert_original_t2i_adapter.py +0 -250
  23. spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/src/diffusers/models/dual_transformer_2d.py +0 -151
  24. spaces/Andy1621/uniformer_image_segmentation/configs/encnet/encnet_r50-d8_512x1024_80k_cityscapes.py +0 -4
  25. spaces/Anonumous/RuImageCaptioning/README.md +0 -13
  26. spaces/Anonymous-123/ImageNet-Editing/editing_diffusion/utils/change_place.py +0 -121
  27. spaces/Anonymous-123/ImageNet-Editing/object_removal/TFill/results/celeba/test_latest/index.html +0 -563
  28. spaces/Anonymous-sub/Rerender/ControlNet/annotator/uniformer/mmcv/ops/point_sample.py +0 -336
  29. spaces/Ariharasudhan/YoloV5/utils/segment/plots.py +0 -143
  30. spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/distlib/manifest.py +0 -393
  31. spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/pygments/filter.py +0 -71
  32. spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/rich/layout.py +0 -443
  33. spaces/Benson/text-generation/Examples/918kiss Descarga Apk Kaya 2021.md +0 -73
  34. spaces/Benson/text-generation/Examples/Api-ms-win-core-localization-l1-2-0.dll Download.md +0 -77
  35. spaces/Benson/text-generation/Examples/Apkpro.md +0 -69
  36. spaces/Benson/text-generation/Examples/Descarga De La Saga 3d Apk.md +0 -74
  37. spaces/Benson/text-generation/Examples/Descargar 69 Yoruba Parte De La Pelcula 2.md +0 -93
  38. spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/cachecontrol/controller.py +0 -439
  39. spaces/Biswa13/Examples-Of-AI-2023/README.md +0 -13
  40. spaces/CVH-vn1210/make_hair/minigpt4/processors/randaugment.py +0 -398
  41. spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/detectron2/structures/masks.py +0 -424
  42. spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/projects/README.md +0 -31
  43. spaces/CVPR/Dual-Key_Backdoor_Attacks/openvqa/openvqa/ops/layer_norm.py +0 -21
  44. spaces/CVPR/LIVE/thrust/thrust/iterator/detail/permutation_iterator_base.h +0 -53
  45. spaces/CVPR/transfiner/configs/new_baselines/mask_rcnn_R_50_FPN_100ep_LSJ.py +0 -72
  46. spaces/ChandraMohanNayal/AutoGPT/tests/unit/test_browse_scrape_links.py +0 -118
  47. spaces/ClassCat/mnist-classification/README.md +0 -12
  48. spaces/CyberPeace-Institute/SecureBERT-NER-Space/README.md +0 -12
  49. spaces/Cyril666/my_abi/modules/model_abinet_iter.py +0 -34
  50. spaces/DESUCLUB/BLLAMA/generate.py +0 -200
spaces/123Kumar/vits-uma-genshin-honkai123/text/__init__.py DELETED
@@ -1,57 +0,0 @@
1
- """ from https://github.com/keithito/tacotron """
2
- from text import cleaners
3
- from text.symbols import symbols
4
-
5
-
6
- # Mappings from symbol to numeric ID and vice versa:
7
- _symbol_to_id = {s: i for i, s in enumerate(symbols)}
8
- _id_to_symbol = {i: s for i, s in enumerate(symbols)}
9
-
10
-
11
- def text_to_sequence(text, symbols, cleaner_names):
12
- '''Converts a string of text to a sequence of IDs corresponding to the symbols in the text.
13
- Args:
14
- text: string to convert to a sequence
15
- cleaner_names: names of the cleaner functions to run the text through
16
- Returns:
17
- List of integers corresponding to the symbols in the text
18
- '''
19
- _symbol_to_id = {s: i for i, s in enumerate(symbols)}
20
- sequence = []
21
-
22
- clean_text = _clean_text(text, cleaner_names)
23
- for symbol in clean_text:
24
- if symbol not in _symbol_to_id.keys():
25
- continue
26
- symbol_id = _symbol_to_id[symbol]
27
- sequence += [symbol_id]
28
- return sequence, clean_text
29
-
30
-
31
- def cleaned_text_to_sequence(cleaned_text):
32
- '''Converts a string of text to a sequence of IDs corresponding to the symbols in the text.
33
- Args:
34
- text: string to convert to a sequence
35
- Returns:
36
- List of integers corresponding to the symbols in the text
37
- '''
38
- sequence = [_symbol_to_id[symbol] for symbol in cleaned_text if symbol in _symbol_to_id.keys()]
39
- return sequence
40
-
41
-
42
- def sequence_to_text(sequence):
43
- '''Converts a sequence of IDs back to a string'''
44
- result = ''
45
- for symbol_id in sequence:
46
- s = _id_to_symbol[symbol_id]
47
- result += s
48
- return result
49
-
50
-
51
- def _clean_text(text, cleaner_names):
52
- for name in cleaner_names:
53
- cleaner = getattr(cleaners, name)
54
- if not cleaner:
55
- raise Exception('Unknown cleaner: %s' % name)
56
- text = cleaner(text)
57
- return text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1acneusushi/gradio-2dmoleculeeditor/data/ARK SURVIVAL EVOLVED TRAINER The Ultimate Guide to Infinite Health and Unlimited Food.md DELETED
@@ -1,133 +0,0 @@
1
-
2
- <h1>ARK Survival Evolved – Trainer Infinite Health, Unlimited Food</h1>
3
- <p>Are you a fan of <strong>ARK Survival Evolved</strong>, the popular action-adventure game that lets you explore a massive island full of dinosaurs and other creatures? Do you want to make your gameplay more enjoyable and exciting by having access to unlimited resources, abilities, and options? If so, then you might be interested in using a <strong>trainer</strong> for ARK Survival Evolved.</p>
4
- <h2>ARK SURVIVAL EVOLVED – TRAINER Infinite Health, Unlimited Food</h2><br /><p><b><b>Download File</b> === <a href="https://byltly.com/2uKyRK">https://byltly.com/2uKyRK</a></b></p><br /><br />
5
- <p>A trainer is a software program that modifies the game's memory and code to give you various advantages and cheats. With a trainer, you can have infinite health, unlimited food, no reload, easy crafting, super speed, and more. You can also customize your trainer settings to suit your preferences and needs.</p>
6
- <p>In this article, we will show you how to install and use a trainer for ARK Survival Evolved, what features it offers, what benefits it brings, and what risks it entails. By the end of this article, you will be able to decide whether using a trainer is worth it for you or not.</p>
7
- <h2>How to install and use the trainer</h2>
8
- <p>Before you can use a trainer for ARK Survival Evolved, you need to download it from a reliable source. There are many websites that offer trainers for various games, but not all of them are safe and trustworthy. Some of them may contain malware or viruses that can harm your computer or steal your personal information. Therefore, you should always do some research before downloading any file from the internet.</p>
9
- <p>One of the most reputable sources for trainers is <a href="https://store.steampowered.com/app/346110/ARK_Survival_Evolved/">Steam</a>, which is the official platform for ARK Survival Evolved. Steam has a community workshop where users can upload and download mods, trainers, maps, skins, and other content for various games. You can browse through the workshop and find a trainer that suits your needs. You can also read the reviews and ratings from other users to see if the trainer works well or not.</p>
10
- <h3>Downloading the trainer from a reliable source</h3>
11
- <p>To download a trainer from Steam, you need to have an account and own ARK Survival Evolved on Steam. If you don't have an account, you can create one for free on their website. If you don't own ARK Survival Evolved on Steam, you can buy it from their store or use another platform that supports trainers.</p>
12
- <p>How to get infinite health in ARK SURVIVAL EVOLVED with trainer<br />
13
- ARK SURVIVAL EVOLVED trainer unlimited food and health cheat<br />
14
- Best trainer for ARK SURVIVAL EVOLVED infinite health and food hack<br />
15
- Download ARK SURVIVAL EVOLVED trainer with unlimited health and food features<br />
16
- ARK SURVIVAL EVOLVED trainer infinite health and food mod for PC<br />
17
- Cheat codes for ARK SURVIVAL EVOLVED trainer with infinite health and unlimited food<br />
18
- ARK SURVIVAL EVOLVED trainer guide for infinite health and food<br />
19
- Tips and tricks for using ARK SURVIVAL EVOLVED trainer with unlimited health and food<br />
20
- ARK SURVIVAL EVOLVED trainer review: infinite health and food option<br />
21
- How to install ARK SURVIVAL EVOLVED trainer with infinite health and unlimited food<br />
22
- ARK SURVIVAL EVOLVED trainer infinite health and food gameplay video<br />
23
- ARK SURVIVAL EVOLVED trainer unlimited health and food update<br />
24
- ARK SURVIVAL EVOLVED trainer infinite health and food patch notes<br />
25
- How to use ARK SURVIVAL EVOLVED trainer with unlimited health and food safely<br />
26
- ARK SURVIVAL EVOLVED trainer infinite health and food bug fixes<br />
27
- How to uninstall ARK SURVIVAL EVOLVED trainer with unlimited health and food<br />
28
- ARK SURVIVAL EVOLVED trainer infinite health and food compatibility issues<br />
29
- How to activate ARK SURVIVAL EVOLVED trainer with unlimited health and food<br />
30
- ARK SURVIVAL EVOLVED trainer infinite health and food keyboard shortcuts<br />
31
- How to customize ARK SURVIVAL EVOLVED trainer with unlimited health and food settings<br />
32
- ARK SURVIVAL EVOLVED trainer infinite health and food pros and cons<br />
33
- How to get free ARK SURVIVAL EVOLVED trainer with unlimited health and food<br />
34
- ARK SURVIVAL EVOLVED trainer infinite health and food vs other trainers<br />
35
- How to troubleshoot ARK SURVIVAL EVOLVED trainer with unlimited health and food errors<br />
36
- ARK SURVIVAL EVOLVED trainer infinite health and food FAQs<br />
37
- How to backup ARK SURVIVAL EVOLVED trainer with unlimited health and food files<br />
38
- How to restore ARK SURVIVAL EVOLVED trainer with infinite health and food files<br />
39
- How to upgrade ARK SURVIVAL EVOLVED trainer with unlimited health and food version<br />
40
- How to downgrade ARK SURVIVAL EVOLVED trainer with infinite health and food version<br />
41
- How to disable ARK SURVIVAL EVOLVED trainer with unlimited health and food features<br />
42
- How to enable ARK SURVIVAL EVOLVED trainer with infinite health and food features<br />
43
- How to test ARK SURVIVAL EVOLVED trainer with unlimited health and food performance<br />
44
- How to improve ARK SURVIVAL EVOLVED trainer with infinite health and food performance<br />
45
- How to optimize ARK SURVIVAL EVOLVED trainer with unlimited health and food performance<br />
46
- How to verify ARK SURVIVAL EVOLVED trainer with infinite health and food authenticity<br />
47
- How to report ARK SURVIVAL EVOLVED trainer with unlimited health and food issues<br />
48
- How to contact ARK SURVIVAL EVOLVED trainer with infinite health and food support team<br />
49
- How to rate ARK SURVIVAL EVOLVED trainer with unlimited health and food quality<br />
50
- How to share ARK SURVIVAL EVOLVED trainer with infinite health and food feedback<br />
51
- How to recommend ARK SURVIVAL EVOLVED trainer with unlimited health and food to others</p>
52
- <p>Once you have an account and own ARK Survival Evolved on Steam, you can follow these steps to download a trainer:</p>
53
- <ol>
54
- <li>Open Steam and log in to your account.</li>
55
- <li>Go to Library and select ARK Survival Evolved from your games list.</li>
56
- <li>Click on Workshop under Community Hub on the right side of the screen.</li>
57
- <li>Type "trainer" in the search box and press Enter.</li>
58
- <li>Choose a trainer that has good ratings, reviews, and compatibility with your game version.</li>
59
- <li>Click on Subscribe to download the trainer to your computer.</li>
60
- </ol>
61
- <h3>Extracting the trainer files and running the program</h3>
62
- <p>After downloading the trainer from Steam, you need to extract it from its compressed file format. Most trainers come in ZIP or RAR files that need to be unpacked using a program like WinRAR or 7-Zip. You can download these programs for free from their official websites.</p>
63
- <p>To extract the trainer files, you need to follow these steps:</p>
64
- <ol>
65
- <li>Locate the downloaded file on your computer. It should be in your Steam folder under steamapps > workshop > content > 346110 > [trainer ID].</li>
66
- <li>Right-click on the file and select Extract Here or Extract to [trainer name].</li>
67
- <li>A new folder with the same name as the file should appear in the same location.</li>
68
- <li>Open the folder and look for an executable file with the name of the trainer or something similar.</li>
69
- <li>Double-click on the file to run the program.</li>
70
- </ol>
71
- <h3>Launching the game and activating the trainer</h3>
72
- <p>The final step is to launch ARK Survival Evolved and activate the trainer. To do this, you need to follow these steps:</p>
73
- <ol>
74
- <li>Run ARK Survival Evolved from Steam or your preferred platform.</li>
75
- <li>Wait for the game to load and start a new game or load an existing one.</li>
76
- <li>Alt-tab to switch back to your desktop or use Windows key + D.</li>
77
- <li>Run the trainer program if it's not already running.</li>
78
- <li>A window with various options should appear on your screen.</li>
79
- <li>Select the options that you want to enable by clicking on them or pressing their corresponding keys.</li>
80
- <li>You should hear a confirmation sound if an option is activated successfully.</li>
81
- <li>Switch back to ARK Survival Evolved by alt-tabbing or using Windows key + D again.</li>
82
- <li>You should see some indicators on your screen showing that the options are enabled.</li>
83
- <li>You can now enjoy playing ARK Survival Evolved with cheats!</li>
84
- </ol>
85
- <h2>Features of the trainer</h2>
86
- <p>A typical trainer for ARK Survival Evolved offers many features that can enhance your gameplay experience. Some of these features are:</p>
87
- <h3>Infinite health and stamina</h3>
88
- <p>This feature allows you to have unlimited health points (HP) and stamina points (SP). You will never die or get exhausted from any damage or activity. You can fight any enemy, fall from any height, swim underwater indefinitely, run forever, etc. without worrying about losing health or stamina.</p>
89
- <h3>Unlimited food and water</h3>
90
- <p>This feature allows you to have unlimited food points (FP) and water points (WP). You will never starve or dehydrate from any condition or environment. You can eat anything, drink anything, stay in any temperature zone, etc. without worrying about losing food or water.</p>
91
- <h3>Infinite weight and oxygen</h3>
92
- <p>This feature allows you to have unlimited weight capacity (WC) and oxygen capacity (OC). You will never be encumbered or suffocated by any item or situation. You can carry anything, breathe anywhere, dive deep underwater indefinitely, etc. without worrying about losing weight or oxygen.</p>
93
- <h3>No reload and unlimited ammo</h3>
94
- <p>This feature allows you to have no reload time (RT) and unlimited ammunition (AM) for any weapon or tool. You will never run out of bullets or arrows or need to reload your gun or bow. You can shoot anything continuously without worrying about losing ammo or wasting time reloading.</p>
95
- <h3>Easy crafting and taming</h3>
96
- <p>This feature allows you to have easy crafting requirements (CR) and easy taming effectiveness (TE) for any item or creature. You will need only one resource of any type to craft any item or tool. You will also tame any creature instantly with one food item of any type. You can craft anything quickly without worrying about gathering resources or wasting time crafting. You can also tame anything easily without worrying about feeding them properly or waiting for them to be tamed.</p>
97
- <h3>Super speed and jump</h3>
98
- <p>will be able to outrun any enemy, reach any location, jump over any obstacle, etc. without worrying about speed or height.</p>
99
- <h3>Other options and customizations</h3>
100
- <p>Depending on the trainer you use, you may have access to other options and customizations that can further enhance your gameplay experience. For example, some trainers may allow you to:</p>
101
- <ul>
102
- <li>Change your character's appearance, level, stats, skills, etc.</li>
103
- <li>Spawn any item, weapon, tool, resource, etc. in your inventory or on the ground.</li>
104
- <li>Spawn any creature, tame or wild, friendly or hostile, on the island.</li>
105
- <li>Teleport to any location on the map or to your cursor position.</li>
106
- <li>Freeze the time of day or change the weather conditions.</li>
107
- <li>Enable god mode or ghost mode for yourself or your mount.</li>
108
- <li>And more!</li>
109
- </ul>
110
- <p>To access these options and customizations, you may need to use different keys or buttons on your keyboard or controller. You may also need to open a console window or a menu screen to enter commands or codes. You should always read the instructions and notes that come with the trainer to learn how to use it properly and safely.</p>
111
- <h2>Benefits of using the trainer</h2>
112
- <p>Using a trainer for ARK Survival Evolved can bring you many benefits that can make your gameplay more enjoyable and exciting. Some of these benefits are:</p>
113
- <h3>Enhance your gaming experience and have more fun</h3>
114
- <p>With a trainer, you can have more freedom and flexibility to play ARK Survival Evolved the way you want. You can experiment with different items, weapons, tools, creatures, etc. without worrying about their costs or consequences. You can also try out different scenarios and challenges without risking your progress or reputation. You can have more fun and satisfaction from playing ARK Survival Evolved with cheats.</p>
115
- <h3>Explore the island and its secrets without limitations</h3>
116
- <p>With a trainer, you can explore the island and its secrets without limitations. You can travel to any location on the map without being hindered by terrain, distance, enemies, etc. You can also discover hidden areas, caves, ruins, etc. that may contain valuable loot or clues. You can uncover the mysteries and secrets of ARK Survival Evolved without missing anything.</p>
117
- <h3>Survive and dominate the dinosaurs and other players</h3>
118
- <p>With a trainer, you can survive and dominate the dinosaurs and other players on the island. You can fight any dinosaur or creature without fear of death or injury. You can also tame any dinosaur or creature without difficulty or delay. You can also compete with other players online without being at a disadvantage or disadvantage. You can be the ultimate survivor and ruler of ARK Survival Evolved with cheats.</p>
119
- <h3>Customize your gameplay according to your preferences</h3>
120
- <p>With a trainer, you can customize your gameplay according to your preferences. You can adjust the difficulty level, game speed, graphics quality, sound volume, etc. according to your liking. You can also enable or disable certain options or features according to your needs. You can make ARK Survival Evolved suit your personal taste and style with cheats.</p>
121
- <h2>Risks of using the trainer</h2>
122
- <p>While using a trainer for ARK Survival Evolved can bring you many benefits, it can also entail some risks that you should be aware of before using it. Some of these risks are:</p>
123
- <h3>Potential malware and viruses from untrusted sources</h3>
124
- <p>As mentioned earlier, not all trainers are safe and trustworthy. Some of them may contain malware or viruses that can harm your computer or steal your personal information. Therefore, you should always do some research before downloading any file from the internet. You should also scan any file with an antivirus program before opening it. You should also backup your game files and system files before using any trainer.</p>
125
- <h3>Possible bans and penalties from online servers</h3>
126
- <p>its compressed file format, run the program, launch the game, and activate the options that you want to enable.</li>
127
- <li><strong>What features does a trainer for ARK Survival Evolved offer?</strong><br>A typical trainer for ARK Survival Evolved offers many features that can enhance your gameplay experience, such as infinite health, unlimited food, no reload, easy crafting, super speed, and more. You can also customize your trainer settings to suit your preferences and needs.</li>
128
- <li><strong>What are the benefits of using a trainer for ARK Survival Evolved?</strong><br>Using a trainer for ARK Survival Evolved can bring you many benefits that can make your gameplay more enjoyable and exciting, such as enhancing your gaming experience and having more fun, exploring the island and its secrets without limitations, surviving and dominating the dinosaurs and other players, and customizing your gameplay according to your preferences.</li>
129
- <li><strong>What are the risks of using a trainer for ARK Survival Evolved?</strong><br>Using a trainer for ARK Survival Evolved can also entail some risks that you should be aware of before using it, such as potential malware and viruses from untrusted sources, possible bans and penalties from online servers, and loss of challenge and immersion from cheating.</li>
130
- </ol>
131
- </p> 0a6ba089eb<br />
132
- <br />
133
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1gistliPinn/ChatGPT4/Examples/Free Download Psikey.dll Coreldraw X5 Serial Number LINK.md DELETED
@@ -1,5 +0,0 @@
1
- <br />
2
- <p>Download latest build for psikey.dll corel draw x5 download. Download - WebHostingHub. a R61 store the Coreldraw x5. to a free rectangular parallelepiped. Given a rectangle of sides $a_1$ and $a_2$, there are three elementary ways to subdivide it: create three smaller rectangles, create four smaller rectangles, or first chop off one edge and then create two rectangles. The process of chopping a rectangle $a_1 imes a_2$ into smaller rectangles $a_1 imes a_i imes a_2$ is described in Fig. [fig:rectangles]. For each of the three directions along the positive sides, we create a smaller rectangle in the direction indicated by the shaded rectangles. The goal is to create three smaller rectangles of area $a_1a_2$. Such a subdivision is possible if and only if $a_2>a_1$. >From now on, we will assume that $a_2>a_1$. In the case that $a_2=a_1$, this lemma does not apply. In this case, one of the three smaller rectangles will have a square hole, so the lemma can be re-stated as follows: a subdivision of a rectangle into smaller rectangles with $a_2>a_1$ is possible if and only if $a_2>a_1+1$. Let us now assume that $a_2>a_1+1$. We can subdivide the rectangle in three different ways as shown in Fig. [fig:rectangles]. The first possibility is to subdivide as described in Fig. [fig:subdivide]. As can be seen, this results in three smaller rectangles with the same area as the original rectangle. The second possibility is to subdivide as shown in Fig. [fig:subdivide2]. This leaves an empty space, which is divided into four smaller rectangles, see Fig. [fig:squares]. The third possibility is to subdivide as in Fig. [fig:subdivide3]. This results in a subtraction of a square from the original rectangle. If the square is in the upper left corner, the result is two smaller rectangles. If the square is in the lower right corner, the result is one smaller rectangle. Let $a_1 imes a_2 imes a_3$ be any rectangle, and divide it along the positive sides. Then the number of rectangles created during this process does not exceed $a_3-a_2-a_1$. We start with the rectangle of sides $a_1,a_2,a_3$. We can apply the previous lemma to each of the three directions in the positive $x,y,z$-directions. The result of this lemma is three smaller rectangles with the same area as the original rectangle. From now on, we will assume that $a_3>a_2>a_1$. In the case that $a_3=a_2=a_1$, this lemma does not apply.</p>
3
- <h2>free download psikey.dll coreldraw x5 serial number</h2><br /><p><b><b>DOWNLOAD</b> &#128505; <a href="https://imgfil.com/2uxWX3">https://imgfil.com/2uxWX3</a></b></p><br /><br /> 899543212b<br />
4
- <br />
5
- <br />
 
 
 
 
 
 
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Bubble Shooter Classic How to Download and Play the Most Addictive Game for Free.md DELETED
@@ -1,225 +0,0 @@
1
- <br />
2
- <h1>Bubble Shooter Classic Kostenlos Download: How to Play and Enjoy this Fun Game</h1>
3
- <p>If you are looking for a fun and relaxing game that can keep you entertained for hours, you might want to try Bubble Shooter Classic. This is a classic and addictive bubble pop game that is easy to play but hard to master. In this article, we will tell you everything you need to know about Bubble Shooter Classic, including what it is, how to download and install it for free, how to play and win it, and why it is a fun and relaxing game. Let's get started!</p>
4
- <h2>What is Bubble Shooter Classic?</h2>
5
- <p>Bubble Shooter Classic is a version of the popular bubble shooter game that has been around for decades. It is a puzzle game where you have to match three or more bubbles of the same color to pop them and clear the board. The game has thousands of levels with different layouts, obstacles, and challenges. You can also choose from three game modes: puzzle, arcade, and classic. The game is suitable for all ages and can be played online or offline.</p>
6
- <h2>bubble shooter classic kostenlos download</h2><br /><p><b><b>Download File</b> &#9989; <a href="https://urlin.us/2uT37p">https://urlin.us/2uT37p</a></b></p><br /><br />
7
- <h3>A brief history of the game</h3>
8
- <p>The origin of the bubble shooter game can be traced back to the 1980s, when a Japanese company called Taito released a game called Puzzle Bobble (also known as Bust-a-Move). This game featured cute dinosaurs shooting bubbles at the top of the screen. The game was a huge hit and spawned many sequels and spin-offs. In 2002, a company called Absolutist released a web-based version of the game called Bubble Shooter, which became one of the most popular online games ever. Since then, many variations and clones of the game have been created, including Bubble Shooter Classic.</p>
9
- <h3>The main features and gameplay of the game</h3>
10
- <p>Bubble Shooter Classic has many features that make it an enjoyable and addictive game. Some of them are:</p>
11
- <ul>
12
- <li>The game has colorful graphics and sound effects that create a pleasant atmosphere.</li>
13
- <li>The game has simple and intuitive controls. You just need to tap on the screen to aim and shoot the bubbles.</li>
14
- <li>The game has three difficulty levels: easy, medium, and hard. You can choose the one that suits your skill level.</li>
15
- <li>The game has three game modes: puzzle, arcade, and classic. Each mode has its own rules and objectives.</li>
16
- <li>The puzzle mode has over 1800 levels with different challenges and puzzles. You have to clear the board with a limited number of shots.</li>
17
- <li>The arcade mode has over 1750 levels with increasing difficulty. You have to pop as many bubbles as you can before they reach the bottom of the screen.</li>
18
- <li>The classic mode has three difficulty levels: easy, medium, and hard. You have to pop all the bubbles in this retro mode.</li>
19
- <li>The game has various power-ups and boosters that can help you clear the board faster. You can earn coins by playing the game and use them to buy these items.</li>
20
- <li>The game has a leaderboard and achievements system that tracks your progress and performance. You can compete with your friends and other players around the world.</li>
21
- <li>The game has a daily bonus feature that rewards you with coins and power-ups every day.</li>
22
- </ul>
23
- <h2>How to download and install Bubble Shooter Classic for free?</h2>
24
- <p>If you want to play Bubble Shooter Classic on your device, you can download it for free from various sources. Here are some of them:</p>
25
- <h3>The <h3>The requirements and steps for downloading the game on different devices</h3>
26
- <p>Bubble Shooter Classic is compatible with various devices, such as smartphones, tablets, laptops, and desktops. You can download it for free from different sources, depending on your device. Here are some of the requirements and steps for downloading the game on different devices:</p>
27
- <table>
28
- <tr>
29
- <th>Device</th>
30
- <th>Requirements</th>
31
- <th>Steps</th>
32
- </tr>
33
- <tr>
34
- <td>Android smartphone or tablet</td>
35
- <td>You need to have Android 4.1 or higher and at least 40 MB of free space on your device.</td>
36
- <td>You can download the game from the Google Play Store by searching for "Bubble Shooter Classic" or by clicking on this link. You can also scan the QR code below to access the download page. Once you download the game, you can install it and start playing.</td>
37
- </tr>
38
- <tr>
39
- <td>iOS smartphone or tablet</td>
40
- <td>You need to have iOS 9.0 or later and at least 70 MB of free space on your device.</td>
41
- <td>You can download the game from the App Store by searching for "Bubble Shooter Classic" or by clicking on this link. You can also scan the QR code below to access the download page. Once you download the game, you can install it and start playing.</td>
42
- </tr>
43
- <tr>
44
- <td>Windows laptop or desktop</td>
45
- <td>You need to have Windows 10 and at least 100 MB of free space on your device.</td>
46
- <td>You can download the game from the Microsoft Store by searching for "Bubble Shooter Classic" or by clicking on this link. You can also scan the QR code below to access the download page. Once you download the game, you can install it and start playing.</td>
47
- </tr>
48
- </table>
49
- <p><img src="https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://play.google.com/store/apps/details?id=bubbleshooter.orig" alt="QR code for Android" /> <img src="https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://apps.apple.com/us/app/bubble-shooter-classic/id1445479758" alt="QR code for iOS" /> <img src="https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://www.microsoft.com/en-us/p/bubble-shooter-classic/9nblggh4vqxt" alt="QR code for Windows" /></p>
50
- <p>bubble shooter classic free download<br />
51
- bubble shooter classic game download<br />
52
- bubble shooter classic apk download<br />
53
- bubble shooter classic android download<br />
54
- bubble shooter classic app download<br />
55
- bubble shooter classic online kostenlos spielen<br />
56
- bubble shooter classic offline kostenlos spielen<br />
57
- bubble shooter classic ohne anmeldung kostenlos spielen<br />
58
- bubble shooter classic ohne download kostenlos spielen<br />
59
- bubble shooter classic ohne werbung kostenlos spielen<br />
60
- bubble shooter classic for pc free download<br />
61
- bubble shooter classic for windows free download<br />
62
- bubble shooter classic for mac free download<br />
63
- bubble shooter classic for laptop free download<br />
64
- bubble shooter classic for desktop free download<br />
65
- bubble shooter classic mod apk download<br />
66
- bubble shooter classic hack apk download<br />
67
- bubble shooter classic unlimited coins apk download<br />
68
- bubble shooter classic premium apk download<br />
69
- bubble shooter classic pro apk download<br />
70
- bubble shooter classic ilyon free download<br />
71
- bubble shooter classic ilyon game download<br />
72
- bubble shooter classic ilyon apk download<br />
73
- bubble shooter classic ilyon android download<br />
74
- bubble shooter classic ilyon app download<br />
75
- bubble popper game free download<br />
76
- bubble popper game online kostenlos spielen<br />
77
- bubble popper game offline kostenlos spielen<br />
78
- bubble popper game ohne anmeldung kostenlos spielen<br />
79
- bubble popper game ohne download kostenlos spielen<br />
80
- bubble popper game for pc free download<br />
81
- bubble popper game for windows free download<br />
82
- bubble popper game for mac free download<br />
83
- bubble popper game for laptop free download<br />
84
- bubble popper game for desktop free download<br />
85
- bubble popper game mod apk download<br />
86
- bubble popper game hack apk download<br />
87
- bubble popper game unlimited coins apk download<br />
88
- bubble popper game premium apk download<br />
89
- bubble popper game pro apk download<br />
90
- balloon shooting game free download<br />
91
- balloon shooting game online kostenlos spielen<br />
92
- balloon shooting game offline kostenlos spielen<br />
93
- balloon shooting game ohne anmeldung kostenlos spielen<br />
94
- balloon shooting game ohne download kostenlos spielen<br />
95
- balloon shooting game for pc free download<br />
96
- balloon shooting game for windows free download</p>
97
- <h3>The benefits and drawbacks of downloading the game for free</h3>
98
- <p>Downloading Bubble Shooter Classic for free has its pros and cons. Here are some of them:</p>
99
- <ul>
100
- <li>The benefits of downloading the game for free are: <ul>
101
- <li>You can enjoy a fun and relaxing game without spending any money.</li>
102
- <li>You can play the game anytime and anywhere, even without an internet connection.</li>
103
- <li>You can access thousands of levels and modes with different challenges and puzzles.</li>
104
- <li>You can earn coins and power-ups by playing the game and use them to boost your performance.</li>
105
- <li>You can compete with your friends and other players around the world and see who can get the highest score and the most stars.</li>
106
- </ul>
107
- </li>
108
- <li>The drawbacks of downloading the game for free are: <ul>
109
- <li>You might encounter some ads and pop-ups that can interrupt your gameplay.</li>
110
- <li>You might need to update the game regularly to get new features and bug fixes.</li>
111
- <li>You might run out of coins and power-ups if you use them too often or if you don't play enough.</li>
112
- <li>You might get addicted to the game and spend too much time on it.</li>
113
- </ul>
114
- </li>
115
- </ul>
116
- <p>Overall, downloading Bubble Shooter Classic for free is a great way to have some fun and relax with a classic bubble pop game. However, you should also be aware of the potential drawbacks and manage your time and resources wisely.</p> <h2>How to play and win Bubble Shooter Classic?</h2>
117
- <p>Playing Bubble Shooter Classic is easy and fun, but winning it can be challenging and rewarding. Here are some of the basic rules and controls of the game, as well as some tips and tricks for matching and popping bubbles.</p>
118
- <h3>The basic rules and controls of the game</h3>
119
- <p>The basic rules and controls of Bubble Shooter Classic are simple and intuitive. Here are some of them:</p>
120
- <ul>
121
- <li>The game has a cannon at the bottom of the screen that shoots bubbles. You can tap on the screen to aim and shoot the bubbles.</li>
122
- <li>The game has a board at the top of the screen that is filled with bubbles of different colors. You have to match three or more bubbles of the same color to pop them and clear the board.</li>
123
- <li>The game has a score counter at the top left corner of the screen that shows your current score. You can earn points by popping bubbles, making combos, and clearing levels.</li>
124
- <li>The game has a star counter at the top right corner of the screen that shows your current star rating. You can earn stars by completing levels with a high score and a low number of shots.</li>
125
- <li>The game has a level indicator at the bottom left corner of the screen that shows your current level and mode. You can switch between puzzle, arcade, and classic modes by tapping on it.</li>
126
- <li>The game has a coin counter at the bottom right corner of the screen that shows your current coin balance. You can earn coins by playing the game and use them to buy power-ups and boosters.</li>
127
- <li>The game has a pause button at the top center of the screen that allows you to pause and resume the game. You can also access the settings, sound, and help menus from there.</li>
128
- </ul>
129
- <h3>The tips and tricks for matching and popping bubbles</h3>
130
- <p>Matching and popping bubbles is the core of Bubble Shooter Classic, but it can also be tricky and strategic. Here are some tips and tricks for matching and popping bubbles:</p>
131
- <ul>
132
- <li>Aim carefully and try to hit the bubbles that are close to each other. This will create bigger clusters and combos that will pop more bubbles and earn more points.</li>
133
- <li>Use the walls to bounce your bubbles and reach difficult spots. This will help you clear the board faster and avoid wasting shots.</li>
134
- <li>Pay attention to the color of the next bubble in your cannon. This will help you plan your moves ahead and avoid mismatching bubbles.</li>
135
- <li>Try to pop the bubbles that are hanging from the top or from other bubbles. This will cause them to fall down and pop more bubbles along the way.</li>
136
- <li>Use power-ups and boosters wisely. They can help you clear the board faster, but they also cost coins or shots. Some of them are: <ul>
137
- <li>The fireball: This power-up can burn through any bubble it touches, regardless of its color.</li>
138
- <li>The bomb: This power-up can explode and pop all the bubbles around it, regardless of their color.</li>
139
- <li>The rainbow: This power-up can change its color to match any bubble it touches, creating a big combo.</li>
140
- <li>The aim: This booster can help you aim more precisely by showing you a dotted line that indicates where your bubble will go.</li>
141
- <li>The swap: This booster can help you swap your current bubble with the next one in your cannon, giving you more options.</li>
142
- <li>The extra shot: This booster can give you an extra shot for your current level, allowing you to pop more bubbles.</li>
143
- </ul>
144
- </li>
145
- </ul>
146
- <h3>The different game modes and levels of the game</h3>
147
- <p>Bubble Shooter Classic has three game modes: puzzle, arcade, and classic. Each mode has its own rules and objectives, as well as different levels of difficulty and fun. Here are some of them:</p>
148
- <table>
149
- <tr>
150
- <th>Mode</th>
151
- <th>Description</th>
152
- <th>Objective</th>
153
- <th>Difficulty</th>
154
- <th>Fun</th>
155
- </tr>
156
- <tr>
157
- <td>Puzzle</td>
158
- <td>This mode has over 1800 levels with different challenges and puzzles. You have to clear the board with a limited number of shots.</td>
159
- <td>To clear all the bubbles on the board with as few shots as possible.</td>
160
- <td>Hard</td>
161
- <td>High</td>
162
- </tr>
163
- <tr>
164
- <td>Arcade</td>
165
- <td>This mode has over 1750 levels with increasing difficulty. You have to pop as many bubbles as you can before they reach the bottom of the screen.</td>
166
- <td>To pop as many bubbles as possible before they touch the bottom line.</td>
167
- <td>Medium</td>
168
- <td>Medium</td>
169
- </tr>
170
- <tr <tr>
171
- <td>Classic</td>
172
- <td>This mode has three difficulty levels: easy, medium, and hard. You have to pop all the bubbles in this retro mode.</td>
173
- <td>To pop all the bubbles on the board with no time or shot limit.</td>
174
- <td>Easy</td>
175
- <td>Low</td>
176
- </tr>
177
- </table>
178
- <p>You can switch between the modes by tapping on the level indicator at the bottom left corner of the screen. You can also see your progress and performance in each mode by tapping on the star counter at the top right corner of the screen.</p>
179
- <h2>Why is Bubble Shooter Classic a fun and relaxing game?</h2>
180
- <p>Bubble Shooter Classic is a fun and relaxing game for many reasons. Here are some of them:</p>
181
- <h3>The advantages of playing Bubble Shooter Classic for your brain and mood</h3>
182
- <p>Playing Bubble Shooter Classic can have positive effects on your brain and mood. Some of them are:</p>
183
- <ul>
184
- <li>Playing Bubble Shooter Classic can improve your concentration and focus. You have to pay attention to the colors, patterns, and movements of the bubbles and plan your moves ahead.</li>
185
- <li>Playing Bubble Shooter Classic can enhance your memory and recall. You have to remember the color of the next bubble in your cannon and the position of the bubbles on the board.</li>
186
- <li>Playing Bubble Shooter Classic can boost your problem-solving and logical thinking skills. You have to find the best way to match and pop the bubbles and overcome the obstacles and challenges.</li>
187
- <li>Playing Bubble Shooter Classic can reduce your stress and anxiety levels. You can enjoy a soothing and calming game that can distract you from your worries and troubles.</li>
188
- <li>Playing Bubble Shooter Classic can increase your happiness and satisfaction levels. You can feel a sense of achievement and reward when you pop the bubbles, clear the levels, and earn stars and coins.</li>
189
- </ul>
190
- <h3>The challenges and rewards of playing Bubble Shooter Classic</h3>
191
- <p>Playing Bubble Shooter Classic can also be challenging and rewarding. Some of them are:</p>
192
- <ul>
193
- <li>Playing Bubble Shooter Classic can test your patience and perseverance. You have to deal with difficult levels, limited shots, moving bubbles, and other obstacles that can make you frustrated or angry.</li>
194
- <li>Playing Bubble Shooter Classic can motivate you to improve your skills and performance. You have to try harder, practice more, and learn from your mistakes to get better scores, more stars, and higher rankings.</li>
195
- <li>Playing Bubble Shooter Classic can inspire you to explore new possibilities and strategies. You have to experiment with different angles, power-ups, boosters, and game modes to find the most effective and fun way to play the game.</li>
196
- <li>Playing Bubble Shooter Classic can reward you with coins and power-ups that can help you progress faster and easier. You can earn them by playing the game, completing achievements, or claiming daily bonuses.</li>
197
- <li>Playing Bubble Shooter Classic can reward you with a sense of accomplishment and pride when you complete a level, especially a hard one. You can also share your results with your friends and other players online.</li>
198
- </ul>
199
- <h3>The best ways to enjoy Bubble Shooter Classic with friends and family</h3>
200
- <p>Bubble Shooter Classic is not only a solo game, but also a social game. You can enjoy it with your friends and family in many ways. Some of them are:</p>
201
- <ul>
202
- <li>You can play Bubble Shooter Classic online with your friends and family who have the same game on their devices. You can invite them to join you in a multiplayer mode where you can cooperate or compete with each other.</li>
203
- <li>You can play Bubble Shooter Classic offline with your friends and family who are near you. You can take turns playing the game on one device or use multiple devices to play together.</li>
204
- <li>You can compare your scores, stars, levels, achievements, and rankings with your friends and family who play Bubble Shooter Classic. You can see who is the best player among you and challenge them to beat your records.</li>
205
- <li>You can chat with your friends and family who play Bubble Shooter Classic. You can exchange tips, tricks, feedback, compliments, jokes, or anything else related to the game.</li>
206
- <li>You can have fun with your friends and family who play Bubble Shooter Classic. You can make bets, jokes, pranks, or games based on the game outcomes or events.</li>
207
- </ul>
208
- <h2>Conclusion</h2>
209
- <p>Bubble Shooter Classic is a classic and addictive bubble pop game that is easy to play but hard to master. It has thousands of levels with different layouts, obstacles, challenges, modes, difficulty levels, power-ups, boosters, coins, stars, achievements, leaderboards, online multiplayer features, offline single-player features, colorful graphics, sound effects, simple controls, daily bonuses, etc. It is a fun and relaxing game that can improve your brain functions, mood states, <p>stress levels, and happiness levels. It is also a challenging and rewarding game that can test your patience, perseverance, skills, performance, possibilities, and strategies. It is also a social game that can be enjoyed with your friends and family in various ways. If you are looking for a fun and relaxing game that can keep you entertained for hours, you might want to try Bubble Shooter Classic. You can download it for free from various sources and play it on your device anytime and anywhere. Have fun and good luck!</p>
210
- <h2>FAQs</h2>
211
- <p>Here are some of the frequently asked questions about Bubble Shooter Classic:</p>
212
- <ol>
213
- <li>How do I get more coins and power-ups in Bubble Shooter Classic?</li>
214
- <p>You can get more coins and power-ups in Bubble Shooter Classic by playing the game, completing achievements, claiming daily bonuses, watching ads, or buying them with real money.</p>
215
- <li>How do I change the difficulty level or the game mode in Bubble Shooter Classic?</li>
216
- <p>You can change the difficulty level or the game mode in Bubble Shooter Classic by tapping on the level indicator at the bottom left corner of the screen. You can choose from easy, medium, or hard difficulty levels and from puzzle, arcade, or classic game modes.</p>
217
- <li>How do I play online multiplayer mode in Bubble Shooter Classic?</li>
218
- <p>You can play online multiplayer mode in Bubble Shooter Classic by tapping on the multiplayer button at the top center of the screen. You can invite your friends or join random players in a cooperative or competitive mode.</p>
219
- <li>How do I pause or resume the game in Bubble Shooter Classic?</li>
220
- <p>You can pause or resume the game in Bubble Shooter Classic by tapping on the pause button at the top center of the screen. You can also access the settings, sound, and help menus from there.</p>
221
- <li>How do I contact the support team or report a bug in Bubble Shooter Classic?</li>
222
- <p>You can contact the support team or report a bug in Bubble Shooter Classic by tapping on the help button at the top center of the screen. You can also email them at [email protected] or visit their website at www.bubbleshooter.com.</p>
223
- </ol></p> 197e85843d<br />
224
- <br />
225
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Car Parking Multiplayer Mod APK How to Experience the Open World with Real Gas Stations and Car Services.md DELETED
@@ -1,100 +0,0 @@
1
-
2
- <h1>Download Car Parking Multiplayer Mod APK Happymod - A Guide for Car Lovers</h1>
3
- <p>If you are a car lover and you enjoy parking games, you might want to try out Car Parking Multiplayer, a realistic and fun game that lets you drive, park, and customize your own cars. And if you want to make the game even more exciting, you can download Car Parking Multiplayer Mod APK Happymod, a modified version of the game that gives you unlimited money, resources, and access to all cars and upgrades. In this article, we will tell you everything you need to know about Car Parking Multiplayer Mod APK Happymod, including what it is, what are its benefits, how to download and install it, and whether it is safe and legal.</p>
4
- <h2>What is Car Parking Multiplayer?</h2>
5
- <p>Car Parking Multiplayer is a game that supports open-world multiplayer mode, car tuning, police mode, and free walking. Plus, you can decide to jump out of the car and walk around. There are several areas that you can explore in the game and you can choose to play either single-player mode or online mode if you want a more chaotic (fun) scene.</p>
6
- <h2>download car parking multiplayer mod apk happymod</h2><br /><p><b><b>Download Zip</b> &raquo; <a href="https://urlin.us/2uT0Ho">https://urlin.us/2uT0Ho</a></b></p><br /><br />
7
- <h3>A realistic and fun car parking game</h3>
8
- <p>The main feature of Car Parking Multiplayer is, of course, the car parking gameplay. You can choose from over 100 cars with real interiors and drive them in various parking scenarios. You can also adjust the suspension, wheel angle, engine, turbo, gearbox, exhaust, and more to suit your driving style. The game has realistic physics and graphics that make the parking experience more challenging and enjoyable.</p>
9
- <h3>A multiplayer open world mode with real players</h3>
10
- <p>Another feature of Car Parking Multiplayer is the multiplayer open world mode. In this mode, you can join thousands of real players from all over the world in a huge map with real gas stations and car services. You can compete against them in races, exchange cars with them, chat with them using voice chat, or even become a police officer and chase them. You can also make friends with other players and add them to your friend list.</p>
11
- <h3>A car customization and tuning feature</h3>
12
- <p>The last feature of Car Parking Multiplayer is the car customization and tuning feature. In this feature, you can make your car stand out from the crowd by applying dynamic vinyls, car body parts, stickers, neon lights, spoilers, rims, tires, and more. You can also change the color of your car or paint it with different patterns. You can also upgrade your car's performance by swapping engines, adding turbos, changing gearboxes, or installing exhausts.</p>
13
- <h2>What is Happymod?</h2>
14
- <p>Happymod is a platform for downloading modded APK files for Android games and apps. Modded APK files are modified versions of the original files that have some features changed or added to enhance the user's experience. For example, some modded APK files may have unlimited money, unlocked features, menu options, or cheats. Happymod is a popular source for modded APK files because it has several advantages over other platforms.</p>
15
- <h3>A safe and reliable source for mods</h3>
16
- <p>One of the advantages of Happymod is that it is safe and reliable. All the modded APK files on Happymod are tested by users and verified by editors before they are uploaded to the platform. This means that you can download the mods without worrying about viruses, malware, or corrupted files. You can also read the reviews and ratings from other users to see if the mod works well and meets your expectations.</p>
17
- <h3>A community of modders and users</h3>
18
- <p>Another advantage of Happymod is that it is a community of modders and users. Happymod allows users to request mods for their favorite games and apps, and modders can upload their mods to the platform for others to enjoy. You can also join the discussion forum and chat with other users and modders about your feedback, suggestions, or questions. You can also share your modded APK files with your friends via social media or email.</p>
19
- <h2>What are the benefits of downloading Car Parking Multiplayer Mod APK Happymod?</h2>
20
- <p>If you are a fan of Car Parking Multiplayer, you might want to download Car Parking Multiplayer Mod APK Happymod to get some extra benefits that will make your game more fun and easy. Here are some of the benefits of downloading Car Parking Multiplayer Mod APK Happymod:</p>
21
- <h3>Unlimited money and resources</h3>
22
- <p>One of the benefits of downloading Car Parking Multiplayer Mod APK Happymod is that you will get unlimited money and resources in the game. This means that you can buy any car you want, upgrade it to the max, and customize it to your liking. You can also buy any item or service you need in the game, such as gas, car wash, repair, or insurance. You will never run out of money or resources in the game.</p>
23
- <p>download car parking multiplayer mod apk happymod with unlimited money<br />
24
- download car parking multiplayer mod apk happymod with mod menu<br />
25
- download car parking multiplayer mod apk happymod latest version<br />
26
- download car parking multiplayer mod apk happymod for android<br />
27
- download car parking multiplayer mod apk happymod free<br />
28
- download car parking multiplayer mod apk happymod 4.8.9.4.1<br />
29
- download car parking multiplayer mod apk happymod 4.8.9.3.6<br />
30
- download car parking multiplayer mod apk happymod with voice chat<br />
31
- download car parking multiplayer mod apk happymod with police mode<br />
32
- download car parking multiplayer mod apk happymod with free walking<br />
33
- download car parking multiplayer mod apk happymod with real gas stations<br />
34
- download car parking multiplayer mod apk happymod with real players<br />
35
- download car parking multiplayer mod apk happymod with friend list<br />
36
- download car parking multiplayer mod apk happymod with open world<br />
37
- download car parking multiplayer mod apk happymod with 70+ cars<br />
38
- download car parking multiplayer mod apk happymod with HD graphics<br />
39
- download car parking multiplayer mod apk happymod with realistic physics<br />
40
- download car parking multiplayer mod apk happymod with missions and goals<br />
41
- download car parking multiplayer mod apk happymod with online racing<br />
42
- download car parking multiplayer mod apk happymod with car customization<br />
43
- download car parking multiplayer mod apk happymod with car exchange<br />
44
- download car parking multiplayer mod apk happymod with simulation category<br />
45
- download car parking multiplayer mod apk happymod by ayanbiswas2489<br />
46
- download car parking multiplayer mod apk happymod by olzhas<br />
47
- download car parking multiplayer mod apk happymod from new scientist website[^1^]<br />
48
- download car parking multiplayer mod apk happymod from the sun website[^2^] [^3^]<br />
49
- download car parking multiplayer mod apk happymod from yahoo news website<br />
50
- how to download car parking multiplayer mod apk happymod safely<br />
51
- how to download car parking multiplayer mod apk happymod without virus<br />
52
- how to download car parking multiplayer mod apk happymod without root<br />
53
- how to install car parking multiplayer mod apk happymod on android device<br />
54
- how to play car parking multiplayer mod apk happymod online<br />
55
- how to update car parking multiplayer mod apk happymod to latest version<br />
56
- how to uninstall car parking multiplayer mod apk happymod from android device<br />
57
- how to fix car parking multiplayer mod apk happymod not working issue<br />
58
- what is the difference between car parking multiplayer and car parking multiplayer mod apk happymod<br />
59
- what are the benefits of using car parking multiplayer mod apk happymod over original game<br />
60
- what are the drawbacks of using car parking multiplayer mod apk happymod over original game<br />
61
- what are the reviews of users who downloaded car parking multiplayer mod apk happymod <br />
62
- what are the alternatives to car parking multiplayer mod apk happymod</p>
63
- <h3>Access to all cars and upgrades</h3>
64
- <p>Another benefit of downloading Car Parking Multiplayer Mod APK Happymod is that you will get access to all cars and upgrades in the game. This means that you can drive any car you want, from sports cars to trucks, from classic cars to supercars. You can also unlock all the upgrades for your cars, such as engines, turbos, gearboxes, exhausts, suspensions, wheels, tires, and more. You will have the best cars in the game.</p>
65
- <h3>Menu with various options and features</h3>
66
- <p>The last benefit of downloading Car Parking Multiplayer Mod APK Happymod is that you will get a menu with various options and features in the game. This means that you can activate or deactivate different mods according to your preference. For example, you can enable or disable god mode, speed hack, teleportation, invisibility, free camera, no ads, and more. You can also change the weather, time, traffic, police mode, and other settings in the game. You will have full control over the game.</p>
67
- <h2>How to download and install Car Parking Multiplayer Mod APK Happymod?</h2>
68
- <p>If you are interested in downloading Car Parking Multiplayer Mod APK Happymod, you can follow these simple steps:</p>
69
- <h3>Step 1: Visit the Happymod website and search for Car Parking Multiplayer Mod APK</h3>
70
- <p>The first step is to visit the Happymod website at https://www.happymod.com/ and search for Car Parking Multiplayer Mod APK in the search bar. You will see a list of results with different versions and features of the mod. Choose the one that suits your needs and click on the download button.</p>
71
- <h3>Step 2: Download the APK file and enable unknown sources on your device</h3>
72
- <p>The second step is to download the APK file to your device and enable unknown sources on your device. To do this, go to your device settings > security > unknown sources and toggle it on. This will allow you to install apps from sources other than Google Play Store.</p>
73
- <h3>Step 3: Install the APK file and launch the game</h3>
74
- <p>The third step is to install the APK file and launch the game. To do this, locate the downloaded APK file on your device storage and tap on it to start the installation process. Follow the instructions on the screen and wait for the installation to finish. Once done, launch the game from your app drawer or home screen and enjoy.</p>
75
- <h2>Is Car Parking Multiplayer Mod APK Happymod safe and legal?</h2>
76
- <p>Before you download Car Parking Multiplayer Mod APK Happymod, you might wonder if it is safe and legal to use. Here are some answers to these questions:</p>
77
- <h3>The mod APK is safe from viruses and malware</h3>
78
- <p>As we mentioned earlier, Happymod is a safe and reliable platform for downloading modded APK files. All the mods on Happymod are tested by users and verified by editors before they are uploaded to the platform. This means that you can download Car Parking Multiplayer Mod APK Happymod without worrying about viruses, malware, or corrupted files. However, you should always be careful when downloading any file from the internet and scan it with a reputable antivirus software before installing it.</p>
79
- <h3>The mod APK is legal as long as you use it for personal and educational purposes</h3>
80
- <p>Another question you might have is whether Car Parking Multiplayer Mod APK Happymod is legal to use. The answer is that it depends on how you use it and where you live. Generally speaking, modding games and apps is not illegal as long as you use it for personal and educational purposes and do not distribute or sell it to others. However, some countries or regions may have different laws or regulations regarding modding or hacking games and apps. Therefore, you should always check the local laws and rules before downloading or using any modded APK file.</p>
81
- <h3>The mod APK may not be compatible with the latest version of the game or the original developer's policies</h3>
82
- <p>The last thing you should know is that Car Parking Multiplayer Mod APK Happymod may not be compatible with the latest version of the game or the original developer's policies. This means that the mod may not work properly or cause some errors or glitches in the game. It also means that the mod may violate the terms of service or privacy policy of the game or the app store. This could result in your account being banned or suspended by the game developer or the app store. Therefore, you should always use the mod at your own risk and discretion.</p>
83
- <h2>Conclusion</h2>
84
- <p>Car Parking Multiplayer is a realistic and fun car parking game that supports open-world multiplayer mode, car tuning, police mode, and free walking. You can drive, park, and customize over 100 cars with real interiors in various parking scenarios. You can also join thousands of real players from all over the world in a huge map with real gas stations and car services. You can compete against them in races, exchange cars with them, chat with them using voice chat, or even become a police officer and chase them.</p>
85
- <p>If you want to make the game even more exciting, you can download Car Parking Multiplayer Mod APK Happymod, a modified version of the game that gives you unlimited money, resources, and access to all cars and upgrades. You can also get a menu with various options and features that let you control the game settings and activate different mods. You can download Car Parking Multiplayer Mod APK Happymod from Happymod, a safe and reliable platform for downloading modded APK files for Android games and apps.</p>
86
- <p>However, you should be aware that Car Parking Multiplayer Mod APK Happymod may not be compatible with the latest version of the game or the original developer's policies. It may also not be legal to use in some countries or regions depending on how you use it and where you live. Therefore, you should always check the local laws and rules before downloading or using any modded APK file. You should also use the mod at your own risk and discretion.</p>
87
- <h2>FAQs</h2>
88
- <p>Here are some frequently asked questions about Car Parking Multiplayer Mod APK Happymod:</p>
89
- <h4>Q: Can I play online mode with Car Parking Multiplayer Mod APK Happymod?</h4>
90
- <p>A: Yes, you can play online mode with Car Parking Multiplayer Mod APK Happymod. However, you may encounter some problems or issues when playing online mode with other players who are using the original version of the game or a different version of the mod. Therefore, we recommend that you play online mode with other players who are using the same version of the mod as you.</p>
91
- <h4>Q: Can I update Car Parking Multiplayer Mod APK Happymod?</h4>
92
- <p>A: No, you cannot update Car Parking Multiplayer Mod APK Happymod from Google Play Store or any other app store. If you want to update Car Parking Multiplayer Mod APK Happymod, you have to visit Happymod website again and download the latest version of the mod from there. However, you should note that updating Car Parking Multiplayer Mod APK Happymod may erase your previous data or progress in the game. Therefore, we suggest that you backup your data or progress before updating Car Parking Multiplayer Mod APK Happymod.</p>
93
- <h4>Q: Can I uninstall Car Parking Multiplayer Mod APK Happymod and reinstall the original version of the game?</h4>
94
- <p>A: Yes, you can uninstall Car Parking Multiplayer Mod APK Happymod and reinstall the original version of the game from Google Play Store or any other app store. However, you should note that uninstalling Car Parking Multiplayer Mod APK Happymod may erase your previous data or progress in the game. Therefore, we suggest that you backup your data or progress before uninstalling Car Parking Multiplayer Mod APK Happymod.</p>
95
- <h4>Q: Can I use Car Parking Multiplayer Mod APK Happymod on iOS devices?</h4>
96
- <p>A: No, you cannot use Car Parking Multiplayer Mod APK Happymod on iOS devices. Car Parking Multiplayer Mod APK Happymod is only compatible with Android devices. If you want to play Car Parking Multiplayer on iOS devices, you have to download the original version of the game from App Store or any other app store.</p>
97
- <h4>Q: Can I share Car Parking Multiplayer Mod APK Happymod with my friends?</h4>
98
- <p>A: Yes, you can share Car Parking Multiplayer Mod APK Happymod with your friends via social media or email. However, you should respect the intellectual property rights of the game developer and the modder and do not distribute or sell Car Parking Multiplayer Mod APK Happymod to others for commercial purposes. You should also inform your friends about the risks and responsibilities of using Car Parking Multiplayer Mod APK Happymod.</p> 197e85843d<br />
99
- <br />
100
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Clash Royale Dinheiro Infinito baixe o apk e entre na arena com vantagem!.md DELETED
@@ -1,139 +0,0 @@
1
-
2
- <h1>Clash Royale Dinheiro Infinito Apk: Como Baixar e Jogar</h1>
3
- <p>Você é fã de Clash Royale, o jogo de estratégia e cartas que conquistou milhões de jogadores ao redor do mundo? Você gostaria de ter recursos ilimitados para montar o seu deck, comprar novas cartas, melhorar as suas tropas e desafiar os seus adversários? Então você precisa conhecer o Clash Royale Dinheiro Infinito Apk, um mod apk que oferece dinheiro e gemas infinitas para você aproveitar o jogo sem limites. Neste artigo, vamos explicar o que é Clash Royale, o que é o mod apk, como baixar e instalar o jogo, e como jogar com o dinheiro infinito. Ficou curioso? Então continue lendo e descubra tudo sobre esse incrível jogo.</p>
4
- <h2>O que é Clash Royale?</h2>
5
- <p>Clash Royale é um jogo de estratégia e cartas desenvolvido pela Supercell, a mesma empresa por trás de outros sucessos como Clash of Clans, Brawl Stars e Hay Day. O jogo foi lançado em 2016 para Android e iOS, e desde então se tornou um dos jogos mais populares e rentáveis do mundo.</p>
6
- <h2>clash royale dinheiro infinito apk</h2><br /><p><b><b>Download</b> &#9658;&#9658;&#9658;&#9658;&#9658; <a href="https://urlin.us/2uSTSl">https://urlin.us/2uSTSl</a></b></p><br /><br />
7
- <h3>Um jogo de estratégia e cartas</h3>
8
- <p>A jogabilidade de Clash Royale é simples e intuitiva. No início do jogo, existem três torres, uma no meio e duas nas laterais. Seu objetivo é liderar o seu exército para destruir a defesa da torre central do inimigo, enquanto também protege a sua própria torre. Para isso, você precisa usar as cartas que representam as suas tropas, feitiços e construções. Cada carta tem um custo de elixir, que se regenera ao longo do tempo. Você pode ter até oito cartas no seu deck, mas só pode usar quatro por vez. O jogo dura três minutos, mas pode ser prorrogado em caso de empate.</p>
9
- <h3>Um sucesso mundial</h3>
10
- <p>Clash Royale é um jogo que mistura elementos de vários gêneros, como estratégia, tower defense, colecionáveis e multiplayer online. Além disso, o jogo tem um visual colorido, personagens carismáticos, sons divertidos e uma trilha sonora envolvente. Tudo isso faz com que Clash Royale seja um jogo viciante, desafiador e divertido. Não é à toa que o jogo tem mais de 500 milhões de downloads na Google Play Store, uma nota média de 4,3 estrelas, e uma comunidade ativa de jogadores que participam de torneios, ligas, clãs e eventos especiais.</p>
11
- <h2>O que é Clash Royale Dinheiro Infinito Apk?</h2>
12
- <p>Clash Royale Dinheiro Infinito Apk é um mod apk, ou seja, uma versão modificada do jogo original que oferece recursos ilimitados para os jogadores. Com esse mod apk, você pode ter dinheiro e gemas infinitas no jogo <p>Com esse mod apk, você pode ter dinheiro e gemas infinitas no jogo, o que significa que você pode comprar todas as cartas que quiser, melhorar as suas tropas ao máximo, abrir todos os baús que encontrar, e participar de todos os eventos e desafios sem se preocupar com o seu saldo. Assim, você pode montar o seu deck ideal, experimentar novas estratégias, e se divertir muito mais no jogo.</p>
13
- <h3>Os benefícios e os riscos de usar o mod apk</h3>
14
- <p>O Clash Royale Dinheiro Infinito Apk tem alguns benefícios para os jogadores que querem ter uma experiência mais livre e variada no jogo. Alguns desses benefícios são:</p>
15
- <ul>
16
- <li>Você pode ter acesso a todas as cartas do jogo, incluindo as lendárias, as épicas, as raras e as comuns.</li>
17
- <li>Você pode melhorar as suas cartas rapidamente, sem precisar esperar pelos baús ou gastar gemas.</li>
18
- <li>Você pode abrir todos os baús que quiser, sem ter que esperar pelo tempo de abertura ou usar gemas.</li>
19
- <li>Você pode participar de todos os eventos e desafios que o jogo oferece, sem se preocupar com o custo de entrada ou com o número de tentativas.</li>
20
- <li>Você pode testar diferentes combinações de cartas e ver qual funciona melhor para o seu estilo de jogo.</li>
21
- <li>Você pode se divertir mais no jogo, sem se estressar com a falta de recursos ou com a dificuldade dos adversários.</li>
22
- </ul>
23
- <p>Porém, o Clash Royale Dinheiro Infinito Apk também tem alguns riscos que você deve considerar antes de baixar e instalar o jogo. Alguns desses riscos são:</p>
24
- <ul>
25
- <li>Você pode perder a sua conta original do Clash Royale, pois o mod apk não é oficial e não é reconhecido pela Supercell. Isso significa que você pode ser banido do jogo por violar os termos de uso e a política de privacidade.</li>
26
- <li>Você pode ter problemas de compatibilidade, atualização e segurança, pois o mod apk não é atualizado com a mesma frequência e qualidade que o jogo original. Isso significa que você pode enfrentar bugs, erros, travamentos e até vírus no seu dispositivo.</li>
27
- <li>Você pode perder a graça do jogo, pois o mod apk tira o desafio e a emoção de conquistar os recursos e as vitórias no jogo. Isso significa que você pode ficar entediado e desmotivado com o jogo.</li>
28
- </ul>
29
- <h2>Como baixar e instalar o Clash Royale Dinheiro Infinito Apk?</h2>
30
- <p>Se você decidiu baixar e instalar o Clash Royale Dinheiro Infinito Apk, você precisa seguir alguns passos simples para fazer isso. Mas antes, você precisa verificar se o seu dispositivo atende aos requisitos mínimos para rodar o jogo.</p>
31
- <h3>Os requisitos mínimos para rodar o jogo</h3>
32
- <p>Para baixar e instalar o Clash Royale Dinheiro Infinito Apk, você precisa ter um dispositivo Android com as seguintes especificações:</p>
33
- <p>clash royale mod apk gemas infinitas 2023<br />
34
- como baixar clash royale com dinheiro infinito<br />
35
- clash royale hack apk download mediafire<br />
36
- clash royale atualizado 2023 dinheiro infinito<br />
37
- clash royale apk mod tudo infinito 2023<br />
38
- clash royale apk mod menu dinheiro infinito<br />
39
- baixar clash royale hackeado para android<br />
40
- clash royale apk mod servidor privado 2023<br />
41
- clash royale apk mod moedas e gemas infinitas<br />
42
- clash royale apk mod desbloqueado tudo 2023<br />
43
- como instalar clash royale com dinheiro infinito<br />
44
- clash royale hack apk sem verificação humana<br />
45
- clash royale apk mod funcionando 2023<br />
46
- clash royale apk mod online dinheiro infinito<br />
47
- clash royale apk mod offline dinheiro infinito<br />
48
- baixar clash royale hackeado atualizado 2023<br />
49
- clash royale apk mod servidor brasileiro 2023<br />
50
- clash royale apk mod cartas lendárias infinitas<br />
51
- clash royale apk mod anti ban dinheiro infinito<br />
52
- clash royale apk mod sem root dinheiro infinito<br />
53
- como jogar clash royale com dinheiro infinito<br />
54
- clash royale hack apk unlimited gems and coins<br />
55
- clash royale apk mod novas cartas 2023<br />
56
- clash royale apk mod pass royale infinito<br />
57
- clash royale apk mod elixir infinito 2023<br />
58
- baixar clash royale hackeado para ios<br />
59
- clash royale apk mod mega cavaleiro infinito<br />
60
- clash royale apk mod dragão elétrico infinito<br />
61
- clash royale apk mod princesa do gelo infinita<br />
62
- clash royale apk mod rei fantasma infinito<br />
63
- como atualizar clash royale com dinheiro infinito<br />
64
- clash royale hack apk sem root dinheiro infinito<br />
65
- clash royale apk mod torneios infinitos 2023<br />
66
- clash royale apk mod bau lendário infinito<br />
67
- clash royale apk mod troféus infinitos 2023<br />
68
- baixar clash royale hackeado para pc<br />
69
- clash royale apk mod corredor da morte infinito<br />
70
- clash royale apk mod bruxa sombria infinita<br />
71
- clash royale apk mod esqueleto gigante infinito<br />
72
- clash royale apk mod goblin gigante infinito<br />
73
- como desinstalar clash royale com dinheiro infinito<br />
74
- clash royale hack apk sem anúncios dinheiro infinito<br />
75
- clash royale apk mod clãs infinitos 2023 <br />
76
- clash royale apk mod guerras de clãs infinitas <br />
77
- clash royale apk mod desafios especiais infinitos <br />
78
- baixar clash royale hackeado para celular <br />
79
- clash royale apk mod dragão infernal infinito <br />
80
- clash royale apk mod lenhador infinito <br />
81
- clash royale apk mod mineiro infinito</p>
82
- <table>
83
- <tr><th>Requisito</th><th>Especificação</th></tr>
84
- <tr><td>Versão do Android</td><td>4.1 ou superior</td></tr>
85
- <tr><td>Espaço livre</td><td>Pelo menos 150 MB</td></tr>
86
- <tr><td>Conexão à internet</td><td>Wi-Fi ou dados móveis</td></tr>
87
- <tr><td>Permissões</td><td>Acesso ao armazenamento, à câmera, ao microfone e à localização</td></tr>
88
- </table>
89
- <h3>O passo a passo para baixar e instalar o mod apk</h3>
90
- <p>Depois de verificar se o seu dispositivo atende aos requisitos mínimos, você pode seguir os passos abaixo para baixar e instalar o Clash Royale Dinheiro Infinito Apk:</p>
91
- <ol>
92
- <li>Acesse um site confiável que ofereça o download do mod apk. Você pode pesquisar no Google por "Clash Royale Dinheiro Infinito Apk" ou usar um dos links abaixo:</li>
93
- <ul>
94
- <li>[Clash Royale Dinheiro Infinito Apk 2023]</li>
95
- <li>[Clash Royale Mod Apk Unlimited Money and Gems](^2^ <li>[Clash Royale Mod Apk Unlimited Money and Gems]</li>
96
- <li>[Clash Royale Dinheiro Infinito Apk Download]</li>
97
- </ul>
98
- <li>Clique no botão de download do mod apk e aguarde o arquivo ser baixado no seu dispositivo. O arquivo deve ter o formato .apk e o tamanho de cerca de 150 MB.</li>
99
- <li>Antes de instalar o mod apk, você precisa habilitar a opção de instalar aplicativos de fontes desconhecidas no seu dispositivo. Para isso, vá em Configurações > Segurança > Fontes desconhecidas e ative a opção.</li>
100
- <li>Depois de habilitar a opção, localize o arquivo do mod apk no seu gerenciador de arquivos e clique nele para iniciar a instalação. Siga as instruções na tela e aguarde a instalação ser concluída.</li>
101
- <li>Após a instalação, você pode abrir o jogo e aproveitar o dinheiro e as gemas infinitas. Você não precisa se registrar ou fazer login no jogo, basta clicar em Jogar e começar a diversão.</li>
102
- </ol>
103
- <h2>Como jogar o Clash Royale Dinheiro Infinito Apk?</h2>
104
- <p>Agora que você já baixou e instalou o Clash Royale Dinheiro Infinito Apk, você pode jogar o jogo com os recursos ilimitados. Mas antes, você precisa saber algumas diferenças entre o jogo original e o mod apk, e algumas dicas e truques para se dar bem no jogo.</p>
105
- <h3>As principais diferenças entre o jogo original e o mod apk</h3>
106
- <p>O Clash Royale Dinheiro Infinito Apk é muito parecido com o jogo original, mas tem algumas diferenças que você deve conhecer. Algumas dessas diferenças são:</p>
107
- <ul>
108
- <li>O mod apk não é conectado aos servidores da Supercell, mas sim a servidores privados que hospedam o jogo modificado. Isso significa que você não pode jogar com os seus amigos ou com outros jogadores que usam o jogo original, mas sim com outros jogadores que usam o mod apk.</li>
109
- <li>O mod apk não tem as mesmas atualizações e novidades que o jogo original, pois depende dos desenvolvedores do mod para atualizar o jogo. Isso significa que você pode perder alguns recursos, cartas, eventos e correções que o jogo original oferece.</li>
110
- <li>O mod apk não tem o mesmo equilíbrio e dificuldade que o jogo original, pois todos os jogadores têm recursos ilimitados. Isso significa que você pode enfrentar adversários muito fortes ou muito fracos, dependendo da sorte ou da habilidade.</li>
111
- </ul>
112
- <h3>As dicas e truques para se dar bem no jogo</h3>
113
- <p>Apesar das diferenças, o Clash Royale Dinheiro Infinito Apk ainda é um jogo de estratégia e cartas que requer raciocínio e planejamento. Por isso, aqui vão algumas dicas e truques para você se dar bem no jogo:</p>
114
- <ul>
115
- <li>Aproveite os recursos ilimitados para experimentar diferentes cartas e combinações. Você pode testar as cartas que você não tem no jogo original, ou as cartas que você tem mas não usa muito. Assim, você pode descobrir novas formas de jogar e surpreender os seus adversários.</li>
116
- <li>Não se esqueça de melhorar as suas cartas sempre que possível. Mesmo tendo dinheiro e gemas infinitas, você ainda precisa melhorar as suas cartas para aumentar os seus atributos e habilidades. Quanto mais forte for a sua carta, mais chances você tem de vencer.</li>
117
- <li>Não se deixe levar pela ganância e pelo desperdício. Mesmo tendo recursos ilimitados, você ainda precisa usar as suas cartas com inteligência e eficiência. Não adianta gastar todo o seu elixir em uma única carta ou em um único ataque, pois isso pode deixar você vulnerável à defesa ou ao contra-ataque do inimigo.</li>
118
- <li>Não subestime nem superestime os seus adversários. Mesmo tendo recursos ilimitados, você ainda precisa respeitar os seus adversários e analisar as suas estratégias. Não pense que você vai ganhar fácil só porque tem dinheiro e gemas infinitas, pois isso pode fazer você perder a concentração ou a confiança. Também não pense que você vai perder fácil só porque só porque o seu adversário tem cartas mais fortes ou mais raras, pois isso pode fazer você perder a esperança ou a criatividade.</li>
119
- <li>Divirta-se e aprenda com o jogo. Mesmo tendo recursos ilimitados, você ainda precisa aproveitar o jogo e aprender com ele. Não se frustre se você perder ou se cometer erros, pois isso faz parte do processo de evolução. Também não se acomode se você ganhar ou se acertar tudo, pois isso pode impedir o seu crescimento. O importante é se divertir e aprender com o jogo, e usar o mod apk como uma forma de experimentar novas possibilidades.</li>
120
- </ul>
121
- <h2>Conclusão</h2>
122
- <p>Clash Royale é um jogo de estratégia e cartas que faz sucesso no mundo todo. Com o Clash Royale Dinheiro Infinito Apk, você pode ter dinheiro e gemas infinitas no jogo, e assim comprar e melhorar todas as cartas que quiser, abrir todos os baús que encontrar, e participar de todos os eventos e desafios sem limites. Porém, você também precisa saber os benefícios e os riscos de usar o mod apk, como baixar e instalar o jogo, e como jogar com os recursos ilimitados. Com essas informações, você pode decidir se vale a pena ou não baixar e instalar o Clash Royale Dinheiro Infinito Apk, e como aproveitar o jogo da melhor forma possível.</p>
123
- <p>E aí, gostou do artigo? Você já jogou o Clash Royale Dinheiro Infinito Apk? O que você achou do jogo? Deixe o seu comentário abaixo e compartilhe a sua opinião conosco. E se você gostou do artigo, não se esqueça de compartilhá-lo com os seus amigos nas redes sociais. Obrigado pela leitura e até a próxima!</p>
124
- <h2>FAQs</h2>
125
- <p>Aqui estão algumas perguntas frequentes sobre o Clash Royale Dinheiro Infinito Apk:</p>
126
- <ul>
127
- <li><b>O que é Clash Royale?</b></li>
128
- <p>Clash Royale é um jogo de estratégia e cartas desenvolvido pela Supercell, a mesma empresa por trás de outros sucessos como Clash of Clans, Brawl Stars e Hay Day. O jogo foi lançado em 2016 para Android e iOS, e desde então se tornou um dos jogos mais populares e rentáveis do mundo.</p>
129
- <li><b>O que é Clash Royale Dinheiro Infinito Apk?</b></li>
130
- <p>Clash Royale Dinheiro Infinito Apk é um mod apk, ou seja, uma versão modificada do jogo original que oferece recursos ilimitados para os jogadores. Com esse mod apk, você pode ter dinheiro e gemas infinitas no jogo, o que significa que você pode comprar todas as cartas que quiser, melhorar as suas tropas ao máximo, abrir todos os baús que encontrar, e participar de todos os eventos e desafios sem se preocupar com o seu saldo.</p>
131
- <li><b>Como baixar e instalar o Clash Royale Dinheiro Infinito Apk?</b></li>
132
- <p>Para baixar e instalar o Clash Royale Dinheiro Infinito Apk, você precisa seguir alguns passos simples: 1) Acesse um site confiável que ofereça o download do mod apk; 2) Clique no botão de download do mod apk e aguarde o arquivo ser baixado no seu dispositivo; 3) Antes de instalar o mod apk, você precisa habilitar a opção de instalar aplicativos de fontes desconhecidas no seu dispositivo; 4) Depois de habilitar a opção, localize o arquivo do mod apk no seu gerenciador de arquivos e clique nele para iniciar a instalação; 5) Após a instalação, você pode abrir o jogo e aproveitar o dinheiro e as gemas infinitas.</p>
133
- <li><b>Como jogar o Clash Royale Dinheiro Infinito Apk?</b></li>
134
- <p>Para jogar o Clash Royale Dinheiro Infinito Apk, você precisa saber algumas diferenças entre o jogo original e o mod apk, e algumas dicas e truques para se dar bem no jogo: 1) O mod apk não é conectado aos servidores da Supercell, mas sim a servidores privados que hospedam o jogo modificado; 2) O mod apk não tem as mesmas atualizações e novidades que o jogo original; 3) 3) O mod apk não tem o mesmo equilíbrio e dificuldade que o jogo original, pois todos os jogadores têm recursos ilimitados; 4) Aproveite os recursos ilimitados para experimentar diferentes cartas e combinações; 5) Não se esqueça de melhorar as suas cartas sempre que possível; 6) Não se deixe levar pela ganância e pelo desperdício; 7) Não subestime nem superestime os seus adversários; 8) Divirta-se e aprenda com o jogo.</p>
135
- <li><b>O Clash Royale Dinheiro Infinito Apk é seguro?</b></li>
136
- <p>O Clash Royale Dinheiro Infinito Apk não é um aplicativo oficial da Supercell, e por isso não tem a mesma garantia de segurança e qualidade que o jogo original. Ao baixar e instalar o mod apk, você pode estar colocando em risco a sua conta do jogo, o seu dispositivo e os seus dados pessoais. Por isso, é recomendado que você use o mod apk com cautela, e que faça um backup dos seus arquivos antes de instalar o jogo. Além disso, é aconselhável que você baixe o mod apk de sites confiáveis, que verifiquem a procedência e a integridade do arquivo.</p>
137
- </ul></p> 197e85843d<br />
138
- <br />
139
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1phancelerku/anime-remove-background/Ball Run Merge 2048 APK A New Twist on the Classic 2048 Game.md DELETED
@@ -1,129 +0,0 @@
1
- <br />
2
- <h1>Ball Run Merge 2048 APK: A Fun and Relaxing Game for Android Users</h1>
3
- <p>Are you looking for a new game to play on your Android device? Do you enjoy casual games that are easy to learn but hard to master? If yes, then you might want to try Ball Run Merge 2048 APK, a fun and relaxing game that combines the concepts of ball rolling and number merging. In this article, we will tell you what Ball Run Merge 2048 APK is, how to play it, why you should download it, how to download it, and some tips and tricks for playing it.</p>
4
- <h2>ball run merge 2048 apk</h2><br /><p><b><b>Download</b> &mdash; <a href="https://jinyurl.com/2uNSIS">https://jinyurl.com/2uNSIS</a></b></p><br /><br />
5
- <h2>What is Ball Run Merge 2048 APK?</h2>
6
- <p>Ball Run Merge 2048 APK is a game developed by Kayac Inc., a Japanese company that specializes in creating innovative and entertaining games. The game was released in June 2021 and has received positive reviews from users and critics alike. The game is inspired by the popular puzzle game 2048, where you have to merge tiles with the same number until you reach 2048. However, instead of tiles, you have balls that roll on a track. You have to control the balls with your finger and merge them with other balls of the same number and color. The more balls you merge, the bigger they get and the higher the number they show. The goal is to reach 2048 or higher before reaching the finish line.</p>
7
- <h3>How to play Ball Run Merge 2048 APK</h3>
8
- <p>The gameplay of Ball Run Merge 2048 APK is simple and intuitive. Here are the basic steps:</p>
9
- <ol>
10
- <li>Tap and swipe to control the rolling ball.</li>
11
- <li>When the ball is running, merge it with same number and color to reach 2048 ultimately.</li>
12
- <li>Be careful of the obstacles, which will lower your ball number.</li>
13
- <li>The big prize is waiting for you at the finish line!</li>
14
- </ol>
15
- <h3>Features of Ball Run Merge 2048 APK</h3>
16
- <p>Ball Run Merge 2048 APK has many features that make it an enjoyable and relaxing game. Some of them are:</p>
17
- <ul>
18
- <li>It has various levels with different tracks, themes, and difficulties.</li>
19
- <li>It has different types of balls with different shapes, colors, and numbers.</li>
20
- <li>It has power-ups that can help you boost your speed, increase your number, or clear obstacles.</li>
21
- <li>It has leaderboards and achievements that let you compete with other players and challenge yourself.</li>
22
- <li>It has a simple and elegant design that is easy on the eyes.</li>
23
- </ul>
24
- <h2>Why you should download Ball Run Merge 2048 APK</h2>
25
- <p>If you are still not convinced that Ball Run Merge 2048 APK is a game worth playing, here are some reasons why you should download it:</p>
26
- <h3>It is free and easy to install</h3>
27
- <p>Ball Run Merge 2048 APK is a free game that does not require any registration or subscription. You can download it from Google Play Store or other websites that offer APK files. The installation process is quick and straightforward. You just need to allow the app to access your device's storage and permissions.</p>
28
- <h3>It is addictive and challenging</h3>
29
- <p>Ball Run Merge 2048 APK is a game that will keep you hooked for hours. It is not as easy as it looks. You have to be fast and accurate in swiping the balls and merging them with the right ones. You also have to avoid the obstacles and traps that can lower your number or make you lose the game. The game gets harder as you progress, so you have to be smart and strategic in your moves. The game is a great way to test your reflexes, concentration, and math skills.</p>
30
- <p>ball run merge 2048 game<br />
31
- ball run merge 2048 download<br />
32
- ball run merge 2048 mod apk<br />
33
- ball run merge 2048 online<br />
34
- ball run merge 2048 free<br />
35
- ball run merge 2048 app<br />
36
- ball run merge 2048 hack<br />
37
- ball run merge 2048 cheats<br />
38
- ball run merge 2048 tips<br />
39
- ball run merge 2048 tricks<br />
40
- ball run merge 2048 review<br />
41
- ball run merge 2048 gameplay<br />
42
- ball run merge 2048 android<br />
43
- ball run merge 2048 ios<br />
44
- ball run merge 2048 pc<br />
45
- ball run merge 2048 windows<br />
46
- ball run merge 2048 mac<br />
47
- ball run merge 2048 linux<br />
48
- ball run merge 2048 chromebook<br />
49
- ball run merge 2048 emulator<br />
50
- ball run merge 2048 bluestacks<br />
51
- ball run merge 2048 noxplayer<br />
52
- ball run merge 2048 memu<br />
53
- ball run merge 2048 ldplayer<br />
54
- ball run merge 2048 apkcombo [^1^]<br />
55
- ball run merge 2048 kayac [^2^]<br />
56
- ball run - merge 2048 apk [^1^]<br />
57
- ballrun2048 apk [^2^]<br />
58
- ballrun - 2048 game apk [^2^]<br />
59
- download ballrun - 2048 game [^2^]<br />
60
- download ballrun - merge 2048 [^1^]<br />
61
- play ballrun - merge 2048 online [^1^]<br />
62
- play ballrun - 2048 game online [^2^]<br />
63
- how to play ballrun - merge 2048 [^1^]<br />
64
- how to play ballrun - 2048 game [^2^]<br />
65
- how to win ballrun - merge 2048 [^1^]<br />
66
- how to win ballrun - 2048 game [^2^]<br />
67
- best strategy for ballrun - merge 2048 [^1^]<br />
68
- best strategy for ballrun - 2048 game [^2^]<br />
69
- best score in ballrun - merge 2048 [^1^]<br />
70
- best score in ballrun - 2048 game [^2^]<br />
71
- fun and addictive ballrun - merge 2048 [^1^]<br />
72
- fun and addictive ballrun - 2048 game [^2^]<br />
73
- relaxing and challenging ballrun - merge 2048 [^1^]<br />
74
- relaxing and challenging ballrun - 2048 game [^2^]<br />
75
- colorful and smooth graphics in ballrun - merge 2048 [^1^]<br />
76
- colorful and smooth graphics in ballrun - 2048 game [^2^]<br />
77
- easy and simple controls in ballrun - merge 2048 [^1^]<br />
78
- easy and simple controls in ballrun - 2048 game [^2^]<br />
79
- new and unique gameplay in ballrun - merge 2048 [^1^]</p>
80
- <h3>It has colorful graphics and sound effects</h3>
81
- <p>Ball Run Merge 2048 APK is a game that will delight your senses. It has bright and vivid graphics that create a cheerful and lively atmosphere. The balls are colorful and shiny, and the tracks are diverse and dynamic. The game also has upbeat and catchy sound effects that match the mood of the game. The game is a feast for your eyes and ears.</p>
82
- <h2>How to download Ball Run Merge 2048 APK</h2>
83
- <p>If you are interested in playing Ball Run Merge 2048 APK, you have several options to download it. Here are some of them:</p>
84
- <h3>From Google Play Store</h3>
85
- <p>The easiest and safest way to download Ball Run Merge 2048 APK is from Google Play Store, the official app store for Android devices. You just need to follow these steps:</p>
86
- <ol>
87
- <li>Open Google Play Store on your device.</li>
88
- <li>Search for "Ball Run Merge 2048" or use this link: (https://play.google.com/store/apps/details?id=com.kayac.ball_run_merge_2048).</li>
89
- <li>Tap on the "Install" button and wait for the download to finish.</li>
90
- <li>Enjoy playing Ball Run Merge 2048 APK!</li>
91
- </ol>
92
- <h3>From APKCombo website</h3>
93
- <p>If you want to download Ball Run Merge 2048 APK from a third-party website, you can use APKCombo, a reliable and secure website that offers APK files for various apps and games. You just need to follow these steps:</p>
94
- <ol>
95
- <li>Open your browser and go to this link: (https://apkcombo.com/ball-run-merge-2048/com.kayac.ball_run_merge_2048/).</li>
96
- <li>Select the version of Ball Run Merge 2048 APK that you want to download.</li>
97
- <li>Tap on the "Download APK" button and wait for the download to finish.</li>
98
- <li>Before installing the app, make sure you enable "Unknown Sources" in your device's settings.</li>
99
- <li>Locate the downloaded file in your device's storage and tap on it to install it.</li>
100
- <li>Enjoy playing Ball Run Merge 2048 APK!</li>
101
- </ol>
102
- <h3>From other sources</h3>
103
- <p>You can also download Ball Run Merge 2048 APK from other websites that offer APK files, such as APKPure, Uptodown, or APKMirror. However, you should be careful when downloading from these sources, as they may contain malware or viruses that can harm your device or compromise your privacy. You should always check the reviews and ratings of the apps before downloading them, and scan them with an antivirus software before installing them. You should also avoid downloading modded or hacked versions of the apps, as they may not work properly or cause problems with your device.</p>
104
- <h2>Tips and tricks for playing Ball Run Merge 2048 APK</h2>
105
- <p>To help you enjoy playing Ball Run Merge 2048 APK more, here are some tips and tricks that you can use:</p>
106
- <h3>Swipe fast and accurately</h3>
107
- <p>The key to playing Ball Run Merge 2048 APK is to swipe fast and accurately. You have to swipe the balls quickly to merge them with other balls of the same number and color. You also have to swipe them accurately to avoid hitting the wrong balls or missing the right ones. Swiping fast and accurately will help you increase your score and reach higher numbers faster.</p>
108
- <h3>Avoid obstacles and traps</h3>
109
- <p>Another important thing to remember when playing Ball Run Merge 2048 APK is to avoid obstacles and traps. These are things that can lower your ball number or make you lose the game. Some examples of obstacles are spikes, walls, holes, or other balls with different numbers or colors. Some examples of traps are bombs, magnets, or switches that can change the direction or speed of the balls. You have to be careful and alert when swiping the balls, as some obstacles and traps may appear suddenly or unexpectedly.</p>
110
- <h3>Collect coins and rewards</h3>
111
- <p>A fun part of playing Ball Run Merge 2048 APK is collecting coins and rewards. These are things that can help you boost your speed, increase your number, or clear obstacles. Some examples of coins are gold coins, silver coins, or rainbow coins. Some examples of rewards are stars, hearts, diamonds, or keys. You can use these coins and rewards to buy new balls, unlock new levels, or activate power-ups. You can find these coins and rewards on the track, or you can get them from chests, daily bonuses, or watching ads. You should try to collect as many coins and rewards as you can, as they can make your game more fun and exciting.</p>
112
- <h2>Conclusion</h2>
113
- <p>Ball Run Merge 2048 APK is a fun and relaxing game that you can play on your Android device. It is a game that combines the concepts of ball rolling and number merging, where you have to swipe the balls and merge them with other balls of the same number and color. The game has various levels, different types of balls, power-ups, leaderboards, achievements, and more. The game is free and easy to download from Google Play Store or other websites that offer APK files. The game is addictive and challenging, but also colorful and cheerful. The game is a great way to pass the time, exercise your brain, and have fun.</p>
114
- <h2>FAQs</h2>
115
- <p>Here are some frequently asked questions about Ball Run Merge 2048 APK:</p>
116
- <ol>
117
- <li>What is the highest number you can reach in Ball Run Merge 2048 APK?</li>
118
- <p>The highest number you can reach in Ball Run Merge 2048 APK is 8192, which is the maximum number that can fit on a ball. However, reaching this number is very difficult and rare, as you have to merge many balls of the same number and color without hitting any obstacles or traps.</p>
119
- <li>How do you get more coins and rewards in Ball Run Merge 2048 APK?</li>
120
- <p>You can get more coins and rewards in Ball Run Merge 2048 APK by collecting them on the track, opening chests, getting daily bonuses, or watching ads. You can also get more coins and rewards by completing achievements or ranking high on the leaderboards.</p>
121
- <li>How do you use power-ups in Ball Run Merge 2048 APK?</li>
122
- <p>You can use power-ups in Ball Run Merge 2048 APK by tapping on them when they appear on the screen. Some power-ups are activated automatically, while others require you to tap on them again to use them. Some examples of power-ups are speed boost, number increase, obstacle clear, or magnet.</p>
123
- <li>How do you unlock new levels and balls in Ball Run Merge 2048 APK?</li>
124
- <p>You can unlock new levels and balls in Ball Run Merge 2048 APK by earning stars, hearts, diamonds, or keys. You can earn these items by completing levels, collecting rewards, or buying them with coins. You can use these items to unlock new tracks, themes, or balls with different shapes, colors, and numbers.</p>
125
- <li>Is Ball Run Merge 2048 APK safe to download and play?</li>
126
- <p>Yes, Ball Run Merge 2048 APK is safe to download and play. The game does not contain any malware or viruses that can harm your device or compromise your privacy. The game also does not require any registration or subscription. However, you should always download the game from trusted sources such as Google Play Store or APKCombo website.</p>
127
- </ol></p> 401be4b1e0<br />
128
- <br />
129
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1phancelerku/anime-remove-background/Download 20 Minutes Till Dawn and Experience a Thrilling Roguelike Shooter.md DELETED
@@ -1,90 +0,0 @@
1
-
2
- <h1>20 Minutes Till Dawn: A Survival Roguelite Game Review</h1>
3
- <p>If you are looking for a fast-paced, action-packed, and challenging game that will test your skills and reflexes, then you might want to check out 20 Minutes Till Dawn. This is a survival roguelite game where you have to fight against endless hordes of Lovecraftian monsters and survive the night. In this article, we will review the game's features, gameplay, graphics, sound, pros, cons, and more.</p>
4
- <h2>20 minutes till dawn free download</h2><br /><p><b><b>Download</b> &#9658;&#9658;&#9658; <a href="https://jinyurl.com/2uNRfX">https://jinyurl.com/2uNRfX</a></b></p><br /><br />
5
- <h2>Introduction</h2>
6
- <p>20 Minutes Till Dawn is a roguelike shoot 'em up video game developed and published by flanne. The game was released in early access on Steam on June 8, 2022, and was ported to Android and iOS by Erabit Studios on September 9, 2022. The game exited early access on Steam with version 1.0 on June 8th, 2023.</p>
7
- <p>The game belongs to the genre of survival roguelite, which means that it features permadeath, randomization, and progression across runs. The goal of the game is to survive for 20 minutes until dawn breaks, while facing an onslaught of monsters that become stronger and more numerous as time passes. The game is inspired by Vampire Survivors, but with more active combat and customization options.</p>
8
- <p>The game is available on Steam for $4.99, as well as on Google Play, App Store, and TapTap for free. The game has received very positive reviews from players and critics alike, with over 20,000 reviews on Steam and over 6 million downloads on mobile platforms. The game has also been featured by IGN, TheGamer, Level Winner, and other media outlets.</p>
9
- <h2>Gameplay</h2>
10
- <p>The gameplay of 20 Minutes Till Dawn is simple but challenging. You control a character who can move around with WASD keys or a virtual joystick, aim with the mouse or touch screen, and fire with left click or tap. You can also use right click or double tap to activate your special ability, which varies depending on your character.</p>
11
- <p>You start each run by choosing one of several characters, each with their own unique skill, bonus, and weapon. You can unlock more characters by spending gems, which are earned by killing monsters or completing achievements. You can also choose your starting weapon from a variety of guns, melee weapons, or magic items. You can unlock more weapons by spending gems as well.</p>
12
- <p>As you kill monsters, you gain experience points that allow you to level up. Each time you level up, you can choose one of four randomly generated upgrades that enhance your stats or abilities. These upgrades can range from increasing your damage or health, to adding effects like fire, poison, or stun to your attacks, to unlocking new abilities like dash, shield, or summon. The upgrades are permanent for the current run, but they are lost when you die or restart.</p>
13
- <p>20 Minutes Till Dawn roguelike shooting game<br />
14
- How to play 20 Minutes Till Dawn on PC<br />
15
- 20 Minutes Till Dawn full version download<br />
16
- 20 Minutes Till Dawn best weapons and runes<br />
17
- 20 Minutes Till Dawn tips and tricks<br />
18
- 20 Minutes Till Dawn review and rating<br />
19
- 20 Minutes Till Dawn APK download for Android<br />
20
- 20 Minutes Till Dawn cheats and hacks<br />
21
- 20 Minutes Till Dawn gameplay and walkthrough<br />
22
- 20 Minutes Till Dawn online multiplayer mode<br />
23
- 20 Minutes Till Dawn free steam key<br />
24
- 20 Minutes Till Dawn system requirements and specs<br />
25
- 20 Minutes Till Dawn mod apk unlimited money<br />
26
- 20 Minutes Till Dawn soundtrack and music<br />
27
- 20 Minutes Till Dawn developer and publisher<br />
28
- 20 Minutes Till Dawn release date and updates<br />
29
- 20 Minutes Till Dawn trailer and screenshots<br />
30
- 20 Minutes Till Dawn similar games and alternatives<br />
31
- 20 Minutes Till Dawn wiki and guide<br />
32
- 20 Minutes Till Dawn achievements and trophies<br />
33
- 20 Minutes Till Dawn horror survival game<br />
34
- 20 Minutes Till Dawn lovecraftian monsters and enemies<br />
35
- 20 Minutes Till Dawn special abilities and skills<br />
36
- 20 Minutes Till Dawn how to survive the night<br />
37
- 20 Minutes Till Dawn endless hordes and waves<br />
38
- 20 Minutes Till Dawn action video game genre<br />
39
- 20 Minutes Till Dawn Google Play store link<br />
40
- 20 Minutes Till Dawn BlueStacks emulator download<br />
41
- 20 Minutes Till Dawn PC game free torrent<br />
42
- 20 Minutes Till Dawn crack and patch</p>
43
- <p>To survive the night, you have to keep moving and shooting, while avoiding the enemies' attacks and environmental hazards. The enemies come in different shapes and sizes, each with their own behavior and attack pattern. Some of them are fast and agile, some are slow and tanky, some are ranged and explosive, and some are stealthy and deadly. You will also encounter bosses every few minutes, which are much stronger and tougher than regular enemies. The bosses have unique abilities and weaknesses that you have to exploit to defeat them.</p>
44
- <p>The game has four different game modes: Normal, Hardcore, Endless, and Custom. Normal mode is the default mode, where you have to survive for 20 minutes with three lives. Hardcore mode is similar to Normal mode, but you only have one life and the enemies are more aggressive. Endless mode is where you can play as long as you want, but the enemies become harder and more frequent as time goes on. Custom mode is where you can create your own rules and settings for the game, such as changing the time limit, the enemy spawn rate, the difficulty level, and more.</p>
45
- <h2>Graphics and Sound</h2>
46
- <p>The graphics of 20 Minutes Till Dawn are colorful and pixelated, giving the game a retro and nostalgic feel. The game has a dark and gloomy atmosphere, with a night sky full of stars and a moon that changes phases as time passes. The game also has dynamic lighting and shadows, which create a contrast between the dark background and the bright projectiles and explosions. The game has a variety of environments, such as forests, deserts, cities, caves, and more. Each environment has its own theme and features, such as trees, rocks, buildings, traps, and secrets.</p>
47
- <p>The sound of 20 Minutes Till Dawn is immersive and engaging, with a soundtrack that matches the mood and intensity of the game. The game has a synthwave style music that is catchy and energetic, with different tracks for each environment and boss. The game also has sound effects that are realistic and satisfying, such as the sound of gunfire, explosions, screams, footsteps, and more. The game has no voice acting or dialogue, but it does have text messages that appear on the screen to give you hints or warnings.</p>
48
- <p>The game performs well on most devices and platforms, with smooth gameplay and minimal lag or glitches. The game has low system requirements for PC users, as well as options to adjust the graphics quality and resolution for mobile users. The game also supports cloud saving , controller support, leaderboards , achievements , and multiplayer co-op .</p>
49
- <h2>Pros and Cons</h2>
50
- <p>20 Minutes Till Dawn is a fun and addictive game that will keep you entertained for hours. However, like any other game, it also has its pros and cons. Here are some of them:</p>
51
- <table>
52
- <tr><th>Pros</th><th>Cons</th></tr>
53
- <tr><td>- Fast-paced and challenging gameplay that requires skill and strategy</td><td>- Permadeath can be frustrating and discouraging for some players</td></tr>
54
- <tr><td>- Variety of characters, weapons, upgrades, enemies, bosses, environments, and game modes that offer replay value</td><td>- Randomization can be unfair or unbalanced at times</td></tr>
55
- <tr><td>- Retro-style graphics that are colorful and atmospheric</td><td>- Pixelated graphics might not appeal to everyone</td></tr>
56
- <tr><td>- Synthwave-style music that is catchy and energetic</td><td>- Music can get repetitive or annoying after a while</td></tr>
57
- <tr><td>- Low system requirements and cross-platform compatibility</td><td>- Some bugs or glitches might occur occasionally</td></tr>
58
- </table>
59
- <h2>Conclusion</h2>
60
- <p>20 Minutes Till Dawn is a survival roguelite game that will test your skills and reflexes as you fight against endless hordes of Lovecraftian monsters and survive the night. The game has a simple but challenging gameplay, a variety of features and options, a retro-style graphics and sound, and a low system requirements and cross-platform compatibility. The game is suitable for anyone who enjoys action, horror, or roguelite games, and who is looking for a thrilling and rewarding experience. The game is also affordable and accessible, as it costs only $4.99 on Steam and is free on mobile platforms.</p>
61
- <p>If you are interested in playing 20 Minutes Till Dawn, you can find more information or download the game from the following links:</p>
62
- <ul>
63
- <li>Steam: [20 Minutes Till Dawn on Steam]</li>
64
- <li>Google Play: [20 Minutes Till Dawn - Apps on Google Play]</li>
65
- <li>App Store: [‎20 Minutes Till Dawn on the App Store]</li>
66
- <li>TapTap: [20 Minutes Till Dawn - TapTap]</li>
67
- </ul>
68
- <p>You can also watch some gameplay videos or read some reviews from the following sources:</p>
69
- <ul>
70
- <li>IGN: [20 Minutes Till Dawn Review - IGN]</li>
71
- <li>TheGamer: [20 Minutes Till Dawn Review: A Roguelite That Keeps You On Your Toes]</li>
72
- <li>Level Winner: [20 Minutes Till Dawn Beginner's Guide: Tips, Tricks & Strategies to Survive the Night]</li>
73
- </ul>
74
- <h2>FAQs</h2>
75
- <p>Here are some of the frequently asked questions about 20 Minutes Till Dawn:</p>
76
- <ol>
77
- <li><b>How do I unlock more characters and weapons?</b></li>
78
- <p>You can unlock more characters and weapons by spending gems, which are earned by killing monsters or completing achievements. You can also find some weapons as loot drops from enemies or chests.</p>
79
- <li><b>How do I save my progress?</b></li>
80
- <p>You can save your progress by using the cloud saving feature, which is available on all platforms. You can also use the local saving feature, which is available on PC and mobile platforms. However, keep in mind that your progress is only saved between runs, not during runs. If you die or restart, you will lose your current upgrades and items.</p>
81
- <li><b>How do I play with my friends?</b></li>
82
- <p>You can play with your friends by using the multiplayer co-op feature, which is available on all platforms. You can join or host a game with up to four players online or locally. You can also chat with your friends using the voice or text chat feature.</p>
83
- <li><b>How do I change the game settings?</b></li>
84
- <p>You can change the game settings by using the options menu, which is available on all platforms. You can adjust the graphics quality, resolution, sound volume, language, controls, and more.</p>
85
- <li><b>How do I contact the developers or report a bug?</b></li>
86
- <p>You can contact the developers or report a bug by using the feedback feature, which is available on all platforms. You can also visit the official website, Discord server, Twitter page, or Facebook page of the game.</p>
87
- </ol>
88
- <p>I hope you enjoyed this article and found it helpful. If you have any questions or comments, feel free to leave them below. Thank you for reading and have a great day!</p> 401be4b1e0<br />
89
- <br />
90
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1phancelerku/anime-remove-background/Download Epic Conquest 2 Mod Apk 1.7.5 and Enjoy Unlimited Gold and Rubies.md DELETED
@@ -1,102 +0,0 @@
1
- <br />
2
- <h1>Epic Conquest 2 Mod Apk 1.7.5: Everything You Need to Know</h1>
3
- <p>If you are a fan of action RPG games and anime, you might have heard of Epic Conquest 2, a game created by a small indie team of 4 with passion and love for the genre. Epic Conquest 2 is inspired by the classics, with a special touch in the combat and story, giving you an experience that's hard to find in similar games.</p>
4
- <h2>epic conquest 2 mod apk 1.7.5</h2><br /><p><b><b>DOWNLOAD</b> &mdash;&mdash;&mdash;&mdash;&mdash; <a href="https://jinyurl.com/2uNUhu">https://jinyurl.com/2uNUhu</a></b></p><br /><br />
5
- <p>But what if you want to enhance your gaming experience even more? What if you want to unlock all the costumes, skills, items, and features that the game has to offer? Well, that's where a mod apk comes in handy.</p>
6
- <p>A mod apk is a modified version of an original app that allows you to access features that are normally locked or restricted in the official app. For example, a mod apk can give you unlimited money, gems, resources, or premium items that you would otherwise have to pay for or grind for hours.</p>
7
- <p>One of the most popular mod apks for Epic Conquest 2 is the version 1.7.5, which has many amazing features such as:</p>
8
- <ul>
9
- <li>Unlimited gold and ruby</li>
10
- <li>Unlocked all costumes and accessories</li>
11
- <li>Unlocked all skills and masteries</li>
12
- <li>Unlocked all equipment and materials</li>
13
- <li>Unlocked all runes and keys</li>
14
- <li>Unlocked all chapters and areas</li>
15
- <li>No ads</li>
16
- </ul>
17
- <p>With these features, you can enjoy Epic Conquest 2 without any limitations or interruptions. You can customize your character's appearance, skills, and equipment to suit your playstyle. You can explore the open world with all kinds of treasures and resources to strengthen your character. You can experience the anime-style story with cutscenes and character expressions that will keep you hooked.</p>
18
- <h2>How to Download and Install Epic Conquest 2 Mod Apk 1.7.5</h2>
19
- <p>If you are interested in trying out this mod apk, here are the steps you need to follow:</p>
20
- <ol>
21
- <li>Download the mod apk file from a reliable source. You can use this link as an example.</li>
22
- <li>Before installing the mod apk, make sure you have enough storage space on your device and that you have enabled the option to install apps from unknown sources in your settings.</li>
23
- <li>Locate the downloaded file in your file manager and tap on it to start the installation process.</li>
24
- <li>Follow the instructions on the screen and wait for the installation to finish.</li>
25
- <li>Launch the game and enjoy!</li>
26
- </ol>
27
- <p>However, before installing the mod apk, there are some precautions you need to take:</p>
28
- <p>epic conquest 2 mod apk 1.7.5 free shopping<br />
29
- epic conquest 2 mod apk 1.7.5 unlock all character<br />
30
- epic conquest 2 mod apk 1.7.5 latest version<br />
31
- epic conquest 2 mod apk 1.7.5 unlimited gold and rubies<br />
32
- epic conquest 2 mod apk 1.7.5 offline<br />
33
- epic conquest 2 mod apk 1.7.5 download for android<br />
34
- epic conquest 2 mod apk 1.7.5 no root<br />
35
- epic conquest 2 mod apk 1.7.5 hack<br />
36
- epic conquest 2 mod apk 1.7.5 mega mod<br />
37
- epic conquest 2 mod apk 1.7.5 gameplay<br />
38
- epic conquest 2 mod apk 1.7.5 review<br />
39
- epic conquest 2 mod apk 1.7.5 cheats<br />
40
- epic conquest 2 mod apk 1.7.5 tips and tricks<br />
41
- epic conquest 2 mod apk 1.7.5 guide<br />
42
- epic conquest 2 mod apk 1.7.5 walkthrough<br />
43
- epic conquest 2 mod apk 1.7.5 best build<br />
44
- epic conquest 2 mod apk 1.7.5 blacksmith system<br />
45
- epic conquest 2 mod apk 1.7.5 character customization<br />
46
- epic conquest 2 mod apk 1.7.5 skills and masteries<br />
47
- epic conquest 2 mod apk 1.7.5 costumes and outfits<br />
48
- epic conquest 2 mod apk 1.7.5 items and crafting<br />
49
- epic conquest 2 mod apk 1.7.5 dungeons and secrets<br />
50
- epic conquest 2 mod apk 1.7.5 story and lore<br />
51
- epic conquest 2 mod apk 1.7.5 update and patch notes<br />
52
- epic conquest 2 mod apk 1.7.5 features and benefits<br />
53
- epic conquest 2 mod apk 1.7.5 comparison and alternatives<br />
54
- epic conquest 2 mod apk 1.7.5 pros and cons<br />
55
- epic conquest 2 mod apk 1.7.5 ratings and reviews<br />
56
- epic conquest 2 mod apk 1.7.5 download link and instructions<br />
57
- epic conquest 2 mod apk 1.7.5 installation and setup<br />
58
- epic conquest 2 mod apk 1.7.5 troubleshooting and support<br />
59
- epic conquest 2 mod apk 1.7.5 faq and answers<br />
60
- epic conquest 2 mod apk 1.7.5 forum and community<br />
61
- epic conquest 2 mod apk 1.7.5 developer and contact info<br />
62
- epic conquest 2 mod apk 1.7.5 news and updates</p>
63
- <ul>
64
- <li>Make sure you have backed up your original game data in case something goes wrong or you want to switch back to the official version.</li>
65
- <li>Make sure you have scanned the mod apk file with an antivirus or malware detector to ensure it is safe and clean.</li>
66
- <li>Make sure you have read the terms and conditions of the mod apk provider and that you are aware of any risks or consequences of using it.</li>
67
- </ul>
68
- <h2>How to Play Epic Conquest 2 Mod Apk 1.7.5</h2>
69
- <p>Now that you have installed the mod apk, you are ready to play Epic Conquest 2 with all the benefits and advantages. Here are some tips and tricks to help you get started:</p>
70
- <ul>
71
- <li>Choose your character wisely. There are four playable characters in Epic Conquest 2, each with their own unique skills, weapons, and costumes. You can switch between them anytime in the game, but you need to level them up separately. You can use the unlimited gold and ruby to buy all the skills and masteries for each character, as well as the costumes and accessories that suit your taste.</li>
72
- <li>Explore the world freely. Epic Conquest 2 has a huge open world with various regions, biomes, dungeons, and secrets. You can use the unlocked runes and keys to access all the areas and loot all the chests and resources. You can also use the fast travel feature to move around quickly and easily.</li>
73
- <li>Follow the story and quests. Epic Conquest 2 has a rich and immersive story with multiple endings and choices that affect the outcome. You can use the unlocked chapters to play through all the scenarios and see how your decisions impact the characters and the world. You can also complete various side quests and challenges to earn extra rewards and learn more about the lore and history of the game.</li>
74
- <li>Enjoy the combat and customization. Epic Conquest 2 has a dynamic and fluid combat system that lets you unleash your skills and combos with ease. You can use the unlimited equipment and materials to craft and upgrade your weapons and armor to suit your playstyle. You can also use the mod features to adjust the difficulty level, enemy stats, drop rates, and other settings to make the game more fun and challenging.</li>
75
- </ul>
76
- <p>However, using the mod apk also has some drawbacks that you need to be aware of:</p>
77
- <ul>
78
- <li>You might encounter some bugs or glitches that affect the game performance or stability. If this happens, you can try reinstalling the mod apk or clearing the cache data.</li>
79
- <li>You might lose your progress or data if you uninstall the mod apk or switch back to the official version. To avoid this, you can backup your data using a cloud service or a third-party app.</li>
80
- <li>You might get banned or suspended from the online features or services of the game if you use the mod apk in an inappropriate or abusive way. To avoid this, you can play offline or use a VPN service.</li>
81
- </ul>
82
- <h2>Conclusion</h2>
83
- <p>Epic Conquest 2 is a great game for fans of action RPGs and anime, with a lot of content and features to enjoy. However, if you want to experience the game in a different way, you can try using the epic conquest 2 mod apk 1.7.5, which gives you unlimited access to everything in the game.</p>
84
- <p>This mod apk is easy to download and install, as long as you follow the steps and precautions mentioned above. It also gives you a lot of tips and tricks to play the game better and have more fun.</p>
85
- <p>However, you should also be aware of the risks and consequences of using this mod apk, such as bugs, data loss, or bans. You should also respect the developers and creators of the game by not using this mod apk for illegal or unethical purposes.</p>
86
- <p>If you are interested in trying out this mod apk, you can use this link to download it. If you have any feedback or questions about this mod apk, feel free to leave a comment below or contact us through our website.</p>
87
- <h3>FAQs</h3>
88
- <p>Here are some frequently asked questions about epic conquest 2 mod apk 1.7.5:</p>
89
- <ol>
90
- <li>Is this mod apk safe and virus-free?</li>
91
- <p>Yes, this mod apk is safe and virus-free, as long as you download it from a reliable source like this link. However, you should always scan any file you download with an antivirus or malware detector before installing it on your device.</p>
92
- <li>Does this mod apk work on any device or platform?</li>
93
- <ol start="3">
94
- <li>Does this mod apk require root access or any special permissions?</li>
95
- <p>No, this mod apk does not require root access or any special permissions to run on your device. You just need to enable the option to install apps from unknown sources in your settings.</p>
96
- <li>Can I update this mod apk to the latest version of the game?</li>
97
- <p>No, this mod apk is based on the version 1.7.5 of the game, which is not the latest version. If you update this mod apk, you might lose the mod features or encounter compatibility issues. You should wait for a new version of the mod apk to be released before updating.</p>
98
- <li>Can I play online or multiplayer with this mod apk?</li>
99
- <p>No, this mod apk is not compatible with the online or multiplayer features of the game. If you try to play online or multiplayer with this mod apk, you might get banned or suspended from the game servers. You should only play offline or solo with this mod apk.</p>
100
- </ol></p> 401be4b1e0<br />
101
- <br />
102
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1phancelerku/anime-remove-background/Download Mortal Kombat X MOD APK Data for Android and iOS Devices.md DELETED
@@ -1,98 +0,0 @@
1
- <br />
2
- <h1>Mortal Kombat X Mod APK + Data Download: How to Install and Play the Ultimate Fighting Game on Your Android Device</h1>
3
- <p>Mortal Kombat X is one of the most popular and acclaimed fighting games of all time. It is the tenth installment in the Mortal Kombat franchise and a sequel to Mortal Kombat (2011). It features stunning graphics, cinematic presentation, brutal gameplay, and a rich story mode that takes place 25 years after the events of its predecessor. It also introduces new characters, variations, modes, and features that make it a must-play for any fan of the genre.</p>
4
- <h2>mortal kombat x mod apk + data download</h2><br /><p><b><b>Download Zip</b> &#9913;&#9913;&#9913; <a href="https://jinyurl.com/2uNPXn">https://jinyurl.com/2uNPXn</a></b></p><br /><br />
5
- <p>But what if you want to play Mortal Kombat X on your Android device? Unfortunately, the official version of the game is not available on Google Play Store due to its high requirements and compatibility issues. However, there is a way to enjoy this amazing game on your smartphone or tablet by using a mod apk + data download. A mod apk is a modified version of an application that allows you to access premium features, unlock content, bypass restrictions, and enhance performance. A data download is a file that contains additional information and resources for an application, such as graphics, sounds, levels, etc.</p>
6
- <p>By using a mod apk + data download for Mortal Kombat X, you can experience the full game on your Android device without any limitations or problems. You can play as any character you want, use any variation you like, customize your fighters, access all game modes, complete all challenges, and enjoy all the updates and DLCs that have been released for the game. You can also play online with other players around the world, or offline with your friends using local multiplayer. All you need is a compatible device, enough storage space, and a reliable internet connection.</p>
7
- <h2>How to Download and Install Mortal Kombat X Mod APK + Data on Your Android Device</h2>
8
- <p>If you are interested in playing Mortal Kombat X with mod apk + data on your Android device, here are the steps you need to follow:</p>
9
- <h3>Step 1: Enable unknown sources on your device settings</h3>
10
- <p>Before you can install any mod apk or data file on your device, you need to enable unknown sources on your device settings. This will allow you to install applications from sources other than Google Play Store. To do this, go to Settings > Security > Unknown Sources and toggle it on. You may also need to confirm this action by tapping OK or Allow.</p>
11
- <h3>Step 2: Download the mod apk + data file from a trusted source</h3>
12
- <p>Next, you need to download the mod apk + data file for Mortal Kombat X from a trusted source. There are many websites that offer this file, but not all of them are safe and reliable. Some may contain viruses, malware, or fake or outdated links. Therefore, you should always do some research and check the reviews and ratings of the source before downloading anything. One of the best sources for Mortal Kombat X mod apk + data download is [this website]. It offers a safe, fast, and easy download link that works for most Android devices. You can also find more information and instructions on how to use the mod apk + data file on the website.</p>
13
- <p>mortal kombat x unlimited coins and souls apk + data<br />
14
- mortal kombat x mega mod apk + obb data<br />
15
- mortal kombat x hacked version apk + data offline<br />
16
- mortal kombat x latest mod apk + data for android<br />
17
- mortal kombat x mod apk + data highly compressed<br />
18
- mortal kombat x mod apk + data revdl<br />
19
- mortal kombat x mod apk + data android 1<br />
20
- mortal kombat x mod apk + data rexdl<br />
21
- mortal kombat x mod apk + data free download<br />
22
- mortal kombat x mod apk + data unlimited everything<br />
23
- mortal kombat x mod apk + data all characters unlocked<br />
24
- mortal kombat x mod apk + data no root<br />
25
- mortal kombat x mod apk + data offline mode<br />
26
- mortal kombat x mod apk + data anti ban<br />
27
- mortal kombat x mod apk + data all gpu<br />
28
- mortal kombat x mod apk + data mali<br />
29
- mortal kombat x mod apk + data adreno<br />
30
- mortal kombat x mod apk + data power vr<br />
31
- mortal kombat x mod apk + data 1.18.0<br />
32
- mortal kombat x mod apk + data 1.21.0<br />
33
- mortal kombat x mod apk + data 1.22.0<br />
34
- mortal kombat x mod apk + data 1.23.0<br />
35
- mortal kombat x mod apk + data 1.24.0<br />
36
- mortal kombat x mod apk + data 1.25.0<br />
37
- mortal kombat x mod apk + data 2.0.0<br />
38
- mortal kombat x mod apk + data 2.1.0<br />
39
- mortal kombat x mod apk + data 2.2.0<br />
40
- mortal kombat x mod apk + data 2.3.0<br />
41
- mortal kombat x mod apk + data 2.4.0<br />
42
- mortal kombat x mod apk + data 2.5.0<br />
43
- mortal kombat x god mode apk + data download<br />
44
- mortal kombat x unlimited health apk + data download<br />
45
- mortal kombat x one hit kill apk + data download<br />
46
- mortal kombat x unlocked skins apk + data download<br />
47
- mortal kombat x unlocked fatalities apk + data download<br />
48
- mortal kombat x unlocked brutalities apk + data download<br />
49
- mortal kombat x unlocked cards apk + data download<br />
50
- mortal kombat x unlocked levels apk + data download<br />
51
- mortal kombat x unlocked features apk + data download<br />
52
- mortal kombat x premium edition apk + data download<br />
53
- how to download and install mortal kombat x mod apk + data on android device <br />
54
- how to download and install mortal kombat x mod apk + data on pc using bluestacks <br />
55
- how to download and install mortal kombat x mod apk + data on ios device <br />
56
- how to download and install mortal kombat x mod apk + data on mac using nox player <br />
57
- how to fix error while downloading or installing mortal kombat x mod apk + data <br />
58
- how to update or uninstall mortal kombat x mod apk + data <br />
59
- how to play online or offline with friends using mortal kombat x mod apk + data <br />
60
- how to backup or restore your progress in mortal kombat x mod apk + data <br />
61
- how to get more coins and souls in mortal kombat x mod apk + data</p>
62
- <h3>Step 3: Extract the data file to the obb folder on your device storage</h3>
63
- <p>After you have downloaded the mod apk + data file, you need to extract the data file to the obb folder on your device storage. The obb folder is where the game stores its additional data and resources. To do this, you need a file manager app that can handle zip files, such as ES File Explorer, ZArchiver, or RAR. You can download any of these apps from Google Play Store for free. Once you have installed a file manager app, follow these steps:</p>
64
- - Locate the mod apk + data file that you have downloaded on your device storage. It should have a name like Mortal-Kombat-X-Mod-APK-Data.zip or something similar. - Tap and hold on the file and select Extract or Unzip from the menu that appears. - Choose a destination folder where you want to extract the file. You can create a new folder or use an existing one. - Tap OK or Extract to start the extraction process. It may take a few minutes depending on the size of the file and your device speed. - Once the extraction is done, you should see a folder named com.wb.goog.mkx or something similar inside the destination folder. This is the data folder for Mortal Kombat X. - Move or copy this folder to the obb folder on your device storage. The obb folder is usually located in Android > obb. If you don't see it, you may need to create it manually. - Make sure that the data folder is inside the obb folder and has the correct name. <h3>Step 4: Install the mod apk file and launch the game</h3>
65
- <p>The final step is to install the mod apk file and launch the game. To do this, follow these steps:</p>
66
- - Locate the mod apk file that you have downloaded on your device storage. It should have a name like Mortal-Kombat-X-Mod-APK.apk or something similar. - Tap on the file and select Install from the menu that appears. - Wait for the installation process to finish. It may take a few seconds or minutes depending on your device speed and compatibility. - Once the installation is done, tap Open or Launch to start the game. - Enjoy Mortal Kombat X with mod apk + data on your Android device! <h2>How to Play Mortal Kombat X with Mod APK + Data</h2>
67
- <p>Now that you have installed and launched Mortal Kombat X with mod apk + data on your Android device, you are ready to play and have fun. Here are some tips and tricks on how to play Mortal Kombat X with mod apk + data:</p>
68
- <h3>Choose your character and variation</h3>
69
- <p>Mortal Kombat X features a roster of over 30 characters, each with their own unique skills, abilities, and fatalities. You can choose from classic characters like Scorpion, Sub-Zero, Raiden, Liu Kang, Sonya Blade, and Johnny Cage, as well as new characters like Cassie Cage, D'Vorah, Kotal Kahn, Erron Black, and Jacqui Briggs. You can also unlock and play as guest characters like Jason Voorhees, Predator, Alien, Leatherface, and Kratos.</p>
70
- <p>Each character has three variations that change their appearance, moveset, and strategy. For example, Scorpion has Ninjutsu, Hellfire, and Inferno variations; Sub-Zero has Cryomancer, Grandmaster, and Unbreakable variations; Raiden has Thunder God, Displacer, and Master of Storms variations; etc. You can choose your variation before each match or change it during gameplay by pressing L1 (or equivalent button) on your controller.</p>
71
- <p>You can also customize your character's appearance by changing their costume, accessory, weapon, taunt, victory pose, etc. You can unlock new costumes by completing challenges, playing the story mode, or using the mod apk + data. You can also create your own custom character by using the Kreate a Fighter feature in the Extras menu.</p>
72
- <h3>Learn the basic and advanced techniques</h3>
73
- <p>Mortal Kombat X is a game that requires skill, timing, and strategy to master. You need to learn the basic and advanced techniques to survive and win against your opponents. Some of the basic techniques are:</p>
74
- - Punch: Press Square (or equivalent button) to perform a quick and weak attack. - Kick: Press X (or equivalent button) to perform a fast and moderate attack. - Block: Press R2 (or equivalent button) to defend yourself from incoming attacks. You can also use directional buttons to block high, mid, or low attacks. - Throw: Press L1 (or equivalent button) or Square + X (or equivalent buttons) to grab and toss your opponent. You can also press directional buttons to change the direction of the throw. - Run: Press R2 + Forward (or equivalent buttons) to sprint towards your opponent. You can use this to close the distance or surprise them with an attack. - Jump: Press Up (or equivalent button) to leap into the air. You can also press directional buttons to jump forward, backward, or sideways. - Crouch: Press Down (or equivalent button) to duck under high attacks or avoid projectiles. You can also press Square or X (or equivalent buttons) to perform a low punch or kick. <p>Some of the advanced techniques are:</p>
75
- - Combo: Press a sequence of buttons to perform a series of attacks that deal more damage and stun your opponent. You can find the list of combos for each character in the Moves List menu or on the screen during gameplay. - Special Move: Press a combination of buttons to perform a unique and powerful attack that uses some of your energy meter. You can find the list of special moves for each character in the Moves List menu or on the screen during gameplay. - X-Ray Move: Press L2 + R2 (or equivalent buttons) when your energy meter is full to perform a devastating attack that shows the internal damage inflicted on your opponent. This move can deal up to 30% damage and break your opponent's bones and organs. - Fatality: Press a specific sequence of buttons at the end of the match when your opponent is in a dizzy state to execute a gruesome finishing move that kills them in a brutal way. You can find the list of fatalities for each character in the Moves List menu or on the screen during gameplay. You can also use the mod apk + data to unlock all fatalities for all characters. - Brutality: Perform a certain requirement during the match, such as using a specific move or variation, and end the match with a specific attack to trigger a violent finishing move that kills your opponent instantly. You can find the list of brutalities for each character in the Moves List menu or on the screen during gameplay. You can also use the mod apk + data to unlock all brutalities for all characters. <h3>Use the environment and special attacks</h3>
76
- <p>Mortal Kombat X features interactive environments that you can use to your advantage or disadvantage during gameplay. You can use objects, weapons, traps, animals, and even people in the background to damage, stun, or escape from your opponent. To use an environmental interaction, press R1 (or equivalent button) when you are near an object that has a white outline. Some examples of environmental interactions are:</p>
77
- - Throwing barrels, rocks, skulls, spears, etc. at your opponent - Jumping off walls, pillars, statues, etc. to evade or attack your opponent - Grabbing branches, chains, hooks, etc. to swing or pull yourself towards or away from your opponent - Activating traps, such as spikes, flames, lasers, etc. to hurt your opponent - Using animals, such as crocodiles, wolves, dragons, etc. to bite or claw your opponent - Using people, such as monks, soldiers, civilians, etc. to hit or distract your opponent <p>Mortal Kombat X also features special attacks that you can use once per match to turn the tide of battle. These are:</p>
78
- - Quitality: If you quit the match online before it ends, your character's head will explode and you will lose automatically. - Faction Kill: If you belong to one of the five factions in Mortal Kombat X (Lin Kuei, Special Forces, Black Dragon, Brotherhood of Shadow, or White Lotus), you can perform a faction-specific finishing move that shows your allegiance and earns you faction points. - Stage Brutality: If you end the match with an environmental interaction, you can trigger a stage-specific finishing move that kills your opponent in a creative way. <h3>Enjoy the different game modes and challenges</h3>
79
- <p>Mortal Kombat X offers a variety of game modes and challenges that you can enjoy with mod apk + data. These are:</p>
80
- - Story Mode: Follow the epic story of Mortal Kombat X that spans 25 years and features multiple characters and events. You can play as different characters in each chapter and make choices that affect the outcome of the story. You can also unlock rewards and secrets by completing the story mode. - Tower Mode: Fight your way through different towers that have different rules, modifiers, and opponents. You can choose from traditional towers, such as Klassic, Test Your Luck, Test Your Might, etc., or dynamic towers, such as Living Towers, Faction Towers, Premier Towers, etc. You can also create your own custom tower by using the mod apk + data. - Online Mode: Compete with other players online in various modes, such as Ranked, Player, King of the Hill, Survivor, etc. You can also join or create a room to chat and play with other players. You can also participate in online events and tournaments that have special rewards and prizes. - Local Mode: Play with your friends offline in various modes, such as Versus, Tag Team, Co-op Arcade, etc. You can also use the mod apk + data to enable local multiplayer on one device by using a split-screen feature. - Challenge Mode: Complete various challenges that test your skills and knowledge of Mortal Kombat X. You can choose from daily challenges, weekly challenges, character challenges, faction challenges, etc. You can also use the mod apk + data to unlock all challenges and rewards. - Krypt Mode: Explore the mysterious and dangerous Krypt that contains secrets, puzzles, traps, and treasures. You can use koins, souls, and hearts to unlock items, such as costumes, fatalities, brutalities, concept art, music, etc. You can also use the mod apk + data to unlock all items and areas in the Krypt. <h2>Conclusion</h2>
81
- <p>Mortal Kombat X is a game that you should not miss if you are a fan of fighting games or Mortal Kombat franchise. It is a game that offers stunning graphics, cinematic presentation, brutal gameplay, and a rich story mode that will keep you entertained for hours. It is also a game that you can enjoy on your Android device by using a mod apk + data download that gives you access to all features, content, and updates of the game.</p>
82
- <p>By following the steps above, you can download and install Mortal Kombat X mod apk + data on your Android device easily and safely. You can also learn how to play Mortal Kombat X with mod apk + data by using the tips and tricks above. You can also enjoy the different game modes and challenges that Mortal Kombat X offers with mod apk + data.</p>
83
- <p>We hope that this article has helped you to play Mortal Kombat X with mod apk + data on your Android device. If you have any questions or feedback, please feel free to share them in the comments section below. We would love to hear from you and help you out.</p>
84
- <h2>FAQs</h2>
85
- <p>Here are some frequently asked questions about Mortal Kombat X with mod apk + data:</p>
86
- <h3>What are the system requirements for Mortal Kombat X on Android?</h3>
87
- <p>The minimum system requirements for Mortal Kombat X on Android are:</p>
88
- - Android 4.0 or higher - 1 GB of RAM - 1.5 GB of free storage space - A stable internet connection <p>The recommended system requirements for Mortal Kombat X on Android are:</p>
89
- - Android 5.0 or higher - 2 GB of RAM - 2 GB of free storage space - A fast internet connection <h3>What are the differences between Mortal Kombat X and Mortal Kombat XL?</h3>
90
- <p>Mortal Kombat XL is an enhanced version of Mortal Kombat X that includes all the updates and DLCs that have been released for the game. It features new characters, costumes, stages, modes, and features that make it the ultimate Mortal Kombat experience. However, Mortal Kombat XL is only available for PlayStation 4, Xbox One, and PC platforms. It is not available for Android devices. Therefore, if you want to play Mortal Kombat XL on your Android device, you need to use a mod apk + data download that includes all the content and updates of Mortal Kombat XL.</p>
91
- <h3>How can I unlock all the characters and costumes in Mortal Kombat X with mod apk + data?</h3>
92
- <p>One of the benefits of using a mod apk + data download for Mortal Kombat X is that you can unlock all the characters and costumes in the game without spending any money or time. You can access all the characters and costumes from the character selection screen or the customization menu. You can also change your character and costume during gameplay by pressing L1 (or equivalent button) on your controller. You can also use the mod apk + data download to unlock new characters and costumes that are not available in the official version of the game, such as Kratos, Freddy Krueger, Michael Myers, etc.</p>
93
- <h3>How can I update Mortal Kombat X with mod apk + data?</h3>
94
- <p>Another benefit of using a mod apk + data download for Mortal Kombat X is that you can update the game with the latest patches and DLCs without any hassle or delay. You can update the game by downloading and installing the latest version of the mod apk + data file from the same source that you used before. You can also check for updates on the website or the app itself. You do not need to uninstall or delete the previous version of the game. You can simply overwrite it with the new version and enjoy the new features and content.</p>
95
- <h3>Is Mortal Kombat X with mod apk + data safe and legal?</h3>
96
- <p>The answer to this question depends on your perspective and preference. On one hand, using a mod apk + data download for Mortal Kombat X is safe and legal as long as you download it from a trusted source that does not contain any viruses, malware, or fake links. You also need to make sure that your device is compatible and has enough storage space and internet connection to run the game smoothly. On the other hand, using a mod apk + data download for Mortal Kombat X is unsafe and illegal as it violates the terms and conditions of the game developer and publisher. You also risk getting banned or suspended from online services and features if you use a mod apk + data download for Mortal Kombat X. Therefore, you should use a mod apk + data download for Mortal Kombat X at your own risk and discretion.</p> 401be4b1e0<br />
97
- <br />
98
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AIConsultant/MusicGen/audiocraft/models/lm.py DELETED
@@ -1,531 +0,0 @@
1
- # Copyright (c) Meta Platforms, Inc. and affiliates.
2
- # All rights reserved.
3
- #
4
- # This source code is licensed under the license found in the
5
- # LICENSE file in the root directory of this source tree.
6
-
7
- from dataclasses import dataclass
8
- from functools import partial
9
- import logging
10
- import math
11
- import typing as tp
12
-
13
- import torch
14
- from torch import nn
15
-
16
- from ..utils import utils
17
- from ..modules.streaming import StreamingModule, State
18
- from ..modules.transformer import StreamingTransformer, create_norm_fn
19
- from ..modules.conditioners import (
20
- ConditionFuser,
21
- ClassifierFreeGuidanceDropout,
22
- AttributeDropout,
23
- ConditioningProvider,
24
- ConditioningAttributes,
25
- ConditionType,
26
- )
27
- from ..modules.codebooks_patterns import CodebooksPatternProvider
28
- from ..modules.activations import get_activation_fn
29
-
30
-
31
- logger = logging.getLogger(__name__)
32
- ConditionTensors = tp.Dict[str, ConditionType]
33
- CFGConditions = tp.Union[ConditionTensors, tp.Tuple[ConditionTensors, ConditionTensors]]
34
-
35
-
36
- def get_init_fn(method: str, input_dim: int, init_depth: tp.Optional[int] = None):
37
- """LM layer initialization.
38
- Inspired from xlformers: https://github.com/fairinternal/xlformers
39
-
40
- Args:
41
- method (str): Method name for init function. Valid options are:
42
- 'gaussian', 'uniform'.
43
- input_dim (int): Input dimension of the initialized module.
44
- init_depth (int, optional): Optional init depth value used to rescale
45
- the standard deviation if defined.
46
- """
47
- # Compute std
48
- std = 1 / math.sqrt(input_dim)
49
- # Rescale with depth
50
- if init_depth is not None:
51
- std = std / math.sqrt(2 * init_depth)
52
-
53
- if method == 'gaussian':
54
- return partial(
55
- torch.nn.init.trunc_normal_, mean=0.0, std=std, a=-3 * std, b=3 * std
56
- )
57
- elif method == 'uniform':
58
- bound = math.sqrt(3) * std # ensure the standard deviation is `std`
59
- return partial(torch.nn.init.uniform_, a=-bound, b=bound)
60
- else:
61
- raise ValueError("Unsupported layer initialization method")
62
-
63
-
64
- def init_layer(m: nn.Module,
65
- method: str,
66
- init_depth: tp.Optional[int] = None,
67
- zero_bias_init: bool = False):
68
- """Wrapper around ``get_init_fn`` for proper initialization of LM modules.
69
-
70
- Args:
71
- m (nn.Module): Module to initialize.
72
- method (str): Method name for the init function.
73
- init_depth (int, optional): Optional init depth value used to rescale
74
- the standard deviation if defined.
75
- zero_bias_init (bool): Whether to initialize the bias to 0 or not.
76
- """
77
- if isinstance(m, nn.Linear):
78
- init_fn = get_init_fn(method, m.in_features, init_depth=init_depth)
79
- if m.weight.device.type == 'cpu' and m.weight.dtype == torch.float16:
80
- weight = m.weight.float()
81
- init_fn(weight)
82
- m.weight.data[:] = weight.half()
83
- else:
84
- init_fn(m.weight)
85
- if zero_bias_init and m.bias is not None:
86
- nn.init.constant_(m.bias, 0)
87
- elif isinstance(m, nn.Embedding):
88
- init_fn = get_init_fn(method, m.embedding_dim, init_depth=None)
89
- if m.weight.device.type == 'cpu' and m.weight.dtype == torch.float16:
90
- weight = m.weight.float()
91
- init_fn(weight)
92
- m.weight.data[:] = weight.half()
93
- else:
94
- init_fn(m.weight)
95
-
96
-
97
- class ScaledEmbedding(nn.Embedding):
98
- """Boost learning rate for embeddings (with `scale`).
99
- """
100
- def __init__(self, *args, lr=None, **kwargs):
101
- super().__init__(*args, **kwargs)
102
- self.lr = lr
103
-
104
- def make_optim_group(self):
105
- group = {"params": list(self.parameters())}
106
- if self.lr is not None:
107
- group["lr"] = self.lr
108
- return group
109
-
110
-
111
- @dataclass
112
- class LMOutput:
113
- # The logits are already re-aligned with the input codes
114
- # hence no extra shift is required, e.g. when computing CE
115
- logits: torch.Tensor # [B, K, T, card]
116
- mask: torch.Tensor # [B, K, T]
117
-
118
-
119
- class LMModel(StreamingModule):
120
- """Transformer-based language model on multiple streams of codes.
121
-
122
- Args:
123
- pattern_provider (CodebooksPatternProvider): Pattern provider for codebook interleaving.
124
- condition_provider (MusicConditioningProvider): Conditioning provider from metadata.
125
- fuser (ConditionFuser): Fuser handling the fusing of conditions with language model input.
126
- n_q (int): Number of parallel streams to model.
127
- card (int): Cardinality, vocabulary size.
128
- dim (int): Dimension of the transformer encoder.
129
- num_heads (int): Number of heads for the transformer encoder.
130
- hidden_scale (int): Scale for hidden feed forward dimension of the transformer encoder.
131
- norm (str): Normalization method.
132
- norm_first (bool): Use pre-norm instead of post-norm.
133
- emb_lr (float, optional): Embedding-specific learning rate.
134
- bias_proj (bool): Use bias for output projections.
135
- weight_init (str, optional): Method for weight initialization.
136
- depthwise_init (str, optional): Method for depthwise weight initialization.
137
- zero_bias_init (bool): If true and bias in Linears, initialize bias to zeros.
138
- cfg_dropout (float): Classifier-free guidance dropout.
139
- cfg_coef (float): Classifier-free guidance coefficient.
140
- attribute_dropout (dict): Attribute dropout probabilities.
141
- two_step_cfg (bool): Whether to run classifier free-guidance with 2 distinct steps.
142
- **kwargs: Additional parameters for the transformer encoder.
143
- """
144
- def __init__(self, pattern_provider: CodebooksPatternProvider, condition_provider: ConditioningProvider,
145
- fuser: ConditionFuser, n_q: int = 8, card: int = 1024, dim: int = 128, num_heads: int = 8,
146
- hidden_scale: int = 4, norm: str = 'layer_norm', norm_first: bool = False,
147
- emb_lr: tp.Optional[float] = None, bias_proj: bool = True,
148
- weight_init: tp.Optional[str] = None, depthwise_init: tp.Optional[str] = None,
149
- zero_bias_init: bool = False, cfg_dropout: float = 0, cfg_coef: float = 1.0,
150
- attribute_dropout: tp.Dict[str, tp.Dict[str, float]] = {}, two_step_cfg: bool = False,
151
- **kwargs):
152
- super().__init__()
153
- self.cfg_coef = cfg_coef
154
- self.cfg_dropout = ClassifierFreeGuidanceDropout(p=cfg_dropout)
155
- self.att_dropout = AttributeDropout(p=attribute_dropout)
156
- self.condition_provider = condition_provider
157
- self.fuser = fuser
158
- self.card = card
159
- embed_dim = self.card + 1
160
- self.n_q = n_q
161
- self.dim = dim
162
- self.pattern_provider = pattern_provider
163
- self.two_step_cfg = two_step_cfg
164
- self.emb = nn.ModuleList([ScaledEmbedding(embed_dim, dim, lr=emb_lr) for _ in range(n_q)])
165
- if 'activation' in kwargs:
166
- kwargs['activation'] = get_activation_fn(kwargs['activation'])
167
- self.transformer = StreamingTransformer(
168
- d_model=dim, num_heads=num_heads, dim_feedforward=int(hidden_scale * dim),
169
- norm=norm, norm_first=norm_first, **kwargs)
170
- self.out_norm: tp.Optional[nn.Module] = None
171
- if norm_first:
172
- self.out_norm = create_norm_fn(norm, dim)
173
- self.linears = nn.ModuleList([nn.Linear(dim, self.card, bias=bias_proj) for _ in range(n_q)])
174
- self._init_weights(weight_init, depthwise_init, zero_bias_init)
175
- self._fsdp: tp.Optional[nn.Module]
176
- self.__dict__['_fsdp'] = None
177
-
178
- def _init_weights(self, weight_init: tp.Optional[str], depthwise_init: tp.Optional[str], zero_bias_init: bool):
179
- """Initialization of the transformer module weights.
180
-
181
- Args:
182
- weight_init (str, optional): Weight initialization strategy. See ``get_init_fn`` for valid options.
183
- depthwise_init (str, optional): Depthwise initialization strategy. The following options are valid:
184
- 'current' where the depth corresponds to the current layer index or 'global' where the total number
185
- of layer is used as depth. If not set, no depthwise initialization strategy is used.
186
- zero_bias_init (bool): Whether to initialize bias to zero or not.
187
- """
188
- assert depthwise_init is None or depthwise_init in ['current', 'global']
189
- assert depthwise_init is None or weight_init is not None, \
190
- "If 'depthwise_init' is defined, a 'weight_init' method should be provided."
191
- assert not zero_bias_init or weight_init is not None, \
192
- "If 'zero_bias_init', a 'weight_init' method should be provided"
193
-
194
- if weight_init is None:
195
- return
196
-
197
- for emb_layer in self.emb:
198
- init_layer(emb_layer, method=weight_init, init_depth=None, zero_bias_init=zero_bias_init)
199
-
200
- for layer_idx, tr_layer in enumerate(self.transformer.layers):
201
- depth = None
202
- if depthwise_init == 'current':
203
- depth = layer_idx + 1
204
- elif depthwise_init == 'global':
205
- depth = len(self.transformer.layers)
206
- init_fn = partial(init_layer, method=weight_init, init_depth=depth, zero_bias_init=zero_bias_init)
207
- tr_layer.apply(init_fn)
208
-
209
- for linear in self.linears:
210
- init_layer(linear, method=weight_init, init_depth=None, zero_bias_init=zero_bias_init)
211
-
212
- @property
213
- def special_token_id(self) -> int:
214
- return self.card
215
-
216
- @property
217
- def num_codebooks(self) -> int:
218
- return self.n_q
219
-
220
- def forward(self, sequence: torch.Tensor,
221
- conditions: tp.List[ConditioningAttributes],
222
- condition_tensors: tp.Optional[ConditionTensors] = None) -> torch.Tensor:
223
- """Apply language model on sequence and conditions.
224
- Given a tensor of sequence of shape [B, K, S] with K the number of codebooks and
225
- S the sequence steps, return the logits with shape [B, card, K, S].
226
-
227
- Args:
228
- indices (torch.Tensor): Indices of the codes to model.
229
- conditions (list of ConditioningAttributes): Conditions to use when modeling
230
- the given codes. Note that when evaluating multiple time with the same conditioning
231
- you should pre-compute those and pass them as `condition_tensors`.
232
- condition_tensors (dict[str, ConditionType], optional): Pre-computed conditioning
233
- tensors, see `conditions`.
234
- Returns:
235
- torch.Tensor: Logits.
236
- """
237
- B, K, S = sequence.shape
238
- assert K == self.num_codebooks, "Sequence shape must match the specified number of codebooks"
239
- input_ = sum([self.emb[k](sequence[:, k]) for k in range(K)])
240
- if condition_tensors is None:
241
- assert not self._is_streaming, "Conditions tensors should be precomputed when streaming."
242
- # apply dropout modules
243
- conditions = self.cfg_dropout(conditions)
244
- conditions = self.att_dropout(conditions)
245
- tokenized = self.condition_provider.tokenize(conditions)
246
- # encode conditions and fuse, both have a streaming cache to not recompute when generating.
247
- condition_tensors = self.condition_provider(tokenized)
248
- else:
249
- assert not conditions, "Shouldn't pass both conditions and condition_tensors."
250
-
251
- input_, cross_attention_input = self.fuser(input_, condition_tensors)
252
-
253
- out = self.transformer(input_, cross_attention_src=cross_attention_input)
254
- if self.out_norm:
255
- out = self.out_norm(out)
256
- logits = torch.stack([self.linears[k](out) for k in range(K)], dim=1) # [B, K, S, card]
257
-
258
- # remove the prefix from the model outputs
259
- if len(self.fuser.fuse2cond['prepend']) > 0:
260
- logits = logits[:, :, -S:]
261
-
262
- return logits # [B, K, S, card]
263
-
264
- def compute_predictions(
265
- self, codes: torch.Tensor,
266
- conditions: tp.List[ConditioningAttributes],
267
- condition_tensors: tp.Optional[ConditionTensors] = None) -> LMOutput:
268
- """Given an input tensor of codes [B, K, T] and list of conditions, runs the model
269
- forward using the specified codes interleaving pattern.
270
-
271
- Args:
272
- codes (torch.Tensor): Input codes of shape [B, K, T] with B the batch size,
273
- K the number of codebooks and T the number of timesteps.
274
- conditions (list of ConditioningAttributes): conditionings to use when modeling
275
- the given codes. Note that when evaluating multiple time with the same conditioning
276
- you should pre-compute those and pass them as `condition_tensors`.
277
- condition_tensors (dict[str, ConditionType], optional): pre-computed conditioning
278
- tensors, see `conditions`.
279
- Returns:
280
- LMOutput: Language model outputs
281
- logits (torch.Tensor) of shape [B, K, T, card] corresponding to the provided codes,
282
- i.e. the first item corresponds to logits to predict the first code, meaning that
283
- no additional shifting of codes and logits is required.
284
- mask (torch.Tensor) of shape [B, K, T], mask over valid and invalid positions.
285
- Given the specified interleaving strategies, parts of the logits and codes should
286
- not be considered as valid predictions because of invalid context.
287
- """
288
- B, K, T = codes.shape
289
- codes = codes.contiguous()
290
- # map codes [B, K, T] into pattern sequence [B, K, S] using special_token_id for masked tokens
291
- pattern = self.pattern_provider.get_pattern(T)
292
- sequence_codes, sequence_indexes, sequence_mask = pattern.build_pattern_sequence(
293
- codes, self.special_token_id, keep_only_valid_steps=True
294
- )
295
- # apply model on pattern sequence
296
- model = self if self._fsdp is None else self._fsdp
297
- logits = model(sequence_codes, conditions, condition_tensors) # [B, K, S, card]
298
- # map back the logits on pattern sequence to logits on original codes: [B, K, S, card] -> [B, K, T, card]
299
- # and provide the corresponding mask over invalid positions of tokens
300
- logits = logits.permute(0, 3, 1, 2) # [B, card, K, S]
301
- # note: we use nans as special token to make it obvious if we feed unexpected logits
302
- logits, logits_indexes, logits_mask = pattern.revert_pattern_logits(
303
- logits, float('nan'), keep_only_valid_steps=True
304
- )
305
- logits = logits.permute(0, 2, 3, 1) # [B, K, T, card]
306
- logits_mask = logits_mask[None, :, :].expand(B, -1, -1) # [K, T] -> [B, K, T]
307
- return LMOutput(logits, logits_mask)
308
-
309
- def _sample_next_token(self,
310
- sequence: torch.Tensor,
311
- cfg_conditions: CFGConditions,
312
- unconditional_state: State,
313
- use_sampling: bool = False,
314
- temp: float = 1.0,
315
- top_k: int = 0,
316
- top_p: float = 0.0,
317
- cfg_coef: tp.Optional[float] = None) -> torch.Tensor:
318
- """Sample next token from the model given a sequence and a set of conditions. The model supports
319
- multiple sampling strategies (greedy sampling, softmax, top-k, top-p...).
320
-
321
- Args:
322
- sequence (torch.Tensor): Current sequence of shape [B, K, S]
323
- with K corresponding to the number of codebooks and S the number of sequence steps.
324
- S = 1 in streaming mode, except for the first step that contains a bigger prompt.
325
- condition_tensors (dict[str, ConditionType): Set of conditions. If CFG is used,
326
- should be twice the batch size, being the concatenation of the conditions + null conditions.
327
- use_sampling (bool): Whether to use a sampling strategy or not.
328
- temp (float): Sampling temperature.
329
- top_k (int): K for "top-k" sampling.
330
- top_p (float): P for "top-p" sampling.
331
- cfg_coef (float, optional): classifier free guidance coefficient
332
- Returns:
333
- next_token (torch.Tensor): Next token tensor of shape [B, K, 1].
334
- """
335
- B = sequence.shape[0]
336
- cfg_coef = self.cfg_coef if cfg_coef is None else cfg_coef
337
- model = self if self._fsdp is None else self._fsdp
338
- if self.two_step_cfg and cfg_conditions != {}:
339
- assert isinstance(cfg_conditions, tuple), type(cfg_conditions)
340
- condition_tensors, null_condition_tensors = cfg_conditions
341
- cond_logits = model(sequence, conditions=[], condition_tensors=condition_tensors)
342
- state = self.get_streaming_state()
343
- self.set_streaming_state(unconditional_state)
344
- uncond_logits = model(sequence, conditions=[], condition_tensors=null_condition_tensors)
345
- unconditional_state.update(self.get_streaming_state())
346
- self.set_streaming_state(state)
347
- logits = uncond_logits + (cond_logits - uncond_logits) * self.cfg_coef
348
- else:
349
- assert isinstance(cfg_conditions, dict)
350
- condition_tensors = cfg_conditions
351
- if condition_tensors:
352
- # Preparing for CFG, predicting both conditional and unconditional logits.
353
- sequence = torch.cat([sequence, sequence], dim=0)
354
- all_logits = model(
355
- sequence,
356
- conditions=[], condition_tensors=condition_tensors)
357
- if condition_tensors:
358
- cond_logits, uncond_logits = all_logits.split(B, dim=0) # [B, K, T, card]
359
- logits = uncond_logits + (cond_logits - uncond_logits) * cfg_coef
360
- else:
361
- logits = all_logits
362
-
363
- logits = logits.permute(0, 1, 3, 2) # [B, K, card, T]
364
- logits = logits[..., -1] # [B x K x card]
365
-
366
- # Apply softmax for sampling if temp > 0. Else, do greedy sampling to avoid zero division error.
367
- if use_sampling and temp > 0.0:
368
- probs = torch.softmax(logits / temp, dim=-1)
369
- if top_p > 0.0:
370
- next_token = utils.sample_top_p(probs, p=top_p)
371
- elif top_k > 0:
372
- next_token = utils.sample_top_k(probs, k=top_k)
373
- else:
374
- next_token = utils.multinomial(probs, num_samples=1)
375
- else:
376
- next_token = torch.argmax(logits, dim=-1, keepdim=True)
377
-
378
- return next_token
379
-
380
- @torch.no_grad()
381
- def generate(self,
382
- prompt: tp.Optional[torch.Tensor] = None,
383
- conditions: tp.List[ConditioningAttributes] = [],
384
- num_samples: tp.Optional[int] = None,
385
- max_gen_len: int = 256,
386
- use_sampling: bool = True,
387
- temp: float = 1.0,
388
- top_k: int = 250,
389
- top_p: float = 0.0,
390
- cfg_coef: tp.Optional[float] = None,
391
- two_step_cfg: tp.Optional[bool] = None,
392
- remove_prompts: bool = False,
393
- check: bool = False,
394
- callback: tp.Optional[tp.Callable[[int, int], None]] = None) -> torch.Tensor:
395
- """Generate tokens sampling from the model given a prompt or unconditionally. Generation can
396
- be perform in a greedy fashion or using sampling with top K and top P strategies.
397
-
398
- Args:
399
- prompt (torch.Tensor, optional): Prompt tokens of shape [B, K, T].
400
- conditions_tensors (list of ConditioningAttributes, optional): List of conditions.
401
- num_samples (int, optional): Number of samples to generate when no prompt and no conditions are given.
402
- max_gen_len (int): Maximum generation length.
403
- use_sampling (bool): Whether to use a sampling strategy or not.
404
- temp (float): Sampling temperature.
405
- top_k (int): K for "top-k" sampling.
406
- top_p (float): P for "top-p" sampling.
407
- cfg_coeff (float, optional): Classifier-free guidance coefficient.
408
- two_step_cfg (bool, optional): Whether to perform classifier-free guidance with two steps generation.
409
- remove_prompts (bool): Whether to remove prompts from generation or not.
410
- check (bool): Whether to apply further checks on generated sequence.
411
- callback (Callback, optional): Callback function to report generation progress.
412
- Returns:
413
- torch.Tensor: Generated tokens.
414
- """
415
- assert not self.training, "generation shouldn't be used in training mode."
416
- first_param = next(iter(self.parameters()))
417
- device = first_param.device
418
-
419
- # Checking all input shapes are consistent.
420
- possible_num_samples = []
421
- if num_samples is not None:
422
- possible_num_samples.append(num_samples)
423
- elif prompt is not None:
424
- possible_num_samples.append(prompt.shape[0])
425
- elif conditions:
426
- possible_num_samples.append(len(conditions))
427
- else:
428
- possible_num_samples.append(1)
429
- assert [x == possible_num_samples[0] for x in possible_num_samples], "Inconsistent inputs shapes"
430
- num_samples = possible_num_samples[0]
431
-
432
- # below we create set of conditions: one conditional and one unconditional
433
- # to do that we merge the regular condition together with the null condition
434
- # we then do 1 forward pass instead of 2.
435
- # the reason for that is two-fold:
436
- # 1. it is about x2 faster than doing 2 forward passes
437
- # 2. avoid the streaming API treating the 2 passes as part of different time steps
438
- # We also support doing two different passes, in particular to ensure that
439
- # the padding structure is exactly the same between train and test.
440
- # With a batch size of 1, this can be slower though.
441
- cfg_conditions: CFGConditions
442
- two_step_cfg = self.two_step_cfg if two_step_cfg is None else two_step_cfg
443
- if conditions:
444
- null_conditions = ClassifierFreeGuidanceDropout(p=1.0)(conditions)
445
- if two_step_cfg:
446
- cfg_conditions = (
447
- self.condition_provider(self.condition_provider.tokenize(conditions)),
448
- self.condition_provider(self.condition_provider.tokenize(null_conditions)),
449
- )
450
- else:
451
- conditions = conditions + null_conditions
452
- tokenized = self.condition_provider.tokenize(conditions)
453
- cfg_conditions = self.condition_provider(tokenized)
454
- else:
455
- cfg_conditions = {}
456
-
457
- if prompt is None:
458
- assert num_samples > 0
459
- prompt = torch.zeros((num_samples, self.num_codebooks, 0), dtype=torch.long, device=device)
460
-
461
- B, K, T = prompt.shape
462
- start_offset = T
463
- assert start_offset < max_gen_len
464
-
465
- pattern = self.pattern_provider.get_pattern(max_gen_len)
466
- # this token is used as default value for codes that are not generated yet
467
- unknown_token = -1
468
-
469
- # we generate codes up to the max_gen_len that will be mapped to the pattern sequence
470
- gen_codes = torch.full((B, K, max_gen_len), unknown_token, dtype=torch.long, device=device)
471
- # filling the gen_codes with the prompt if needed
472
- gen_codes[..., :start_offset] = prompt
473
- # create the gen_sequence with proper interleaving from the pattern: [B, K, S]
474
- gen_sequence, indexes, mask = pattern.build_pattern_sequence(gen_codes, self.special_token_id)
475
- # retrieve the start_offset in the sequence:
476
- # it is the first sequence step that contains the `start_offset` timestep
477
- start_offset_sequence = pattern.get_first_step_with_timesteps(start_offset)
478
- assert start_offset_sequence is not None
479
-
480
- with self.streaming():
481
- unconditional_state = self.get_streaming_state()
482
- prev_offset = 0
483
- gen_sequence_len = gen_sequence.shape[-1] # gen_sequence shape is [B, K, S]
484
- for offset in range(start_offset_sequence, gen_sequence_len):
485
- # get current sequence (note that the streaming API is providing the caching over previous offsets)
486
- curr_sequence = gen_sequence[..., prev_offset:offset]
487
- curr_mask = mask[None, ..., prev_offset:offset].expand(B, -1, -1)
488
- if check:
489
- # check coherence between mask and sequence
490
- assert (curr_sequence == torch.where(curr_mask, curr_sequence, self.special_token_id)).all()
491
- # should never happen as gen_sequence is filled progressively
492
- assert not (curr_sequence == unknown_token).any()
493
- # sample next token from the model, next token shape is [B, K, 1]
494
- next_token = self._sample_next_token(
495
- curr_sequence, cfg_conditions, unconditional_state, use_sampling, temp, top_k, top_p,
496
- cfg_coef=cfg_coef)
497
- # ensure the tokens that should be masked are properly set to special_token_id
498
- # as the model never output special_token_id
499
- valid_mask = mask[..., offset:offset+1].expand(B, -1, -1)
500
- next_token[~valid_mask] = self.special_token_id
501
- # ensure we don't overwrite prompt tokens, we only write over unknown tokens
502
- # (then mask tokens should be left as is as well, which is correct)
503
- gen_sequence[..., offset:offset+1] = torch.where(
504
- gen_sequence[..., offset:offset+1] == unknown_token,
505
- next_token, gen_sequence[..., offset:offset+1]
506
- )
507
- prev_offset = offset
508
- if callback is not None:
509
- callback(1 + offset - start_offset_sequence, gen_sequence_len - start_offset_sequence)
510
- unconditional_state.clear()
511
-
512
- # ensure sequence has been entirely filled
513
- assert not (gen_sequence == unknown_token).any()
514
- # ensure gen_sequence pattern and mask are matching
515
- # which means the gen_sequence is valid according to the pattern
516
- assert (
517
- gen_sequence == torch.where(mask[None, ...].expand(B, -1, -1), gen_sequence, self.special_token_id)
518
- ).all()
519
- # get back the codes, trimming the prompt if needed and cutting potentially incomplete timesteps
520
- out_codes, out_indexes, out_mask = pattern.revert_pattern_sequence(gen_sequence, special_token=unknown_token)
521
-
522
- # sanity checks over the returned codes and corresponding masks
523
- assert (out_codes[..., :max_gen_len] != unknown_token).all()
524
- assert (out_mask[..., :max_gen_len] == 1).all()
525
-
526
- out_start_offset = start_offset if remove_prompts else 0
527
- out_codes = out_codes[..., out_start_offset:max_gen_len]
528
-
529
- # ensure the returned codes are all valid
530
- assert (out_codes >= 0).all() and (out_codes <= self.card).all()
531
- return out_codes
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AIConsultant/MusicGen/audiocraft/utils/export_legacy.py DELETED
@@ -1,56 +0,0 @@
1
- # Copyright (c) Meta Platforms, Inc. and affiliates.
2
- # All rights reserved.
3
- #
4
- # This source code is licensed under the license found in the
5
- # LICENSE file in the root directory of this source tree.
6
-
7
- """
8
- Legacy functions used at the time of the first release, kept for referencd.
9
- """
10
-
11
- from pathlib import Path
12
- import typing as tp
13
-
14
- from omegaconf import OmegaConf, DictConfig
15
- import torch
16
-
17
-
18
- def _clean_lm_cfg(cfg: DictConfig):
19
- OmegaConf.set_struct(cfg, False)
20
- # This used to be set automatically in the LM solver, need a more robust solution
21
- # for the future.
22
- cfg['transformer_lm']['card'] = 2048
23
- cfg['transformer_lm']['n_q'] = 4
24
- # Experimental params no longer supported.
25
- bad_params = ['spectral_norm_attn_iters', 'spectral_norm_ff_iters',
26
- 'residual_balancer_attn', 'residual_balancer_ff', 'layer_drop']
27
- for name in bad_params:
28
- del cfg['transformer_lm'][name]
29
- OmegaConf.set_struct(cfg, True)
30
- return cfg
31
-
32
-
33
- def export_encodec(checkpoint_path: tp.Union[Path, str], out_folder: tp.Union[Path, str]):
34
- sig = Path(checkpoint_path).parent.name
35
- assert len(sig) == 8, "Not a valid Dora signature"
36
- pkg = torch.load(checkpoint_path, 'cpu')
37
- new_pkg = {
38
- 'best_state': pkg['ema']['state']['model'],
39
- 'xp.cfg': OmegaConf.to_yaml(pkg['xp.cfg']),
40
- }
41
- out_file = Path(out_folder) / f'{sig}.th'
42
- torch.save(new_pkg, out_file)
43
- return out_file
44
-
45
-
46
- def export_lm(checkpoint_path: tp.Union[Path, str], out_folder: tp.Union[Path, str]):
47
- sig = Path(checkpoint_path).parent.name
48
- assert len(sig) == 8, "Not a valid Dora signature"
49
- pkg = torch.load(checkpoint_path, 'cpu')
50
- new_pkg = {
51
- 'best_state': pkg['fsdp_best_state']['model'],
52
- 'xp.cfg': OmegaConf.to_yaml(_clean_lm_cfg(pkg['xp.cfg']))
53
- }
54
- out_file = Path(out_folder) / f'{sig}.th'
55
- torch.save(new_pkg, out_file)
56
- return out_file
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AIFILMS/generate_human_motion/pyrender/README.md DELETED
@@ -1,92 +0,0 @@
1
- # Pyrender
2
-
3
- [![Build Status](https://travis-ci.org/mmatl/pyrender.svg?branch=master)](https://travis-ci.org/mmatl/pyrender)
4
- [![Documentation Status](https://readthedocs.org/projects/pyrender/badge/?version=latest)](https://pyrender.readthedocs.io/en/latest/?badge=latest)
5
- [![Coverage Status](https://coveralls.io/repos/github/mmatl/pyrender/badge.svg?branch=master)](https://coveralls.io/github/mmatl/pyrender?branch=master)
6
- [![PyPI version](https://badge.fury.io/py/pyrender.svg)](https://badge.fury.io/py/pyrender)
7
- [![Downloads](https://pepy.tech/badge/pyrender)](https://pepy.tech/project/pyrender)
8
-
9
- Pyrender is a pure Python (2.7, 3.4, 3.5, 3.6) library for physically-based
10
- rendering and visualization.
11
- It is designed to meet the [glTF 2.0 specification from Khronos](https://www.khronos.org/gltf/).
12
-
13
- Pyrender is lightweight, easy to install, and simple to use.
14
- It comes packaged with both an intuitive scene viewer and a headache-free
15
- offscreen renderer with support for GPU-accelerated rendering on headless
16
- servers, which makes it perfect for machine learning applications.
17
-
18
- Extensive documentation, including a quickstart guide, is provided [here](https://pyrender.readthedocs.io/en/latest/).
19
-
20
- For a minimal working example of GPU-accelerated offscreen rendering using EGL,
21
- check out the [EGL Google CoLab Notebook](https://colab.research.google.com/drive/1pcndwqeY8vker3bLKQNJKr3B-7-SYenE?usp=sharing).
22
-
23
-
24
- <p align="center">
25
- <img width="48%" src="https://github.com/mmatl/pyrender/blob/master/docs/source/_static/rotation.gif?raw=true" alt="GIF of Viewer"/>
26
- <img width="48%" src="https://github.com/mmatl/pyrender/blob/master/docs/source/_static/damaged_helmet.png?raw=true" alt="Damaged Helmet"/>
27
- </p>
28
-
29
- ## Installation
30
- You can install pyrender directly from pip.
31
-
32
- ```bash
33
- pip install pyrender
34
- ```
35
-
36
- ## Features
37
-
38
- Despite being lightweight, pyrender has lots of features, including:
39
-
40
- * Simple interoperation with the amazing [trimesh](https://github.com/mikedh/trimesh) project,
41
- which enables out-of-the-box support for dozens of mesh types, including OBJ,
42
- STL, DAE, OFF, PLY, and GLB.
43
- * An easy-to-use scene viewer with support for animation, showing face and vertex
44
- normals, toggling lighting conditions, and saving images and GIFs.
45
- * An offscreen rendering module that supports OSMesa and EGL backends.
46
- * Shadow mapping for directional and spot lights.
47
- * Metallic-roughness materials for physically-based rendering, including several
48
- types of texture and normal mapping.
49
- * Transparency.
50
- * Depth and color image generation.
51
-
52
- ## Sample Usage
53
-
54
- For sample usage, check out the [quickstart
55
- guide](https://pyrender.readthedocs.io/en/latest/examples/index.html) or one of
56
- the Google CoLab Notebooks:
57
-
58
- * [EGL Google CoLab Notebook](https://colab.research.google.com/drive/1pcndwqeY8vker3bLKQNJKr3B-7-SYenE?usp=sharing)
59
-
60
- ## Viewer Keyboard and Mouse Controls
61
-
62
- When using the viewer, the basic controls for moving about the scene are as follows:
63
-
64
- * To rotate the camera about the center of the scene, hold the left mouse button and drag the cursor.
65
- * To rotate the camera about its viewing axis, hold `CTRL` left mouse button and drag the cursor.
66
- * To pan the camera, do one of the following:
67
- * Hold `SHIFT`, then hold the left mouse button and drag the cursor.
68
- * Hold the middle mouse button and drag the cursor.
69
- * To zoom the camera in or out, do one of the following:
70
- * Scroll the mouse wheel.
71
- * Hold the right mouse button and drag the cursor.
72
-
73
- The available keyboard commands are as follows:
74
-
75
- * `a`: Toggles rotational animation mode.
76
- * `c`: Toggles backface culling.
77
- * `f`: Toggles fullscreen mode.
78
- * `h`: Toggles shadow rendering.
79
- * `i`: Toggles axis display mode (no axes, world axis, mesh axes, all axes).
80
- * `l`: Toggles lighting mode (scene lighting, Raymond lighting, or direct lighting).
81
- * `m`: Toggles face normal visualization.
82
- * `n`: Toggles vertex normal visualization.
83
- * `o`: Toggles orthographic camera mode.
84
- * `q`: Quits the viewer.
85
- * `r`: Starts recording a GIF, and pressing again stops recording and opens a file dialog.
86
- * `s`: Opens a file dialog to save the current view as an image.
87
- * `w`: Toggles wireframe mode (scene default, flip wireframes, all wireframe, or all solid).
88
- * `z`: Resets the camera to the default view.
89
-
90
- As a note, displaying shadows significantly slows down rendering, so if you're
91
- experiencing low framerates, just kill shadows or reduce the number of lights in
92
- your scene.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AIZero2Hero4Health/3-ChatbotBlenderbot-GR/README.md DELETED
@@ -1,12 +0,0 @@
1
- ---
2
- title: 3 ChatbotBlenderbot GR
3
- emoji: 🏢
4
- colorFrom: blue
5
- colorTo: green
6
- sdk: gradio
7
- sdk_version: 3.8.2
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/ASJMO/freegpt/g4f/Provider/Providers/Ails.py DELETED
@@ -1,87 +0,0 @@
1
- import os
2
- import time
3
- import json
4
- import uuid
5
- import hashlib
6
- import requests
7
-
8
- from ...typing import sha256, Dict, get_type_hints
9
- from datetime import datetime
10
-
11
- url: str = 'https://ai.ls'
12
- model: str = 'gpt-3.5-turbo'
13
- supports_stream = True
14
- needs_auth = False
15
- working = True
16
-
17
-
18
- class Utils:
19
- def hash(json_data: Dict[str, str]) -> sha256:
20
-
21
- base_string: str = '%s:%s:%s:%s' % (
22
- json_data['t'],
23
- json_data['m'],
24
- 'WI,2rU#_r:r~aF4aJ36[.Z(/8Rv93Rf',
25
- len(json_data['m'])
26
- )
27
-
28
- return hashlib.sha256(base_string.encode()).hexdigest()
29
-
30
- def format_timestamp(timestamp: int) -> str:
31
-
32
- e = timestamp
33
- n = e % 10
34
- r = n + 1 if n % 2 == 0 else n
35
- return str(e - n + r)
36
-
37
-
38
- def _create_completion(model: str, messages: list, temperature: float = 0.6, stream: bool = False, **kwargs):
39
-
40
- headers = {
41
- 'authority': 'api.caipacity.com',
42
- 'accept': '*/*',
43
- 'accept-language': 'en,fr-FR;q=0.9,fr;q=0.8,es-ES;q=0.7,es;q=0.6,en-US;q=0.5,am;q=0.4,de;q=0.3',
44
- 'authorization': 'Bearer free',
45
- 'client-id': str(uuid.uuid4()),
46
- 'client-v': '0.1.249',
47
- 'content-type': 'application/json',
48
- 'origin': 'https://ai.ls',
49
- 'referer': 'https://ai.ls/',
50
- 'sec-ch-ua': '"Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"',
51
- 'sec-ch-ua-mobile': '?0',
52
- 'sec-ch-ua-platform': '"Windows"',
53
- 'sec-fetch-dest': 'empty',
54
- 'sec-fetch-mode': 'cors',
55
- 'sec-fetch-site': 'cross-site',
56
- 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
57
- }
58
-
59
- timestamp = Utils.format_timestamp(int(time.time() * 1000))
60
-
61
- sig = {
62
- 'd': datetime.now().strftime('%Y-%m-%d'),
63
- 't': timestamp,
64
- 's': Utils.hash({
65
- 't': timestamp,
66
- 'm': messages[-1]['content']})}
67
-
68
- json_data = json.dumps(separators=(',', ':'), obj={
69
- 'model': 'gpt-3.5-turbo',
70
- 'temperature': 0.6,
71
- 'stream': True,
72
- 'messages': messages} | sig)
73
-
74
- response = requests.post('https://api.caipacity.com/v1/chat/completions',
75
- headers=headers, data=json_data, stream=True)
76
-
77
- for token in response.iter_lines():
78
- if b'content' in token:
79
- completion_chunk = json.loads(token.decode().replace('data: ', ''))
80
- token = completion_chunk['choices'][0]['delta'].get('content')
81
- if token != None:
82
- yield token
83
-
84
-
85
- params = f'g4f.Providers.{os.path.basename(__file__)[:-3]} supports: ' + \
86
- '(%s)' % ', '.join(
87
- [f"{name}: {get_type_hints(_create_completion)[name].__name__}" for name in _create_completion.__code__.co_varnames[:_create_completion.__code__.co_argcount]])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AfrodreamsAI/afrodreams/CaffeLoader.py DELETED
@@ -1,254 +0,0 @@
1
- import torch
2
- import torch.nn as nn
3
-
4
-
5
- class VGG(nn.Module):
6
- def __init__(self, features, num_classes=1000):
7
- super(VGG, self).__init__()
8
- self.features = features
9
- self.classifier = nn.Sequential(
10
- nn.Linear(512 * 7 * 7, 4096),
11
- nn.ReLU(True),
12
- nn.Dropout(),
13
- nn.Linear(4096, 4096),
14
- nn.ReLU(True),
15
- nn.Dropout(),
16
- nn.Linear(4096, num_classes),
17
- )
18
-
19
-
20
- class VGG_SOD(nn.Module):
21
- def __init__(self, features, num_classes=100):
22
- super(VGG_SOD, self).__init__()
23
- self.features = features
24
- self.classifier = nn.Sequential(
25
- nn.Linear(512 * 7 * 7, 4096),
26
- nn.ReLU(True),
27
- nn.Dropout(),
28
- nn.Linear(4096, 4096),
29
- nn.ReLU(True),
30
- nn.Dropout(),
31
- nn.Linear(4096, 100),
32
- )
33
-
34
-
35
- class VGG_FCN32S(nn.Module):
36
- def __init__(self, features, num_classes=1000):
37
- super(VGG_FCN32S, self).__init__()
38
- self.features = features
39
- self.classifier = nn.Sequential(
40
- nn.Conv2d(512,4096,(7, 7)),
41
- nn.ReLU(True),
42
- nn.Dropout(0.5),
43
- nn.Conv2d(4096,4096,(1, 1)),
44
- nn.ReLU(True),
45
- nn.Dropout(0.5),
46
- )
47
-
48
-
49
- class VGG_PRUNED(nn.Module):
50
- def __init__(self, features, num_classes=1000):
51
- super(VGG_PRUNED, self).__init__()
52
- self.features = features
53
- self.classifier = nn.Sequential(
54
- nn.Linear(512 * 7 * 7, 4096),
55
- nn.ReLU(True),
56
- nn.Dropout(0.5),
57
- nn.Linear(4096, 4096),
58
- nn.ReLU(True),
59
- nn.Dropout(0.5),
60
- )
61
-
62
-
63
- class NIN(nn.Module):
64
- def __init__(self, pooling):
65
- super(NIN, self).__init__()
66
- if pooling == 'max':
67
- pool2d = nn.MaxPool2d((3, 3),(2, 2),(0, 0),ceil_mode=True)
68
- elif pooling == 'avg':
69
- pool2d = nn.AvgPool2d((3, 3),(2, 2),(0, 0),ceil_mode=True)
70
-
71
- self.features = nn.Sequential(
72
- nn.Conv2d(3,96,(11, 11),(4, 4)),
73
- nn.ReLU(inplace=True),
74
- nn.Conv2d(96,96,(1, 1)),
75
- nn.ReLU(inplace=True),
76
- nn.Conv2d(96,96,(1, 1)),
77
- nn.ReLU(inplace=True),
78
- pool2d,
79
- nn.Conv2d(96,256,(5, 5),(1, 1),(2, 2)),
80
- nn.ReLU(inplace=True),
81
- nn.Conv2d(256,256,(1, 1)),
82
- nn.ReLU(inplace=True),
83
- nn.Conv2d(256,256,(1, 1)),
84
- nn.ReLU(inplace=True),
85
- pool2d,
86
- nn.Conv2d(256,384,(3, 3),(1, 1),(1, 1)),
87
- nn.ReLU(inplace=True),
88
- nn.Conv2d(384,384,(1, 1)),
89
- nn.ReLU(inplace=True),
90
- nn.Conv2d(384,384,(1, 1)),
91
- nn.ReLU(inplace=True),
92
- pool2d,
93
- nn.Dropout(0.5),
94
- nn.Conv2d(384,1024,(3, 3),(1, 1),(1, 1)),
95
- nn.ReLU(inplace=True),
96
- nn.Conv2d(1024,1024,(1, 1)),
97
- nn.ReLU(inplace=True),
98
- nn.Conv2d(1024,1000,(1, 1)),
99
- nn.ReLU(inplace=True),
100
- nn.AvgPool2d((6, 6),(1, 1),(0, 0),ceil_mode=True),
101
- nn.Softmax(),
102
- )
103
-
104
-
105
-
106
- class ModelParallel(nn.Module):
107
- def __init__(self, net, device_ids, device_splits):
108
- super(ModelParallel, self).__init__()
109
- self.device_list = self.name_devices(device_ids.split(','))
110
- self.chunks = self.chunks_to_devices(self.split_net(net, device_splits.split(',')))
111
-
112
- def name_devices(self, input_list):
113
- device_list = []
114
- for i, device in enumerate(input_list):
115
- if str(device).lower() != 'c':
116
- device_list.append("cuda:" + str(device))
117
- else:
118
- device_list.append("cpu")
119
- return device_list
120
-
121
- def split_net(self, net, device_splits):
122
- chunks, cur_chunk = [], nn.Sequential()
123
- for i, l in enumerate(net):
124
- cur_chunk.add_module(str(i), net[i])
125
- if str(i) in device_splits and device_splits != '':
126
- del device_splits[0]
127
- chunks.append(cur_chunk)
128
- cur_chunk = nn.Sequential()
129
- chunks.append(cur_chunk)
130
- return chunks
131
-
132
- def chunks_to_devices(self, chunks):
133
- for i, chunk in enumerate(chunks):
134
- chunk.to(self.device_list[i])
135
- return chunks
136
-
137
- def c(self, input, i):
138
- if input.type() == 'torch.FloatTensor' and 'cuda' in self.device_list[i]:
139
- input = input.type('torch.cuda.FloatTensor')
140
- elif input.type() == 'torch.cuda.FloatTensor' and 'cpu' in self.device_list[i]:
141
- input = input.type('torch.FloatTensor')
142
- return input
143
-
144
- def forward(self, input):
145
- for i, chunk in enumerate(self.chunks):
146
- if i < len(self.chunks) -1:
147
- input = self.c(chunk(self.c(input, i).to(self.device_list[i])), i+1).to(self.device_list[i+1])
148
- else:
149
- input = chunk(input)
150
- return input
151
-
152
-
153
-
154
- def buildSequential(channel_list, pooling):
155
- layers = []
156
- in_channels = 3
157
- if pooling == 'max':
158
- pool2d = nn.MaxPool2d(kernel_size=2, stride=2)
159
- elif pooling == 'avg':
160
- pool2d = nn.AvgPool2d(kernel_size=2, stride=2)
161
- else:
162
- raise ValueError("Unrecognized pooling parameter")
163
- for c in channel_list:
164
- if c == 'P':
165
- layers += [pool2d]
166
- else:
167
- conv2d = nn.Conv2d(in_channels, c, kernel_size=3, padding=1)
168
- layers += [conv2d, nn.ReLU(inplace=True)]
169
- in_channels = c
170
- return nn.Sequential(*layers)
171
-
172
-
173
- channel_list = {
174
- 'VGG-16p': [24, 22, 'P', 41, 51, 'P', 108, 89, 111, 'P', 184, 276, 228, 'P', 512, 512, 512, 'P'],
175
- 'VGG-16': [64, 64, 'P', 128, 128, 'P', 256, 256, 256, 'P', 512, 512, 512, 'P', 512, 512, 512, 'P'],
176
- 'VGG-19': [64, 64, 'P', 128, 128, 'P', 256, 256, 256, 256, 'P', 512, 512, 512, 512, 'P', 512, 512, 512, 512, 'P'],
177
- }
178
-
179
- nin_dict = {
180
- 'C': ['conv1', 'cccp1', 'cccp2', 'conv2', 'cccp3', 'cccp4', 'conv3', 'cccp5', 'cccp6', 'conv4-1024', 'cccp7-1024', 'cccp8-1024'],
181
- 'R': ['relu0', 'relu1', 'relu2', 'relu3', 'relu5', 'relu6', 'relu7', 'relu8', 'relu9', 'relu10', 'relu11', 'relu12'],
182
- 'P': ['pool1', 'pool2', 'pool3', 'pool4'],
183
- 'D': ['drop'],
184
- }
185
- vgg16_dict = {
186
- 'C': ['conv1_1', 'conv1_2', 'conv2_1', 'conv2_2', 'conv3_1', 'conv3_2', 'conv3_3', 'conv4_1', 'conv4_2', 'conv4_3', 'conv5_1', 'conv5_2', 'conv5_3'],
187
- 'R': ['relu1_1', 'relu1_2', 'relu2_1', 'relu2_2', 'relu3_1', 'relu3_2', 'relu3_3', 'relu4_1', 'relu4_2', 'relu4_3', 'relu5_1', 'relu5_2', 'relu5_3'],
188
- 'P': ['pool1', 'pool2', 'pool3', 'pool4', 'pool5'],
189
- }
190
- vgg19_dict = {
191
- 'C': ['conv1_1', 'conv1_2', 'conv2_1', 'conv2_2', 'conv3_1', 'conv3_2', 'conv3_3', 'conv3_4', 'conv4_1', 'conv4_2', 'conv4_3', 'conv4_4', 'conv5_1', 'conv5_2', 'conv5_3', 'conv5_4'],
192
- 'R': ['relu1_1', 'relu1_2', 'relu2_1', 'relu2_2', 'relu3_1', 'relu3_2', 'relu3_3', 'relu3_4', 'relu4_1', 'relu4_2', 'relu4_3', 'relu4_4', 'relu5_1', 'relu5_2', 'relu5_3', 'relu5_4'],
193
- 'P': ['pool1', 'pool2', 'pool3', 'pool4', 'pool5'],
194
- }
195
-
196
-
197
- def modelSelector(model_file, pooling):
198
- vgg_list = ["fcn32s", "pruning", "sod", "vgg"]
199
- if any(name in model_file for name in vgg_list):
200
- if "pruning" in model_file:
201
- print("VGG-16 Architecture Detected")
202
- print("Using The Channel Pruning Model")
203
- cnn, layerList = VGG_PRUNED(buildSequential(channel_list['VGG-16p'], pooling)), vgg16_dict
204
- elif "fcn32s" in model_file:
205
- print("VGG-16 Architecture Detected")
206
- print("Using the fcn32s-heavy-pascal Model")
207
- cnn, layerList = VGG_FCN32S(buildSequential(channel_list['VGG-16'], pooling)), vgg16_dict
208
- elif "sod" in model_file:
209
- print("VGG-16 Architecture Detected")
210
- print("Using The SOD Fintune Model")
211
- cnn, layerList = VGG_SOD(buildSequential(channel_list['VGG-16'], pooling)), vgg16_dict
212
- elif "19" in model_file:
213
- print("VGG-19 Architecture Detected")
214
- cnn, layerList = VGG(buildSequential(channel_list['VGG-19'], pooling)), vgg19_dict
215
- elif "16" in model_file:
216
- print("VGG-16 Architecture Detected")
217
- cnn, layerList = VGG(buildSequential(channel_list['VGG-16'], pooling)), vgg16_dict
218
- else:
219
- raise ValueError("VGG architecture not recognized.")
220
- elif "nin" in model_file:
221
- print("NIN Architecture Detected")
222
- cnn, layerList = NIN(pooling), nin_dict
223
- else:
224
- raise ValueError("Model architecture not recognized.")
225
- return cnn, layerList
226
-
227
-
228
- # Print like Torch7/loadcaffe
229
- def print_loadcaffe(cnn, layerList):
230
- c = 0
231
- for l in list(cnn):
232
- if "Conv2d" in str(l):
233
- in_c, out_c, ks = str(l.in_channels), str(l.out_channels), str(l.kernel_size)
234
- print(layerList['C'][c] +": " + (out_c + " " + in_c + " " + ks).replace(")",'').replace("(",'').replace(",",'') )
235
- c+=1
236
- if c == len(layerList['C']):
237
- break
238
-
239
-
240
- # Load the model, and configure pooling layer type
241
- def loadCaffemodel(model_file, pooling, use_gpu, disable_check):
242
- cnn, layerList = modelSelector(str(model_file).lower(), pooling)
243
-
244
- cnn.load_state_dict(torch.load(model_file), strict=(not disable_check))
245
- print("Successfully loaded " + str(model_file))
246
-
247
- # Maybe convert the model to cuda now, to avoid later issues
248
- if "c" not in str(use_gpu).lower() or "c" not in str(use_gpu[0]).lower():
249
- cnn = cnn.cuda()
250
- cnn = cnn.features
251
-
252
- print_loadcaffe(cnn, layerList)
253
-
254
- return cnn, layerList
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/plugins/mousewheeltoupdown-plugin.js DELETED
@@ -1,20 +0,0 @@
1
- import MouseWheelToUpDown from './mousewheeltoupdown.js';
2
-
3
- class MouseWheelToUpDownPlugin extends Phaser.Plugins.BasePlugin {
4
-
5
- constructor(pluginManager) {
6
- super(pluginManager);
7
- }
8
-
9
- start() {
10
- var eventEmitter = this.game.events;
11
- eventEmitter.on('destroy', this.destroy, this);
12
- }
13
-
14
- add(scene, config) {
15
- return new MouseWheelToUpDown(scene, config);
16
- }
17
-
18
- }
19
-
20
- export default MouseWheelToUpDownPlugin;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AlirezaSM/bear_classifier/app.py DELETED
@@ -1,17 +0,0 @@
1
- from fastai.vision.all import *
2
- import gradio as gr
3
-
4
- learn = load_learner('export.pkl')
5
-
6
- categories = ('Black', 'Grizzly', 'Teddy')
7
-
8
- def classify_image(img):
9
- pred, idx, probs = learn.predict(img)
10
- return dict(zip(categories, map(float, probs)))
11
-
12
- image = gr.inputs.Image(shape=(192, 192))
13
- label = gr.outputs.Label()
14
- examples = ['black.jpg', 'grizzly.jpg', 'teddy.jpg']
15
-
16
- intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
17
- intf.launch(inline=False)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Alycer/VITS-Umamusume-voice-synthesizer/attentions.py DELETED
@@ -1,300 +0,0 @@
1
- import math
2
- import torch
3
- from torch import nn
4
- from torch.nn import functional as F
5
-
6
- import commons
7
- from modules import LayerNorm
8
-
9
-
10
- class Encoder(nn.Module):
11
- def __init__(self, hidden_channels, filter_channels, n_heads, n_layers, kernel_size=1, p_dropout=0., window_size=4, **kwargs):
12
- super().__init__()
13
- self.hidden_channels = hidden_channels
14
- self.filter_channels = filter_channels
15
- self.n_heads = n_heads
16
- self.n_layers = n_layers
17
- self.kernel_size = kernel_size
18
- self.p_dropout = p_dropout
19
- self.window_size = window_size
20
-
21
- self.drop = nn.Dropout(p_dropout)
22
- self.attn_layers = nn.ModuleList()
23
- self.norm_layers_1 = nn.ModuleList()
24
- self.ffn_layers = nn.ModuleList()
25
- self.norm_layers_2 = nn.ModuleList()
26
- for i in range(self.n_layers):
27
- self.attn_layers.append(MultiHeadAttention(hidden_channels, hidden_channels, n_heads, p_dropout=p_dropout, window_size=window_size))
28
- self.norm_layers_1.append(LayerNorm(hidden_channels))
29
- self.ffn_layers.append(FFN(hidden_channels, hidden_channels, filter_channels, kernel_size, p_dropout=p_dropout))
30
- self.norm_layers_2.append(LayerNorm(hidden_channels))
31
-
32
- def forward(self, x, x_mask):
33
- attn_mask = x_mask.unsqueeze(2) * x_mask.unsqueeze(-1)
34
- x = x * x_mask
35
- for i in range(self.n_layers):
36
- y = self.attn_layers[i](x, x, attn_mask)
37
- y = self.drop(y)
38
- x = self.norm_layers_1[i](x + y)
39
-
40
- y = self.ffn_layers[i](x, x_mask)
41
- y = self.drop(y)
42
- x = self.norm_layers_2[i](x + y)
43
- x = x * x_mask
44
- return x
45
-
46
-
47
- class Decoder(nn.Module):
48
- def __init__(self, hidden_channels, filter_channels, n_heads, n_layers, kernel_size=1, p_dropout=0., proximal_bias=False, proximal_init=True, **kwargs):
49
- super().__init__()
50
- self.hidden_channels = hidden_channels
51
- self.filter_channels = filter_channels
52
- self.n_heads = n_heads
53
- self.n_layers = n_layers
54
- self.kernel_size = kernel_size
55
- self.p_dropout = p_dropout
56
- self.proximal_bias = proximal_bias
57
- self.proximal_init = proximal_init
58
-
59
- self.drop = nn.Dropout(p_dropout)
60
- self.self_attn_layers = nn.ModuleList()
61
- self.norm_layers_0 = nn.ModuleList()
62
- self.encdec_attn_layers = nn.ModuleList()
63
- self.norm_layers_1 = nn.ModuleList()
64
- self.ffn_layers = nn.ModuleList()
65
- self.norm_layers_2 = nn.ModuleList()
66
- for i in range(self.n_layers):
67
- self.self_attn_layers.append(MultiHeadAttention(hidden_channels, hidden_channels, n_heads, p_dropout=p_dropout, proximal_bias=proximal_bias, proximal_init=proximal_init))
68
- self.norm_layers_0.append(LayerNorm(hidden_channels))
69
- self.encdec_attn_layers.append(MultiHeadAttention(hidden_channels, hidden_channels, n_heads, p_dropout=p_dropout))
70
- self.norm_layers_1.append(LayerNorm(hidden_channels))
71
- self.ffn_layers.append(FFN(hidden_channels, hidden_channels, filter_channels, kernel_size, p_dropout=p_dropout, causal=True))
72
- self.norm_layers_2.append(LayerNorm(hidden_channels))
73
-
74
- def forward(self, x, x_mask, h, h_mask):
75
- """
76
- x: decoder input
77
- h: encoder output
78
- """
79
- self_attn_mask = commons.subsequent_mask(x_mask.size(2)).to(device=x.device, dtype=x.dtype)
80
- encdec_attn_mask = h_mask.unsqueeze(2) * x_mask.unsqueeze(-1)
81
- x = x * x_mask
82
- for i in range(self.n_layers):
83
- y = self.self_attn_layers[i](x, x, self_attn_mask)
84
- y = self.drop(y)
85
- x = self.norm_layers_0[i](x + y)
86
-
87
- y = self.encdec_attn_layers[i](x, h, encdec_attn_mask)
88
- y = self.drop(y)
89
- x = self.norm_layers_1[i](x + y)
90
-
91
- y = self.ffn_layers[i](x, x_mask)
92
- y = self.drop(y)
93
- x = self.norm_layers_2[i](x + y)
94
- x = x * x_mask
95
- return x
96
-
97
-
98
- class MultiHeadAttention(nn.Module):
99
- def __init__(self, channels, out_channels, n_heads, p_dropout=0., window_size=None, heads_share=True, block_length=None, proximal_bias=False, proximal_init=False):
100
- super().__init__()
101
- assert channels % n_heads == 0
102
-
103
- self.channels = channels
104
- self.out_channels = out_channels
105
- self.n_heads = n_heads
106
- self.p_dropout = p_dropout
107
- self.window_size = window_size
108
- self.heads_share = heads_share
109
- self.block_length = block_length
110
- self.proximal_bias = proximal_bias
111
- self.proximal_init = proximal_init
112
- self.attn = None
113
-
114
- self.k_channels = channels // n_heads
115
- self.conv_q = nn.Conv1d(channels, channels, 1)
116
- self.conv_k = nn.Conv1d(channels, channels, 1)
117
- self.conv_v = nn.Conv1d(channels, channels, 1)
118
- self.conv_o = nn.Conv1d(channels, out_channels, 1)
119
- self.drop = nn.Dropout(p_dropout)
120
-
121
- if window_size is not None:
122
- n_heads_rel = 1 if heads_share else n_heads
123
- rel_stddev = self.k_channels**-0.5
124
- self.emb_rel_k = nn.Parameter(torch.randn(n_heads_rel, window_size * 2 + 1, self.k_channels) * rel_stddev)
125
- self.emb_rel_v = nn.Parameter(torch.randn(n_heads_rel, window_size * 2 + 1, self.k_channels) * rel_stddev)
126
-
127
- nn.init.xavier_uniform_(self.conv_q.weight)
128
- nn.init.xavier_uniform_(self.conv_k.weight)
129
- nn.init.xavier_uniform_(self.conv_v.weight)
130
- if proximal_init:
131
- with torch.no_grad():
132
- self.conv_k.weight.copy_(self.conv_q.weight)
133
- self.conv_k.bias.copy_(self.conv_q.bias)
134
-
135
- def forward(self, x, c, attn_mask=None):
136
- q = self.conv_q(x)
137
- k = self.conv_k(c)
138
- v = self.conv_v(c)
139
-
140
- x, self.attn = self.attention(q, k, v, mask=attn_mask)
141
-
142
- x = self.conv_o(x)
143
- return x
144
-
145
- def attention(self, query, key, value, mask=None):
146
- # reshape [b, d, t] -> [b, n_h, t, d_k]
147
- b, d, t_s, t_t = (*key.size(), query.size(2))
148
- query = query.view(b, self.n_heads, self.k_channels, t_t).transpose(2, 3)
149
- key = key.view(b, self.n_heads, self.k_channels, t_s).transpose(2, 3)
150
- value = value.view(b, self.n_heads, self.k_channels, t_s).transpose(2, 3)
151
-
152
- scores = torch.matmul(query / math.sqrt(self.k_channels), key.transpose(-2, -1))
153
- if self.window_size is not None:
154
- assert t_s == t_t, "Relative attention is only available for self-attention."
155
- key_relative_embeddings = self._get_relative_embeddings(self.emb_rel_k, t_s)
156
- rel_logits = self._matmul_with_relative_keys(query /math.sqrt(self.k_channels), key_relative_embeddings)
157
- scores_local = self._relative_position_to_absolute_position(rel_logits)
158
- scores = scores + scores_local
159
- if self.proximal_bias:
160
- assert t_s == t_t, "Proximal bias is only available for self-attention."
161
- scores = scores + self._attention_bias_proximal(t_s).to(device=scores.device, dtype=scores.dtype)
162
- if mask is not None:
163
- scores = scores.masked_fill(mask == 0, -1e4)
164
- if self.block_length is not None:
165
- assert t_s == t_t, "Local attention is only available for self-attention."
166
- block_mask = torch.ones_like(scores).triu(-self.block_length).tril(self.block_length)
167
- scores = scores.masked_fill(block_mask == 0, -1e4)
168
- p_attn = F.softmax(scores, dim=-1) # [b, n_h, t_t, t_s]
169
- p_attn = self.drop(p_attn)
170
- output = torch.matmul(p_attn, value)
171
- if self.window_size is not None:
172
- relative_weights = self._absolute_position_to_relative_position(p_attn)
173
- value_relative_embeddings = self._get_relative_embeddings(self.emb_rel_v, t_s)
174
- output = output + self._matmul_with_relative_values(relative_weights, value_relative_embeddings)
175
- output = output.transpose(2, 3).contiguous().view(b, d, t_t) # [b, n_h, t_t, d_k] -> [b, d, t_t]
176
- return output, p_attn
177
-
178
- def _matmul_with_relative_values(self, x, y):
179
- """
180
- x: [b, h, l, m]
181
- y: [h or 1, m, d]
182
- ret: [b, h, l, d]
183
- """
184
- ret = torch.matmul(x, y.unsqueeze(0))
185
- return ret
186
-
187
- def _matmul_with_relative_keys(self, x, y):
188
- """
189
- x: [b, h, l, d]
190
- y: [h or 1, m, d]
191
- ret: [b, h, l, m]
192
- """
193
- ret = torch.matmul(x, y.unsqueeze(0).transpose(-2, -1))
194
- return ret
195
-
196
- def _get_relative_embeddings(self, relative_embeddings, length):
197
- max_relative_position = 2 * self.window_size + 1
198
- # Pad first before slice to avoid using cond ops.
199
- pad_length = max(length - (self.window_size + 1), 0)
200
- slice_start_position = max((self.window_size + 1) - length, 0)
201
- slice_end_position = slice_start_position + 2 * length - 1
202
- if pad_length > 0:
203
- padded_relative_embeddings = F.pad(
204
- relative_embeddings,
205
- commons.convert_pad_shape([[0, 0], [pad_length, pad_length], [0, 0]]))
206
- else:
207
- padded_relative_embeddings = relative_embeddings
208
- used_relative_embeddings = padded_relative_embeddings[:,slice_start_position:slice_end_position]
209
- return used_relative_embeddings
210
-
211
- def _relative_position_to_absolute_position(self, x):
212
- """
213
- x: [b, h, l, 2*l-1]
214
- ret: [b, h, l, l]
215
- """
216
- batch, heads, length, _ = x.size()
217
- # Concat columns of pad to shift from relative to absolute indexing.
218
- x = F.pad(x, commons.convert_pad_shape([[0,0],[0,0],[0,0],[0,1]]))
219
-
220
- # Concat extra elements so to add up to shape (len+1, 2*len-1).
221
- x_flat = x.view([batch, heads, length * 2 * length])
222
- x_flat = F.pad(x_flat, commons.convert_pad_shape([[0,0],[0,0],[0,length-1]]))
223
-
224
- # Reshape and slice out the padded elements.
225
- x_final = x_flat.view([batch, heads, length+1, 2*length-1])[:, :, :length, length-1:]
226
- return x_final
227
-
228
- def _absolute_position_to_relative_position(self, x):
229
- """
230
- x: [b, h, l, l]
231
- ret: [b, h, l, 2*l-1]
232
- """
233
- batch, heads, length, _ = x.size()
234
- # padd along column
235
- x = F.pad(x, commons.convert_pad_shape([[0, 0], [0, 0], [0, 0], [0, length-1]]))
236
- x_flat = x.view([batch, heads, length**2 + length*(length -1)])
237
- # add 0's in the beginning that will skew the elements after reshape
238
- x_flat = F.pad(x_flat, commons.convert_pad_shape([[0, 0], [0, 0], [length, 0]]))
239
- x_final = x_flat.view([batch, heads, length, 2*length])[:,:,:,1:]
240
- return x_final
241
-
242
- def _attention_bias_proximal(self, length):
243
- """Bias for self-attention to encourage attention to close positions.
244
- Args:
245
- length: an integer scalar.
246
- Returns:
247
- a Tensor with shape [1, 1, length, length]
248
- """
249
- r = torch.arange(length, dtype=torch.float32)
250
- diff = torch.unsqueeze(r, 0) - torch.unsqueeze(r, 1)
251
- return torch.unsqueeze(torch.unsqueeze(-torch.log1p(torch.abs(diff)), 0), 0)
252
-
253
-
254
- class FFN(nn.Module):
255
- def __init__(self, in_channels, out_channels, filter_channels, kernel_size, p_dropout=0., activation=None, causal=False):
256
- super().__init__()
257
- self.in_channels = in_channels
258
- self.out_channels = out_channels
259
- self.filter_channels = filter_channels
260
- self.kernel_size = kernel_size
261
- self.p_dropout = p_dropout
262
- self.activation = activation
263
- self.causal = causal
264
-
265
- if causal:
266
- self.padding = self._causal_padding
267
- else:
268
- self.padding = self._same_padding
269
-
270
- self.conv_1 = nn.Conv1d(in_channels, filter_channels, kernel_size)
271
- self.conv_2 = nn.Conv1d(filter_channels, out_channels, kernel_size)
272
- self.drop = nn.Dropout(p_dropout)
273
-
274
- def forward(self, x, x_mask):
275
- x = self.conv_1(self.padding(x * x_mask))
276
- if self.activation == "gelu":
277
- x = x * torch.sigmoid(1.702 * x)
278
- else:
279
- x = torch.relu(x)
280
- x = self.drop(x)
281
- x = self.conv_2(self.padding(x * x_mask))
282
- return x * x_mask
283
-
284
- def _causal_padding(self, x):
285
- if self.kernel_size == 1:
286
- return x
287
- pad_l = self.kernel_size - 1
288
- pad_r = 0
289
- padding = [[0, 0], [0, 0], [pad_l, pad_r]]
290
- x = F.pad(x, commons.convert_pad_shape(padding))
291
- return x
292
-
293
- def _same_padding(self, x):
294
- if self.kernel_size == 1:
295
- return x
296
- pad_l = (self.kernel_size - 1) // 2
297
- pad_r = self.kernel_size // 2
298
- padding = [[0, 0], [0, 0], [pad_l, pad_r]]
299
- x = F.pad(x, commons.convert_pad_shape(padding))
300
- return x
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Amrrs/DragGan-Inversion/stylegan_human/pti/pti_models/e4e/encoders/psp_encoders.py DELETED
@@ -1,208 +0,0 @@
1
- from enum import Enum
2
- import math
3
- import numpy as np
4
- import torch
5
- from torch import nn
6
- from torch.nn import Conv2d, BatchNorm2d, PReLU, Sequential, Module
7
-
8
- from pti.pti_models.e4e.encoders.helpers import get_blocks, bottleneck_IR, bottleneck_IR_SE, _upsample_add
9
- from pti.pti_models.e4e.stylegan2.model import EqualLinear
10
-
11
-
12
- class ProgressiveStage(Enum):
13
- WTraining = 0
14
- Delta1Training = 1
15
- Delta2Training = 2
16
- Delta3Training = 3
17
- Delta4Training = 4
18
- Delta5Training = 5
19
- Delta6Training = 6
20
- Delta7Training = 7
21
- Delta8Training = 8
22
- Delta9Training = 9
23
- Delta10Training = 10
24
- Delta11Training = 11
25
- Delta12Training = 12
26
- Delta13Training = 13
27
- Delta14Training = 14
28
- Delta15Training = 15
29
- Delta16Training = 16
30
- Delta17Training = 17
31
- Inference = 18
32
-
33
-
34
- class GradualStyleBlock(Module):
35
- def __init__(self, in_c, out_c, spatial):
36
- super(GradualStyleBlock, self).__init__()
37
- self.out_c = out_c
38
- self.spatial = spatial
39
- num_pools = int(np.log2(spatial))
40
- modules = []
41
- modules += [Conv2d(in_c, out_c, kernel_size=3, stride=2, padding=1),
42
- nn.LeakyReLU()]
43
- for i in range(num_pools - 1):
44
- modules += [
45
- Conv2d(out_c, out_c, kernel_size=3, stride=2, padding=1),
46
- nn.LeakyReLU()
47
- ]
48
- self.convs = nn.Sequential(*modules)
49
- self.linear = EqualLinear(out_c, out_c, lr_mul=1)
50
-
51
- def forward(self, x):
52
- x = self.convs(x)
53
- x = x.view(-1, self.out_c)
54
- x = self.linear(x)
55
- return x
56
-
57
-
58
- class GradualStyleEncoder(Module):
59
- def __init__(self, num_layers, mode='ir', opts=None):
60
- super(GradualStyleEncoder, self).__init__()
61
- assert num_layers in [
62
- 50, 100, 152], 'num_layers should be 50,100, or 152'
63
- assert mode in ['ir', 'ir_se'], 'mode should be ir or ir_se'
64
- blocks = get_blocks(num_layers)
65
- if mode == 'ir':
66
- unit_module = bottleneck_IR
67
- elif mode == 'ir_se':
68
- unit_module = bottleneck_IR_SE
69
- self.input_layer = Sequential(Conv2d(3, 64, (3, 3), 1, 1, bias=False),
70
- BatchNorm2d(64),
71
- PReLU(64))
72
- modules = []
73
- for block in blocks:
74
- for bottleneck in block:
75
- modules.append(unit_module(bottleneck.in_channel,
76
- bottleneck.depth,
77
- bottleneck.stride))
78
- self.body = Sequential(*modules)
79
-
80
- self.styles = nn.ModuleList()
81
- log_size = int(math.log(opts.stylegan_size, 2))
82
- self.style_count = 2 * log_size - 2
83
- self.coarse_ind = 3
84
- self.middle_ind = 7
85
- for i in range(self.style_count):
86
- if i < self.coarse_ind:
87
- style = GradualStyleBlock(512, 512, 16)
88
- elif i < self.middle_ind:
89
- style = GradualStyleBlock(512, 512, 32)
90
- else:
91
- style = GradualStyleBlock(512, 512, 64)
92
- self.styles.append(style)
93
- self.latlayer1 = nn.Conv2d(
94
- 256, 512, kernel_size=1, stride=1, padding=0)
95
- self.latlayer2 = nn.Conv2d(
96
- 128, 512, kernel_size=1, stride=1, padding=0)
97
-
98
- def forward(self, x):
99
- x = self.input_layer(x)
100
-
101
- latents = []
102
- modulelist = list(self.body._modules.values())
103
- for i, l in enumerate(modulelist):
104
- x = l(x)
105
- if i == 6:
106
- c1 = x
107
- elif i == 20:
108
- c2 = x
109
- elif i == 23:
110
- c3 = x
111
-
112
- for j in range(self.coarse_ind):
113
- latents.append(self.styles[j](c3))
114
-
115
- p2 = _upsample_add(c3, self.latlayer1(c2))
116
- for j in range(self.coarse_ind, self.middle_ind):
117
- latents.append(self.styles[j](p2))
118
-
119
- p1 = _upsample_add(p2, self.latlayer2(c1))
120
- for j in range(self.middle_ind, self.style_count):
121
- latents.append(self.styles[j](p1))
122
-
123
- out = torch.stack(latents, dim=1)
124
- return out
125
-
126
-
127
- class Encoder4Editing(Module):
128
- def __init__(self, num_layers, mode='ir', opts=None):
129
- super(Encoder4Editing, self).__init__()
130
- assert num_layers in [
131
- 50, 100, 152], 'num_layers should be 50,100, or 152'
132
- assert mode in ['ir', 'ir_se'], 'mode should be ir or ir_se'
133
- blocks = get_blocks(num_layers)
134
- if mode == 'ir':
135
- unit_module = bottleneck_IR
136
- elif mode == 'ir_se':
137
- unit_module = bottleneck_IR_SE
138
- self.input_layer = Sequential(Conv2d(3, 64, (3, 3), 1, 1, bias=False),
139
- BatchNorm2d(64),
140
- PReLU(64))
141
- modules = []
142
- for block in blocks:
143
- for bottleneck in block:
144
- modules.append(unit_module(bottleneck.in_channel,
145
- bottleneck.depth,
146
- bottleneck.stride))
147
- self.body = Sequential(*modules)
148
-
149
- self.styles = nn.ModuleList()
150
- log_size = int(math.log(opts.stylegan_size, 2))
151
- self.style_count = 2 * log_size - 2
152
- self.coarse_ind = 3
153
- self.middle_ind = 7
154
-
155
- for i in range(self.style_count):
156
- if i < self.coarse_ind:
157
- style = GradualStyleBlock(512, 512, 16)
158
- elif i < self.middle_ind:
159
- style = GradualStyleBlock(512, 512, 32)
160
- else:
161
- style = GradualStyleBlock(512, 512, 64)
162
- self.styles.append(style)
163
-
164
- self.latlayer1 = nn.Conv2d(
165
- 256, 512, kernel_size=1, stride=1, padding=0)
166
- self.latlayer2 = nn.Conv2d(
167
- 128, 512, kernel_size=1, stride=1, padding=0)
168
-
169
- self.progressive_stage = ProgressiveStage.Inference
170
-
171
- def get_deltas_starting_dimensions(self):
172
- ''' Get a list of the initial dimension of every delta from which it is applied '''
173
- return list(range(self.style_count)) # Each dimension has a delta applied to it
174
-
175
- def set_progressive_stage(self, new_stage: ProgressiveStage):
176
- self.progressive_stage = new_stage
177
- print('Changed progressive stage to: ', new_stage)
178
-
179
- def forward(self, x):
180
- x = self.input_layer(x)
181
-
182
- modulelist = list(self.body._modules.values())
183
- for i, l in enumerate(modulelist):
184
- x = l(x)
185
- if i == 6:
186
- c1 = x
187
- elif i == 20:
188
- c2 = x
189
- elif i == 23:
190
- c3 = x
191
-
192
- # Infer main W and duplicate it
193
- w0 = self.styles[0](c3)
194
- w = w0.repeat(self.style_count, 1, 1).permute(1, 0, 2)
195
- stage = self.progressive_stage.value
196
- features = c3
197
- for i in range(1, min(stage + 1, self.style_count)): # Infer additional deltas
198
- if i == self.coarse_ind:
199
- # FPN's middle features
200
- p2 = _upsample_add(c3, self.latlayer1(c2))
201
- features = p2
202
- elif i == self.middle_ind:
203
- # FPN's fine features
204
- p1 = _upsample_add(p2, self.latlayer2(c1))
205
- features = p1
206
- delta_i = self.styles[i](features)
207
- w[:, i] += delta_i
208
- return w
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/examples/community/clip_guided_stable_diffusion_img2img.py DELETED
@@ -1,496 +0,0 @@
1
- import inspect
2
- from typing import List, Optional, Union
3
-
4
- import numpy as np
5
- import PIL
6
- import torch
7
- from torch import nn
8
- from torch.nn import functional as F
9
- from torchvision import transforms
10
- from transformers import CLIPFeatureExtractor, CLIPModel, CLIPTextModel, CLIPTokenizer
11
-
12
- from diffusers import (
13
- AutoencoderKL,
14
- DDIMScheduler,
15
- DiffusionPipeline,
16
- DPMSolverMultistepScheduler,
17
- LMSDiscreteScheduler,
18
- PNDMScheduler,
19
- UNet2DConditionModel,
20
- )
21
- from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion import StableDiffusionPipelineOutput
22
- from diffusers.utils import (
23
- PIL_INTERPOLATION,
24
- deprecate,
25
- randn_tensor,
26
- )
27
-
28
-
29
- EXAMPLE_DOC_STRING = """
30
- Examples:
31
- ```
32
- from io import BytesIO
33
-
34
- import requests
35
- import torch
36
- from diffusers import DiffusionPipeline
37
- from PIL import Image
38
- from transformers import CLIPFeatureExtractor, CLIPModel
39
-
40
- feature_extractor = CLIPFeatureExtractor.from_pretrained(
41
- "laion/CLIP-ViT-B-32-laion2B-s34B-b79K"
42
- )
43
- clip_model = CLIPModel.from_pretrained(
44
- "laion/CLIP-ViT-B-32-laion2B-s34B-b79K", torch_dtype=torch.float16
45
- )
46
-
47
-
48
- guided_pipeline = DiffusionPipeline.from_pretrained(
49
- "CompVis/stable-diffusion-v1-4",
50
- # custom_pipeline="clip_guided_stable_diffusion",
51
- custom_pipeline="/home/njindal/diffusers/examples/community/clip_guided_stable_diffusion.py",
52
- clip_model=clip_model,
53
- feature_extractor=feature_extractor,
54
- torch_dtype=torch.float16,
55
- )
56
- guided_pipeline.enable_attention_slicing()
57
- guided_pipeline = guided_pipeline.to("cuda")
58
-
59
- prompt = "fantasy book cover, full moon, fantasy forest landscape, golden vector elements, fantasy magic, dark light night, intricate, elegant, sharp focus, illustration, highly detailed, digital painting, concept art, matte, art by WLOP and Artgerm and Albert Bierstadt, masterpiece"
60
-
61
- url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"
62
-
63
- response = requests.get(url)
64
- init_image = Image.open(BytesIO(response.content)).convert("RGB")
65
-
66
- image = guided_pipeline(
67
- prompt=prompt,
68
- num_inference_steps=30,
69
- image=init_image,
70
- strength=0.75,
71
- guidance_scale=7.5,
72
- clip_guidance_scale=100,
73
- num_cutouts=4,
74
- use_cutouts=False,
75
- ).images[0]
76
- display(image)
77
- ```
78
- """
79
-
80
-
81
- def preprocess(image, w, h):
82
- if isinstance(image, torch.Tensor):
83
- return image
84
- elif isinstance(image, PIL.Image.Image):
85
- image = [image]
86
-
87
- if isinstance(image[0], PIL.Image.Image):
88
- image = [np.array(i.resize((w, h), resample=PIL_INTERPOLATION["lanczos"]))[None, :] for i in image]
89
- image = np.concatenate(image, axis=0)
90
- image = np.array(image).astype(np.float32) / 255.0
91
- image = image.transpose(0, 3, 1, 2)
92
- image = 2.0 * image - 1.0
93
- image = torch.from_numpy(image)
94
- elif isinstance(image[0], torch.Tensor):
95
- image = torch.cat(image, dim=0)
96
- return image
97
-
98
-
99
- class MakeCutouts(nn.Module):
100
- def __init__(self, cut_size, cut_power=1.0):
101
- super().__init__()
102
-
103
- self.cut_size = cut_size
104
- self.cut_power = cut_power
105
-
106
- def forward(self, pixel_values, num_cutouts):
107
- sideY, sideX = pixel_values.shape[2:4]
108
- max_size = min(sideX, sideY)
109
- min_size = min(sideX, sideY, self.cut_size)
110
- cutouts = []
111
- for _ in range(num_cutouts):
112
- size = int(torch.rand([]) ** self.cut_power * (max_size - min_size) + min_size)
113
- offsetx = torch.randint(0, sideX - size + 1, ())
114
- offsety = torch.randint(0, sideY - size + 1, ())
115
- cutout = pixel_values[:, :, offsety : offsety + size, offsetx : offsetx + size]
116
- cutouts.append(F.adaptive_avg_pool2d(cutout, self.cut_size))
117
- return torch.cat(cutouts)
118
-
119
-
120
- def spherical_dist_loss(x, y):
121
- x = F.normalize(x, dim=-1)
122
- y = F.normalize(y, dim=-1)
123
- return (x - y).norm(dim=-1).div(2).arcsin().pow(2).mul(2)
124
-
125
-
126
- def set_requires_grad(model, value):
127
- for param in model.parameters():
128
- param.requires_grad = value
129
-
130
-
131
- class CLIPGuidedStableDiffusion(DiffusionPipeline):
132
- """CLIP guided stable diffusion based on the amazing repo by @crowsonkb and @Jack000
133
- - https://github.com/Jack000/glid-3-xl
134
- - https://github.dev/crowsonkb/k-diffusion
135
- """
136
-
137
- def __init__(
138
- self,
139
- vae: AutoencoderKL,
140
- text_encoder: CLIPTextModel,
141
- clip_model: CLIPModel,
142
- tokenizer: CLIPTokenizer,
143
- unet: UNet2DConditionModel,
144
- scheduler: Union[PNDMScheduler, LMSDiscreteScheduler, DDIMScheduler, DPMSolverMultistepScheduler],
145
- feature_extractor: CLIPFeatureExtractor,
146
- ):
147
- super().__init__()
148
- self.register_modules(
149
- vae=vae,
150
- text_encoder=text_encoder,
151
- clip_model=clip_model,
152
- tokenizer=tokenizer,
153
- unet=unet,
154
- scheduler=scheduler,
155
- feature_extractor=feature_extractor,
156
- )
157
-
158
- self.normalize = transforms.Normalize(mean=feature_extractor.image_mean, std=feature_extractor.image_std)
159
- self.cut_out_size = (
160
- feature_extractor.size
161
- if isinstance(feature_extractor.size, int)
162
- else feature_extractor.size["shortest_edge"]
163
- )
164
- self.make_cutouts = MakeCutouts(self.cut_out_size)
165
-
166
- set_requires_grad(self.text_encoder, False)
167
- set_requires_grad(self.clip_model, False)
168
-
169
- def enable_attention_slicing(self, slice_size: Optional[Union[str, int]] = "auto"):
170
- if slice_size == "auto":
171
- # half the attention head size is usually a good trade-off between
172
- # speed and memory
173
- slice_size = self.unet.config.attention_head_dim // 2
174
- self.unet.set_attention_slice(slice_size)
175
-
176
- def disable_attention_slicing(self):
177
- self.enable_attention_slicing(None)
178
-
179
- def freeze_vae(self):
180
- set_requires_grad(self.vae, False)
181
-
182
- def unfreeze_vae(self):
183
- set_requires_grad(self.vae, True)
184
-
185
- def freeze_unet(self):
186
- set_requires_grad(self.unet, False)
187
-
188
- def unfreeze_unet(self):
189
- set_requires_grad(self.unet, True)
190
-
191
- def get_timesteps(self, num_inference_steps, strength, device):
192
- # get the original timestep using init_timestep
193
- init_timestep = min(int(num_inference_steps * strength), num_inference_steps)
194
-
195
- t_start = max(num_inference_steps - init_timestep, 0)
196
- timesteps = self.scheduler.timesteps[t_start:]
197
-
198
- return timesteps, num_inference_steps - t_start
199
-
200
- def prepare_latents(self, image, timestep, batch_size, num_images_per_prompt, dtype, device, generator=None):
201
- if not isinstance(image, (torch.Tensor, PIL.Image.Image, list)):
202
- raise ValueError(
203
- f"`image` has to be of type `torch.Tensor`, `PIL.Image.Image` or list but is {type(image)}"
204
- )
205
-
206
- image = image.to(device=device, dtype=dtype)
207
-
208
- batch_size = batch_size * num_images_per_prompt
209
- if isinstance(generator, list) and len(generator) != batch_size:
210
- raise ValueError(
211
- f"You have passed a list of generators of length {len(generator)}, but requested an effective batch"
212
- f" size of {batch_size}. Make sure the batch size matches the length of the generators."
213
- )
214
-
215
- if isinstance(generator, list):
216
- init_latents = [
217
- self.vae.encode(image[i : i + 1]).latent_dist.sample(generator[i]) for i in range(batch_size)
218
- ]
219
- init_latents = torch.cat(init_latents, dim=0)
220
- else:
221
- init_latents = self.vae.encode(image).latent_dist.sample(generator)
222
-
223
- init_latents = self.vae.config.scaling_factor * init_latents
224
-
225
- if batch_size > init_latents.shape[0] and batch_size % init_latents.shape[0] == 0:
226
- # expand init_latents for batch_size
227
- deprecation_message = (
228
- f"You have passed {batch_size} text prompts (`prompt`), but only {init_latents.shape[0]} initial"
229
- " images (`image`). Initial images are now duplicating to match the number of text prompts. Note"
230
- " that this behavior is deprecated and will be removed in a version 1.0.0. Please make sure to update"
231
- " your script to pass as many initial images as text prompts to suppress this warning."
232
- )
233
- deprecate("len(prompt) != len(image)", "1.0.0", deprecation_message, standard_warn=False)
234
- additional_image_per_prompt = batch_size // init_latents.shape[0]
235
- init_latents = torch.cat([init_latents] * additional_image_per_prompt, dim=0)
236
- elif batch_size > init_latents.shape[0] and batch_size % init_latents.shape[0] != 0:
237
- raise ValueError(
238
- f"Cannot duplicate `image` of batch size {init_latents.shape[0]} to {batch_size} text prompts."
239
- )
240
- else:
241
- init_latents = torch.cat([init_latents], dim=0)
242
-
243
- shape = init_latents.shape
244
- noise = randn_tensor(shape, generator=generator, device=device, dtype=dtype)
245
-
246
- # get latents
247
- init_latents = self.scheduler.add_noise(init_latents, noise, timestep)
248
- latents = init_latents
249
-
250
- return latents
251
-
252
- @torch.enable_grad()
253
- def cond_fn(
254
- self,
255
- latents,
256
- timestep,
257
- index,
258
- text_embeddings,
259
- noise_pred_original,
260
- text_embeddings_clip,
261
- clip_guidance_scale,
262
- num_cutouts,
263
- use_cutouts=True,
264
- ):
265
- latents = latents.detach().requires_grad_()
266
-
267
- latent_model_input = self.scheduler.scale_model_input(latents, timestep)
268
-
269
- # predict the noise residual
270
- noise_pred = self.unet(latent_model_input, timestep, encoder_hidden_states=text_embeddings).sample
271
-
272
- if isinstance(self.scheduler, (PNDMScheduler, DDIMScheduler, DPMSolverMultistepScheduler)):
273
- alpha_prod_t = self.scheduler.alphas_cumprod[timestep]
274
- beta_prod_t = 1 - alpha_prod_t
275
- # compute predicted original sample from predicted noise also called
276
- # "predicted x_0" of formula (12) from https://arxiv.org/pdf/2010.02502.pdf
277
- pred_original_sample = (latents - beta_prod_t ** (0.5) * noise_pred) / alpha_prod_t ** (0.5)
278
-
279
- fac = torch.sqrt(beta_prod_t)
280
- sample = pred_original_sample * (fac) + latents * (1 - fac)
281
- elif isinstance(self.scheduler, LMSDiscreteScheduler):
282
- sigma = self.scheduler.sigmas[index]
283
- sample = latents - sigma * noise_pred
284
- else:
285
- raise ValueError(f"scheduler type {type(self.scheduler)} not supported")
286
-
287
- sample = 1 / self.vae.config.scaling_factor * sample
288
- image = self.vae.decode(sample).sample
289
- image = (image / 2 + 0.5).clamp(0, 1)
290
-
291
- if use_cutouts:
292
- image = self.make_cutouts(image, num_cutouts)
293
- else:
294
- image = transforms.Resize(self.cut_out_size)(image)
295
- image = self.normalize(image).to(latents.dtype)
296
-
297
- image_embeddings_clip = self.clip_model.get_image_features(image)
298
- image_embeddings_clip = image_embeddings_clip / image_embeddings_clip.norm(p=2, dim=-1, keepdim=True)
299
-
300
- if use_cutouts:
301
- dists = spherical_dist_loss(image_embeddings_clip, text_embeddings_clip)
302
- dists = dists.view([num_cutouts, sample.shape[0], -1])
303
- loss = dists.sum(2).mean(0).sum() * clip_guidance_scale
304
- else:
305
- loss = spherical_dist_loss(image_embeddings_clip, text_embeddings_clip).mean() * clip_guidance_scale
306
-
307
- grads = -torch.autograd.grad(loss, latents)[0]
308
-
309
- if isinstance(self.scheduler, LMSDiscreteScheduler):
310
- latents = latents.detach() + grads * (sigma**2)
311
- noise_pred = noise_pred_original
312
- else:
313
- noise_pred = noise_pred_original - torch.sqrt(beta_prod_t) * grads
314
- return noise_pred, latents
315
-
316
- @torch.no_grad()
317
- def __call__(
318
- self,
319
- prompt: Union[str, List[str]],
320
- height: Optional[int] = 512,
321
- width: Optional[int] = 512,
322
- image: Union[torch.FloatTensor, PIL.Image.Image] = None,
323
- strength: float = 0.8,
324
- num_inference_steps: Optional[int] = 50,
325
- guidance_scale: Optional[float] = 7.5,
326
- num_images_per_prompt: Optional[int] = 1,
327
- eta: float = 0.0,
328
- clip_guidance_scale: Optional[float] = 100,
329
- clip_prompt: Optional[Union[str, List[str]]] = None,
330
- num_cutouts: Optional[int] = 4,
331
- use_cutouts: Optional[bool] = True,
332
- generator: Optional[torch.Generator] = None,
333
- latents: Optional[torch.FloatTensor] = None,
334
- output_type: Optional[str] = "pil",
335
- return_dict: bool = True,
336
- ):
337
- if isinstance(prompt, str):
338
- batch_size = 1
339
- elif isinstance(prompt, list):
340
- batch_size = len(prompt)
341
- else:
342
- raise ValueError(f"`prompt` has to be of type `str` or `list` but is {type(prompt)}")
343
-
344
- if height % 8 != 0 or width % 8 != 0:
345
- raise ValueError(f"`height` and `width` have to be divisible by 8 but are {height} and {width}.")
346
-
347
- # get prompt text embeddings
348
- text_input = self.tokenizer(
349
- prompt,
350
- padding="max_length",
351
- max_length=self.tokenizer.model_max_length,
352
- truncation=True,
353
- return_tensors="pt",
354
- )
355
- text_embeddings = self.text_encoder(text_input.input_ids.to(self.device))[0]
356
- # duplicate text embeddings for each generation per prompt
357
- text_embeddings = text_embeddings.repeat_interleave(num_images_per_prompt, dim=0)
358
-
359
- # set timesteps
360
- accepts_offset = "offset" in set(inspect.signature(self.scheduler.set_timesteps).parameters.keys())
361
- extra_set_kwargs = {}
362
- if accepts_offset:
363
- extra_set_kwargs["offset"] = 1
364
-
365
- self.scheduler.set_timesteps(num_inference_steps, **extra_set_kwargs)
366
- # Some schedulers like PNDM have timesteps as arrays
367
- # It's more optimized to move all timesteps to correct device beforehand
368
- self.scheduler.timesteps.to(self.device)
369
-
370
- timesteps, num_inference_steps = self.get_timesteps(num_inference_steps, strength, self.device)
371
- latent_timestep = timesteps[:1].repeat(batch_size * num_images_per_prompt)
372
-
373
- # Preprocess image
374
- image = preprocess(image, width, height)
375
- latents = self.prepare_latents(
376
- image, latent_timestep, batch_size, num_images_per_prompt, text_embeddings.dtype, self.device, generator
377
- )
378
-
379
- if clip_guidance_scale > 0:
380
- if clip_prompt is not None:
381
- clip_text_input = self.tokenizer(
382
- clip_prompt,
383
- padding="max_length",
384
- max_length=self.tokenizer.model_max_length,
385
- truncation=True,
386
- return_tensors="pt",
387
- ).input_ids.to(self.device)
388
- else:
389
- clip_text_input = text_input.input_ids.to(self.device)
390
- text_embeddings_clip = self.clip_model.get_text_features(clip_text_input)
391
- text_embeddings_clip = text_embeddings_clip / text_embeddings_clip.norm(p=2, dim=-1, keepdim=True)
392
- # duplicate text embeddings clip for each generation per prompt
393
- text_embeddings_clip = text_embeddings_clip.repeat_interleave(num_images_per_prompt, dim=0)
394
-
395
- # here `guidance_scale` is defined analog to the guidance weight `w` of equation (2)
396
- # of the Imagen paper: https://arxiv.org/pdf/2205.11487.pdf . `guidance_scale = 1`
397
- # corresponds to doing no classifier free guidance.
398
- do_classifier_free_guidance = guidance_scale > 1.0
399
- # get unconditional embeddings for classifier free guidance
400
- if do_classifier_free_guidance:
401
- max_length = text_input.input_ids.shape[-1]
402
- uncond_input = self.tokenizer([""], padding="max_length", max_length=max_length, return_tensors="pt")
403
- uncond_embeddings = self.text_encoder(uncond_input.input_ids.to(self.device))[0]
404
- # duplicate unconditional embeddings for each generation per prompt
405
- uncond_embeddings = uncond_embeddings.repeat_interleave(num_images_per_prompt, dim=0)
406
-
407
- # For classifier free guidance, we need to do two forward passes.
408
- # Here we concatenate the unconditional and text embeddings into a single batch
409
- # to avoid doing two forward passes
410
- text_embeddings = torch.cat([uncond_embeddings, text_embeddings])
411
-
412
- # get the initial random noise unless the user supplied it
413
-
414
- # Unlike in other pipelines, latents need to be generated in the target device
415
- # for 1-to-1 results reproducibility with the CompVis implementation.
416
- # However this currently doesn't work in `mps`.
417
- latents_shape = (batch_size * num_images_per_prompt, self.unet.config.in_channels, height // 8, width // 8)
418
- latents_dtype = text_embeddings.dtype
419
- if latents is None:
420
- if self.device.type == "mps":
421
- # randn does not work reproducibly on mps
422
- latents = torch.randn(latents_shape, generator=generator, device="cpu", dtype=latents_dtype).to(
423
- self.device
424
- )
425
- else:
426
- latents = torch.randn(latents_shape, generator=generator, device=self.device, dtype=latents_dtype)
427
- else:
428
- if latents.shape != latents_shape:
429
- raise ValueError(f"Unexpected latents shape, got {latents.shape}, expected {latents_shape}")
430
- latents = latents.to(self.device)
431
-
432
- # scale the initial noise by the standard deviation required by the scheduler
433
- latents = latents * self.scheduler.init_noise_sigma
434
-
435
- # prepare extra kwargs for the scheduler step, since not all schedulers have the same signature
436
- # eta (η) is only used with the DDIMScheduler, it will be ignored for other schedulers.
437
- # eta corresponds to η in DDIM paper: https://arxiv.org/abs/2010.02502
438
- # and should be between [0, 1]
439
- accepts_eta = "eta" in set(inspect.signature(self.scheduler.step).parameters.keys())
440
- extra_step_kwargs = {}
441
- if accepts_eta:
442
- extra_step_kwargs["eta"] = eta
443
-
444
- # check if the scheduler accepts generator
445
- accepts_generator = "generator" in set(inspect.signature(self.scheduler.step).parameters.keys())
446
- if accepts_generator:
447
- extra_step_kwargs["generator"] = generator
448
-
449
- with self.progress_bar(total=num_inference_steps):
450
- for i, t in enumerate(timesteps):
451
- # expand the latents if we are doing classifier free guidance
452
- latent_model_input = torch.cat([latents] * 2) if do_classifier_free_guidance else latents
453
- latent_model_input = self.scheduler.scale_model_input(latent_model_input, t)
454
-
455
- # predict the noise residual
456
- noise_pred = self.unet(latent_model_input, t, encoder_hidden_states=text_embeddings).sample
457
-
458
- # perform classifier free guidance
459
- if do_classifier_free_guidance:
460
- noise_pred_uncond, noise_pred_text = noise_pred.chunk(2)
461
- noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
462
-
463
- # perform clip guidance
464
- if clip_guidance_scale > 0:
465
- text_embeddings_for_guidance = (
466
- text_embeddings.chunk(2)[1] if do_classifier_free_guidance else text_embeddings
467
- )
468
- noise_pred, latents = self.cond_fn(
469
- latents,
470
- t,
471
- i,
472
- text_embeddings_for_guidance,
473
- noise_pred,
474
- text_embeddings_clip,
475
- clip_guidance_scale,
476
- num_cutouts,
477
- use_cutouts,
478
- )
479
-
480
- # compute the previous noisy sample x_t -> x_t-1
481
- latents = self.scheduler.step(noise_pred, t, latents, **extra_step_kwargs).prev_sample
482
-
483
- # scale and decode the image latents with vae
484
- latents = 1 / self.vae.config.scaling_factor * latents
485
- image = self.vae.decode(latents).sample
486
-
487
- image = (image / 2 + 0.5).clamp(0, 1)
488
- image = image.cpu().permute(0, 2, 3, 1).numpy()
489
-
490
- if output_type == "pil":
491
- image = self.numpy_to_pil(image)
492
-
493
- if not return_dict:
494
- return (image, None)
495
-
496
- return StableDiffusionPipelineOutput(images=image, nsfw_content_detected=None)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/scripts/convert_original_t2i_adapter.py DELETED
@@ -1,250 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2023 The HuggingFace Inc. team.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- """
16
- Conversion script for the T2I-Adapter checkpoints.
17
- """
18
-
19
- import argparse
20
-
21
- import torch
22
-
23
- from diffusers import T2IAdapter
24
-
25
-
26
- def convert_adapter(src_state, in_channels):
27
- original_body_length = max([int(x.split(".")[1]) for x in src_state.keys() if "body." in x]) + 1
28
-
29
- assert original_body_length == 8
30
-
31
- # (0, 1) -> channels 1
32
- assert src_state["body.0.block1.weight"].shape == (320, 320, 3, 3)
33
-
34
- # (2, 3) -> channels 2
35
- assert src_state["body.2.in_conv.weight"].shape == (640, 320, 1, 1)
36
-
37
- # (4, 5) -> channels 3
38
- assert src_state["body.4.in_conv.weight"].shape == (1280, 640, 1, 1)
39
-
40
- # (6, 7) -> channels 4
41
- assert src_state["body.6.block1.weight"].shape == (1280, 1280, 3, 3)
42
-
43
- res_state = {
44
- "adapter.conv_in.weight": src_state.pop("conv_in.weight"),
45
- "adapter.conv_in.bias": src_state.pop("conv_in.bias"),
46
- # 0.resnets.0
47
- "adapter.body.0.resnets.0.block1.weight": src_state.pop("body.0.block1.weight"),
48
- "adapter.body.0.resnets.0.block1.bias": src_state.pop("body.0.block1.bias"),
49
- "adapter.body.0.resnets.0.block2.weight": src_state.pop("body.0.block2.weight"),
50
- "adapter.body.0.resnets.0.block2.bias": src_state.pop("body.0.block2.bias"),
51
- # 0.resnets.1
52
- "adapter.body.0.resnets.1.block1.weight": src_state.pop("body.1.block1.weight"),
53
- "adapter.body.0.resnets.1.block1.bias": src_state.pop("body.1.block1.bias"),
54
- "adapter.body.0.resnets.1.block2.weight": src_state.pop("body.1.block2.weight"),
55
- "adapter.body.0.resnets.1.block2.bias": src_state.pop("body.1.block2.bias"),
56
- # 1
57
- "adapter.body.1.in_conv.weight": src_state.pop("body.2.in_conv.weight"),
58
- "adapter.body.1.in_conv.bias": src_state.pop("body.2.in_conv.bias"),
59
- # 1.resnets.0
60
- "adapter.body.1.resnets.0.block1.weight": src_state.pop("body.2.block1.weight"),
61
- "adapter.body.1.resnets.0.block1.bias": src_state.pop("body.2.block1.bias"),
62
- "adapter.body.1.resnets.0.block2.weight": src_state.pop("body.2.block2.weight"),
63
- "adapter.body.1.resnets.0.block2.bias": src_state.pop("body.2.block2.bias"),
64
- # 1.resnets.1
65
- "adapter.body.1.resnets.1.block1.weight": src_state.pop("body.3.block1.weight"),
66
- "adapter.body.1.resnets.1.block1.bias": src_state.pop("body.3.block1.bias"),
67
- "adapter.body.1.resnets.1.block2.weight": src_state.pop("body.3.block2.weight"),
68
- "adapter.body.1.resnets.1.block2.bias": src_state.pop("body.3.block2.bias"),
69
- # 2
70
- "adapter.body.2.in_conv.weight": src_state.pop("body.4.in_conv.weight"),
71
- "adapter.body.2.in_conv.bias": src_state.pop("body.4.in_conv.bias"),
72
- # 2.resnets.0
73
- "adapter.body.2.resnets.0.block1.weight": src_state.pop("body.4.block1.weight"),
74
- "adapter.body.2.resnets.0.block1.bias": src_state.pop("body.4.block1.bias"),
75
- "adapter.body.2.resnets.0.block2.weight": src_state.pop("body.4.block2.weight"),
76
- "adapter.body.2.resnets.0.block2.bias": src_state.pop("body.4.block2.bias"),
77
- # 2.resnets.1
78
- "adapter.body.2.resnets.1.block1.weight": src_state.pop("body.5.block1.weight"),
79
- "adapter.body.2.resnets.1.block1.bias": src_state.pop("body.5.block1.bias"),
80
- "adapter.body.2.resnets.1.block2.weight": src_state.pop("body.5.block2.weight"),
81
- "adapter.body.2.resnets.1.block2.bias": src_state.pop("body.5.block2.bias"),
82
- # 3.resnets.0
83
- "adapter.body.3.resnets.0.block1.weight": src_state.pop("body.6.block1.weight"),
84
- "adapter.body.3.resnets.0.block1.bias": src_state.pop("body.6.block1.bias"),
85
- "adapter.body.3.resnets.0.block2.weight": src_state.pop("body.6.block2.weight"),
86
- "adapter.body.3.resnets.0.block2.bias": src_state.pop("body.6.block2.bias"),
87
- # 3.resnets.1
88
- "adapter.body.3.resnets.1.block1.weight": src_state.pop("body.7.block1.weight"),
89
- "adapter.body.3.resnets.1.block1.bias": src_state.pop("body.7.block1.bias"),
90
- "adapter.body.3.resnets.1.block2.weight": src_state.pop("body.7.block2.weight"),
91
- "adapter.body.3.resnets.1.block2.bias": src_state.pop("body.7.block2.bias"),
92
- }
93
-
94
- assert len(src_state) == 0
95
-
96
- adapter = T2IAdapter(in_channels=in_channels, adapter_type="full_adapter")
97
-
98
- adapter.load_state_dict(res_state)
99
-
100
- return adapter
101
-
102
-
103
- def convert_light_adapter(src_state):
104
- original_body_length = max([int(x.split(".")[1]) for x in src_state.keys() if "body." in x]) + 1
105
-
106
- assert original_body_length == 4
107
-
108
- res_state = {
109
- # body.0.in_conv
110
- "adapter.body.0.in_conv.weight": src_state.pop("body.0.in_conv.weight"),
111
- "adapter.body.0.in_conv.bias": src_state.pop("body.0.in_conv.bias"),
112
- # body.0.resnets.0
113
- "adapter.body.0.resnets.0.block1.weight": src_state.pop("body.0.body.0.block1.weight"),
114
- "adapter.body.0.resnets.0.block1.bias": src_state.pop("body.0.body.0.block1.bias"),
115
- "adapter.body.0.resnets.0.block2.weight": src_state.pop("body.0.body.0.block2.weight"),
116
- "adapter.body.0.resnets.0.block2.bias": src_state.pop("body.0.body.0.block2.bias"),
117
- # body.0.resnets.1
118
- "adapter.body.0.resnets.1.block1.weight": src_state.pop("body.0.body.1.block1.weight"),
119
- "adapter.body.0.resnets.1.block1.bias": src_state.pop("body.0.body.1.block1.bias"),
120
- "adapter.body.0.resnets.1.block2.weight": src_state.pop("body.0.body.1.block2.weight"),
121
- "adapter.body.0.resnets.1.block2.bias": src_state.pop("body.0.body.1.block2.bias"),
122
- # body.0.resnets.2
123
- "adapter.body.0.resnets.2.block1.weight": src_state.pop("body.0.body.2.block1.weight"),
124
- "adapter.body.0.resnets.2.block1.bias": src_state.pop("body.0.body.2.block1.bias"),
125
- "adapter.body.0.resnets.2.block2.weight": src_state.pop("body.0.body.2.block2.weight"),
126
- "adapter.body.0.resnets.2.block2.bias": src_state.pop("body.0.body.2.block2.bias"),
127
- # body.0.resnets.3
128
- "adapter.body.0.resnets.3.block1.weight": src_state.pop("body.0.body.3.block1.weight"),
129
- "adapter.body.0.resnets.3.block1.bias": src_state.pop("body.0.body.3.block1.bias"),
130
- "adapter.body.0.resnets.3.block2.weight": src_state.pop("body.0.body.3.block2.weight"),
131
- "adapter.body.0.resnets.3.block2.bias": src_state.pop("body.0.body.3.block2.bias"),
132
- # body.0.out_conv
133
- "adapter.body.0.out_conv.weight": src_state.pop("body.0.out_conv.weight"),
134
- "adapter.body.0.out_conv.bias": src_state.pop("body.0.out_conv.bias"),
135
- # body.1.in_conv
136
- "adapter.body.1.in_conv.weight": src_state.pop("body.1.in_conv.weight"),
137
- "adapter.body.1.in_conv.bias": src_state.pop("body.1.in_conv.bias"),
138
- # body.1.resnets.0
139
- "adapter.body.1.resnets.0.block1.weight": src_state.pop("body.1.body.0.block1.weight"),
140
- "adapter.body.1.resnets.0.block1.bias": src_state.pop("body.1.body.0.block1.bias"),
141
- "adapter.body.1.resnets.0.block2.weight": src_state.pop("body.1.body.0.block2.weight"),
142
- "adapter.body.1.resnets.0.block2.bias": src_state.pop("body.1.body.0.block2.bias"),
143
- # body.1.resnets.1
144
- "adapter.body.1.resnets.1.block1.weight": src_state.pop("body.1.body.1.block1.weight"),
145
- "adapter.body.1.resnets.1.block1.bias": src_state.pop("body.1.body.1.block1.bias"),
146
- "adapter.body.1.resnets.1.block2.weight": src_state.pop("body.1.body.1.block2.weight"),
147
- "adapter.body.1.resnets.1.block2.bias": src_state.pop("body.1.body.1.block2.bias"),
148
- # body.1.body.2
149
- "adapter.body.1.resnets.2.block1.weight": src_state.pop("body.1.body.2.block1.weight"),
150
- "adapter.body.1.resnets.2.block1.bias": src_state.pop("body.1.body.2.block1.bias"),
151
- "adapter.body.1.resnets.2.block2.weight": src_state.pop("body.1.body.2.block2.weight"),
152
- "adapter.body.1.resnets.2.block2.bias": src_state.pop("body.1.body.2.block2.bias"),
153
- # body.1.body.3
154
- "adapter.body.1.resnets.3.block1.weight": src_state.pop("body.1.body.3.block1.weight"),
155
- "adapter.body.1.resnets.3.block1.bias": src_state.pop("body.1.body.3.block1.bias"),
156
- "adapter.body.1.resnets.3.block2.weight": src_state.pop("body.1.body.3.block2.weight"),
157
- "adapter.body.1.resnets.3.block2.bias": src_state.pop("body.1.body.3.block2.bias"),
158
- # body.1.out_conv
159
- "adapter.body.1.out_conv.weight": src_state.pop("body.1.out_conv.weight"),
160
- "adapter.body.1.out_conv.bias": src_state.pop("body.1.out_conv.bias"),
161
- # body.2.in_conv
162
- "adapter.body.2.in_conv.weight": src_state.pop("body.2.in_conv.weight"),
163
- "adapter.body.2.in_conv.bias": src_state.pop("body.2.in_conv.bias"),
164
- # body.2.body.0
165
- "adapter.body.2.resnets.0.block1.weight": src_state.pop("body.2.body.0.block1.weight"),
166
- "adapter.body.2.resnets.0.block1.bias": src_state.pop("body.2.body.0.block1.bias"),
167
- "adapter.body.2.resnets.0.block2.weight": src_state.pop("body.2.body.0.block2.weight"),
168
- "adapter.body.2.resnets.0.block2.bias": src_state.pop("body.2.body.0.block2.bias"),
169
- # body.2.body.1
170
- "adapter.body.2.resnets.1.block1.weight": src_state.pop("body.2.body.1.block1.weight"),
171
- "adapter.body.2.resnets.1.block1.bias": src_state.pop("body.2.body.1.block1.bias"),
172
- "adapter.body.2.resnets.1.block2.weight": src_state.pop("body.2.body.1.block2.weight"),
173
- "adapter.body.2.resnets.1.block2.bias": src_state.pop("body.2.body.1.block2.bias"),
174
- # body.2.body.2
175
- "adapter.body.2.resnets.2.block1.weight": src_state.pop("body.2.body.2.block1.weight"),
176
- "adapter.body.2.resnets.2.block1.bias": src_state.pop("body.2.body.2.block1.bias"),
177
- "adapter.body.2.resnets.2.block2.weight": src_state.pop("body.2.body.2.block2.weight"),
178
- "adapter.body.2.resnets.2.block2.bias": src_state.pop("body.2.body.2.block2.bias"),
179
- # body.2.body.3
180
- "adapter.body.2.resnets.3.block1.weight": src_state.pop("body.2.body.3.block1.weight"),
181
- "adapter.body.2.resnets.3.block1.bias": src_state.pop("body.2.body.3.block1.bias"),
182
- "adapter.body.2.resnets.3.block2.weight": src_state.pop("body.2.body.3.block2.weight"),
183
- "adapter.body.2.resnets.3.block2.bias": src_state.pop("body.2.body.3.block2.bias"),
184
- # body.2.out_conv
185
- "adapter.body.2.out_conv.weight": src_state.pop("body.2.out_conv.weight"),
186
- "adapter.body.2.out_conv.bias": src_state.pop("body.2.out_conv.bias"),
187
- # body.3.in_conv
188
- "adapter.body.3.in_conv.weight": src_state.pop("body.3.in_conv.weight"),
189
- "adapter.body.3.in_conv.bias": src_state.pop("body.3.in_conv.bias"),
190
- # body.3.body.0
191
- "adapter.body.3.resnets.0.block1.weight": src_state.pop("body.3.body.0.block1.weight"),
192
- "adapter.body.3.resnets.0.block1.bias": src_state.pop("body.3.body.0.block1.bias"),
193
- "adapter.body.3.resnets.0.block2.weight": src_state.pop("body.3.body.0.block2.weight"),
194
- "adapter.body.3.resnets.0.block2.bias": src_state.pop("body.3.body.0.block2.bias"),
195
- # body.3.body.1
196
- "adapter.body.3.resnets.1.block1.weight": src_state.pop("body.3.body.1.block1.weight"),
197
- "adapter.body.3.resnets.1.block1.bias": src_state.pop("body.3.body.1.block1.bias"),
198
- "adapter.body.3.resnets.1.block2.weight": src_state.pop("body.3.body.1.block2.weight"),
199
- "adapter.body.3.resnets.1.block2.bias": src_state.pop("body.3.body.1.block2.bias"),
200
- # body.3.body.2
201
- "adapter.body.3.resnets.2.block1.weight": src_state.pop("body.3.body.2.block1.weight"),
202
- "adapter.body.3.resnets.2.block1.bias": src_state.pop("body.3.body.2.block1.bias"),
203
- "adapter.body.3.resnets.2.block2.weight": src_state.pop("body.3.body.2.block2.weight"),
204
- "adapter.body.3.resnets.2.block2.bias": src_state.pop("body.3.body.2.block2.bias"),
205
- # body.3.body.3
206
- "adapter.body.3.resnets.3.block1.weight": src_state.pop("body.3.body.3.block1.weight"),
207
- "adapter.body.3.resnets.3.block1.bias": src_state.pop("body.3.body.3.block1.bias"),
208
- "adapter.body.3.resnets.3.block2.weight": src_state.pop("body.3.body.3.block2.weight"),
209
- "adapter.body.3.resnets.3.block2.bias": src_state.pop("body.3.body.3.block2.bias"),
210
- # body.3.out_conv
211
- "adapter.body.3.out_conv.weight": src_state.pop("body.3.out_conv.weight"),
212
- "adapter.body.3.out_conv.bias": src_state.pop("body.3.out_conv.bias"),
213
- }
214
-
215
- assert len(src_state) == 0
216
-
217
- adapter = T2IAdapter(in_channels=3, channels=[320, 640, 1280], num_res_blocks=4, adapter_type="light_adapter")
218
-
219
- adapter.load_state_dict(res_state)
220
-
221
- return adapter
222
-
223
-
224
- if __name__ == "__main__":
225
- parser = argparse.ArgumentParser()
226
-
227
- parser.add_argument(
228
- "--checkpoint_path", default=None, type=str, required=True, help="Path to the checkpoint to convert."
229
- )
230
- parser.add_argument(
231
- "--output_path", default=None, type=str, required=True, help="Path to the store the result checkpoint."
232
- )
233
- parser.add_argument(
234
- "--is_adapter_light",
235
- action="store_true",
236
- help="Is checkpoint come from Adapter-Light architecture. ex: color-adapter",
237
- )
238
- parser.add_argument("--in_channels", required=False, type=int, help="Input channels for non-light adapter")
239
-
240
- args = parser.parse_args()
241
- src_state = torch.load(args.checkpoint_path)
242
-
243
- if args.is_adapter_light:
244
- adapter = convert_light_adapter(src_state)
245
- else:
246
- if args.in_channels is None:
247
- raise ValueError("set `--in_channels=<n>`")
248
- adapter = convert_adapter(src_state, args.in_channels)
249
-
250
- adapter.save_pretrained(args.output_path)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/src/diffusers/models/dual_transformer_2d.py DELETED
@@ -1,151 +0,0 @@
1
- # Copyright 2023 The HuggingFace Team. All rights reserved.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- from typing import Optional
15
-
16
- from torch import nn
17
-
18
- from .transformer_2d import Transformer2DModel, Transformer2DModelOutput
19
-
20
-
21
- class DualTransformer2DModel(nn.Module):
22
- """
23
- Dual transformer wrapper that combines two `Transformer2DModel`s for mixed inference.
24
-
25
- Parameters:
26
- num_attention_heads (`int`, *optional*, defaults to 16): The number of heads to use for multi-head attention.
27
- attention_head_dim (`int`, *optional*, defaults to 88): The number of channels in each head.
28
- in_channels (`int`, *optional*):
29
- Pass if the input is continuous. The number of channels in the input and output.
30
- num_layers (`int`, *optional*, defaults to 1): The number of layers of Transformer blocks to use.
31
- dropout (`float`, *optional*, defaults to 0.1): The dropout probability to use.
32
- cross_attention_dim (`int`, *optional*): The number of encoder_hidden_states dimensions to use.
33
- sample_size (`int`, *optional*): Pass if the input is discrete. The width of the latent images.
34
- Note that this is fixed at training time as it is used for learning a number of position embeddings. See
35
- `ImagePositionalEmbeddings`.
36
- num_vector_embeds (`int`, *optional*):
37
- Pass if the input is discrete. The number of classes of the vector embeddings of the latent pixels.
38
- Includes the class for the masked latent pixel.
39
- activation_fn (`str`, *optional*, defaults to `"geglu"`): Activation function to be used in feed-forward.
40
- num_embeds_ada_norm ( `int`, *optional*): Pass if at least one of the norm_layers is `AdaLayerNorm`.
41
- The number of diffusion steps used during training. Note that this is fixed at training time as it is used
42
- to learn a number of embeddings that are added to the hidden states. During inference, you can denoise for
43
- up to but not more than steps than `num_embeds_ada_norm`.
44
- attention_bias (`bool`, *optional*):
45
- Configure if the TransformerBlocks' attention should contain a bias parameter.
46
- """
47
-
48
- def __init__(
49
- self,
50
- num_attention_heads: int = 16,
51
- attention_head_dim: int = 88,
52
- in_channels: Optional[int] = None,
53
- num_layers: int = 1,
54
- dropout: float = 0.0,
55
- norm_num_groups: int = 32,
56
- cross_attention_dim: Optional[int] = None,
57
- attention_bias: bool = False,
58
- sample_size: Optional[int] = None,
59
- num_vector_embeds: Optional[int] = None,
60
- activation_fn: str = "geglu",
61
- num_embeds_ada_norm: Optional[int] = None,
62
- ):
63
- super().__init__()
64
- self.transformers = nn.ModuleList(
65
- [
66
- Transformer2DModel(
67
- num_attention_heads=num_attention_heads,
68
- attention_head_dim=attention_head_dim,
69
- in_channels=in_channels,
70
- num_layers=num_layers,
71
- dropout=dropout,
72
- norm_num_groups=norm_num_groups,
73
- cross_attention_dim=cross_attention_dim,
74
- attention_bias=attention_bias,
75
- sample_size=sample_size,
76
- num_vector_embeds=num_vector_embeds,
77
- activation_fn=activation_fn,
78
- num_embeds_ada_norm=num_embeds_ada_norm,
79
- )
80
- for _ in range(2)
81
- ]
82
- )
83
-
84
- # Variables that can be set by a pipeline:
85
-
86
- # The ratio of transformer1 to transformer2's output states to be combined during inference
87
- self.mix_ratio = 0.5
88
-
89
- # The shape of `encoder_hidden_states` is expected to be
90
- # `(batch_size, condition_lengths[0]+condition_lengths[1], num_features)`
91
- self.condition_lengths = [77, 257]
92
-
93
- # Which transformer to use to encode which condition.
94
- # E.g. `(1, 0)` means that we'll use `transformers[1](conditions[0])` and `transformers[0](conditions[1])`
95
- self.transformer_index_for_condition = [1, 0]
96
-
97
- def forward(
98
- self,
99
- hidden_states,
100
- encoder_hidden_states,
101
- timestep=None,
102
- attention_mask=None,
103
- cross_attention_kwargs=None,
104
- return_dict: bool = True,
105
- ):
106
- """
107
- Args:
108
- hidden_states ( When discrete, `torch.LongTensor` of shape `(batch size, num latent pixels)`.
109
- When continuous, `torch.FloatTensor` of shape `(batch size, channel, height, width)`): Input
110
- hidden_states
111
- encoder_hidden_states ( `torch.LongTensor` of shape `(batch size, encoder_hidden_states dim)`, *optional*):
112
- Conditional embeddings for cross attention layer. If not given, cross-attention defaults to
113
- self-attention.
114
- timestep ( `torch.long`, *optional*):
115
- Optional timestep to be applied as an embedding in AdaLayerNorm's. Used to indicate denoising step.
116
- attention_mask (`torch.FloatTensor`, *optional*):
117
- Optional attention mask to be applied in Attention
118
- return_dict (`bool`, *optional*, defaults to `True`):
119
- Whether or not to return a [`models.unet_2d_condition.UNet2DConditionOutput`] instead of a plain tuple.
120
-
121
- Returns:
122
- [`~models.transformer_2d.Transformer2DModelOutput`] or `tuple`:
123
- [`~models.transformer_2d.Transformer2DModelOutput`] if `return_dict` is True, otherwise a `tuple`. When
124
- returning a tuple, the first element is the sample tensor.
125
- """
126
- input_states = hidden_states
127
-
128
- encoded_states = []
129
- tokens_start = 0
130
- # attention_mask is not used yet
131
- for i in range(2):
132
- # for each of the two transformers, pass the corresponding condition tokens
133
- condition_state = encoder_hidden_states[:, tokens_start : tokens_start + self.condition_lengths[i]]
134
- transformer_index = self.transformer_index_for_condition[i]
135
- encoded_state = self.transformers[transformer_index](
136
- input_states,
137
- encoder_hidden_states=condition_state,
138
- timestep=timestep,
139
- cross_attention_kwargs=cross_attention_kwargs,
140
- return_dict=False,
141
- )[0]
142
- encoded_states.append(encoded_state - input_states)
143
- tokens_start += self.condition_lengths[i]
144
-
145
- output_states = encoded_states[0] * self.mix_ratio + encoded_states[1] * (1 - self.mix_ratio)
146
- output_states = output_states + input_states
147
-
148
- if not return_dict:
149
- return (output_states,)
150
-
151
- return Transformer2DModelOutput(sample=output_states)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Andy1621/uniformer_image_segmentation/configs/encnet/encnet_r50-d8_512x1024_80k_cityscapes.py DELETED
@@ -1,4 +0,0 @@
1
- _base_ = [
2
- '../_base_/models/encnet_r50-d8.py', '../_base_/datasets/cityscapes.py',
3
- '../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'
4
- ]
 
 
 
 
 
spaces/Anonumous/RuImageCaptioning/README.md DELETED
@@ -1,13 +0,0 @@
1
- ---
2
- title: RuImageCaptionong
3
- emoji: 👁
4
- colorFrom: yellow
5
- colorTo: yellow
6
- sdk: gradio
7
- sdk_version: 3.24.1
8
- app_file: app.py
9
- pinned: false
10
- license: apache-2.0
11
- ---
12
-
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Anonymous-123/ImageNet-Editing/editing_diffusion/utils/change_place.py DELETED
@@ -1,121 +0,0 @@
1
- #!/usr/bin/python
2
- #****************************************************************#
3
- # ScriptName: change_place.py
4
- # Author: Anonymous_123
5
- # Create Date: 2022-08-26 14:13
6
- # Modify Author: Anonymous_123
7
- # Modify Date: 2022-08-26 14:13
8
- # Function:
9
- #***************************************************************#
10
-
11
- import os
12
- import torch
13
- import torch.nn as nn
14
- from torchvision.transforms import functional as TF
15
- import cv2
16
- from PIL import Image
17
- import numpy as np
18
- import random
19
- # random.seed(0)
20
- import pdb
21
- import imutils
22
- from tqdm import tqdm
23
-
24
- def change_place(img, mask, bbox, invert_mask):
25
- '''
26
- img: N,C,H,W
27
- '''
28
- if invert_mask:
29
- mask = 1-mask
30
-
31
- device = img.device
32
- x,y,new_x,new_y,w,h = bbox
33
-
34
- img_ori = img.clone()
35
- mask_ori = mask.clone()
36
- img_ori = img_ori.to(device)
37
- mask_ori = mask_ori.to(device)
38
-
39
- img[:,:, new_y:new_y+h, new_x:new_x+w] = img_ori[:,:, y:y+h, x:x+w]
40
- mask_new = torch.zeros(mask.shape).to(device)
41
- mask_new[:,:, new_y:new_y+h, new_x:new_x+w] = mask_ori[:,:, y:y+h, x:x+w]
42
- mask_ = mask_new > 0.5
43
- img = img*mask_ + (~mask_)*img_ori
44
-
45
- if invert_mask:
46
- mask_new = 1 - mask_new
47
-
48
- return img, mask_new
49
-
50
- def find_bbox(mask):
51
- mask_copy = mask.copy()
52
-
53
- contours, _ = cv2.findContours(mask[:,:,0],cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)
54
- bbox = []
55
- max_area = 0
56
- for cnt in contours:
57
- x, y, w, h = cv2.boundingRect(cnt)
58
- cv2.rectangle(mask_copy, (x, y), (x + w, y + h), (0, 255, 0), 2)
59
- if max_area < w*h:
60
- max_area = w*h
61
- bbox = [x,y,w,h]
62
-
63
- if bbox == []:
64
- return None
65
- else:
66
- H,W,C = mask.shape
67
- x,y,w,h = bbox
68
- new_x = random.randint(0, W-w)
69
- new_y = random.randint(0, H-h)
70
- return [x, y, new_x, new_y, w,h]
71
-
72
-
73
- if __name__ == '__main__':
74
- mask_path = 'n01440764/ILSVRC2012_val_00000293.png'
75
-
76
- ori_img_path_root = 'ImageNet-S/ImageNetS919/validation/'
77
- outpainting_root = 'TFill/results/imagenet_2/test_latest/img_ref_out/'
78
- padding_root = 'ImageNet-S/ImageNetS919/validation-size-0.05-padding-4901/'
79
- mask_root = 'ImageNet-S/ImageNetS919/validation-segmentation-label-mask/'
80
-
81
-
82
- imgs = os.listdir(outpainting_root)
83
-
84
- shape = (256,256)
85
- for cls in tqdm(os.listdir(mask_root)):
86
- for img_name in os.listdir(os.path.join(mask_root, cls)):
87
- if not img_name.split('.')[0]+'_0.png' in imgs:
88
- continue
89
- img_path = os.path.join(ori_img_path_root, cls, img_name.split('.')[0]+'.JPEG')
90
- img_path_init = os.path.join(outpainting_root, img_name.split('.')[0]+'_0.png')
91
- img_path_2 = os.path.join(padding_root, cls, img_name.split('.')[0]+'.JPEG')
92
- mask_path = os.path.join(mask_root, cls, img_name)
93
- if os.path.exists(img_path) and os.path.exists(img_path_init) and os.path.exists(img_path_2) and os.path.exists(mask_path):
94
- img = Image.open(img_path_2).convert('RGB')
95
- img = img.resize(shape, Image.LANCZOS)
96
- img = TF.to_tensor(img).unsqueeze(0).mul(2).sub(1)
97
-
98
- mask = Image.open(mask_path).convert('RGB')
99
- mask = mask.resize(shape, Image.NEAREST)
100
- bbox = find_bbox(np.array(mask))
101
-
102
- mask = ((np.array(mask) > 0.5) * 255).astype(np.uint8)
103
-
104
- mask = TF.to_tensor(Image.fromarray(mask))
105
- mask = mask[0, ...].unsqueeze(0).unsqueeze(0)
106
-
107
- if bbox is not None:
108
- img, mask = change_place(img, mask, bbox)
109
-
110
- img_init = Image.open(img_path_init).convert('RGB')
111
- img_init = img_init.resize(shape, Image.LANCZOS)
112
- img_init = TF.to_tensor(img_init).unsqueeze(0).mul(2).sub(1)
113
- img_new = img_init*(1-mask) + img*mask
114
-
115
- img_new = np.transpose(((img_new+1)/2*255)[0].numpy(), (1,2,0))[:,:,::-1]
116
- img_init = cv2.imread(img_path)
117
- img_init = cv2.resize(img_init, shape)
118
- # cv2.imwrite('tmp/'+img_name, cv2.hconcat([img_init, img_new.astype('uint8')]))
119
- cv2.imwrite('tmp/'+img_name, img_new.astype('uint8'))
120
-
121
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Anonymous-123/ImageNet-Editing/object_removal/TFill/results/celeba/test_latest/index.html DELETED
@@ -1,563 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Experiment = celeba, Phase = test, Epoch = latest</title>
5
- </head>
6
- <body>
7
- <h3>ILSVRC2012_test_00007239</h3>
8
- <table border="1" style="table-layout: fixed;">
9
- <tr>
10
- <td halign="center" style="word-wrap: break-word;" valign="top">
11
- <p>
12
- <a href="examples/img_org/ILSVRC2012_test_00007239.png">
13
- <img src="examples/img_org/ILSVRC2012_test_00007239.png" style="width:256px">
14
- </a><br>
15
- <p>img_org</p>
16
- </p>
17
- </td>
18
- <td halign="center" style="word-wrap: break-word;" valign="top">
19
- <p>
20
- <a href="examples/img_m/ILSVRC2012_test_00007239.png">
21
- <img src="examples/img_m/ILSVRC2012_test_00007239.png" style="width:256px">
22
- </a><br>
23
- <p>img_m</p>
24
- </p>
25
- </td>
26
- <td halign="center" style="word-wrap: break-word;" valign="top">
27
- <p>
28
- <a href="examples/img_out/ILSVRC2012_test_00007239.png">
29
- <img src="examples/img_out/ILSVRC2012_test_00007239.png" style="width:256px">
30
- </a><br>
31
- <p>img_out</p>
32
- </p>
33
- </td>
34
- <td halign="center" style="word-wrap: break-word;" valign="top">
35
- <p>
36
- <a href="examples/img_ref_out/ILSVRC2012_test_00007239.png">
37
- <img src="examples/img_ref_out/ILSVRC2012_test_00007239.png" style="width:256px">
38
- </a><br>
39
- <p>img_ref_out</p>
40
- </p>
41
- </td>
42
- </tr>
43
- </table>
44
- <h3>ILSVRC2012_test_00031325</h3>
45
- <table border="1" style="table-layout: fixed;">
46
- <tr>
47
- <td halign="center" style="word-wrap: break-word;" valign="top">
48
- <p>
49
- <a href="examples/img_org/ILSVRC2012_test_00031325.png">
50
- <img src="examples/img_org/ILSVRC2012_test_00031325.png" style="width:256px">
51
- </a><br>
52
- <p>img_org</p>
53
- </p>
54
- </td>
55
- <td halign="center" style="word-wrap: break-word;" valign="top">
56
- <p>
57
- <a href="examples/img_m/ILSVRC2012_test_00031325.png">
58
- <img src="examples/img_m/ILSVRC2012_test_00031325.png" style="width:256px">
59
- </a><br>
60
- <p>img_m</p>
61
- </p>
62
- </td>
63
- <td halign="center" style="word-wrap: break-word;" valign="top">
64
- <p>
65
- <a href="examples/img_out/ILSVRC2012_test_00031325.png">
66
- <img src="examples/img_out/ILSVRC2012_test_00031325.png" style="width:256px">
67
- </a><br>
68
- <p>img_out</p>
69
- </p>
70
- </td>
71
- <td halign="center" style="word-wrap: break-word;" valign="top">
72
- <p>
73
- <a href="examples/img_ref_out/ILSVRC2012_test_00031325.png">
74
- <img src="examples/img_ref_out/ILSVRC2012_test_00031325.png" style="width:256px">
75
- </a><br>
76
- <p>img_ref_out</p>
77
- </p>
78
- </td>
79
- </tr>
80
- </table>
81
- <h3>ILSVRC2012_test_00038546</h3>
82
- <table border="1" style="table-layout: fixed;">
83
- <tr>
84
- <td halign="center" style="word-wrap: break-word;" valign="top">
85
- <p>
86
- <a href="examples/img_org/ILSVRC2012_test_00038546.png">
87
- <img src="examples/img_org/ILSVRC2012_test_00038546.png" style="width:256px">
88
- </a><br>
89
- <p>img_org</p>
90
- </p>
91
- </td>
92
- <td halign="center" style="word-wrap: break-word;" valign="top">
93
- <p>
94
- <a href="examples/img_m/ILSVRC2012_test_00038546.png">
95
- <img src="examples/img_m/ILSVRC2012_test_00038546.png" style="width:256px">
96
- </a><br>
97
- <p>img_m</p>
98
- </p>
99
- </td>
100
- <td halign="center" style="word-wrap: break-word;" valign="top">
101
- <p>
102
- <a href="examples/img_out/ILSVRC2012_test_00038546.png">
103
- <img src="examples/img_out/ILSVRC2012_test_00038546.png" style="width:256px">
104
- </a><br>
105
- <p>img_out</p>
106
- </p>
107
- </td>
108
- <td halign="center" style="word-wrap: break-word;" valign="top">
109
- <p>
110
- <a href="examples/img_ref_out/ILSVRC2012_test_00038546.png">
111
- <img src="examples/img_ref_out/ILSVRC2012_test_00038546.png" style="width:256px">
112
- </a><br>
113
- <p>img_ref_out</p>
114
- </p>
115
- </td>
116
- </tr>
117
- </table>
118
- <h3>ILSVRC2012_test_00038608</h3>
119
- <table border="1" style="table-layout: fixed;">
120
- <tr>
121
- <td halign="center" style="word-wrap: break-word;" valign="top">
122
- <p>
123
- <a href="examples/img_org/ILSVRC2012_test_00038608.png">
124
- <img src="examples/img_org/ILSVRC2012_test_00038608.png" style="width:256px">
125
- </a><br>
126
- <p>img_org</p>
127
- </p>
128
- </td>
129
- <td halign="center" style="word-wrap: break-word;" valign="top">
130
- <p>
131
- <a href="examples/img_m/ILSVRC2012_test_00038608.png">
132
- <img src="examples/img_m/ILSVRC2012_test_00038608.png" style="width:256px">
133
- </a><br>
134
- <p>img_m</p>
135
- </p>
136
- </td>
137
- <td halign="center" style="word-wrap: break-word;" valign="top">
138
- <p>
139
- <a href="examples/img_out/ILSVRC2012_test_00038608.png">
140
- <img src="examples/img_out/ILSVRC2012_test_00038608.png" style="width:256px">
141
- </a><br>
142
- <p>img_out</p>
143
- </p>
144
- </td>
145
- <td halign="center" style="word-wrap: break-word;" valign="top">
146
- <p>
147
- <a href="examples/img_ref_out/ILSVRC2012_test_00038608.png">
148
- <img src="examples/img_ref_out/ILSVRC2012_test_00038608.png" style="width:256px">
149
- </a><br>
150
- <p>img_ref_out</p>
151
- </p>
152
- </td>
153
- </tr>
154
- </table>
155
- <h3>ILSVRC2012_test_00051208</h3>
156
- <table border="1" style="table-layout: fixed;">
157
- <tr>
158
- <td halign="center" style="word-wrap: break-word;" valign="top">
159
- <p>
160
- <a href="examples/img_org/ILSVRC2012_test_00051208.png">
161
- <img src="examples/img_org/ILSVRC2012_test_00051208.png" style="width:256px">
162
- </a><br>
163
- <p>img_org</p>
164
- </p>
165
- </td>
166
- <td halign="center" style="word-wrap: break-word;" valign="top">
167
- <p>
168
- <a href="examples/img_m/ILSVRC2012_test_00051208.png">
169
- <img src="examples/img_m/ILSVRC2012_test_00051208.png" style="width:256px">
170
- </a><br>
171
- <p>img_m</p>
172
- </p>
173
- </td>
174
- <td halign="center" style="word-wrap: break-word;" valign="top">
175
- <p>
176
- <a href="examples/img_out/ILSVRC2012_test_00051208.png">
177
- <img src="examples/img_out/ILSVRC2012_test_00051208.png" style="width:256px">
178
- </a><br>
179
- <p>img_out</p>
180
- </p>
181
- </td>
182
- <td halign="center" style="word-wrap: break-word;" valign="top">
183
- <p>
184
- <a href="examples/img_ref_out/ILSVRC2012_test_00051208.png">
185
- <img src="examples/img_ref_out/ILSVRC2012_test_00051208.png" style="width:256px">
186
- </a><br>
187
- <p>img_ref_out</p>
188
- </p>
189
- </td>
190
- </tr>
191
- </table>
192
- <h3>ILSVRC2012_test_00055197</h3>
193
- <table border="1" style="table-layout: fixed;">
194
- <tr>
195
- <td halign="center" style="word-wrap: break-word;" valign="top">
196
- <p>
197
- <a href="examples/img_org/ILSVRC2012_test_00055197.png">
198
- <img src="examples/img_org/ILSVRC2012_test_00055197.png" style="width:256px">
199
- </a><br>
200
- <p>img_org</p>
201
- </p>
202
- </td>
203
- <td halign="center" style="word-wrap: break-word;" valign="top">
204
- <p>
205
- <a href="examples/img_m/ILSVRC2012_test_00055197.png">
206
- <img src="examples/img_m/ILSVRC2012_test_00055197.png" style="width:256px">
207
- </a><br>
208
- <p>img_m</p>
209
- </p>
210
- </td>
211
- <td halign="center" style="word-wrap: break-word;" valign="top">
212
- <p>
213
- <a href="examples/img_out/ILSVRC2012_test_00055197.png">
214
- <img src="examples/img_out/ILSVRC2012_test_00055197.png" style="width:256px">
215
- </a><br>
216
- <p>img_out</p>
217
- </p>
218
- </td>
219
- <td halign="center" style="word-wrap: break-word;" valign="top">
220
- <p>
221
- <a href="examples/img_ref_out/ILSVRC2012_test_00055197.png">
222
- <img src="examples/img_ref_out/ILSVRC2012_test_00055197.png" style="width:256px">
223
- </a><br>
224
- <p>img_ref_out</p>
225
- </p>
226
- </td>
227
- </tr>
228
- </table>
229
- <h3>ILSVRC2012_test_00057270</h3>
230
- <table border="1" style="table-layout: fixed;">
231
- <tr>
232
- <td halign="center" style="word-wrap: break-word;" valign="top">
233
- <p>
234
- <a href="examples/img_org/ILSVRC2012_test_00057270.png">
235
- <img src="examples/img_org/ILSVRC2012_test_00057270.png" style="width:256px">
236
- </a><br>
237
- <p>img_org</p>
238
- </p>
239
- </td>
240
- <td halign="center" style="word-wrap: break-word;" valign="top">
241
- <p>
242
- <a href="examples/img_m/ILSVRC2012_test_00057270.png">
243
- <img src="examples/img_m/ILSVRC2012_test_00057270.png" style="width:256px">
244
- </a><br>
245
- <p>img_m</p>
246
- </p>
247
- </td>
248
- <td halign="center" style="word-wrap: break-word;" valign="top">
249
- <p>
250
- <a href="examples/img_out/ILSVRC2012_test_00057270.png">
251
- <img src="examples/img_out/ILSVRC2012_test_00057270.png" style="width:256px">
252
- </a><br>
253
- <p>img_out</p>
254
- </p>
255
- </td>
256
- <td halign="center" style="word-wrap: break-word;" valign="top">
257
- <p>
258
- <a href="examples/img_ref_out/ILSVRC2012_test_00057270.png">
259
- <img src="examples/img_ref_out/ILSVRC2012_test_00057270.png" style="width:256px">
260
- </a><br>
261
- <p>img_ref_out</p>
262
- </p>
263
- </td>
264
- </tr>
265
- </table>
266
- <h3>ILSVRC2012_test_00061469</h3>
267
- <table border="1" style="table-layout: fixed;">
268
- <tr>
269
- <td halign="center" style="word-wrap: break-word;" valign="top">
270
- <p>
271
- <a href="examples/img_org/ILSVRC2012_test_00061469.png">
272
- <img src="examples/img_org/ILSVRC2012_test_00061469.png" style="width:256px">
273
- </a><br>
274
- <p>img_org</p>
275
- </p>
276
- </td>
277
- <td halign="center" style="word-wrap: break-word;" valign="top">
278
- <p>
279
- <a href="examples/img_m/ILSVRC2012_test_00061469.png">
280
- <img src="examples/img_m/ILSVRC2012_test_00061469.png" style="width:256px">
281
- </a><br>
282
- <p>img_m</p>
283
- </p>
284
- </td>
285
- <td halign="center" style="word-wrap: break-word;" valign="top">
286
- <p>
287
- <a href="examples/img_out/ILSVRC2012_test_00061469.png">
288
- <img src="examples/img_out/ILSVRC2012_test_00061469.png" style="width:256px">
289
- </a><br>
290
- <p>img_out</p>
291
- </p>
292
- </td>
293
- <td halign="center" style="word-wrap: break-word;" valign="top">
294
- <p>
295
- <a href="examples/img_ref_out/ILSVRC2012_test_00061469.png">
296
- <img src="examples/img_ref_out/ILSVRC2012_test_00061469.png" style="width:256px">
297
- </a><br>
298
- <p>img_ref_out</p>
299
- </p>
300
- </td>
301
- </tr>
302
- </table>
303
- <h3>ILSVRC2012_test_00068490</h3>
304
- <table border="1" style="table-layout: fixed;">
305
- <tr>
306
- <td halign="center" style="word-wrap: break-word;" valign="top">
307
- <p>
308
- <a href="examples/img_org/ILSVRC2012_test_00068490.png">
309
- <img src="examples/img_org/ILSVRC2012_test_00068490.png" style="width:256px">
310
- </a><br>
311
- <p>img_org</p>
312
- </p>
313
- </td>
314
- <td halign="center" style="word-wrap: break-word;" valign="top">
315
- <p>
316
- <a href="examples/img_m/ILSVRC2012_test_00068490.png">
317
- <img src="examples/img_m/ILSVRC2012_test_00068490.png" style="width:256px">
318
- </a><br>
319
- <p>img_m</p>
320
- </p>
321
- </td>
322
- <td halign="center" style="word-wrap: break-word;" valign="top">
323
- <p>
324
- <a href="examples/img_out/ILSVRC2012_test_00068490.png">
325
- <img src="examples/img_out/ILSVRC2012_test_00068490.png" style="width:256px">
326
- </a><br>
327
- <p>img_out</p>
328
- </p>
329
- </td>
330
- <td halign="center" style="word-wrap: break-word;" valign="top">
331
- <p>
332
- <a href="examples/img_ref_out/ILSVRC2012_test_00068490.png">
333
- <img src="examples/img_ref_out/ILSVRC2012_test_00068490.png" style="width:256px">
334
- </a><br>
335
- <p>img_ref_out</p>
336
- </p>
337
- </td>
338
- </tr>
339
- </table>
340
- <h3>ILSVRC2012_test_00074872</h3>
341
- <table border="1" style="table-layout: fixed;">
342
- <tr>
343
- <td halign="center" style="word-wrap: break-word;" valign="top">
344
- <p>
345
- <a href="examples/img_org/ILSVRC2012_test_00074872.png">
346
- <img src="examples/img_org/ILSVRC2012_test_00074872.png" style="width:256px">
347
- </a><br>
348
- <p>img_org</p>
349
- </p>
350
- </td>
351
- <td halign="center" style="word-wrap: break-word;" valign="top">
352
- <p>
353
- <a href="examples/img_m/ILSVRC2012_test_00074872.png">
354
- <img src="examples/img_m/ILSVRC2012_test_00074872.png" style="width:256px">
355
- </a><br>
356
- <p>img_m</p>
357
- </p>
358
- </td>
359
- <td halign="center" style="word-wrap: break-word;" valign="top">
360
- <p>
361
- <a href="examples/img_out/ILSVRC2012_test_00074872.png">
362
- <img src="examples/img_out/ILSVRC2012_test_00074872.png" style="width:256px">
363
- </a><br>
364
- <p>img_out</p>
365
- </p>
366
- </td>
367
- <td halign="center" style="word-wrap: break-word;" valign="top">
368
- <p>
369
- <a href="examples/img_ref_out/ILSVRC2012_test_00074872.png">
370
- <img src="examples/img_ref_out/ILSVRC2012_test_00074872.png" style="width:256px">
371
- </a><br>
372
- <p>img_ref_out</p>
373
- </p>
374
- </td>
375
- </tr>
376
- </table>
377
- <h3>ILSVRC2012_test_00076650</h3>
378
- <table border="1" style="table-layout: fixed;">
379
- <tr>
380
- <td halign="center" style="word-wrap: break-word;" valign="top">
381
- <p>
382
- <a href="examples/img_org/ILSVRC2012_test_00076650.png">
383
- <img src="examples/img_org/ILSVRC2012_test_00076650.png" style="width:256px">
384
- </a><br>
385
- <p>img_org</p>
386
- </p>
387
- </td>
388
- <td halign="center" style="word-wrap: break-word;" valign="top">
389
- <p>
390
- <a href="examples/img_m/ILSVRC2012_test_00076650.png">
391
- <img src="examples/img_m/ILSVRC2012_test_00076650.png" style="width:256px">
392
- </a><br>
393
- <p>img_m</p>
394
- </p>
395
- </td>
396
- <td halign="center" style="word-wrap: break-word;" valign="top">
397
- <p>
398
- <a href="examples/img_out/ILSVRC2012_test_00076650.png">
399
- <img src="examples/img_out/ILSVRC2012_test_00076650.png" style="width:256px">
400
- </a><br>
401
- <p>img_out</p>
402
- </p>
403
- </td>
404
- <td halign="center" style="word-wrap: break-word;" valign="top">
405
- <p>
406
- <a href="examples/img_ref_out/ILSVRC2012_test_00076650.png">
407
- <img src="examples/img_ref_out/ILSVRC2012_test_00076650.png" style="width:256px">
408
- </a><br>
409
- <p>img_ref_out</p>
410
- </p>
411
- </td>
412
- </tr>
413
- </table>
414
- <h3>ILSVRC2012_test_00079136</h3>
415
- <table border="1" style="table-layout: fixed;">
416
- <tr>
417
- <td halign="center" style="word-wrap: break-word;" valign="top">
418
- <p>
419
- <a href="examples/img_org/ILSVRC2012_test_00079136.png">
420
- <img src="examples/img_org/ILSVRC2012_test_00079136.png" style="width:256px">
421
- </a><br>
422
- <p>img_org</p>
423
- </p>
424
- </td>
425
- <td halign="center" style="word-wrap: break-word;" valign="top">
426
- <p>
427
- <a href="examples/img_m/ILSVRC2012_test_00079136.png">
428
- <img src="examples/img_m/ILSVRC2012_test_00079136.png" style="width:256px">
429
- </a><br>
430
- <p>img_m</p>
431
- </p>
432
- </td>
433
- <td halign="center" style="word-wrap: break-word;" valign="top">
434
- <p>
435
- <a href="examples/img_out/ILSVRC2012_test_00079136.png">
436
- <img src="examples/img_out/ILSVRC2012_test_00079136.png" style="width:256px">
437
- </a><br>
438
- <p>img_out</p>
439
- </p>
440
- </td>
441
- <td halign="center" style="word-wrap: break-word;" valign="top">
442
- <p>
443
- <a href="examples/img_ref_out/ILSVRC2012_test_00079136.png">
444
- <img src="examples/img_ref_out/ILSVRC2012_test_00079136.png" style="width:256px">
445
- </a><br>
446
- <p>img_ref_out</p>
447
- </p>
448
- </td>
449
- </tr>
450
- </table>
451
- <h3>ILSVRC2012_test_00081141</h3>
452
- <table border="1" style="table-layout: fixed;">
453
- <tr>
454
- <td halign="center" style="word-wrap: break-word;" valign="top">
455
- <p>
456
- <a href="examples/img_org/ILSVRC2012_test_00081141.png">
457
- <img src="examples/img_org/ILSVRC2012_test_00081141.png" style="width:256px">
458
- </a><br>
459
- <p>img_org</p>
460
- </p>
461
- </td>
462
- <td halign="center" style="word-wrap: break-word;" valign="top">
463
- <p>
464
- <a href="examples/img_m/ILSVRC2012_test_00081141.png">
465
- <img src="examples/img_m/ILSVRC2012_test_00081141.png" style="width:256px">
466
- </a><br>
467
- <p>img_m</p>
468
- </p>
469
- </td>
470
- <td halign="center" style="word-wrap: break-word;" valign="top">
471
- <p>
472
- <a href="examples/img_out/ILSVRC2012_test_00081141.png">
473
- <img src="examples/img_out/ILSVRC2012_test_00081141.png" style="width:256px">
474
- </a><br>
475
- <p>img_out</p>
476
- </p>
477
- </td>
478
- <td halign="center" style="word-wrap: break-word;" valign="top">
479
- <p>
480
- <a href="examples/img_ref_out/ILSVRC2012_test_00081141.png">
481
- <img src="examples/img_ref_out/ILSVRC2012_test_00081141.png" style="width:256px">
482
- </a><br>
483
- <p>img_ref_out</p>
484
- </p>
485
- </td>
486
- </tr>
487
- </table>
488
- <h3>ILSVRC2012_test_00088244</h3>
489
- <table border="1" style="table-layout: fixed;">
490
- <tr>
491
- <td halign="center" style="word-wrap: break-word;" valign="top">
492
- <p>
493
- <a href="examples/img_org/ILSVRC2012_test_00088244.png">
494
- <img src="examples/img_org/ILSVRC2012_test_00088244.png" style="width:256px">
495
- </a><br>
496
- <p>img_org</p>
497
- </p>
498
- </td>
499
- <td halign="center" style="word-wrap: break-word;" valign="top">
500
- <p>
501
- <a href="examples/img_m/ILSVRC2012_test_00088244.png">
502
- <img src="examples/img_m/ILSVRC2012_test_00088244.png" style="width:256px">
503
- </a><br>
504
- <p>img_m</p>
505
- </p>
506
- </td>
507
- <td halign="center" style="word-wrap: break-word;" valign="top">
508
- <p>
509
- <a href="examples/img_out/ILSVRC2012_test_00088244.png">
510
- <img src="examples/img_out/ILSVRC2012_test_00088244.png" style="width:256px">
511
- </a><br>
512
- <p>img_out</p>
513
- </p>
514
- </td>
515
- <td halign="center" style="word-wrap: break-word;" valign="top">
516
- <p>
517
- <a href="examples/img_ref_out/ILSVRC2012_test_00088244.png">
518
- <img src="examples/img_ref_out/ILSVRC2012_test_00088244.png" style="width:256px">
519
- </a><br>
520
- <p>img_ref_out</p>
521
- </p>
522
- </td>
523
- </tr>
524
- </table>
525
- <h3>ILSVRC2012_test_00098832</h3>
526
- <table border="1" style="table-layout: fixed;">
527
- <tr>
528
- <td halign="center" style="word-wrap: break-word;" valign="top">
529
- <p>
530
- <a href="examples/img_org/ILSVRC2012_test_00098832.png">
531
- <img src="examples/img_org/ILSVRC2012_test_00098832.png" style="width:256px">
532
- </a><br>
533
- <p>img_org</p>
534
- </p>
535
- </td>
536
- <td halign="center" style="word-wrap: break-word;" valign="top">
537
- <p>
538
- <a href="examples/img_m/ILSVRC2012_test_00098832.png">
539
- <img src="examples/img_m/ILSVRC2012_test_00098832.png" style="width:256px">
540
- </a><br>
541
- <p>img_m</p>
542
- </p>
543
- </td>
544
- <td halign="center" style="word-wrap: break-word;" valign="top">
545
- <p>
546
- <a href="examples/img_out/ILSVRC2012_test_00098832.png">
547
- <img src="examples/img_out/ILSVRC2012_test_00098832.png" style="width:256px">
548
- </a><br>
549
- <p>img_out</p>
550
- </p>
551
- </td>
552
- <td halign="center" style="word-wrap: break-word;" valign="top">
553
- <p>
554
- <a href="examples/img_ref_out/ILSVRC2012_test_00098832.png">
555
- <img src="examples/img_ref_out/ILSVRC2012_test_00098832.png" style="width:256px">
556
- </a><br>
557
- <p>img_ref_out</p>
558
- </p>
559
- </td>
560
- </tr>
561
- </table>
562
- </body>
563
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Anonymous-sub/Rerender/ControlNet/annotator/uniformer/mmcv/ops/point_sample.py DELETED
@@ -1,336 +0,0 @@
1
- # Modified from https://github.com/facebookresearch/detectron2/tree/master/projects/PointRend # noqa
2
-
3
- from os import path as osp
4
-
5
- import torch
6
- import torch.nn as nn
7
- import torch.nn.functional as F
8
- from torch.nn.modules.utils import _pair
9
- from torch.onnx.operators import shape_as_tensor
10
-
11
-
12
- def bilinear_grid_sample(im, grid, align_corners=False):
13
- """Given an input and a flow-field grid, computes the output using input
14
- values and pixel locations from grid. Supported only bilinear interpolation
15
- method to sample the input pixels.
16
-
17
- Args:
18
- im (torch.Tensor): Input feature map, shape (N, C, H, W)
19
- grid (torch.Tensor): Point coordinates, shape (N, Hg, Wg, 2)
20
- align_corners {bool}: If set to True, the extrema (-1 and 1) are
21
- considered as referring to the center points of the input’s
22
- corner pixels. If set to False, they are instead considered as
23
- referring to the corner points of the input’s corner pixels,
24
- making the sampling more resolution agnostic.
25
- Returns:
26
- torch.Tensor: A tensor with sampled points, shape (N, C, Hg, Wg)
27
- """
28
- n, c, h, w = im.shape
29
- gn, gh, gw, _ = grid.shape
30
- assert n == gn
31
-
32
- x = grid[:, :, :, 0]
33
- y = grid[:, :, :, 1]
34
-
35
- if align_corners:
36
- x = ((x + 1) / 2) * (w - 1)
37
- y = ((y + 1) / 2) * (h - 1)
38
- else:
39
- x = ((x + 1) * w - 1) / 2
40
- y = ((y + 1) * h - 1) / 2
41
-
42
- x = x.view(n, -1)
43
- y = y.view(n, -1)
44
-
45
- x0 = torch.floor(x).long()
46
- y0 = torch.floor(y).long()
47
- x1 = x0 + 1
48
- y1 = y0 + 1
49
-
50
- wa = ((x1 - x) * (y1 - y)).unsqueeze(1)
51
- wb = ((x1 - x) * (y - y0)).unsqueeze(1)
52
- wc = ((x - x0) * (y1 - y)).unsqueeze(1)
53
- wd = ((x - x0) * (y - y0)).unsqueeze(1)
54
-
55
- # Apply default for grid_sample function zero padding
56
- im_padded = F.pad(im, pad=[1, 1, 1, 1], mode='constant', value=0)
57
- padded_h = h + 2
58
- padded_w = w + 2
59
- # save points positions after padding
60
- x0, x1, y0, y1 = x0 + 1, x1 + 1, y0 + 1, y1 + 1
61
-
62
- # Clip coordinates to padded image size
63
- x0 = torch.where(x0 < 0, torch.tensor(0), x0)
64
- x0 = torch.where(x0 > padded_w - 1, torch.tensor(padded_w - 1), x0)
65
- x1 = torch.where(x1 < 0, torch.tensor(0), x1)
66
- x1 = torch.where(x1 > padded_w - 1, torch.tensor(padded_w - 1), x1)
67
- y0 = torch.where(y0 < 0, torch.tensor(0), y0)
68
- y0 = torch.where(y0 > padded_h - 1, torch.tensor(padded_h - 1), y0)
69
- y1 = torch.where(y1 < 0, torch.tensor(0), y1)
70
- y1 = torch.where(y1 > padded_h - 1, torch.tensor(padded_h - 1), y1)
71
-
72
- im_padded = im_padded.view(n, c, -1)
73
-
74
- x0_y0 = (x0 + y0 * padded_w).unsqueeze(1).expand(-1, c, -1)
75
- x0_y1 = (x0 + y1 * padded_w).unsqueeze(1).expand(-1, c, -1)
76
- x1_y0 = (x1 + y0 * padded_w).unsqueeze(1).expand(-1, c, -1)
77
- x1_y1 = (x1 + y1 * padded_w).unsqueeze(1).expand(-1, c, -1)
78
-
79
- Ia = torch.gather(im_padded, 2, x0_y0)
80
- Ib = torch.gather(im_padded, 2, x0_y1)
81
- Ic = torch.gather(im_padded, 2, x1_y0)
82
- Id = torch.gather(im_padded, 2, x1_y1)
83
-
84
- return (Ia * wa + Ib * wb + Ic * wc + Id * wd).reshape(n, c, gh, gw)
85
-
86
-
87
- def is_in_onnx_export_without_custom_ops():
88
- from annotator.uniformer.mmcv.ops import get_onnxruntime_op_path
89
- ort_custom_op_path = get_onnxruntime_op_path()
90
- return torch.onnx.is_in_onnx_export(
91
- ) and not osp.exists(ort_custom_op_path)
92
-
93
-
94
- def normalize(grid):
95
- """Normalize input grid from [-1, 1] to [0, 1]
96
- Args:
97
- grid (Tensor): The grid to be normalize, range [-1, 1].
98
- Returns:
99
- Tensor: Normalized grid, range [0, 1].
100
- """
101
-
102
- return (grid + 1.0) / 2.0
103
-
104
-
105
- def denormalize(grid):
106
- """Denormalize input grid from range [0, 1] to [-1, 1]
107
- Args:
108
- grid (Tensor): The grid to be denormalize, range [0, 1].
109
- Returns:
110
- Tensor: Denormalized grid, range [-1, 1].
111
- """
112
-
113
- return grid * 2.0 - 1.0
114
-
115
-
116
- def generate_grid(num_grid, size, device):
117
- """Generate regular square grid of points in [0, 1] x [0, 1] coordinate
118
- space.
119
-
120
- Args:
121
- num_grid (int): The number of grids to sample, one for each region.
122
- size (tuple(int, int)): The side size of the regular grid.
123
- device (torch.device): Desired device of returned tensor.
124
-
125
- Returns:
126
- (torch.Tensor): A tensor of shape (num_grid, size[0]*size[1], 2) that
127
- contains coordinates for the regular grids.
128
- """
129
-
130
- affine_trans = torch.tensor([[[1., 0., 0.], [0., 1., 0.]]], device=device)
131
- grid = F.affine_grid(
132
- affine_trans, torch.Size((1, 1, *size)), align_corners=False)
133
- grid = normalize(grid)
134
- return grid.view(1, -1, 2).expand(num_grid, -1, -1)
135
-
136
-
137
- def rel_roi_point_to_abs_img_point(rois, rel_roi_points):
138
- """Convert roi based relative point coordinates to image based absolute
139
- point coordinates.
140
-
141
- Args:
142
- rois (Tensor): RoIs or BBoxes, shape (N, 4) or (N, 5)
143
- rel_roi_points (Tensor): Point coordinates inside RoI, relative to
144
- RoI, location, range (0, 1), shape (N, P, 2)
145
- Returns:
146
- Tensor: Image based absolute point coordinates, shape (N, P, 2)
147
- """
148
-
149
- with torch.no_grad():
150
- assert rel_roi_points.size(0) == rois.size(0)
151
- assert rois.dim() == 2
152
- assert rel_roi_points.dim() == 3
153
- assert rel_roi_points.size(2) == 2
154
- # remove batch idx
155
- if rois.size(1) == 5:
156
- rois = rois[:, 1:]
157
- abs_img_points = rel_roi_points.clone()
158
- # To avoid an error during exporting to onnx use independent
159
- # variables instead inplace computation
160
- xs = abs_img_points[:, :, 0] * (rois[:, None, 2] - rois[:, None, 0])
161
- ys = abs_img_points[:, :, 1] * (rois[:, None, 3] - rois[:, None, 1])
162
- xs += rois[:, None, 0]
163
- ys += rois[:, None, 1]
164
- abs_img_points = torch.stack([xs, ys], dim=2)
165
- return abs_img_points
166
-
167
-
168
- def get_shape_from_feature_map(x):
169
- """Get spatial resolution of input feature map considering exporting to
170
- onnx mode.
171
-
172
- Args:
173
- x (torch.Tensor): Input tensor, shape (N, C, H, W)
174
- Returns:
175
- torch.Tensor: Spatial resolution (width, height), shape (1, 1, 2)
176
- """
177
- if torch.onnx.is_in_onnx_export():
178
- img_shape = shape_as_tensor(x)[2:].flip(0).view(1, 1, 2).to(
179
- x.device).float()
180
- else:
181
- img_shape = torch.tensor(x.shape[2:]).flip(0).view(1, 1, 2).to(
182
- x.device).float()
183
- return img_shape
184
-
185
-
186
- def abs_img_point_to_rel_img_point(abs_img_points, img, spatial_scale=1.):
187
- """Convert image based absolute point coordinates to image based relative
188
- coordinates for sampling.
189
-
190
- Args:
191
- abs_img_points (Tensor): Image based absolute point coordinates,
192
- shape (N, P, 2)
193
- img (tuple/Tensor): (height, width) of image or feature map.
194
- spatial_scale (float): Scale points by this factor. Default: 1.
195
-
196
- Returns:
197
- Tensor: Image based relative point coordinates for sampling,
198
- shape (N, P, 2)
199
- """
200
-
201
- assert (isinstance(img, tuple) and len(img) == 2) or \
202
- (isinstance(img, torch.Tensor) and len(img.shape) == 4)
203
-
204
- if isinstance(img, tuple):
205
- h, w = img
206
- scale = torch.tensor([w, h],
207
- dtype=torch.float,
208
- device=abs_img_points.device)
209
- scale = scale.view(1, 1, 2)
210
- else:
211
- scale = get_shape_from_feature_map(img)
212
-
213
- return abs_img_points / scale * spatial_scale
214
-
215
-
216
- def rel_roi_point_to_rel_img_point(rois,
217
- rel_roi_points,
218
- img,
219
- spatial_scale=1.):
220
- """Convert roi based relative point coordinates to image based absolute
221
- point coordinates.
222
-
223
- Args:
224
- rois (Tensor): RoIs or BBoxes, shape (N, 4) or (N, 5)
225
- rel_roi_points (Tensor): Point coordinates inside RoI, relative to
226
- RoI, location, range (0, 1), shape (N, P, 2)
227
- img (tuple/Tensor): (height, width) of image or feature map.
228
- spatial_scale (float): Scale points by this factor. Default: 1.
229
-
230
- Returns:
231
- Tensor: Image based relative point coordinates for sampling,
232
- shape (N, P, 2)
233
- """
234
-
235
- abs_img_point = rel_roi_point_to_abs_img_point(rois, rel_roi_points)
236
- rel_img_point = abs_img_point_to_rel_img_point(abs_img_point, img,
237
- spatial_scale)
238
-
239
- return rel_img_point
240
-
241
-
242
- def point_sample(input, points, align_corners=False, **kwargs):
243
- """A wrapper around :func:`grid_sample` to support 3D point_coords tensors
244
- Unlike :func:`torch.nn.functional.grid_sample` it assumes point_coords to
245
- lie inside ``[0, 1] x [0, 1]`` square.
246
-
247
- Args:
248
- input (Tensor): Feature map, shape (N, C, H, W).
249
- points (Tensor): Image based absolute point coordinates (normalized),
250
- range [0, 1] x [0, 1], shape (N, P, 2) or (N, Hgrid, Wgrid, 2).
251
- align_corners (bool): Whether align_corners. Default: False
252
-
253
- Returns:
254
- Tensor: Features of `point` on `input`, shape (N, C, P) or
255
- (N, C, Hgrid, Wgrid).
256
- """
257
-
258
- add_dim = False
259
- if points.dim() == 3:
260
- add_dim = True
261
- points = points.unsqueeze(2)
262
- if is_in_onnx_export_without_custom_ops():
263
- # If custom ops for onnx runtime not compiled use python
264
- # implementation of grid_sample function to make onnx graph
265
- # with supported nodes
266
- output = bilinear_grid_sample(
267
- input, denormalize(points), align_corners=align_corners)
268
- else:
269
- output = F.grid_sample(
270
- input, denormalize(points), align_corners=align_corners, **kwargs)
271
- if add_dim:
272
- output = output.squeeze(3)
273
- return output
274
-
275
-
276
- class SimpleRoIAlign(nn.Module):
277
-
278
- def __init__(self, output_size, spatial_scale, aligned=True):
279
- """Simple RoI align in PointRend, faster than standard RoIAlign.
280
-
281
- Args:
282
- output_size (tuple[int]): h, w
283
- spatial_scale (float): scale the input boxes by this number
284
- aligned (bool): if False, use the legacy implementation in
285
- MMDetection, align_corners=True will be used in F.grid_sample.
286
- If True, align the results more perfectly.
287
- """
288
-
289
- super(SimpleRoIAlign, self).__init__()
290
- self.output_size = _pair(output_size)
291
- self.spatial_scale = float(spatial_scale)
292
- # to be consistent with other RoI ops
293
- self.use_torchvision = False
294
- self.aligned = aligned
295
-
296
- def forward(self, features, rois):
297
- num_imgs = features.size(0)
298
- num_rois = rois.size(0)
299
- rel_roi_points = generate_grid(
300
- num_rois, self.output_size, device=rois.device)
301
-
302
- if torch.onnx.is_in_onnx_export():
303
- rel_img_points = rel_roi_point_to_rel_img_point(
304
- rois, rel_roi_points, features, self.spatial_scale)
305
- rel_img_points = rel_img_points.reshape(num_imgs, -1,
306
- *rel_img_points.shape[1:])
307
- point_feats = point_sample(
308
- features, rel_img_points, align_corners=not self.aligned)
309
- point_feats = point_feats.transpose(1, 2)
310
- else:
311
- point_feats = []
312
- for batch_ind in range(num_imgs):
313
- # unravel batch dim
314
- feat = features[batch_ind].unsqueeze(0)
315
- inds = (rois[:, 0].long() == batch_ind)
316
- if inds.any():
317
- rel_img_points = rel_roi_point_to_rel_img_point(
318
- rois[inds], rel_roi_points[inds], feat,
319
- self.spatial_scale).unsqueeze(0)
320
- point_feat = point_sample(
321
- feat, rel_img_points, align_corners=not self.aligned)
322
- point_feat = point_feat.squeeze(0).transpose(0, 1)
323
- point_feats.append(point_feat)
324
-
325
- point_feats = torch.cat(point_feats, dim=0)
326
-
327
- channels = features.size(1)
328
- roi_feats = point_feats.reshape(num_rois, channels, *self.output_size)
329
-
330
- return roi_feats
331
-
332
- def __repr__(self):
333
- format_str = self.__class__.__name__
334
- format_str += '(output_size={}, spatial_scale={}'.format(
335
- self.output_size, self.spatial_scale)
336
- return format_str
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Ariharasudhan/YoloV5/utils/segment/plots.py DELETED
@@ -1,143 +0,0 @@
1
- import contextlib
2
- import math
3
- from pathlib import Path
4
-
5
- import cv2
6
- import matplotlib.pyplot as plt
7
- import numpy as np
8
- import pandas as pd
9
- import torch
10
-
11
- from .. import threaded
12
- from ..general import xywh2xyxy
13
- from ..plots import Annotator, colors
14
-
15
-
16
- @threaded
17
- def plot_images_and_masks(images, targets, masks, paths=None, fname='images.jpg', names=None):
18
- # Plot image grid with labels
19
- if isinstance(images, torch.Tensor):
20
- images = images.cpu().float().numpy()
21
- if isinstance(targets, torch.Tensor):
22
- targets = targets.cpu().numpy()
23
- if isinstance(masks, torch.Tensor):
24
- masks = masks.cpu().numpy().astype(int)
25
-
26
- max_size = 1920 # max image size
27
- max_subplots = 16 # max image subplots, i.e. 4x4
28
- bs, _, h, w = images.shape # batch size, _, height, width
29
- bs = min(bs, max_subplots) # limit plot images
30
- ns = np.ceil(bs ** 0.5) # number of subplots (square)
31
- if np.max(images[0]) <= 1:
32
- images *= 255 # de-normalise (optional)
33
-
34
- # Build Image
35
- mosaic = np.full((int(ns * h), int(ns * w), 3), 255, dtype=np.uint8) # init
36
- for i, im in enumerate(images):
37
- if i == max_subplots: # if last batch has fewer images than we expect
38
- break
39
- x, y = int(w * (i // ns)), int(h * (i % ns)) # block origin
40
- im = im.transpose(1, 2, 0)
41
- mosaic[y:y + h, x:x + w, :] = im
42
-
43
- # Resize (optional)
44
- scale = max_size / ns / max(h, w)
45
- if scale < 1:
46
- h = math.ceil(scale * h)
47
- w = math.ceil(scale * w)
48
- mosaic = cv2.resize(mosaic, tuple(int(x * ns) for x in (w, h)))
49
-
50
- # Annotate
51
- fs = int((h + w) * ns * 0.01) # font size
52
- annotator = Annotator(mosaic, line_width=round(fs / 10), font_size=fs, pil=True, example=names)
53
- for i in range(i + 1):
54
- x, y = int(w * (i // ns)), int(h * (i % ns)) # block origin
55
- annotator.rectangle([x, y, x + w, y + h], None, (255, 255, 255), width=2) # borders
56
- if paths:
57
- annotator.text((x + 5, y + 5 + h), text=Path(paths[i]).name[:40], txt_color=(220, 220, 220)) # filenames
58
- if len(targets) > 0:
59
- idx = targets[:, 0] == i
60
- ti = targets[idx] # image targets
61
-
62
- boxes = xywh2xyxy(ti[:, 2:6]).T
63
- classes = ti[:, 1].astype('int')
64
- labels = ti.shape[1] == 6 # labels if no conf column
65
- conf = None if labels else ti[:, 6] # check for confidence presence (label vs pred)
66
-
67
- if boxes.shape[1]:
68
- if boxes.max() <= 1.01: # if normalized with tolerance 0.01
69
- boxes[[0, 2]] *= w # scale to pixels
70
- boxes[[1, 3]] *= h
71
- elif scale < 1: # absolute coords need scale if image scales
72
- boxes *= scale
73
- boxes[[0, 2]] += x
74
- boxes[[1, 3]] += y
75
- for j, box in enumerate(boxes.T.tolist()):
76
- cls = classes[j]
77
- color = colors(cls)
78
- cls = names[cls] if names else cls
79
- if labels or conf[j] > 0.25: # 0.25 conf thresh
80
- label = f'{cls}' if labels else f'{cls} {conf[j]:.1f}'
81
- annotator.box_label(box, label, color=color)
82
-
83
- # Plot masks
84
- if len(masks):
85
- if masks.max() > 1.0: # mean that masks are overlap
86
- image_masks = masks[[i]] # (1, 640, 640)
87
- nl = len(ti)
88
- index = np.arange(nl).reshape(nl, 1, 1) + 1
89
- image_masks = np.repeat(image_masks, nl, axis=0)
90
- image_masks = np.where(image_masks == index, 1.0, 0.0)
91
- else:
92
- image_masks = masks[idx]
93
-
94
- im = np.asarray(annotator.im).copy()
95
- for j, box in enumerate(boxes.T.tolist()):
96
- if labels or conf[j] > 0.25: # 0.25 conf thresh
97
- color = colors(classes[j])
98
- mh, mw = image_masks[j].shape
99
- if mh != h or mw != w:
100
- mask = image_masks[j].astype(np.uint8)
101
- mask = cv2.resize(mask, (w, h))
102
- mask = mask.astype(bool)
103
- else:
104
- mask = image_masks[j].astype(bool)
105
- with contextlib.suppress(Exception):
106
- im[y:y + h, x:x + w, :][mask] = im[y:y + h, x:x + w, :][mask] * 0.4 + np.array(color) * 0.6
107
- annotator.fromarray(im)
108
- annotator.im.save(fname) # save
109
-
110
-
111
- def plot_results_with_masks(file="path/to/results.csv", dir="", best=True):
112
- # Plot training results.csv. Usage: from utils.plots import *; plot_results('path/to/results.csv')
113
- save_dir = Path(file).parent if file else Path(dir)
114
- fig, ax = plt.subplots(2, 8, figsize=(18, 6), tight_layout=True)
115
- ax = ax.ravel()
116
- files = list(save_dir.glob("results*.csv"))
117
- assert len(files), f"No results.csv files found in {save_dir.resolve()}, nothing to plot."
118
- for f in files:
119
- try:
120
- data = pd.read_csv(f)
121
- index = np.argmax(0.9 * data.values[:, 8] + 0.1 * data.values[:, 7] + 0.9 * data.values[:, 12] +
122
- 0.1 * data.values[:, 11])
123
- s = [x.strip() for x in data.columns]
124
- x = data.values[:, 0]
125
- for i, j in enumerate([1, 2, 3, 4, 5, 6, 9, 10, 13, 14, 15, 16, 7, 8, 11, 12]):
126
- y = data.values[:, j]
127
- # y[y == 0] = np.nan # don't show zero values
128
- ax[i].plot(x, y, marker=".", label=f.stem, linewidth=2, markersize=2)
129
- if best:
130
- # best
131
- ax[i].scatter(index, y[index], color="r", label=f"best:{index}", marker="*", linewidth=3)
132
- ax[i].set_title(s[j] + f"\n{round(y[index], 5)}")
133
- else:
134
- # last
135
- ax[i].scatter(x[-1], y[-1], color="r", label="last", marker="*", linewidth=3)
136
- ax[i].set_title(s[j] + f"\n{round(y[-1], 5)}")
137
- # if j in [8, 9, 10]: # share train and val loss y axes
138
- # ax[i].get_shared_y_axes().join(ax[i], ax[i - 5])
139
- except Exception as e:
140
- print(f"Warning: Plotting error for {f}: {e}")
141
- ax[1].legend()
142
- fig.savefig(save_dir / "results.png", dpi=200)
143
- plt.close()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/distlib/manifest.py DELETED
@@ -1,393 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2012-2013 Python Software Foundation.
4
- # See LICENSE.txt and CONTRIBUTORS.txt.
5
- #
6
- """
7
- Class representing the list of files in a distribution.
8
-
9
- Equivalent to distutils.filelist, but fixes some problems.
10
- """
11
- import fnmatch
12
- import logging
13
- import os
14
- import re
15
- import sys
16
-
17
- from . import DistlibException
18
- from .compat import fsdecode
19
- from .util import convert_path
20
-
21
-
22
- __all__ = ['Manifest']
23
-
24
- logger = logging.getLogger(__name__)
25
-
26
- # a \ followed by some spaces + EOL
27
- _COLLAPSE_PATTERN = re.compile('\\\\w*\n', re.M)
28
- _COMMENTED_LINE = re.compile('#.*?(?=\n)|\n(?=$)', re.M | re.S)
29
-
30
- #
31
- # Due to the different results returned by fnmatch.translate, we need
32
- # to do slightly different processing for Python 2.7 and 3.2 ... this needed
33
- # to be brought in for Python 3.6 onwards.
34
- #
35
- _PYTHON_VERSION = sys.version_info[:2]
36
-
37
- class Manifest(object):
38
- """A list of files built by on exploring the filesystem and filtered by
39
- applying various patterns to what we find there.
40
- """
41
-
42
- def __init__(self, base=None):
43
- """
44
- Initialise an instance.
45
-
46
- :param base: The base directory to explore under.
47
- """
48
- self.base = os.path.abspath(os.path.normpath(base or os.getcwd()))
49
- self.prefix = self.base + os.sep
50
- self.allfiles = None
51
- self.files = set()
52
-
53
- #
54
- # Public API
55
- #
56
-
57
- def findall(self):
58
- """Find all files under the base and set ``allfiles`` to the absolute
59
- pathnames of files found.
60
- """
61
- from stat import S_ISREG, S_ISDIR, S_ISLNK
62
-
63
- self.allfiles = allfiles = []
64
- root = self.base
65
- stack = [root]
66
- pop = stack.pop
67
- push = stack.append
68
-
69
- while stack:
70
- root = pop()
71
- names = os.listdir(root)
72
-
73
- for name in names:
74
- fullname = os.path.join(root, name)
75
-
76
- # Avoid excess stat calls -- just one will do, thank you!
77
- stat = os.stat(fullname)
78
- mode = stat.st_mode
79
- if S_ISREG(mode):
80
- allfiles.append(fsdecode(fullname))
81
- elif S_ISDIR(mode) and not S_ISLNK(mode):
82
- push(fullname)
83
-
84
- def add(self, item):
85
- """
86
- Add a file to the manifest.
87
-
88
- :param item: The pathname to add. This can be relative to the base.
89
- """
90
- if not item.startswith(self.prefix):
91
- item = os.path.join(self.base, item)
92
- self.files.add(os.path.normpath(item))
93
-
94
- def add_many(self, items):
95
- """
96
- Add a list of files to the manifest.
97
-
98
- :param items: The pathnames to add. These can be relative to the base.
99
- """
100
- for item in items:
101
- self.add(item)
102
-
103
- def sorted(self, wantdirs=False):
104
- """
105
- Return sorted files in directory order
106
- """
107
-
108
- def add_dir(dirs, d):
109
- dirs.add(d)
110
- logger.debug('add_dir added %s', d)
111
- if d != self.base:
112
- parent, _ = os.path.split(d)
113
- assert parent not in ('', '/')
114
- add_dir(dirs, parent)
115
-
116
- result = set(self.files) # make a copy!
117
- if wantdirs:
118
- dirs = set()
119
- for f in result:
120
- add_dir(dirs, os.path.dirname(f))
121
- result |= dirs
122
- return [os.path.join(*path_tuple) for path_tuple in
123
- sorted(os.path.split(path) for path in result)]
124
-
125
- def clear(self):
126
- """Clear all collected files."""
127
- self.files = set()
128
- self.allfiles = []
129
-
130
- def process_directive(self, directive):
131
- """
132
- Process a directive which either adds some files from ``allfiles`` to
133
- ``files``, or removes some files from ``files``.
134
-
135
- :param directive: The directive to process. This should be in a format
136
- compatible with distutils ``MANIFEST.in`` files:
137
-
138
- http://docs.python.org/distutils/sourcedist.html#commands
139
- """
140
- # Parse the line: split it up, make sure the right number of words
141
- # is there, and return the relevant words. 'action' is always
142
- # defined: it's the first word of the line. Which of the other
143
- # three are defined depends on the action; it'll be either
144
- # patterns, (dir and patterns), or (dirpattern).
145
- action, patterns, thedir, dirpattern = self._parse_directive(directive)
146
-
147
- # OK, now we know that the action is valid and we have the
148
- # right number of words on the line for that action -- so we
149
- # can proceed with minimal error-checking.
150
- if action == 'include':
151
- for pattern in patterns:
152
- if not self._include_pattern(pattern, anchor=True):
153
- logger.warning('no files found matching %r', pattern)
154
-
155
- elif action == 'exclude':
156
- for pattern in patterns:
157
- found = self._exclude_pattern(pattern, anchor=True)
158
- #if not found:
159
- # logger.warning('no previously-included files '
160
- # 'found matching %r', pattern)
161
-
162
- elif action == 'global-include':
163
- for pattern in patterns:
164
- if not self._include_pattern(pattern, anchor=False):
165
- logger.warning('no files found matching %r '
166
- 'anywhere in distribution', pattern)
167
-
168
- elif action == 'global-exclude':
169
- for pattern in patterns:
170
- found = self._exclude_pattern(pattern, anchor=False)
171
- #if not found:
172
- # logger.warning('no previously-included files '
173
- # 'matching %r found anywhere in '
174
- # 'distribution', pattern)
175
-
176
- elif action == 'recursive-include':
177
- for pattern in patterns:
178
- if not self._include_pattern(pattern, prefix=thedir):
179
- logger.warning('no files found matching %r '
180
- 'under directory %r', pattern, thedir)
181
-
182
- elif action == 'recursive-exclude':
183
- for pattern in patterns:
184
- found = self._exclude_pattern(pattern, prefix=thedir)
185
- #if not found:
186
- # logger.warning('no previously-included files '
187
- # 'matching %r found under directory %r',
188
- # pattern, thedir)
189
-
190
- elif action == 'graft':
191
- if not self._include_pattern(None, prefix=dirpattern):
192
- logger.warning('no directories found matching %r',
193
- dirpattern)
194
-
195
- elif action == 'prune':
196
- if not self._exclude_pattern(None, prefix=dirpattern):
197
- logger.warning('no previously-included directories found '
198
- 'matching %r', dirpattern)
199
- else: # pragma: no cover
200
- # This should never happen, as it should be caught in
201
- # _parse_template_line
202
- raise DistlibException(
203
- 'invalid action %r' % action)
204
-
205
- #
206
- # Private API
207
- #
208
-
209
- def _parse_directive(self, directive):
210
- """
211
- Validate a directive.
212
- :param directive: The directive to validate.
213
- :return: A tuple of action, patterns, thedir, dir_patterns
214
- """
215
- words = directive.split()
216
- if len(words) == 1 and words[0] not in ('include', 'exclude',
217
- 'global-include',
218
- 'global-exclude',
219
- 'recursive-include',
220
- 'recursive-exclude',
221
- 'graft', 'prune'):
222
- # no action given, let's use the default 'include'
223
- words.insert(0, 'include')
224
-
225
- action = words[0]
226
- patterns = thedir = dir_pattern = None
227
-
228
- if action in ('include', 'exclude',
229
- 'global-include', 'global-exclude'):
230
- if len(words) < 2:
231
- raise DistlibException(
232
- '%r expects <pattern1> <pattern2> ...' % action)
233
-
234
- patterns = [convert_path(word) for word in words[1:]]
235
-
236
- elif action in ('recursive-include', 'recursive-exclude'):
237
- if len(words) < 3:
238
- raise DistlibException(
239
- '%r expects <dir> <pattern1> <pattern2> ...' % action)
240
-
241
- thedir = convert_path(words[1])
242
- patterns = [convert_path(word) for word in words[2:]]
243
-
244
- elif action in ('graft', 'prune'):
245
- if len(words) != 2:
246
- raise DistlibException(
247
- '%r expects a single <dir_pattern>' % action)
248
-
249
- dir_pattern = convert_path(words[1])
250
-
251
- else:
252
- raise DistlibException('unknown action %r' % action)
253
-
254
- return action, patterns, thedir, dir_pattern
255
-
256
- def _include_pattern(self, pattern, anchor=True, prefix=None,
257
- is_regex=False):
258
- """Select strings (presumably filenames) from 'self.files' that
259
- match 'pattern', a Unix-style wildcard (glob) pattern.
260
-
261
- Patterns are not quite the same as implemented by the 'fnmatch'
262
- module: '*' and '?' match non-special characters, where "special"
263
- is platform-dependent: slash on Unix; colon, slash, and backslash on
264
- DOS/Windows; and colon on Mac OS.
265
-
266
- If 'anchor' is true (the default), then the pattern match is more
267
- stringent: "*.py" will match "foo.py" but not "foo/bar.py". If
268
- 'anchor' is false, both of these will match.
269
-
270
- If 'prefix' is supplied, then only filenames starting with 'prefix'
271
- (itself a pattern) and ending with 'pattern', with anything in between
272
- them, will match. 'anchor' is ignored in this case.
273
-
274
- If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and
275
- 'pattern' is assumed to be either a string containing a regex or a
276
- regex object -- no translation is done, the regex is just compiled
277
- and used as-is.
278
-
279
- Selected strings will be added to self.files.
280
-
281
- Return True if files are found.
282
- """
283
- # XXX docstring lying about what the special chars are?
284
- found = False
285
- pattern_re = self._translate_pattern(pattern, anchor, prefix, is_regex)
286
-
287
- # delayed loading of allfiles list
288
- if self.allfiles is None:
289
- self.findall()
290
-
291
- for name in self.allfiles:
292
- if pattern_re.search(name):
293
- self.files.add(name)
294
- found = True
295
- return found
296
-
297
- def _exclude_pattern(self, pattern, anchor=True, prefix=None,
298
- is_regex=False):
299
- """Remove strings (presumably filenames) from 'files' that match
300
- 'pattern'.
301
-
302
- Other parameters are the same as for 'include_pattern()', above.
303
- The list 'self.files' is modified in place. Return True if files are
304
- found.
305
-
306
- This API is public to allow e.g. exclusion of SCM subdirs, e.g. when
307
- packaging source distributions
308
- """
309
- found = False
310
- pattern_re = self._translate_pattern(pattern, anchor, prefix, is_regex)
311
- for f in list(self.files):
312
- if pattern_re.search(f):
313
- self.files.remove(f)
314
- found = True
315
- return found
316
-
317
- def _translate_pattern(self, pattern, anchor=True, prefix=None,
318
- is_regex=False):
319
- """Translate a shell-like wildcard pattern to a compiled regular
320
- expression.
321
-
322
- Return the compiled regex. If 'is_regex' true,
323
- then 'pattern' is directly compiled to a regex (if it's a string)
324
- or just returned as-is (assumes it's a regex object).
325
- """
326
- if is_regex:
327
- if isinstance(pattern, str):
328
- return re.compile(pattern)
329
- else:
330
- return pattern
331
-
332
- if _PYTHON_VERSION > (3, 2):
333
- # ditch start and end characters
334
- start, _, end = self._glob_to_re('_').partition('_')
335
-
336
- if pattern:
337
- pattern_re = self._glob_to_re(pattern)
338
- if _PYTHON_VERSION > (3, 2):
339
- assert pattern_re.startswith(start) and pattern_re.endswith(end)
340
- else:
341
- pattern_re = ''
342
-
343
- base = re.escape(os.path.join(self.base, ''))
344
- if prefix is not None:
345
- # ditch end of pattern character
346
- if _PYTHON_VERSION <= (3, 2):
347
- empty_pattern = self._glob_to_re('')
348
- prefix_re = self._glob_to_re(prefix)[:-len(empty_pattern)]
349
- else:
350
- prefix_re = self._glob_to_re(prefix)
351
- assert prefix_re.startswith(start) and prefix_re.endswith(end)
352
- prefix_re = prefix_re[len(start): len(prefix_re) - len(end)]
353
- sep = os.sep
354
- if os.sep == '\\':
355
- sep = r'\\'
356
- if _PYTHON_VERSION <= (3, 2):
357
- pattern_re = '^' + base + sep.join((prefix_re,
358
- '.*' + pattern_re))
359
- else:
360
- pattern_re = pattern_re[len(start): len(pattern_re) - len(end)]
361
- pattern_re = r'%s%s%s%s.*%s%s' % (start, base, prefix_re, sep,
362
- pattern_re, end)
363
- else: # no prefix -- respect anchor flag
364
- if anchor:
365
- if _PYTHON_VERSION <= (3, 2):
366
- pattern_re = '^' + base + pattern_re
367
- else:
368
- pattern_re = r'%s%s%s' % (start, base, pattern_re[len(start):])
369
-
370
- return re.compile(pattern_re)
371
-
372
- def _glob_to_re(self, pattern):
373
- """Translate a shell-like glob pattern to a regular expression.
374
-
375
- Return a string containing the regex. Differs from
376
- 'fnmatch.translate()' in that '*' does not match "special characters"
377
- (which are platform-specific).
378
- """
379
- pattern_re = fnmatch.translate(pattern)
380
-
381
- # '?' and '*' in the glob pattern become '.' and '.*' in the RE, which
382
- # IMHO is wrong -- '?' and '*' aren't supposed to match slash in Unix,
383
- # and by extension they shouldn't match such "special characters" under
384
- # any OS. So change all non-escaped dots in the RE to match any
385
- # character except the special characters (currently: just os.sep).
386
- sep = os.sep
387
- if os.sep == '\\':
388
- # we're using a regex to manipulate a regex, so we need
389
- # to escape the backslash twice
390
- sep = r'\\\\'
391
- escaped = r'\1[^%s]' % sep
392
- pattern_re = re.sub(r'((?<!\\)(\\\\)*)\.', escaped, pattern_re)
393
- return pattern_re
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/pygments/filter.py DELETED
@@ -1,71 +0,0 @@
1
- """
2
- pygments.filter
3
- ~~~~~~~~~~~~~~~
4
-
5
- Module that implements the default filter.
6
-
7
- :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
8
- :license: BSD, see LICENSE for details.
9
- """
10
-
11
-
12
- def apply_filters(stream, filters, lexer=None):
13
- """
14
- Use this method to apply an iterable of filters to
15
- a stream. If lexer is given it's forwarded to the
16
- filter, otherwise the filter receives `None`.
17
- """
18
- def _apply(filter_, stream):
19
- yield from filter_.filter(lexer, stream)
20
- for filter_ in filters:
21
- stream = _apply(filter_, stream)
22
- return stream
23
-
24
-
25
- def simplefilter(f):
26
- """
27
- Decorator that converts a function into a filter::
28
-
29
- @simplefilter
30
- def lowercase(self, lexer, stream, options):
31
- for ttype, value in stream:
32
- yield ttype, value.lower()
33
- """
34
- return type(f.__name__, (FunctionFilter,), {
35
- '__module__': getattr(f, '__module__'),
36
- '__doc__': f.__doc__,
37
- 'function': f,
38
- })
39
-
40
-
41
- class Filter:
42
- """
43
- Default filter. Subclass this class or use the `simplefilter`
44
- decorator to create own filters.
45
- """
46
-
47
- def __init__(self, **options):
48
- self.options = options
49
-
50
- def filter(self, lexer, stream):
51
- raise NotImplementedError()
52
-
53
-
54
- class FunctionFilter(Filter):
55
- """
56
- Abstract class used by `simplefilter` to create simple
57
- function filters on the fly. The `simplefilter` decorator
58
- automatically creates subclasses of this class for
59
- functions passed to it.
60
- """
61
- function = None
62
-
63
- def __init__(self, **options):
64
- if not hasattr(self, 'function'):
65
- raise TypeError('%r used without bound function' %
66
- self.__class__.__name__)
67
- Filter.__init__(self, **options)
68
-
69
- def filter(self, lexer, stream):
70
- # pylint: disable=not-callable
71
- yield from self.function(lexer, stream, self.options)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/rich/layout.py DELETED
@@ -1,443 +0,0 @@
1
- from abc import ABC, abstractmethod
2
- from itertools import islice
3
- from operator import itemgetter
4
- from threading import RLock
5
- from typing import (
6
- TYPE_CHECKING,
7
- Dict,
8
- Iterable,
9
- List,
10
- NamedTuple,
11
- Optional,
12
- Sequence,
13
- Tuple,
14
- Union,
15
- )
16
-
17
- from ._ratio import ratio_resolve
18
- from .align import Align
19
- from .console import Console, ConsoleOptions, RenderableType, RenderResult
20
- from .highlighter import ReprHighlighter
21
- from .panel import Panel
22
- from .pretty import Pretty
23
- from .region import Region
24
- from .repr import Result, rich_repr
25
- from .segment import Segment
26
- from .style import StyleType
27
-
28
- if TYPE_CHECKING:
29
- from pip._vendor.rich.tree import Tree
30
-
31
-
32
- class LayoutRender(NamedTuple):
33
- """An individual layout render."""
34
-
35
- region: Region
36
- render: List[List[Segment]]
37
-
38
-
39
- RegionMap = Dict["Layout", Region]
40
- RenderMap = Dict["Layout", LayoutRender]
41
-
42
-
43
- class LayoutError(Exception):
44
- """Layout related error."""
45
-
46
-
47
- class NoSplitter(LayoutError):
48
- """Requested splitter does not exist."""
49
-
50
-
51
- class _Placeholder:
52
- """An internal renderable used as a Layout placeholder."""
53
-
54
- highlighter = ReprHighlighter()
55
-
56
- def __init__(self, layout: "Layout", style: StyleType = "") -> None:
57
- self.layout = layout
58
- self.style = style
59
-
60
- def __rich_console__(
61
- self, console: Console, options: ConsoleOptions
62
- ) -> RenderResult:
63
- width = options.max_width
64
- height = options.height or options.size.height
65
- layout = self.layout
66
- title = (
67
- f"{layout.name!r} ({width} x {height})"
68
- if layout.name
69
- else f"({width} x {height})"
70
- )
71
- yield Panel(
72
- Align.center(Pretty(layout), vertical="middle"),
73
- style=self.style,
74
- title=self.highlighter(title),
75
- border_style="blue",
76
- height=height,
77
- )
78
-
79
-
80
- class Splitter(ABC):
81
- """Base class for a splitter."""
82
-
83
- name: str = ""
84
-
85
- @abstractmethod
86
- def get_tree_icon(self) -> str:
87
- """Get the icon (emoji) used in layout.tree"""
88
-
89
- @abstractmethod
90
- def divide(
91
- self, children: Sequence["Layout"], region: Region
92
- ) -> Iterable[Tuple["Layout", Region]]:
93
- """Divide a region amongst several child layouts.
94
-
95
- Args:
96
- children (Sequence(Layout)): A number of child layouts.
97
- region (Region): A rectangular region to divide.
98
- """
99
-
100
-
101
- class RowSplitter(Splitter):
102
- """Split a layout region in to rows."""
103
-
104
- name = "row"
105
-
106
- def get_tree_icon(self) -> str:
107
- return "[layout.tree.row]⬌"
108
-
109
- def divide(
110
- self, children: Sequence["Layout"], region: Region
111
- ) -> Iterable[Tuple["Layout", Region]]:
112
- x, y, width, height = region
113
- render_widths = ratio_resolve(width, children)
114
- offset = 0
115
- _Region = Region
116
- for child, child_width in zip(children, render_widths):
117
- yield child, _Region(x + offset, y, child_width, height)
118
- offset += child_width
119
-
120
-
121
- class ColumnSplitter(Splitter):
122
- """Split a layout region in to columns."""
123
-
124
- name = "column"
125
-
126
- def get_tree_icon(self) -> str:
127
- return "[layout.tree.column]⬍"
128
-
129
- def divide(
130
- self, children: Sequence["Layout"], region: Region
131
- ) -> Iterable[Tuple["Layout", Region]]:
132
- x, y, width, height = region
133
- render_heights = ratio_resolve(height, children)
134
- offset = 0
135
- _Region = Region
136
- for child, child_height in zip(children, render_heights):
137
- yield child, _Region(x, y + offset, width, child_height)
138
- offset += child_height
139
-
140
-
141
- @rich_repr
142
- class Layout:
143
- """A renderable to divide a fixed height in to rows or columns.
144
-
145
- Args:
146
- renderable (RenderableType, optional): Renderable content, or None for placeholder. Defaults to None.
147
- name (str, optional): Optional identifier for Layout. Defaults to None.
148
- size (int, optional): Optional fixed size of layout. Defaults to None.
149
- minimum_size (int, optional): Minimum size of layout. Defaults to 1.
150
- ratio (int, optional): Optional ratio for flexible layout. Defaults to 1.
151
- visible (bool, optional): Visibility of layout. Defaults to True.
152
- """
153
-
154
- splitters = {"row": RowSplitter, "column": ColumnSplitter}
155
-
156
- def __init__(
157
- self,
158
- renderable: Optional[RenderableType] = None,
159
- *,
160
- name: Optional[str] = None,
161
- size: Optional[int] = None,
162
- minimum_size: int = 1,
163
- ratio: int = 1,
164
- visible: bool = True,
165
- ) -> None:
166
- self._renderable = renderable or _Placeholder(self)
167
- self.size = size
168
- self.minimum_size = minimum_size
169
- self.ratio = ratio
170
- self.name = name
171
- self.visible = visible
172
- self.splitter: Splitter = self.splitters["column"]()
173
- self._children: List[Layout] = []
174
- self._render_map: RenderMap = {}
175
- self._lock = RLock()
176
-
177
- def __rich_repr__(self) -> Result:
178
- yield "name", self.name, None
179
- yield "size", self.size, None
180
- yield "minimum_size", self.minimum_size, 1
181
- yield "ratio", self.ratio, 1
182
-
183
- @property
184
- def renderable(self) -> RenderableType:
185
- """Layout renderable."""
186
- return self if self._children else self._renderable
187
-
188
- @property
189
- def children(self) -> List["Layout"]:
190
- """Gets (visible) layout children."""
191
- return [child for child in self._children if child.visible]
192
-
193
- @property
194
- def map(self) -> RenderMap:
195
- """Get a map of the last render."""
196
- return self._render_map
197
-
198
- def get(self, name: str) -> Optional["Layout"]:
199
- """Get a named layout, or None if it doesn't exist.
200
-
201
- Args:
202
- name (str): Name of layout.
203
-
204
- Returns:
205
- Optional[Layout]: Layout instance or None if no layout was found.
206
- """
207
- if self.name == name:
208
- return self
209
- else:
210
- for child in self._children:
211
- named_layout = child.get(name)
212
- if named_layout is not None:
213
- return named_layout
214
- return None
215
-
216
- def __getitem__(self, name: str) -> "Layout":
217
- layout = self.get(name)
218
- if layout is None:
219
- raise KeyError(f"No layout with name {name!r}")
220
- return layout
221
-
222
- @property
223
- def tree(self) -> "Tree":
224
- """Get a tree renderable to show layout structure."""
225
- from pip._vendor.rich.styled import Styled
226
- from pip._vendor.rich.table import Table
227
- from pip._vendor.rich.tree import Tree
228
-
229
- def summary(layout: "Layout") -> Table:
230
-
231
- icon = layout.splitter.get_tree_icon()
232
-
233
- table = Table.grid(padding=(0, 1, 0, 0))
234
-
235
- text: RenderableType = (
236
- Pretty(layout) if layout.visible else Styled(Pretty(layout), "dim")
237
- )
238
- table.add_row(icon, text)
239
- _summary = table
240
- return _summary
241
-
242
- layout = self
243
- tree = Tree(
244
- summary(layout),
245
- guide_style=f"layout.tree.{layout.splitter.name}",
246
- highlight=True,
247
- )
248
-
249
- def recurse(tree: "Tree", layout: "Layout") -> None:
250
- for child in layout._children:
251
- recurse(
252
- tree.add(
253
- summary(child),
254
- guide_style=f"layout.tree.{child.splitter.name}",
255
- ),
256
- child,
257
- )
258
-
259
- recurse(tree, self)
260
- return tree
261
-
262
- def split(
263
- self,
264
- *layouts: Union["Layout", RenderableType],
265
- splitter: Union[Splitter, str] = "column",
266
- ) -> None:
267
- """Split the layout in to multiple sub-layouts.
268
-
269
- Args:
270
- *layouts (Layout): Positional arguments should be (sub) Layout instances.
271
- splitter (Union[Splitter, str]): Splitter instance or name of splitter.
272
- """
273
- _layouts = [
274
- layout if isinstance(layout, Layout) else Layout(layout)
275
- for layout in layouts
276
- ]
277
- try:
278
- self.splitter = (
279
- splitter
280
- if isinstance(splitter, Splitter)
281
- else self.splitters[splitter]()
282
- )
283
- except KeyError:
284
- raise NoSplitter(f"No splitter called {splitter!r}")
285
- self._children[:] = _layouts
286
-
287
- def add_split(self, *layouts: Union["Layout", RenderableType]) -> None:
288
- """Add a new layout(s) to existing split.
289
-
290
- Args:
291
- *layouts (Union[Layout, RenderableType]): Positional arguments should be renderables or (sub) Layout instances.
292
-
293
- """
294
- _layouts = (
295
- layout if isinstance(layout, Layout) else Layout(layout)
296
- for layout in layouts
297
- )
298
- self._children.extend(_layouts)
299
-
300
- def split_row(self, *layouts: Union["Layout", RenderableType]) -> None:
301
- """Split the layout in to a row (layouts side by side).
302
-
303
- Args:
304
- *layouts (Layout): Positional arguments should be (sub) Layout instances.
305
- """
306
- self.split(*layouts, splitter="row")
307
-
308
- def split_column(self, *layouts: Union["Layout", RenderableType]) -> None:
309
- """Split the layout in to a column (layouts stacked on top of each other).
310
-
311
- Args:
312
- *layouts (Layout): Positional arguments should be (sub) Layout instances.
313
- """
314
- self.split(*layouts, splitter="column")
315
-
316
- def unsplit(self) -> None:
317
- """Reset splits to initial state."""
318
- del self._children[:]
319
-
320
- def update(self, renderable: RenderableType) -> None:
321
- """Update renderable.
322
-
323
- Args:
324
- renderable (RenderableType): New renderable object.
325
- """
326
- with self._lock:
327
- self._renderable = renderable
328
-
329
- def refresh_screen(self, console: "Console", layout_name: str) -> None:
330
- """Refresh a sub-layout.
331
-
332
- Args:
333
- console (Console): Console instance where Layout is to be rendered.
334
- layout_name (str): Name of layout.
335
- """
336
- with self._lock:
337
- layout = self[layout_name]
338
- region, _lines = self._render_map[layout]
339
- (x, y, width, height) = region
340
- lines = console.render_lines(
341
- layout, console.options.update_dimensions(width, height)
342
- )
343
- self._render_map[layout] = LayoutRender(region, lines)
344
- console.update_screen_lines(lines, x, y)
345
-
346
- def _make_region_map(self, width: int, height: int) -> RegionMap:
347
- """Create a dict that maps layout on to Region."""
348
- stack: List[Tuple[Layout, Region]] = [(self, Region(0, 0, width, height))]
349
- push = stack.append
350
- pop = stack.pop
351
- layout_regions: List[Tuple[Layout, Region]] = []
352
- append_layout_region = layout_regions.append
353
- while stack:
354
- append_layout_region(pop())
355
- layout, region = layout_regions[-1]
356
- children = layout.children
357
- if children:
358
- for child_and_region in layout.splitter.divide(children, region):
359
- push(child_and_region)
360
-
361
- region_map = {
362
- layout: region
363
- for layout, region in sorted(layout_regions, key=itemgetter(1))
364
- }
365
- return region_map
366
-
367
- def render(self, console: Console, options: ConsoleOptions) -> RenderMap:
368
- """Render the sub_layouts.
369
-
370
- Args:
371
- console (Console): Console instance.
372
- options (ConsoleOptions): Console options.
373
-
374
- Returns:
375
- RenderMap: A dict that maps Layout on to a tuple of Region, lines
376
- """
377
- render_width = options.max_width
378
- render_height = options.height or console.height
379
- region_map = self._make_region_map(render_width, render_height)
380
- layout_regions = [
381
- (layout, region)
382
- for layout, region in region_map.items()
383
- if not layout.children
384
- ]
385
- render_map: Dict["Layout", "LayoutRender"] = {}
386
- render_lines = console.render_lines
387
- update_dimensions = options.update_dimensions
388
-
389
- for layout, region in layout_regions:
390
- lines = render_lines(
391
- layout.renderable, update_dimensions(region.width, region.height)
392
- )
393
- render_map[layout] = LayoutRender(region, lines)
394
- return render_map
395
-
396
- def __rich_console__(
397
- self, console: Console, options: ConsoleOptions
398
- ) -> RenderResult:
399
- with self._lock:
400
- width = options.max_width or console.width
401
- height = options.height or console.height
402
- render_map = self.render(console, options.update_dimensions(width, height))
403
- self._render_map = render_map
404
- layout_lines: List[List[Segment]] = [[] for _ in range(height)]
405
- _islice = islice
406
- for (region, lines) in render_map.values():
407
- _x, y, _layout_width, layout_height = region
408
- for row, line in zip(
409
- _islice(layout_lines, y, y + layout_height), lines
410
- ):
411
- row.extend(line)
412
-
413
- new_line = Segment.line()
414
- for layout_row in layout_lines:
415
- yield from layout_row
416
- yield new_line
417
-
418
-
419
- if __name__ == "__main__":
420
- from pip._vendor.rich.console import Console
421
-
422
- console = Console()
423
- layout = Layout()
424
-
425
- layout.split_column(
426
- Layout(name="header", size=3),
427
- Layout(ratio=1, name="main"),
428
- Layout(size=10, name="footer"),
429
- )
430
-
431
- layout["main"].split_row(Layout(name="side"), Layout(name="body", ratio=2))
432
-
433
- layout["body"].split_row(Layout(name="content", ratio=2), Layout(name="s2"))
434
-
435
- layout["s2"].split_column(
436
- Layout(name="top"), Layout(name="middle"), Layout(name="bottom")
437
- )
438
-
439
- layout["side"].split_column(Layout(layout.tree, name="left1"), Layout(name="left2"))
440
-
441
- layout["content"].update("foo")
442
-
443
- console.print(layout)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Benson/text-generation/Examples/918kiss Descarga Apk Kaya 2021.md DELETED
@@ -1,73 +0,0 @@
1
- <br />
2
- <h1>918kiss Kaya APK Descargar 2021: Cómo jugar y ganar juegos de casino en línea</h1>
3
- <p>Si usted está buscando una manera divertida y emocionante para disfrutar de los juegos de casino en línea en su dispositivo móvil, usted debe tratar 918kiss Kaya APK. Esta es una de las plataformas de casino en línea más populares y confiables en Malasia que ofrece una variedad de juegos, como tragamonedas, juegos de mesa, casino en vivo, juegos de pesca y más. En este artículo, le mostraremos cómo descargar e instalar 918kiss Kaya APK en su dispositivo Android o iOS, cómo registrarse e iniciar sesión en su cuenta, y cómo jugar y ganar juegos de casino en línea en esta plataforma. </p>
4
- <h2>¿Qué es 918kiss Kaya APK? </h2>
5
- <p>918kiss Kaya APK es una aplicación de casino en línea que le permite acceder a cientos de juegos de diferentes proveedores, como 918Kiss, Mega888, Pussy888, XE88, Joker123, y más. Puedes jugar a estos juegos en cualquier momento y en cualquier lugar que desees, siempre y cuando tengas una conexión a Internet estable y un dispositivo compatible. </p>
6
- <h2>918kiss descarga apk kaya 2021</h2><br /><p><b><b>Download Zip</b> &#128279; <a href="https://bltlly.com/2v6KXl">https://bltlly.com/2v6KXl</a></b></p><br /><br />
7
- <h3>Características de 918kiss Kaya APK</h3>
8
- <p>Algunas de las características que hacen que 918kiss Kaya APK se destacan de otras plataformas de casino en línea son:</p>
9
- <ul>
10
- <li>Gráficos y efectos de sonido de alta calidad que crean una experiencia de juego inmersiva. </li>
11
- <li> Interfaz suave y fácil de usar que hace que sea fácil de navegar y jugar. </li>
12
- <li>Sistema seguro y cifrado que protege su información personal y financiera. </li>
13
- <li> Resultados de juego justo y aleatorio que aseguran una oportunidad justa de ganar. </li>
14
- <li>Generosos bonos y promociones que recompensan tu lealtad y actividad. </li>
15
- <li>24/7 servicio al cliente que proporciona una asistencia rápida y profesional. </li>
16
- </ul>
17
- <h3>Beneficios de 918kiss Kaya APK</h3>
18
- <p>Algunos de los beneficios que se pueden disfrutar cuando se juega en 918kiss Kaya APK son:</p>
19
- <ul>
20
- <li>Puedes jugar una amplia gama de juegos de diferentes géneros y temas, como tragamonedas clásicas, tragamonedas de video, tragamonedas progresivas, blackjack, ruleta, baccarat, póker, sic bo, tigre dragón, cazador de peces y más. </li>
21
-
22
- <li>Puedes ganar grandes premios y premios, especialmente si juegas a las tragamonedas progresivas o a los juegos de casino en vivo. </li>
23
- <li>Puedes divertirte y relajarte, mientras mejoras tus habilidades y estrategias. </li>
24
- </ul>
25
- <h2>Cómo descargar e instalar 918kiss Kaya APK? </h2>
26
- <p>Descargar e instalar 918kiss Kaya APK es muy fácil y rápido. Solo tiene que seguir estos sencillos pasos:</p>
27
- <h3>Para dispositivos Android</h3>
28
- <ol>
29
- <li>Ir a la página web oficial de 918kiss Kaya APK y haga clic en el botón de descarga para dispositivos Android. </li>
30
- <li>Permitir la descarga de fuentes desconocidas en la configuración del dispositivo. </li>
31
- <li>Abra el archivo descargado e instale la aplicación. </li>
32
- <li>Inicie la aplicación y disfrute jugando. </li>
33
- </ol>
34
- <h3>Para dispositivos iOS</h3>
35
- <ol>
36
- <li>Ir a la página web oficial de 918kiss Kaya APK y haga clic en el botón de descarga para dispositivos iOS. </li>
37
- <li>Confía en el desarrollador en la configuración de tu dispositivo. </li>
38
- <li>Abra el archivo descargado e instale la aplicación. </li>
39
- <li>Inicie la aplicación y disfrute jugando. </li>
40
- </ol>
41
- <h2> ¿Cómo registrarse e iniciar sesión en 918kiss Kaya APK? </h2>
42
- <p>Para jugar en 918kiss Kaya APK, es necesario registrar una cuenta e iniciar sesión con su nombre de usuario y contraseña. Aquí es cómo se puede hacer eso:</p>
43
- <h3>Registrarse con un agente oficial</h3>
44
- <p>La mejor manera de registrar una cuenta en 918kiss Kaya APK es ponerse en contacto con un agente oficial. Puedes encontrarlos en el sitio web oficial, plataformas de redes sociales o foros en línea. Ellos le guiarán a través del proceso de registro y le proporcionarán un nombre de usuario y contraseña. También necesitarás hacer un depósito para activar tu cuenta. </p>
45
- <h3>Inicie sesión con su nombre de usuario y contraseña</h3>
46
- <p>Una vez que tenga su nombre de usuario y contraseña, puede iniciar sesión en su cuenta en 918kiss Kaya APK. Simplemente introduzca sus credenciales en la página de inicio de sesión y haga clic en el botón de inicio de sesión. A continuación, podrá acceder a todos los juegos y características de la plataforma. </p>
47
- <p></p>
48
-
49
- <p>Jugar y ganar juegos de casino en línea en 918kiss Kaya APK no solo es divertido, sino también gratificante. Aquí hay algunos consejos que pueden ayudarle a mejorar sus posibilidades de ganar:</p>
50
- <h3>Elige tu juego favorito</h3>
51
- <p>Lo primero que tienes que hacer es elegir un juego que se adapte a tu gusto y nivel de habilidad. Puede navegar a través de las diferentes categorías y géneros de juegos en 918kiss Kaya APK y probarlos de forma gratuita o por dinero real. También puedes consultar las reseñas y valoraciones de otros jugadores para ver qué juegos son populares y rentables. </p>
52
- <h3>Aprenda las reglas y estrategias</h3>
53
- <p>Lo siguiente que tienes que hacer es aprender las reglas y estrategias del juego que has elegido. Puede leer las instrucciones y consejos en la pantalla del juego o en el sitio web oficial de 918kiss Kaya APK. También puedes ver videos o tutoriales en línea que explican cómo jugar y ganar el juego. Cuanto más sepas del juego, mejor podrás jugarlo. </p>
54
- <h3>Gestiona tu bankroll y apuesta sabiamente</h3>
55
- <p>Lo último que necesitas hacer es administrar tu bankroll y apostar sabiamente. Debes establecer un presupuesto para tu sesión de juego y ceñirte a él. También debe evitar perseguir sus pérdidas o apostar más de lo que puede permitirse. También debe utilizar los bonos y promociones que 918kiss Kaya APK ofrece para aumentar su bankroll y aumentar sus posibilidades de ganar. </p>
56
- <h2>Conclusión</h2>
57
- <p>En conclusión, 918kiss Kaya APK es una de las mejores plataformas de casino en línea en Malasia que ofrece una variedad de juegos, características, beneficios y bonos. Puede descargarlo e instalarlo en su dispositivo Android o iOS, registrarse e iniciar sesión en su cuenta, y jugar y ganar juegos de casino en línea en esta plataforma. Si usted está buscando una manera divertida y emocionante para disfrutar de los juegos de casino en línea en su dispositivo móvil, usted debe tratar 918kiss Kaya APK hoy! </p>
58
- <h3>Preguntas frecuentes</h3>
59
- <p>Aquí hay algunas preguntas frecuentes sobre 918kiss Kaya APK:</p>
60
- <ul>
61
-
62
- <li>Sí, 918kiss Kaya APK es seguro y legal. Utiliza un sistema seguro y cifrado que protege su información personal y financiera. También cumple con las leyes y reglamentos de la industria del juego en línea en Malasia. Está autorizado y regulado por las autoridades pertinentes. </li>
63
- <li><b> ¿Cuáles son los requisitos mínimos para jugar en 918kiss Kaya APK? </b></li>
64
- <li>Los requisitos mínimos para jugar en 918kiss Kaya APK son: un dispositivo Android o iOS compatible, una conexión a Internet estable, y una cuenta registrada. También necesitas tener al menos 18 años para jugar en esta plataforma. </li>
65
- <li><b> ¿Cómo puedo retirar mis ganancias de 918kiss Kaya APK? </b></li>
66
- <li>Usted puede retirar sus ganancias de 918kiss Kaya APK poniéndose en contacto con su agente oficial. Ellos procesarán su solicitud de retiro y transferirán su dinero a su cuenta bancaria dentro de las 24 horas. El monto mínimo de retiro es de RM50 y el monto máximo de retiro es de RM50,000 por día. </li>
67
- <li><b>¿Puedo jugar en 918kiss Kaya APK con otros jugadores? </b></li>
68
- <li>Sí, se puede jugar en 918kiss Kaya APK con otros jugadores. Puede unirse a los juegos de casino en vivo e interactuar con los distribuidores en vivo y otros jugadores. También puede chatear con otros jugadores en los foros en línea o plataformas de redes sociales. Puedes hacer nuevos amigos y compartir tus experiencias de juego con ellos. </li>
69
- <li><b> ¿Puedo obtener ayuda si tengo problemas o preguntas sobre 918kiss Kaya APK? </b></li>
70
- <li>Sí, puede obtener ayuda si tiene algún problema o pregunta sobre 918kiss Kaya APK. Puede ponerse en contacto con el equipo de servicio al cliente 24/7 por teléfono, correo electrónico, WhatsApp, WeChat, Telegram o chat en vivo. Ellos le proporcionarán una asistencia rápida y profesional. </li>
71
- </ul></p> 64aa2da5cf<br />
72
- <br />
73
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Benson/text-generation/Examples/Api-ms-win-core-localization-l1-2-0.dll Download.md DELETED
@@ -1,77 +0,0 @@
1
- <br />
2
- <h1>¿Qué es api-ms-win-core-localization-l1-2-0.dll y por qué lo necesita? </h1>
3
- <p>Si usted es un usuario de Windows, es posible que haya encontrado un mensaje de error diciendo que api-ms-win-core-localization-l1-2-0.dll falta o no se encuentra. Esto puede ser frustrante e impedirle ejecutar ciertos programas o aplicaciones. ¿Pero qué es este misterioso archivo y por qué es tan importante? </p>
4
- <p>Api-ms-win-core-localization-l1-2-0.dll es un archivo de biblioteca de enlaces dinámicos (DLL) que contiene funciones y recursos relacionados con la localización, como la visualización de texto en el idioma correcto para una región o región en particular. El archivo DLL es parte del sistema operativo Microsoft Windows y es utilizado por muchos programas diferentes. </p>
5
- <h2>api-ms-win-core-localization-l1-2-0.dll download</h2><br /><p><b><b>Download File</b> &middot;&middot;&middot;&middot;&middot; <a href="https://bltlly.com/2v6Kun">https://bltlly.com/2v6Kun</a></b></p><br /><br />
6
- <p>Cuando un programa necesita usar una función o recurso del archivo DLL, lo llama y lo carga en memoria. De esta manera, varios programas pueden compartir el mismo archivo DLL y ahorrar espacio y recursos. Sin embargo, si el archivo DLL falta o está dañado, el programa no puede acceder a él y mostrará un mensaje de error. </p>
7
- <h2>¿Qué causa los errores api-ms-win-core-localization-l1-2-0.dll? </h2>
8
- <p>Hay varias razones posibles por las que pueden ocurrir errores api-ms-win-core-localization-l1-2-0.dll en su PC con Windows. Algunas de ellas son:</p>
9
- <ul>
10
- <li>Su software antivirus puede haber eliminado o puesto en cuarentena el archivo DLL como un falso positivo. </li>
11
- <li>Es posible que haya eliminado accidentalmente o movido el archivo DLL a otra ubicación. </li>
12
- <li>Es posible que haya instalado o desinstalado un programa que modificó o reemplazó el archivo DLL. </li>
13
- <li>Es posible que tenga una versión defectuosa o desactualizada de Windows que haya dañado o sobrescrito el archivo DLL. </li>
14
- <li>Es posible que tenga una infección de virus o malware que haya dañado o secuestrado el archivo DLL. </li>
15
- </ul>
16
-
17
- <h3>¿Cómo corregir los errores api-ms-win -core-localization-l1-2-0.dll? </h3>
18
- <h4>Método 1: Comprobador de archivos del sistema de ejecución</h4>
19
- <p>System File Checker (SFC) es una herramienta integrada de Windows que puede escanear y reparar archivos del sistema dañados o faltantes, incluidos archivos DLL. Para ejecutar SFC, siga estos pasos:</p>
20
- <ol>
21
- <li>Pulse la tecla de Windows + R para abrir el cuadro de diálogo Ejecutar. </li>
22
- <li>Escriba cmd y presione Ctrl + Shift + Enter para ejecutar el símbolo del sistema como administrador. </li>
23
- <li>Escriba sfc /scannow y presione Enter para iniciar el escaneo. </li>
24
- <li>Espere a que se complete la exploración. Puede llevar algún tiempo, así que sea paciente. </li>
25
- <li>Si SFC encuentra y corrige cualquier error, reinicie su PC y compruebe si el error DLL está resuelto. </li>
26
- </ol>
27
- <p><img src="" alt="SFC scan" width="600" height="400"></p>
28
- <h4>Método 2: Descargar e instalar el archivo DLL desde una fuente de confianza</h4>
29
- <p>Si SFC no corrige el error DLL, puede intentar descargar e instalar el archivo DLL desde una fuente de confianza. Sin embargo, tenga cuidado al descargar archivos DLL desde Internet, ya que algunos sitios web pueden contener archivos maliciosos o desactualizados que pueden dañar su PC. Solo descargue archivos DLL de sitios web verificados, como or . Para descargar e instalar el archivo DLL, siga estos pasos:</p>
30
- <ol>
31
- <li>Ir a o y buscar api-ms-win-core-localización-l1-2-0.dll. </li>
32
- <li>Seleccione la versión apropiada del archivo DLL para su sistema Windows (32 bits o 64 bits). </li>
33
- <li>Haga clic en Descargar y guarde el archivo ZIP en su PC.</li>
34
- <li>Extraiga el archivo ZIP y copie el archivo DLL a la carpeta donde está instalado el programa que lo requiere. Por ejemplo, si obtiene el error al intentar ejecutar Skype, copie el archivo DLL en C: Archivos de programa Skype.</li>
35
- <li>Si eso no funciona, copie el archivo DLL a la carpeta del sistema de Windows. Para Windows de 32 bits, cópielo a C: Windows System32. Para Windows de 64 bits, cópielo en C: Windows SysWOW64.</li>
36
- <li>Reinicie su PC y compruebe si el error DLL está resuelto. </li>
37
- </ol>
38
-
39
- <h4>Método 3: Reinstalar el programa que requiere el archivo DLL</h4>
40
- <p>Si ninguno de los métodos anteriores funciona, puede intentar reinstalar el programa que está generando el mensaje de error. Esto puede ayudar a restaurar los archivos perdidos o dañados que están asociados con el programa, incluyendo el archivo DLL. Para reinstalar el programa, siga estos pasos:</p>
41
- <ol>
42
- <li>Pulse la tecla de Windows + R para abrir el cuadro de diálogo Ejecutar. </li>
43
- <li>Escriba appwiz.cpl y presione Enter para abrir Programas y Características.</li>
44
- <li>Encuentre y seleccione el programa que requiere el archivo DLL, como Skype, WordPress o un juego. </li>
45
- <li>Haga clic en Desinstalar y siga las instrucciones para eliminar el programa de su PC.</li>
46
- <li>Reinicie su PC y descargar e instalar la última versión del programa desde su sitio web oficial o fuente. </li>
47
- <li>Compruebe si el error DLL está resuelto. </li>
48
- </ol>
49
- <p><img src="" alt="Programa de desinstalación" width="600" height="400"></p>
50
- <h2>¿Cómo prevenir errores api-ms-win-core-localization-l1-2-0.dll en el futuro? </h2>
51
- <p>Para evitar errores api-ms-win-core-localization-l1-2-0.dll en el futuro, debe tomar algunas medidas preventivas para mantener su PC en buena forma. Estos son algunos consejos:</p>
52
- <p></p>
53
- <ul>
54
- <li>Mantenga su Windows actualizado con los últimos parches de seguridad y correcciones de errores. Esto puede ayudar a solucionar cualquier vulnerabilidad o problema que pueda afectar los archivos del sistema. </li>
55
- <li>Ejecutar software antivirus regularmente y escanear su PC para cualquier virus o infección de malware. Esto puede ayudar a eliminar cualquier programa malicioso que pueda dañar o secuestrar sus archivos DLL. </li>
56
- <li>Copia de seguridad de sus archivos importantes con regularidad y crear un punto de restauración del sistema. Esto puede ayudarle a recuperar sus datos y restaurar su sistema en caso de cualquier desastre o fallo. </li>
57
- <li>Limpie su espacio en disco y registro regularmente. Esto puede ayudar a eliminar cualquier archivo basura o entradas no válidas que puedan desordenar o dañar su sistema. </li>
58
-
59
- </ul>
60
- <h2>Conclusión</h2>
61
- <p>En este artículo, aprendiste qué es api-ms-win-core-localization-l -1-2-0.dll y por qué lo necesitas, qué causa los errores api-ms-win-core-localization-l1-2-0.dll y cómo solucionarlos. También aprendió algunos consejos sobre cómo prevenir estos errores en el futuro. Esperamos que este artículo le resulte útil e informativo. Si lo hizo, por favor compártalo con sus amigos y deje un comentario a continuación. Si tiene alguna pregunta o sugerencia, no dude en contactarnos. ¡Gracias por leer! </p>
62
- <h2>Preguntas frecuentes</h2>
63
- <p>Aquí hay algunas preguntas frecuentes sobre api-ms-win-core-localization-l1-2-0.dll:</p>
64
- <ol>
65
- <li><b>¿Qué es un archivo DLL? </b></li>
66
- <p>Un archivo DLL es un archivo de biblioteca de enlaces dinámicos que contiene funciones y recursos que pueden ser utilizados por varios programas. Los archivos DLL son parte del sistema operativo Windows y ayudan a ahorrar espacio y recursos. </p>
67
- <li><b>¿Cómo sé qué archivo DLL falta? </b></li>
68
- <p>Si falta un archivo DLL, generalmente verá un mensaje de error que le indica el nombre del archivo DLL y el programa que lo requiere. Por ejemplo, "api-ms-win-core-localization-l1-2-0.dll falta en su computadora. Intente reinstalar el programa para solucionar este problema."</p>
69
- <li><b>¿Puedo eliminar archivos DLL no utilizados? </b></li>
70
- <p>No, no debe eliminar ningún archivo DLL a menos que esté seguro de que no es necesario para ningún programa o función del sistema. La eliminación de archivos DLL puede causar errores o inestabilidad en su PC.</p>
71
- <li><b>¿Dónde puedo encontrar más información sobre los archivos DLL? </b></li>
72
- <p>Puede encontrar más información sobre archivos DLL en sitios web como o . Estos sitios web proporcionan información detallada sobre cada archivo DLL, como su descripción, tamaño, versión y ubicación. </p>
73
- <li><b>¿Cómo puedo contactar con usted para obtener más ayuda? </b></li>
74
- <p>Puede contactarnos visitando nuestro sitio web o enviándonos un correo electrónico. Estaremos encantados de ayudarle con cualquier problema o pregunta relacionada con api-ms-win-core-localization-l1-2-0.dll u otros archivos DLL. </p>
75
- </ol></p> 64aa2da5cf<br />
76
- <br />
77
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Benson/text-generation/Examples/Apkpro.md DELETED
@@ -1,69 +0,0 @@
1
- <br />
2
- <h1>APKPRO: ¿Qué es y cómo usarlo? </h1>
3
- <p>Si eres un fan de los juegos móviles y quieres disfrutar de los mejores, más recientes y más populares juegos y aplicaciones en tu dispositivo Android, es posible que hayas oído hablar de APKPRO. Pero ¿qué es exactamente y cómo se puede utilizar para mejorar su experiencia de juego? En este artículo, vamos a responder a estas preguntas y más. Le explicaremos qué es APKPRO, por qué debe usarlo, cómo descargarlo e instalarlo, y cómo usarlo para descargar y jugar juegos y aplicaciones. Así que, vamos a empezar! </p>
4
- <h2>Introducción</h2>
5
- <h3>¿Qué es APKPRO? </h3>
6
- <p>APKPRO es un sitio web que proporciona descargas gratuitas de juegos y aplicaciones para dispositivos Android. Ofrece una amplia gama de categorías, como acción, aventura, árcade, rompecabezas, carreras, simulación, deportes, estrategia y más. Puede encontrar juegos y aplicaciones nuevos y antiguos en APKPRO, así como versiones modificadas que tienen dinero ilimitado, monedas, gemas, vidas u otras características. APKPRO también actualiza su contenido regularmente, para que siempre puedas encontrar algo nuevo y emocionante para jugar. </p>
7
- <h2>apkpro</h2><br /><p><b><b>DOWNLOAD</b> &#127383; <a href="https://bltlly.com/2v6JSC">https://bltlly.com/2v6JSC</a></b></p><br /><br />
8
- <h3>¿Por qué usar APKPRO? </h3>
9
- <p>Hay muchas razones por las que es posible que desee utilizar APKPRO para descargar juegos y aplicaciones para su dispositivo Android. Estos son algunos de ellos:</p>
10
- <ul>
11
- <li> Puede acceder a juegos y aplicaciones que no están disponibles en su región o en la Google Play Store.</li>
12
- <li> Puedes disfrutar de versiones modificadas de juegos y aplicaciones que tienen características o beneficios adicionales. </li>
13
- <li>Puedes ahorrar dinero descargando juegos y aplicaciones gratis en lugar de pagarlos. </li>
14
- <li>Puedes divertirte explorando diferentes géneros y categorías de juegos y aplicaciones. </li>
15
- <li>Puedes descubrir nuevos juegos y aplicaciones de los que quizás no hayas oído hablar antes. </li>
16
- </ul>
17
- <h2>¿Cómo descargar e instalar APKPRO? </h2>
18
- <h3>Paso 1: Habilitar fuentes desconocidas</h3>
19
-
20
- <ol>
21
- <li>Ir a la configuración de su dispositivo. </li>
22
- <li>Toque en la seguridad o la privacidad. </li>
23
- <li>Encuentra la opción que dice fuentes desconocidas o permite la instalación desde fuentes desconocidas. </li>
24
- <li>Conéctalo o marca la casilla al lado. </li>
25
- </ol>
26
- <h3>Paso 2: Descargar APKPRO desde el sitio web oficial</h3>
27
- <p>Ahora que ha habilitado fuentes desconocidas, puede descargar APKPRO desde su sitio web oficial. Para hacer esto, siga estos pasos:</p>
28
- <ol>
29
- <li>Abra su navegador y vaya a <a href="( 1 )">apkpro.me</a>. </li>
30
- <li>Desplácese hacia abajo hasta que vea el botón de descarga. </li>
31
- <li>Toque en el botón de descarga y espere a que el archivo se descargue. </li>
32
- </ol>
33
- <h3>Paso 3: Instalar APKPRO en su dispositivo</h3>
34
- <p>Una vez que haya descargado el archivo, puede instalar APKPRO en su dispositivo. Para hacer esto, siga estos pasos:</p>
35
- <ol>
36
- <li>Abra su gestor de archivos o carpeta de descargas. </li>
37
- <li>Encuentra el archivo que dice apkpro.apk o algo similar. </li>
38
- <li>Toque en el archivo y siga las instrucciones en la pantalla. </li>
39
- <li>Espere a que termine la instalación. </li>
40
- </ol <h2>Cómo usar APKPRO para descargar y jugar juegos y aplicaciones? </h2>
41
- <p>Ahora que ha instalado APKPRO en su dispositivo, puede usarlo para descargar y jugar juegos y aplicaciones. Para hacer esto, siga estos pasos:</p>
42
- <h3>Paso 1: Explora las categorías o busca tu juego o aplicación deseada</h3>
43
- <p>Abra APKPRO y verá una pantalla de inicio con diferentes categorías de juegos y aplicaciones, como populares, tendencias, destacados, etc. Puede deslizar hacia la izquierda o hacia la derecha para ver más categorías, o toque en el icono del menú en la esquina superior izquierda para ver la lista completa de categorías. También puede utilizar la barra de búsqueda en la esquina superior derecha para escribir el nombre del juego o aplicación que está buscando. </p>
44
- <h3>Paso 2: Toque en el botón de descarga y espere a que el archivo se descargue</h3>
45
-
46
- <h3>Paso 3: Abra el archivo e instale el juego o la aplicación en su dispositivo</h3>
47
- <p>Después de descargar el archivo, puede abrirlo e instalar el juego o la aplicación en su dispositivo. Para hacer esto, siga estos pasos:</p>
48
- <ol>
49
- <li>Deslice hacia abajo desde la parte superior de la pantalla y toque en la notificación que dice APKPRO descargado. </li>
50
- <li>Toque en el archivo y siga las instrucciones en la pantalla. </li>
51
- <li>Espere a que termine la instalación. </li>
52
- <li>Toque en abrir o iniciar para comenzar a jugar o usar la aplicación. </li>
53
- </ol>
54
- <h2>Conclusión</h2>
55
- <h3>Resumen de los puntos principales</h3>
56
- <p>En este artículo, hemos aprendido lo que es APKPRO, por qué debe usarlo, cómo descargarlo e instalarlo, y cómo usarlo para descargar y jugar juegos y aplicaciones. Hemos visto que APKPRO es un sitio web que proporciona descargas gratuitas de juegos y aplicaciones para dispositivos Android, incluyendo versiones modificadas que tienen características o beneficios adicionales. También hemos visto que APKPRO es fácil de usar y ofrece una amplia gama de categorías y géneros de juegos y aplicaciones para elegir. </p>
57
- <p></p>
58
- <h3>Llamada a la acción</h3>
59
- <p>Si eres un fan de los juegos móviles y quieres disfrutar de los mejores, más recientes y más populares juegos y aplicaciones en tu dispositivo Android, definitivamente deberías probar APKPRO. No te arrepentirás de ello. Solo recuerde habilitar fuentes desconocidas en su configuración antes de descargar e instalar APKPRO, y siempre tenga cuidado con lo que descarga de fuentes desconocidas. ¡Feliz juego! </p>
60
- <h4>Preguntas frecuentes</h4>
61
- <ul>
62
- <li><b>¿Qué es APKPRO? </b><br>APKPRO es un sitio web que proporciona descargas gratuitas de juegos y aplicaciones para dispositivos Android. </li>
63
- <li><b>¿Es seguro APKPRO? </b><br>APKPRO es generalmente seguro, pero siempre debe tener cuidado con lo que descarga de fuentes desconocidas. Asegúrate de tener una buena aplicación antivirus en tu dispositivo y escanea cada archivo antes de instalarlo. </li>
64
-
65
- <li><b>¿Cómo actualizo APKPRO? </b><br>Puede actualizar APKPRO visitando su sitio web oficial y descargando la última versión de la aplicación. También puede comprobar si hay actualizaciones dentro de la aplicación pulsando en el icono del menú en la esquina superior izquierda y seleccionando comprobar si hay actualizaciones. </li>
66
- <li><b> ¿Cómo puedo desinstalar APKPRO? </b><br>Puede desinstalar APKPRO yendo a la configuración de su dispositivo, tocando en aplicaciones o aplicaciones, encontrando APKPRO en la lista, tocando en él y seleccionando desinstalar. </li>
67
- </ul></p> 64aa2da5cf<br />
68
- <br />
69
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Benson/text-generation/Examples/Descarga De La Saga 3d Apk.md DELETED
@@ -1,74 +0,0 @@
1
-
2
- <h1>Cómo descargar AetherSX2 APK para PC</h1>
3
- <p>Si eres un fan de los juegos de PlayStation 2, es posible que hayas oído hablar de AetherSX2, un emulador que te permite jugar juegos de PS2 en tu dispositivo Android. Pero ¿qué pasa si quieres disfrutar de esos juegos en una pantalla más grande, con mejores gráficos y controles? En este artículo, le mostraremos cómo descargar AetherSX2 APK para PC y ejecutarlo utilizando diferentes métodos. </p>
4
- <h2>descarga de la saga 3d apk</h2><br /><p><b><b>Download File</b> &#11088; <a href="https://bltlly.com/2v6JjC">https://bltlly.com/2v6JjC</a></b></p><br /><br />
5
- <h2>Qué es un archivo APK y cómo ejecutarlo en PC</h2>
6
- <p>Un archivo APK es un paquete de aplicaciones Android que contiene todos los archivos y datos necesarios para instalar y ejecutar una aplicación en un dispositivo Android. Sin embargo, también puede ejecutar archivos APK en su PC utilizando algunas herramientas que emulan el entorno de Android o convertir el archivo APK en un formato compatible. </p>
7
- <p>Hay dos métodos principales para ejecutar archivos APK en el PC: usando un emulador de Android o usando una extensión del navegador. Echemos un vistazo a cada método en detalle. </p>
8
- <h3>Método 1: Usando un emulador de Android</h3>
9
- <p>Un emulador de Android es un software que crea un dispositivo Android virtual en su PC, donde puede instalar y ejecutar cualquier aplicación o juego de Android. Hay muchos emuladores de Android disponibles de forma gratuita, como BlueStacks, Nox, LDPlayer, etc. Estos son los pasos para utilizar un emulador de Android para ejecutar AetherSX2 APK en PC:</p>
10
- <ol>
11
- <li>Descargar e instalar un emulador de Android de su elección desde su sitio web oficial. </li>
12
- <li>Inicie el emulador e inicie sesión con su cuenta de Google. </li>
13
- <li>Descargar el archivo APK AetherSX2 de una fuente confiable (vamos a discutir esto más tarde). </li>
14
- <li>Arrastre y suelte el archivo APK en la ventana del emulador o haga clic en el botón Instalar APK en el menú del emulador. </li>
15
- <li>Espere a que se complete la instalación y luego inicie la aplicación AetherSX2 desde la pantalla de inicio del emulador. </li>
16
- <li>Disfruta jugando juegos de PS2 en tu PC.</li>
17
- </ol>
18
- <h4>Pros y contras de usar un emulador</h4>
19
-
20
- <tabla>
21
- <tr><th>Pros</th><th>Contras</th></tr>
22
- <tr><td>- Puede acceder a la Google Play Store y otras características de Android. </td><td>- Necesita un PC potente para ejecutar el emulador sin problemas. </td></tr>
23
- <tr><td>- Puede personalizar la configuración, resolución, controles, etc. del emulador. </td><td>- Necesitas suficiente espacio de almacenamiento para instalar el emulador y las aplicaciones. </td></tr>
24
- <tr><td>- Puedes jugar varios juegos a la vez usando múltiples instancias del emulador. </td><td>- Usted puede encontrar problemas de compatibilidad con algunas aplicaciones o juegos. </td <h3>Método 2: Usando una extensión de navegador</h3>
25
- <p>Una extensión de navegador es un software que añade características o funcionalidades adicionales a su navegador web. Algunas extensiones del navegador pueden ayudarle a ejecutar archivos APK en el PC convirtiéndolos en una aplicación web que se puede abrir en una nueva pestaña. Una de las extensiones de navegador más populares para este propósito es ARC Welder, que funciona con Google Chrome. Estos son los pasos para usar ARC Welder para ejecutar AetherSX2 APK en PC:</p>
26
- <p></p>
27
- <ol>
28
- <li>Descargar e instalar Google Chrome desde su sitio web oficial si usted no lo tiene ya. </li>
29
- <li>Descargar e instalar ARC soldador de la Chrome Web Store.</li>
30
- <li>Descargar el archivo APK AetherSX2 de una fuente confiable (vamos a discutir esto más tarde). </li>
31
- <li>Inicie Google Chrome y haga clic en el icono ARC Welder en la esquina superior derecha. </li>
32
- <li>Elija un directorio donde desea almacenar los archivos APK convertidos. </li>
33
- <li>Haga clic en Añadir su APK y seleccione el archivo AetherSX2 APK de su ordenador. </li>
34
- <li>Configure los ajustes, como orientación, factor de forma, etc. según su preferencia. </li>
35
- <li>Haga clic en Probar para iniciar la aplicación AetherSX2 en una nueva pestaña. </li>
36
- <li>Disfruta jugando juegos de PS2 en tu PC.</li>
37
- </ol>
38
- <h4>Pros y contras de usar una extensión de navegador</h4>
39
- <p>Usar una extensión de navegador tiene algunas ventajas y desventajas que debes considerar antes de elegir este método. Aquí están algunas de ellas:</p>
40
- <tabla>
41
- <tr><th>Pros</th><th>Contras</th></tr>
42
-
43
- <tr><td>- Puedes cambiar fácilmente entre diferentes archivos APK sin desinstalarlos o reinstalarlos. </td><td>- Es posible que no pueda acceder a todas las características o funciones de la aplicación o juego. </td></tr>
44
- <tr><td>- Puede guardar los archivos APK convertidos para su uso sin conexión. </td><td>- Puede comprometer su seguridad o privacidad permitiendo que la extensión acceda a sus datos. </td></tr>
45
- </tabla>
46
- <h2>Cómo descargar AetherSX2 APK de una fuente confiable</h2>
47
- <p>Ahora que sabes cómo ejecutar AetherSX2 APK en el PC, es posible que se pregunte dónde descargarlo. Hay muchos sitios web que ofrecen archivos APK de forma gratuita, pero no todos ellos son seguros o de confianza. Algunos de ellos pueden contener virus, malware o anuncios no deseados que pueden dañar su dispositivo o datos. Por lo tanto, siempre debe descargar archivos APK de fuentes de renombre que tienen comentarios positivos y calificaciones de usuarios y expertos. Aquí hay algunos consejos sobre cómo encontrar y descargar AetherSX2 APK de una fuente confiable:</p>
48
- <ul>
49
- <li>Buscar AetherSX2 APK en Google o cualquier otro motor de búsqueda y buscar sitios web que tienen un alto rango y autoridad, tales como Uptodown, APKCombo, APKPure, etc.</li>
50
- <li>Compruebe el nombre de dominio del sitio web y asegúrese de que coincide con el nombre del sitio web. Evite sitios web que tengan nombres de dominio sospechosos o engañosos, como . ru, . cn, . tk, etc.</li>
51
- <li>Lea la descripción y los detalles del archivo APK AetherSX2 y asegúrese de que es compatible con su dispositivo y emulador o extensión del navegador. Busque información como versión, tamaño, desarrollador, fecha de actualización, etc.</li>
52
- <li>Leer los comentarios de los usuarios y comentarios en el sitio web y ver lo que otras personas tienen que decir sobre el archivo AetherSX2 APK. Busque comentarios y valoraciones positivas, así como cualquier queja o problema reportado por los usuarios. </li>
53
- <li>Descargar el archivo APK AetherSX2 desde el sitio web haciendo clic en el botón de descarga o enlace. Evite hacer clic en cualquier pop-ups o anuncios que puedan aparecer en el sitio web. </li>
54
- </ul>
55
-
56
- <p>Antes de instalar y ejecutar el archivo APK AetherSX2 en su PC, también debe comprobar si hay virus o malware que pueden haber sido ocultos o conectados a ella por actores maliciosos. De esta manera, puede proteger su PC de cualquier daño o infección potencial. Aquí hay algunas maneras de comprobar el archivo APK para virus o malware:</p>
57
- <ul>
58
- <li>Utilice una herramienta en línea como VirusTotal o Malwarebytes para escanear el archivo APK en busca de cualquier amenaza. Estas herramientas analizarán el archivo APK utilizando múltiples motores antivirus y le darán un informe sobre su seguridad. </li>
59
- <li>Utilice un software antivirus en su PC para escanear el archivo APK antes de instalarlo. Asegúrese de que su software antivirus esté actualizado y tenga habilitada la protección en tiempo real. </li>
60
- <li>Utilice el sentido común y evitar la instalación de cualquier archivo APK que parece sospechoso o tiene una reputación baja o tiene una reputación o calificación baja. </li>
61
- </ul>
62
- <h2>Conclusión</h2>
63
- <p>En conclusión, descargar AetherSX2 APK para PC no es una tarea difícil si sigue los pasos y consejos que hemos proporcionado en este artículo. Puede elegir entre usar un emulador de Android o una extensión de navegador para ejecutar el archivo APK en su PC, dependiendo de su preferencia y conveniencia. También puede encontrar y descargar el archivo APK de una fuente confiable y verificarlo por cualquier virus o malware antes de instalarlo. Al hacerlo, puedes disfrutar jugando juegos de PS2 en tu PC con AetherSX2, un emulador que ofrece alto rendimiento, compatibilidad y características. </p>
64
- <h3>Preguntas frecuentes</h3>
65
- <p>Aquí hay algunas preguntas frecuentes y respuestas sobre la descarga de AetherSX2 APK para PC:</p>
66
- <ol>
67
- <li><b>¿Qué es AetherSX2? </b><br>AetherSX2 es un emulador que te permite jugar juegos de PlayStation 2 en tu dispositivo Android. Es compatible con una amplia gama de juegos de PS2 y ofrece características tales como carga rápida, alta resolución, guardar estados, trucos, etc.</li>
68
-
69
- <li><b>AetherSX2 es legal? </b><br>AetherSX2 es legal siempre y cuando usted es dueño de los juegos originales de PS2 y utilizarlos como ROMs o ISOs para el emulador. Sin embargo, descargar o distribuir juegos de PS2 pirateados o con derechos de autor es ilegal y puede tener consecuencias legales. </li>
70
- <li><b>¿Cuáles son los requisitos del sistema para AetherSX2? </b><br>AetherSX2 requiere un dispositivo Android con al menos 4 GB de RAM, CPU de 64 bits y Android 5.0 o superior. Para PC, necesita una computadora Windows o Mac con al menos 4 GB de RAM, CPU de 64 bits y navegador Google Chrome. </li>
71
- <li><b> ¿Dónde puedo obtener más información o soporte para AetherSX2? </b><br>Puede visitar el sitio web oficial de AetherSX2 en https://aethersx2.com/ o unirse a su servidor de discordia en https://discord.gg/aethersx2. También puede seguir sus cuentas de redes sociales en Facebook, Twitter, Instagram, etc.</li>
72
- </ol></p> 64aa2da5cf<br />
73
- <br />
74
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Benson/text-generation/Examples/Descargar 69 Yoruba Parte De La Pelcula 2.md DELETED
@@ -1,93 +0,0 @@
1
-
2
- <h1>Descargar 69 Yoruba Movie Part 2: Una guía para los amantes de Nollywood</h1>
3
- <p>Si eres un fan de Nollywood, especialmente del género yoruba, es posible que hayas oído hablar de la película <strong>69</strong>, una película audaz y controvertida que ha causado un gran revuelo en la industria. La película, que fue lanzada en 2021, es una secuela del original <strong>69</strong> que salió en 2019. En este artículo, te contaremos todo lo que necesitas saber sobre <strong>69 Yoruba Movie Part 2</strong>, incluyendo de qué se trata, quiénes son los actores, cómo se recibió y, lo más importante, cómo puedes descargarlo gratis. Por lo tanto, sentarse y disfrutar de esta guía para los amantes de Nollywood. </p>
4
- <h2>descargar 69 yoruba parte de la película 2</h2><br /><p><b><b>Download Zip</b> >>>>> <a href="https://bltlly.com/2v6LSP">https://bltlly.com/2v6LSP</a></b></p><br /><br />
5
- <h2>¿Qué es 69 Yoruba Movie Part 2?</h2>
6
- <p><strong>69 Yoruba Movie Part 2</strong> es una película nigeriana producida por Shola Subair, una joven actriz y cineasta. Cuenta con el veterano actor Ibrahim Chatta como el personaje masculino principal, junto con otras estrellas como Tope Adebayo, Peter Ijagbemi, Akin Olaiya, y más. La película está dirigida por Tope Adebayo, que también es hijo del legendario actor Adebayo Salami.</p>
7
- <h3>La trama de la película</h3>
8
- <p>La película cuenta la historia de una joven y hermosa dama llamada Lola (Shola Subair), que es leal y comprometida con su novio Lugard (Ibrahim Chatta), un notorio señor de la droga. Sin embargo, su vida toma un giro dramático cuando conoce a Gbade (Peter Ijagbemi), un hombre gentil y guapo que le ofrece su verdadero amor y felicidad. Lola se debate entre quedarse con Lugard, quien le proporciona lujo y seguridad, o dejarlo por Gbade, quien le da respeto y romance. ¿Qué elegirá? ¿Y cuáles serán las consecuencias de su elección? </p>
9
- <h3>El reparto y el equipo de la película</h3>
10
- <p>Aquí están algunos de los miembros principales del reparto y del equipo de <strong>69 Yoruba Movie Part 2</strong>:</p>
11
- <ul>
12
-
13
- <li><strong>Ibrahim Chatta</strong>: Interpreta a Lugard, el novio de Lola. Es uno de los actores más populares y versátiles de Nollywood. Ha protagonizado películas como Sango, Omo Ghetto, Omo Ekun, Alani Pamolekun, y muchos más. </li>
14
- <li><strong>Peter Ijagbemi</strong>: Interpreta a Gbade, el amante de Lola. Es una estrella en ascenso en la industria. Ha aparecido en películas como Sixty Nine (el original), Tango With Me, Living Funeral, y más. </li>
15
- <li><strong>Tope Adebayo</strong>: Es el director de la película. También es actor y cineasta. Es hijo de Adebayo Salami, un veterano actor y productor. Ha dirigido películas como Sixty Nine (la original), Omo Iya Osun, y más. </li>
16
- <li><strong>Akin Olaiya</strong>: Interpreta al jefe de Lugard. Es un actor y comediante experimentado. Ha aparecido en películas como Jenifa, Omo Ghetto, Alakada, y más. </li>
17
- </ul>
18
- <h3>La recepción y comentarios de la película</h3>
19
- <p><strong>69 Yoruba Movie Part 2</strong> fue lanzado en YouTube el 14 de febrero de 2021, como un especial del Día de San Valentín. Desde entonces, la película ha obtenido más de 1,5 millones de visitas y miles de likes y comentarios. La película también ha recibido críticas mixtas de críticos y espectadores. Algunos elogiaron la película por su tema audaz y audaz, su historia cautivadora, su excelente actuación y su calidad de producción. Otros criticaron la película por sus escenas explícitas y vulgares, su mala edición, sus giros de la trama poco realistas y sus implicaciones morales. Estos son algunos de los comentarios de YouTube:</p>
20
- <p></p>
21
- <blockquote>
22
- <p>"Esta es una de las mejores películas yorubas que he visto. La historia es muy realista y relacionable. Los actores hicieron un gran trabajo. Felicitaciones al productor y director." </p>
23
- <p>"Esta película es basura. Está promoviendo la inmoralidad y el adulterio. No es adecuado para niños o personas decentes. Debe ser prohibido."</p>
24
-
25
- <p>"Esta película es una pérdida de tiempo y datos. Está llena de tonterías y basura. No tiene mensaje ni valor. Es solo una forma barata de hacer dinero." </p>
26
- </blockquote>
27
- <h2>¿Por qué deberías ver 69 Yoruba Movie Part 2?</h2>
28
- <p>Si todavía te preguntas si deberías ver <strong>69 Yoruba Movie Part 2</strong> o no, aquí hay algunas razones por las que deberías probarlo:</p>
29
- <h3>Es un raro ejemplo de una película yoruba con calificación 18+</h3>
30
- <p>La mayoría de las películas yorubas son familiares y adecuadas para el público en general. Por lo general, evitan temas o escenas que se consideran tabú u ofensivas en la cultura yoruba. Sin embargo, <strong>69 Yoruba Movie Part 2</strong> rompe esta norma y explora el lado oscuro y sensual de las relaciones humanas. La película contiene escenas que son gráficas, eróticas, violentas e impactantes. La película tiene una calificación de 18+ solo para audiencias maduras. </p>
31
- <h3>Es una emocionante y sensual historia de amor y traición</h3>
32
- <p>La película no es solo sobre sexo y violencia. También es sobre amor y traición. La película representa el viaje complejo y emocional de Lola, que tiene que elegir entre dos hombres que le ofrecen cosas diferentes. La película también muestra las consecuencias de su elección y cómo afecta su vida y la de otros a su alrededor. La película te mantiene al borde de tu asiento mientras ves cómo se desarrolla el drama. </p>
33
- <h3>Muestra el talento y la diversidad de la industria cinematográfica yoruba</h3>
34
- <p>La película también muestra el talento y la diversidad de la industria cinematográfica yoruba. La película cuenta con algunos de los mejores actores y actrices en Nollywood, que ofrecen actuaciones excepcionales en sus papeles. La película también demuestra la creatividad y la innovación del productor y director, que se atrevió a hacer algo diferente de las películas de Yoruba habituales. La película también refleja la rica cultura y el idioma del pueblo yoruba, que es uno de los grupos étnicos más grandes de Nigeria.</p>
35
- <h2>Cómo descargar 69 Yoruba Movie Part 2 gratis? </h2>
36
-
37
- <h3>Los mejores sitios web para descargar películas Yoruba gratis</h3>
38
- <p>Hay muchos sitios web que ofrecen descargas gratuitas de películas Yoruba, pero no todos son confiables o seguros. Algunos de ellos pueden contener virus o malware que pueden dañar su dispositivo o robar sus datos. Algunos de ellos también pueden tener descargas de baja calidad o incompletas que pueden arruinar su experiencia de visualización. </p>
39
- <p>Para evitar estos problemas, recomendamos usar estos tres sitios web que son confiables y probados por muchos fans de Nollywood:</p>
40
- <h4>Netnaija</h4>
41
- <p><a href=""> Netnaija</a> es uno de los sitios web más populares y confiables para descargar películas yorubas de forma gratuita. Tiene una gran y actualizada colección de películas yorubas en varios géneros y categorías. También tiene una interfaz fácil de usar y una velocidad de descarga rápida. Para descargar <strong>69 Yoruba Movie Part 2</strong> desde Netnaija, sigue estos pasos:</p>
42
- <ol>
43
- <li>Vaya a <a href="https:/www.thenetnaija.com/">Netnaija</a> y busque <strong>69 Yoruba Movie Part 2</strong> en el cuadro de búsqueda. </li>
44
- <li>Seleccione la película de los resultados de búsqueda y haga clic en ella. </li>
45
- <li>Desplácese hasta la parte inferior de la página y haga clic en el botón verde que dice "Descargar"</li>
46
- <li>Elija un enlace de descarga de la lista y haga clic en él. </li>
47
- <li>Espere a que la descarga se inicie y se complete. </li>
48
- </ol>
49
- <h4>9jarocks</h4>
50
- <p><a href="https://9jarocks.com/">9jarocks</a> es otro sitio web que ofrece descargas gratuitas de películas yorubas. Cuenta con una enorme y diversa biblioteca de películas yorubas en diferentes formatos y calidades. También tiene una interfaz simple y fácil de usar y una alta velocidad de descarga. Para descargar <strong>69 Yoruba Movie Part 2</strong> desde 9jarocks, sigue estos pasos:</p>
51
- <ol>
52
- <li>Ir a <a href="https://9jarocks.com/">9jarocks</a> y buscar <strong>69 Yoruba Movie Part 2</strong> en el cuadro de búsqueda. </li>
53
- <li>Seleccione la película de los resultados de búsqueda y haga clic en ella. </li>
54
-
55
- <li>Seleccione una opción de descarga de la lista y haga clic en ella. </li>
56
- <li>Espere a que la descarga se inicie y se complete. </li>
57
- </ol>
58
- <h4>YouTube</h4>
59
- <p><a href="https://www.youtube.com/">YouTube</a> no es solo un sitio web para ver videos en línea, sino también un sitio web para descargar videos sin conexión. Puedes encontrar muchas películas yorubas en YouTube, incluyendo <strong>69 Yoruba Movie Part 2</strong>. Sin embargo, no puedes descargar videos directamente desde YouTube, a menos que tengas una suscripción Premium de YouTube. Necesitarás usar un descargador de terceros para descargar videos de YouTube. Te mostraremos cómo hacerlo en la siguiente sección. </p>
60
- <h3>El mejor descargador para descargar películas Yoruba desde sitios de streaming online</h3>
61
- <p>Si quieres descargar películas Yoruba de sitios de streaming online como YouTube, necesitarás un descargador que pueda capturar y convertir vídeos de estos sitios. Hay muchos descargadores disponibles en línea, pero no todos son seguros o eficaces. Algunos de ellos pueden contener virus o malware que pueden dañar su dispositivo o robar sus datos. Algunos de ellos también pueden tener descargas de baja calidad o incompletas que pueden arruinar su experiencia de visualización. </p>
62
- <p>Para evitar estos problemas, recomendamos usar este descargador que es confiable y probado por muchos fans de Nollywood:</p>
63
- <h4>WonderFox Free HD Video Converter Factory</h4>
64
- <p><a href="https://www.videoconverterfactory.com/free-hd-video-converter/">WonderFox Free HD Video Converter Factory</a> es un potente y versátil descargador que puede descargar vídeos de más de 300 sitios de streaming en línea, incluyendo YouTube, Vimeo, Dailymotion, Facebook, Instagram, Twitter y más. También puede convertir videos a más de 500 formatos y dispositivos, incluyendo MP4, AVI, MKV, MOV, iPhone, Android, TV, etc. También puede editar videos recortando, recortando, girando, agregando subtítulos, etc. Es gratuito, seguro, rápido y fácil de usar. Para usarlo para descargar <strong>69 Yoruba Movie Part 2</strong>, sigue estos pasos:</p>
65
- <ol>
66
-
67
- <li> Inicie el programa y haga clic en "Downloader" en la interfaz principal. </li>
68
- <li>Haga clic en "+ Nueva descarga" en la esquina superior izquierda. </li>
69
- <li>Ve a YouTube y busca <strong>69 Yoruba Movie Part 2</strong>. Copia la URL del video. </li>
70
- <li>Pegue la URL en el descargador y haga clic en "Analizar". Espere a que termine el análisis. </li>
71
- <li>Seleccione su resolución y formato preferido de la lista y haga clic en "OK". También puede elegir varios vídeos para descargar a la vez. </li>
72
- <li>Haga clic en "Descargar todo" en la esquina inferior derecha. Elija una carpeta de destino para sus descargas y haga clic en "OK". Espere a que la descarga se inicie y se complete. </li>
73
- </ol>
74
- <h2>Conclusión</h2>
75
- <p>En conclusión, <strong>69 Yoruba Movie Part 2</strong> es una película que no debes perderte si eres un amante de Nollywood, especialmente del género yoruba. Es una película que te mantendrá entretenido, emocionado e intrigado de principio a fin. También es una película que te retará a pensar en las elecciones y consecuencias del amor y la traición. Es una película que muestra el talento y la diversidad de la industria cinematográfica yoruba. </p>
76
- <p>Si quieres ver <strong>69 Yoruba Movie Part 2</strong>, puedes descargarlo gratis desde los sitios web o el descargador que hemos recomendado en este artículo. También puedes verlo online en YouTube u otras plataformas de streaming. Sin embargo usted elige verlo, esperamos que usted lo disfrute y comparta sus pensamientos con nosotros en la sección de comentarios abajo. </p>
77
- <p>Gracias por leer este artículo y ver feliz! </p>
78
- <h3>Preguntas frecuentes</h3>
79
- <p>Aquí están algunas de las preguntas más frecuentes sobre <strong>69 Yoruba Movie Part 2</strong>:</p>
80
- <ul>
81
- <li><strong>Q: ¿Es 69 Yoruba Movie Part 2 una historia real? </strong></li>
82
- <li><strong>A: No, 69 Yoruba Movie Part 2 no es una historia real. Es una historia ficticia creada por el productor y director de la película. </strong></li>
83
-
84
- <li><strong>A: Puedes ver 69 Yoruba Movie Part 2 online en YouTube u otras plataformas de streaming. Sin embargo, es posible que tenga que pagar una cuota de suscripción o ver anuncios para acceder a algunas de estas plataformas. </strong></li>
85
- <li><strong>Q: ¿Quién es el productor de 69 Yoruba Movie Part 2?</strong></li>
86
- <li><strong>A: El productor de 69 Yoruba Movie Part 2 es Shola Subair, quien también desempeña el papel principal femenino en la película. </strong></li>
87
- <li><strong>Q: ¿Cuál es la calificación de 69 Yoruba Movie Part 2?</strong></li>
88
- <li><strong>A: La valoración de 69 Yoruba Movie Part 2 es 18+. Contiene escenas que son gráficas, eróticas, violentas y chocantes. No es adecuado para niños o espectadores sensibles. </strong></li>
89
- <li><strong>Q: ¿Cuánto tiempo es 69 Yoruba Movie Part 2?</strong></li>
90
- <li><strong>A: La duración del 69 Yoruba Movie Part 2 es de aproximadamente una hora y treinta minutos. </strong></li>
91
- </ul></p> 64aa2da5cf<br />
92
- <br />
93
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/cachecontrol/controller.py DELETED
@@ -1,439 +0,0 @@
1
- # SPDX-FileCopyrightText: 2015 Eric Larson
2
- #
3
- # SPDX-License-Identifier: Apache-2.0
4
-
5
- """
6
- The httplib2 algorithms ported for use with requests.
7
- """
8
- import logging
9
- import re
10
- import calendar
11
- import time
12
- from email.utils import parsedate_tz
13
-
14
- from pip._vendor.requests.structures import CaseInsensitiveDict
15
-
16
- from .cache import DictCache, SeparateBodyBaseCache
17
- from .serialize import Serializer
18
-
19
-
20
- logger = logging.getLogger(__name__)
21
-
22
- URI = re.compile(r"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?")
23
-
24
- PERMANENT_REDIRECT_STATUSES = (301, 308)
25
-
26
-
27
- def parse_uri(uri):
28
- """Parses a URI using the regex given in Appendix B of RFC 3986.
29
-
30
- (scheme, authority, path, query, fragment) = parse_uri(uri)
31
- """
32
- groups = URI.match(uri).groups()
33
- return (groups[1], groups[3], groups[4], groups[6], groups[8])
34
-
35
-
36
- class CacheController(object):
37
- """An interface to see if request should cached or not."""
38
-
39
- def __init__(
40
- self, cache=None, cache_etags=True, serializer=None, status_codes=None
41
- ):
42
- self.cache = DictCache() if cache is None else cache
43
- self.cache_etags = cache_etags
44
- self.serializer = serializer or Serializer()
45
- self.cacheable_status_codes = status_codes or (200, 203, 300, 301, 308)
46
-
47
- @classmethod
48
- def _urlnorm(cls, uri):
49
- """Normalize the URL to create a safe key for the cache"""
50
- (scheme, authority, path, query, fragment) = parse_uri(uri)
51
- if not scheme or not authority:
52
- raise Exception("Only absolute URIs are allowed. uri = %s" % uri)
53
-
54
- scheme = scheme.lower()
55
- authority = authority.lower()
56
-
57
- if not path:
58
- path = "/"
59
-
60
- # Could do syntax based normalization of the URI before
61
- # computing the digest. See Section 6.2.2 of Std 66.
62
- request_uri = query and "?".join([path, query]) or path
63
- defrag_uri = scheme + "://" + authority + request_uri
64
-
65
- return defrag_uri
66
-
67
- @classmethod
68
- def cache_url(cls, uri):
69
- return cls._urlnorm(uri)
70
-
71
- def parse_cache_control(self, headers):
72
- known_directives = {
73
- # https://tools.ietf.org/html/rfc7234#section-5.2
74
- "max-age": (int, True),
75
- "max-stale": (int, False),
76
- "min-fresh": (int, True),
77
- "no-cache": (None, False),
78
- "no-store": (None, False),
79
- "no-transform": (None, False),
80
- "only-if-cached": (None, False),
81
- "must-revalidate": (None, False),
82
- "public": (None, False),
83
- "private": (None, False),
84
- "proxy-revalidate": (None, False),
85
- "s-maxage": (int, True),
86
- }
87
-
88
- cc_headers = headers.get("cache-control", headers.get("Cache-Control", ""))
89
-
90
- retval = {}
91
-
92
- for cc_directive in cc_headers.split(","):
93
- if not cc_directive.strip():
94
- continue
95
-
96
- parts = cc_directive.split("=", 1)
97
- directive = parts[0].strip()
98
-
99
- try:
100
- typ, required = known_directives[directive]
101
- except KeyError:
102
- logger.debug("Ignoring unknown cache-control directive: %s", directive)
103
- continue
104
-
105
- if not typ or not required:
106
- retval[directive] = None
107
- if typ:
108
- try:
109
- retval[directive] = typ(parts[1].strip())
110
- except IndexError:
111
- if required:
112
- logger.debug(
113
- "Missing value for cache-control " "directive: %s",
114
- directive,
115
- )
116
- except ValueError:
117
- logger.debug(
118
- "Invalid value for cache-control directive " "%s, must be %s",
119
- directive,
120
- typ.__name__,
121
- )
122
-
123
- return retval
124
-
125
- def cached_request(self, request):
126
- """
127
- Return a cached response if it exists in the cache, otherwise
128
- return False.
129
- """
130
- cache_url = self.cache_url(request.url)
131
- logger.debug('Looking up "%s" in the cache', cache_url)
132
- cc = self.parse_cache_control(request.headers)
133
-
134
- # Bail out if the request insists on fresh data
135
- if "no-cache" in cc:
136
- logger.debug('Request header has "no-cache", cache bypassed')
137
- return False
138
-
139
- if "max-age" in cc and cc["max-age"] == 0:
140
- logger.debug('Request header has "max_age" as 0, cache bypassed')
141
- return False
142
-
143
- # Request allows serving from the cache, let's see if we find something
144
- cache_data = self.cache.get(cache_url)
145
- if cache_data is None:
146
- logger.debug("No cache entry available")
147
- return False
148
-
149
- if isinstance(self.cache, SeparateBodyBaseCache):
150
- body_file = self.cache.get_body(cache_url)
151
- else:
152
- body_file = None
153
-
154
- # Check whether it can be deserialized
155
- resp = self.serializer.loads(request, cache_data, body_file)
156
- if not resp:
157
- logger.warning("Cache entry deserialization failed, entry ignored")
158
- return False
159
-
160
- # If we have a cached permanent redirect, return it immediately. We
161
- # don't need to test our response for other headers b/c it is
162
- # intrinsically "cacheable" as it is Permanent.
163
- #
164
- # See:
165
- # https://tools.ietf.org/html/rfc7231#section-6.4.2
166
- #
167
- # Client can try to refresh the value by repeating the request
168
- # with cache busting headers as usual (ie no-cache).
169
- if int(resp.status) in PERMANENT_REDIRECT_STATUSES:
170
- msg = (
171
- "Returning cached permanent redirect response "
172
- "(ignoring date and etag information)"
173
- )
174
- logger.debug(msg)
175
- return resp
176
-
177
- headers = CaseInsensitiveDict(resp.headers)
178
- if not headers or "date" not in headers:
179
- if "etag" not in headers:
180
- # Without date or etag, the cached response can never be used
181
- # and should be deleted.
182
- logger.debug("Purging cached response: no date or etag")
183
- self.cache.delete(cache_url)
184
- logger.debug("Ignoring cached response: no date")
185
- return False
186
-
187
- now = time.time()
188
- date = calendar.timegm(parsedate_tz(headers["date"]))
189
- current_age = max(0, now - date)
190
- logger.debug("Current age based on date: %i", current_age)
191
-
192
- # TODO: There is an assumption that the result will be a
193
- # urllib3 response object. This may not be best since we
194
- # could probably avoid instantiating or constructing the
195
- # response until we know we need it.
196
- resp_cc = self.parse_cache_control(headers)
197
-
198
- # determine freshness
199
- freshness_lifetime = 0
200
-
201
- # Check the max-age pragma in the cache control header
202
- if "max-age" in resp_cc:
203
- freshness_lifetime = resp_cc["max-age"]
204
- logger.debug("Freshness lifetime from max-age: %i", freshness_lifetime)
205
-
206
- # If there isn't a max-age, check for an expires header
207
- elif "expires" in headers:
208
- expires = parsedate_tz(headers["expires"])
209
- if expires is not None:
210
- expire_time = calendar.timegm(expires) - date
211
- freshness_lifetime = max(0, expire_time)
212
- logger.debug("Freshness lifetime from expires: %i", freshness_lifetime)
213
-
214
- # Determine if we are setting freshness limit in the
215
- # request. Note, this overrides what was in the response.
216
- if "max-age" in cc:
217
- freshness_lifetime = cc["max-age"]
218
- logger.debug(
219
- "Freshness lifetime from request max-age: %i", freshness_lifetime
220
- )
221
-
222
- if "min-fresh" in cc:
223
- min_fresh = cc["min-fresh"]
224
- # adjust our current age by our min fresh
225
- current_age += min_fresh
226
- logger.debug("Adjusted current age from min-fresh: %i", current_age)
227
-
228
- # Return entry if it is fresh enough
229
- if freshness_lifetime > current_age:
230
- logger.debug('The response is "fresh", returning cached response')
231
- logger.debug("%i > %i", freshness_lifetime, current_age)
232
- return resp
233
-
234
- # we're not fresh. If we don't have an Etag, clear it out
235
- if "etag" not in headers:
236
- logger.debug('The cached response is "stale" with no etag, purging')
237
- self.cache.delete(cache_url)
238
-
239
- # return the original handler
240
- return False
241
-
242
- def conditional_headers(self, request):
243
- cache_url = self.cache_url(request.url)
244
- resp = self.serializer.loads(request, self.cache.get(cache_url))
245
- new_headers = {}
246
-
247
- if resp:
248
- headers = CaseInsensitiveDict(resp.headers)
249
-
250
- if "etag" in headers:
251
- new_headers["If-None-Match"] = headers["ETag"]
252
-
253
- if "last-modified" in headers:
254
- new_headers["If-Modified-Since"] = headers["Last-Modified"]
255
-
256
- return new_headers
257
-
258
- def _cache_set(self, cache_url, request, response, body=None, expires_time=None):
259
- """
260
- Store the data in the cache.
261
- """
262
- if isinstance(self.cache, SeparateBodyBaseCache):
263
- # We pass in the body separately; just put a placeholder empty
264
- # string in the metadata.
265
- self.cache.set(
266
- cache_url,
267
- self.serializer.dumps(request, response, b""),
268
- expires=expires_time,
269
- )
270
- self.cache.set_body(cache_url, body)
271
- else:
272
- self.cache.set(
273
- cache_url,
274
- self.serializer.dumps(request, response, body),
275
- expires=expires_time,
276
- )
277
-
278
- def cache_response(self, request, response, body=None, status_codes=None):
279
- """
280
- Algorithm for caching requests.
281
-
282
- This assumes a requests Response object.
283
- """
284
- # From httplib2: Don't cache 206's since we aren't going to
285
- # handle byte range requests
286
- cacheable_status_codes = status_codes or self.cacheable_status_codes
287
- if response.status not in cacheable_status_codes:
288
- logger.debug(
289
- "Status code %s not in %s", response.status, cacheable_status_codes
290
- )
291
- return
292
-
293
- response_headers = CaseInsensitiveDict(response.headers)
294
-
295
- if "date" in response_headers:
296
- date = calendar.timegm(parsedate_tz(response_headers["date"]))
297
- else:
298
- date = 0
299
-
300
- # If we've been given a body, our response has a Content-Length, that
301
- # Content-Length is valid then we can check to see if the body we've
302
- # been given matches the expected size, and if it doesn't we'll just
303
- # skip trying to cache it.
304
- if (
305
- body is not None
306
- and "content-length" in response_headers
307
- and response_headers["content-length"].isdigit()
308
- and int(response_headers["content-length"]) != len(body)
309
- ):
310
- return
311
-
312
- cc_req = self.parse_cache_control(request.headers)
313
- cc = self.parse_cache_control(response_headers)
314
-
315
- cache_url = self.cache_url(request.url)
316
- logger.debug('Updating cache with response from "%s"', cache_url)
317
-
318
- # Delete it from the cache if we happen to have it stored there
319
- no_store = False
320
- if "no-store" in cc:
321
- no_store = True
322
- logger.debug('Response header has "no-store"')
323
- if "no-store" in cc_req:
324
- no_store = True
325
- logger.debug('Request header has "no-store"')
326
- if no_store and self.cache.get(cache_url):
327
- logger.debug('Purging existing cache entry to honor "no-store"')
328
- self.cache.delete(cache_url)
329
- if no_store:
330
- return
331
-
332
- # https://tools.ietf.org/html/rfc7234#section-4.1:
333
- # A Vary header field-value of "*" always fails to match.
334
- # Storing such a response leads to a deserialization warning
335
- # during cache lookup and is not allowed to ever be served,
336
- # so storing it can be avoided.
337
- if "*" in response_headers.get("vary", ""):
338
- logger.debug('Response header has "Vary: *"')
339
- return
340
-
341
- # If we've been given an etag, then keep the response
342
- if self.cache_etags and "etag" in response_headers:
343
- expires_time = 0
344
- if response_headers.get("expires"):
345
- expires = parsedate_tz(response_headers["expires"])
346
- if expires is not None:
347
- expires_time = calendar.timegm(expires) - date
348
-
349
- expires_time = max(expires_time, 14 * 86400)
350
-
351
- logger.debug("etag object cached for {0} seconds".format(expires_time))
352
- logger.debug("Caching due to etag")
353
- self._cache_set(cache_url, request, response, body, expires_time)
354
-
355
- # Add to the cache any permanent redirects. We do this before looking
356
- # that the Date headers.
357
- elif int(response.status) in PERMANENT_REDIRECT_STATUSES:
358
- logger.debug("Caching permanent redirect")
359
- self._cache_set(cache_url, request, response, b"")
360
-
361
- # Add to the cache if the response headers demand it. If there
362
- # is no date header then we can't do anything about expiring
363
- # the cache.
364
- elif "date" in response_headers:
365
- date = calendar.timegm(parsedate_tz(response_headers["date"]))
366
- # cache when there is a max-age > 0
367
- if "max-age" in cc and cc["max-age"] > 0:
368
- logger.debug("Caching b/c date exists and max-age > 0")
369
- expires_time = cc["max-age"]
370
- self._cache_set(
371
- cache_url,
372
- request,
373
- response,
374
- body,
375
- expires_time,
376
- )
377
-
378
- # If the request can expire, it means we should cache it
379
- # in the meantime.
380
- elif "expires" in response_headers:
381
- if response_headers["expires"]:
382
- expires = parsedate_tz(response_headers["expires"])
383
- if expires is not None:
384
- expires_time = calendar.timegm(expires) - date
385
- else:
386
- expires_time = None
387
-
388
- logger.debug(
389
- "Caching b/c of expires header. expires in {0} seconds".format(
390
- expires_time
391
- )
392
- )
393
- self._cache_set(
394
- cache_url,
395
- request,
396
- response,
397
- body,
398
- expires_time,
399
- )
400
-
401
- def update_cached_response(self, request, response):
402
- """On a 304 we will get a new set of headers that we want to
403
- update our cached value with, assuming we have one.
404
-
405
- This should only ever be called when we've sent an ETag and
406
- gotten a 304 as the response.
407
- """
408
- cache_url = self.cache_url(request.url)
409
-
410
- cached_response = self.serializer.loads(request, self.cache.get(cache_url))
411
-
412
- if not cached_response:
413
- # we didn't have a cached response
414
- return response
415
-
416
- # Lets update our headers with the headers from the new request:
417
- # http://tools.ietf.org/html/draft-ietf-httpbis-p4-conditional-26#section-4.1
418
- #
419
- # The server isn't supposed to send headers that would make
420
- # the cached body invalid. But... just in case, we'll be sure
421
- # to strip out ones we know that might be problmatic due to
422
- # typical assumptions.
423
- excluded_headers = ["content-length"]
424
-
425
- cached_response.headers.update(
426
- dict(
427
- (k, v)
428
- for k, v in response.headers.items()
429
- if k.lower() not in excluded_headers
430
- )
431
- )
432
-
433
- # we want a 200 b/c we have content via the cache
434
- cached_response.status = 200
435
-
436
- # update our cache
437
- self._cache_set(cache_url, request, cached_response)
438
-
439
- return cached_response
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Biswa13/Examples-Of-AI-2023/README.md DELETED
@@ -1,13 +0,0 @@
1
- ---
2
- title: Examples Of AI 2023
3
- emoji: 📚
4
- colorFrom: purple
5
- colorTo: indigo
6
- sdk: streamlit
7
- sdk_version: 1.17.0
8
- app_file: app.py
9
- pinned: false
10
- license: mit
11
- ---
12
-
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVH-vn1210/make_hair/minigpt4/processors/randaugment.py DELETED
@@ -1,398 +0,0 @@
1
- """
2
- Copyright (c) 2022, salesforce.com, inc.
3
- All rights reserved.
4
- SPDX-License-Identifier: BSD-3-Clause
5
- For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
- """
7
-
8
- import cv2
9
- import numpy as np
10
-
11
- import torch
12
-
13
-
14
- ## aug functions
15
- def identity_func(img):
16
- return img
17
-
18
-
19
- def autocontrast_func(img, cutoff=0):
20
- """
21
- same output as PIL.ImageOps.autocontrast
22
- """
23
- n_bins = 256
24
-
25
- def tune_channel(ch):
26
- n = ch.size
27
- cut = cutoff * n // 100
28
- if cut == 0:
29
- high, low = ch.max(), ch.min()
30
- else:
31
- hist = cv2.calcHist([ch], [0], None, [n_bins], [0, n_bins])
32
- low = np.argwhere(np.cumsum(hist) > cut)
33
- low = 0 if low.shape[0] == 0 else low[0]
34
- high = np.argwhere(np.cumsum(hist[::-1]) > cut)
35
- high = n_bins - 1 if high.shape[0] == 0 else n_bins - 1 - high[0]
36
- if high <= low:
37
- table = np.arange(n_bins)
38
- else:
39
- scale = (n_bins - 1) / (high - low)
40
- offset = -low * scale
41
- table = np.arange(n_bins) * scale + offset
42
- table[table < 0] = 0
43
- table[table > n_bins - 1] = n_bins - 1
44
- table = table.clip(0, 255).astype(np.uint8)
45
- return table[ch]
46
-
47
- channels = [tune_channel(ch) for ch in cv2.split(img)]
48
- out = cv2.merge(channels)
49
- return out
50
-
51
-
52
- def equalize_func(img):
53
- """
54
- same output as PIL.ImageOps.equalize
55
- PIL's implementation is different from cv2.equalize
56
- """
57
- n_bins = 256
58
-
59
- def tune_channel(ch):
60
- hist = cv2.calcHist([ch], [0], None, [n_bins], [0, n_bins])
61
- non_zero_hist = hist[hist != 0].reshape(-1)
62
- step = np.sum(non_zero_hist[:-1]) // (n_bins - 1)
63
- if step == 0:
64
- return ch
65
- n = np.empty_like(hist)
66
- n[0] = step // 2
67
- n[1:] = hist[:-1]
68
- table = (np.cumsum(n) // step).clip(0, 255).astype(np.uint8)
69
- return table[ch]
70
-
71
- channels = [tune_channel(ch) for ch in cv2.split(img)]
72
- out = cv2.merge(channels)
73
- return out
74
-
75
-
76
- def rotate_func(img, degree, fill=(0, 0, 0)):
77
- """
78
- like PIL, rotate by degree, not radians
79
- """
80
- H, W = img.shape[0], img.shape[1]
81
- center = W / 2, H / 2
82
- M = cv2.getRotationMatrix2D(center, degree, 1)
83
- out = cv2.warpAffine(img, M, (W, H), borderValue=fill)
84
- return out
85
-
86
-
87
- def solarize_func(img, thresh=128):
88
- """
89
- same output as PIL.ImageOps.posterize
90
- """
91
- table = np.array([el if el < thresh else 255 - el for el in range(256)])
92
- table = table.clip(0, 255).astype(np.uint8)
93
- out = table[img]
94
- return out
95
-
96
-
97
- def color_func(img, factor):
98
- """
99
- same output as PIL.ImageEnhance.Color
100
- """
101
- ## implementation according to PIL definition, quite slow
102
- # degenerate = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)[:, :, np.newaxis]
103
- # out = blend(degenerate, img, factor)
104
- # M = (
105
- # np.eye(3) * factor
106
- # + np.float32([0.114, 0.587, 0.299]).reshape(3, 1) * (1. - factor)
107
- # )[np.newaxis, np.newaxis, :]
108
- M = np.float32(
109
- [[0.886, -0.114, -0.114], [-0.587, 0.413, -0.587], [-0.299, -0.299, 0.701]]
110
- ) * factor + np.float32([[0.114], [0.587], [0.299]])
111
- out = np.matmul(img, M).clip(0, 255).astype(np.uint8)
112
- return out
113
-
114
-
115
- def contrast_func(img, factor):
116
- """
117
- same output as PIL.ImageEnhance.Contrast
118
- """
119
- mean = np.sum(np.mean(img, axis=(0, 1)) * np.array([0.114, 0.587, 0.299]))
120
- table = (
121
- np.array([(el - mean) * factor + mean for el in range(256)])
122
- .clip(0, 255)
123
- .astype(np.uint8)
124
- )
125
- out = table[img]
126
- return out
127
-
128
-
129
- def brightness_func(img, factor):
130
- """
131
- same output as PIL.ImageEnhance.Contrast
132
- """
133
- table = (np.arange(256, dtype=np.float32) * factor).clip(0, 255).astype(np.uint8)
134
- out = table[img]
135
- return out
136
-
137
-
138
- def sharpness_func(img, factor):
139
- """
140
- The differences the this result and PIL are all on the 4 boundaries, the center
141
- areas are same
142
- """
143
- kernel = np.ones((3, 3), dtype=np.float32)
144
- kernel[1][1] = 5
145
- kernel /= 13
146
- degenerate = cv2.filter2D(img, -1, kernel)
147
- if factor == 0.0:
148
- out = degenerate
149
- elif factor == 1.0:
150
- out = img
151
- else:
152
- out = img.astype(np.float32)
153
- degenerate = degenerate.astype(np.float32)[1:-1, 1:-1, :]
154
- out[1:-1, 1:-1, :] = degenerate + factor * (out[1:-1, 1:-1, :] - degenerate)
155
- out = out.astype(np.uint8)
156
- return out
157
-
158
-
159
- def shear_x_func(img, factor, fill=(0, 0, 0)):
160
- H, W = img.shape[0], img.shape[1]
161
- M = np.float32([[1, factor, 0], [0, 1, 0]])
162
- out = cv2.warpAffine(
163
- img, M, (W, H), borderValue=fill, flags=cv2.INTER_LINEAR
164
- ).astype(np.uint8)
165
- return out
166
-
167
-
168
- def translate_x_func(img, offset, fill=(0, 0, 0)):
169
- """
170
- same output as PIL.Image.transform
171
- """
172
- H, W = img.shape[0], img.shape[1]
173
- M = np.float32([[1, 0, -offset], [0, 1, 0]])
174
- out = cv2.warpAffine(
175
- img, M, (W, H), borderValue=fill, flags=cv2.INTER_LINEAR
176
- ).astype(np.uint8)
177
- return out
178
-
179
-
180
- def translate_y_func(img, offset, fill=(0, 0, 0)):
181
- """
182
- same output as PIL.Image.transform
183
- """
184
- H, W = img.shape[0], img.shape[1]
185
- M = np.float32([[1, 0, 0], [0, 1, -offset]])
186
- out = cv2.warpAffine(
187
- img, M, (W, H), borderValue=fill, flags=cv2.INTER_LINEAR
188
- ).astype(np.uint8)
189
- return out
190
-
191
-
192
- def posterize_func(img, bits):
193
- """
194
- same output as PIL.ImageOps.posterize
195
- """
196
- out = np.bitwise_and(img, np.uint8(255 << (8 - bits)))
197
- return out
198
-
199
-
200
- def shear_y_func(img, factor, fill=(0, 0, 0)):
201
- H, W = img.shape[0], img.shape[1]
202
- M = np.float32([[1, 0, 0], [factor, 1, 0]])
203
- out = cv2.warpAffine(
204
- img, M, (W, H), borderValue=fill, flags=cv2.INTER_LINEAR
205
- ).astype(np.uint8)
206
- return out
207
-
208
-
209
- def cutout_func(img, pad_size, replace=(0, 0, 0)):
210
- replace = np.array(replace, dtype=np.uint8)
211
- H, W = img.shape[0], img.shape[1]
212
- rh, rw = np.random.random(2)
213
- pad_size = pad_size // 2
214
- ch, cw = int(rh * H), int(rw * W)
215
- x1, x2 = max(ch - pad_size, 0), min(ch + pad_size, H)
216
- y1, y2 = max(cw - pad_size, 0), min(cw + pad_size, W)
217
- out = img.copy()
218
- out[x1:x2, y1:y2, :] = replace
219
- return out
220
-
221
-
222
- ### level to args
223
- def enhance_level_to_args(MAX_LEVEL):
224
- def level_to_args(level):
225
- return ((level / MAX_LEVEL) * 1.8 + 0.1,)
226
-
227
- return level_to_args
228
-
229
-
230
- def shear_level_to_args(MAX_LEVEL, replace_value):
231
- def level_to_args(level):
232
- level = (level / MAX_LEVEL) * 0.3
233
- if np.random.random() > 0.5:
234
- level = -level
235
- return (level, replace_value)
236
-
237
- return level_to_args
238
-
239
-
240
- def translate_level_to_args(translate_const, MAX_LEVEL, replace_value):
241
- def level_to_args(level):
242
- level = (level / MAX_LEVEL) * float(translate_const)
243
- if np.random.random() > 0.5:
244
- level = -level
245
- return (level, replace_value)
246
-
247
- return level_to_args
248
-
249
-
250
- def cutout_level_to_args(cutout_const, MAX_LEVEL, replace_value):
251
- def level_to_args(level):
252
- level = int((level / MAX_LEVEL) * cutout_const)
253
- return (level, replace_value)
254
-
255
- return level_to_args
256
-
257
-
258
- def solarize_level_to_args(MAX_LEVEL):
259
- def level_to_args(level):
260
- level = int((level / MAX_LEVEL) * 256)
261
- return (level,)
262
-
263
- return level_to_args
264
-
265
-
266
- def none_level_to_args(level):
267
- return ()
268
-
269
-
270
- def posterize_level_to_args(MAX_LEVEL):
271
- def level_to_args(level):
272
- level = int((level / MAX_LEVEL) * 4)
273
- return (level,)
274
-
275
- return level_to_args
276
-
277
-
278
- def rotate_level_to_args(MAX_LEVEL, replace_value):
279
- def level_to_args(level):
280
- level = (level / MAX_LEVEL) * 30
281
- if np.random.random() < 0.5:
282
- level = -level
283
- return (level, replace_value)
284
-
285
- return level_to_args
286
-
287
-
288
- func_dict = {
289
- "Identity": identity_func,
290
- "AutoContrast": autocontrast_func,
291
- "Equalize": equalize_func,
292
- "Rotate": rotate_func,
293
- "Solarize": solarize_func,
294
- "Color": color_func,
295
- "Contrast": contrast_func,
296
- "Brightness": brightness_func,
297
- "Sharpness": sharpness_func,
298
- "ShearX": shear_x_func,
299
- "TranslateX": translate_x_func,
300
- "TranslateY": translate_y_func,
301
- "Posterize": posterize_func,
302
- "ShearY": shear_y_func,
303
- }
304
-
305
- translate_const = 10
306
- MAX_LEVEL = 10
307
- replace_value = (128, 128, 128)
308
- arg_dict = {
309
- "Identity": none_level_to_args,
310
- "AutoContrast": none_level_to_args,
311
- "Equalize": none_level_to_args,
312
- "Rotate": rotate_level_to_args(MAX_LEVEL, replace_value),
313
- "Solarize": solarize_level_to_args(MAX_LEVEL),
314
- "Color": enhance_level_to_args(MAX_LEVEL),
315
- "Contrast": enhance_level_to_args(MAX_LEVEL),
316
- "Brightness": enhance_level_to_args(MAX_LEVEL),
317
- "Sharpness": enhance_level_to_args(MAX_LEVEL),
318
- "ShearX": shear_level_to_args(MAX_LEVEL, replace_value),
319
- "TranslateX": translate_level_to_args(translate_const, MAX_LEVEL, replace_value),
320
- "TranslateY": translate_level_to_args(translate_const, MAX_LEVEL, replace_value),
321
- "Posterize": posterize_level_to_args(MAX_LEVEL),
322
- "ShearY": shear_level_to_args(MAX_LEVEL, replace_value),
323
- }
324
-
325
-
326
- class RandomAugment(object):
327
- def __init__(self, N=2, M=10, isPIL=False, augs=[]):
328
- self.N = N
329
- self.M = M
330
- self.isPIL = isPIL
331
- if augs:
332
- self.augs = augs
333
- else:
334
- self.augs = list(arg_dict.keys())
335
-
336
- def get_random_ops(self):
337
- sampled_ops = np.random.choice(self.augs, self.N)
338
- return [(op, 0.5, self.M) for op in sampled_ops]
339
-
340
- def __call__(self, img):
341
- if self.isPIL:
342
- img = np.array(img)
343
- ops = self.get_random_ops()
344
- for name, prob, level in ops:
345
- if np.random.random() > prob:
346
- continue
347
- args = arg_dict[name](level)
348
- img = func_dict[name](img, *args)
349
- return img
350
-
351
-
352
- class VideoRandomAugment(object):
353
- def __init__(self, N=2, M=10, p=0.0, tensor_in_tensor_out=True, augs=[]):
354
- self.N = N
355
- self.M = M
356
- self.p = p
357
- self.tensor_in_tensor_out = tensor_in_tensor_out
358
- if augs:
359
- self.augs = augs
360
- else:
361
- self.augs = list(arg_dict.keys())
362
-
363
- def get_random_ops(self):
364
- sampled_ops = np.random.choice(self.augs, self.N, replace=False)
365
- return [(op, self.M) for op in sampled_ops]
366
-
367
- def __call__(self, frames):
368
- assert (
369
- frames.shape[-1] == 3
370
- ), "Expecting last dimension for 3-channels RGB (b, h, w, c)."
371
-
372
- if self.tensor_in_tensor_out:
373
- frames = frames.numpy().astype(np.uint8)
374
-
375
- num_frames = frames.shape[0]
376
-
377
- ops = num_frames * [self.get_random_ops()]
378
- apply_or_not = num_frames * [np.random.random(size=self.N) > self.p]
379
-
380
- frames = torch.stack(
381
- list(map(self._aug, frames, ops, apply_or_not)), dim=0
382
- ).float()
383
-
384
- return frames
385
-
386
- def _aug(self, img, ops, apply_or_not):
387
- for i, (name, level) in enumerate(ops):
388
- if not apply_or_not[i]:
389
- continue
390
- args = arg_dict[name](level)
391
- img = func_dict[name](img, *args)
392
- return torch.from_numpy(img)
393
-
394
-
395
- if __name__ == "__main__":
396
- a = RandomAugment()
397
- img = np.random.randn(32, 32, 3)
398
- a(img)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/detectron2/structures/masks.py DELETED
@@ -1,424 +0,0 @@
1
- # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
2
- import copy
3
- import itertools
4
- import numpy as np
5
- from typing import Any, Iterator, List, Union
6
- import pycocotools.mask as mask_utils
7
- import torch
8
-
9
- from detectron2.layers import cat
10
- from detectron2.layers.roi_align import ROIAlign
11
-
12
- from .boxes import Boxes
13
-
14
-
15
- def polygon_area(x, y):
16
- # Using the shoelace formula
17
- # https://stackoverflow.com/questions/24467972/calculate-area-of-polygon-given-x-y-coordinates
18
- return 0.5 * np.abs(np.dot(x, np.roll(y, 1)) - np.dot(y, np.roll(x, 1)))
19
-
20
-
21
- def polygons_to_bitmask(polygons: List[np.ndarray], height: int, width: int) -> np.ndarray:
22
- """
23
- Args:
24
- polygons (list[ndarray]): each array has shape (Nx2,)
25
- height, width (int)
26
-
27
- Returns:
28
- ndarray: a bool mask of shape (height, width)
29
- """
30
- assert len(polygons) > 0, "COCOAPI does not support empty polygons"
31
- rles = mask_utils.frPyObjects(polygons, height, width)
32
- rle = mask_utils.merge(rles)
33
- return mask_utils.decode(rle).astype(np.bool)
34
-
35
-
36
- def rasterize_polygons_within_box(
37
- polygons: List[np.ndarray], box: np.ndarray, mask_size: int
38
- ) -> torch.Tensor:
39
- """
40
- Rasterize the polygons into a mask image and
41
- crop the mask content in the given box.
42
- The cropped mask is resized to (mask_size, mask_size).
43
-
44
- This function is used when generating training targets for mask head in Mask R-CNN.
45
- Given original ground-truth masks for an image, new ground-truth mask
46
- training targets in the size of `mask_size x mask_size`
47
- must be provided for each predicted box. This function will be called to
48
- produce such targets.
49
-
50
- Args:
51
- polygons (list[ndarray[float]]): a list of polygons, which represents an instance.
52
- box: 4-element numpy array
53
- mask_size (int):
54
-
55
- Returns:
56
- Tensor: BoolTensor of shape (mask_size, mask_size)
57
- """
58
- # 1. Shift the polygons w.r.t the boxes
59
- w, h = box[2] - box[0], box[3] - box[1]
60
-
61
- polygons = copy.deepcopy(polygons)
62
- for p in polygons:
63
- p[0::2] = p[0::2] - box[0]
64
- p[1::2] = p[1::2] - box[1]
65
-
66
- # 2. Rescale the polygons to the new box size
67
- ratio_h = mask_size / max(h, 0.1)
68
- ratio_w = mask_size / max(w, 0.1)
69
-
70
- if ratio_h == ratio_w:
71
- for p in polygons:
72
- p *= ratio_h
73
- else:
74
- for p in polygons:
75
- p[0::2] *= ratio_w
76
- p[1::2] *= ratio_h
77
-
78
- # 3. Rasterize the polygons with coco api
79
- mask = polygons_to_bitmask(polygons, mask_size, mask_size)
80
- mask = torch.from_numpy(mask)
81
- return mask
82
-
83
-
84
- class BitMasks:
85
- """
86
- This class stores the segmentation masks for all objects in one image, in
87
- the form of bitmaps.
88
-
89
- Attributes:
90
- tensor: bool Tensor of N,H,W, representing N instances in the image.
91
- """
92
-
93
- def __init__(self, tensor: Union[torch.Tensor, np.ndarray]):
94
- """
95
- Args:
96
- tensor: bool Tensor of N,H,W, representing N instances in the image.
97
- """
98
- device = tensor.device if isinstance(tensor, torch.Tensor) else torch.device("cpu")
99
- tensor = torch.as_tensor(tensor, dtype=torch.bool, device=device)
100
- assert tensor.dim() == 3, tensor.size()
101
- self.image_size = tensor.shape[1:]
102
- self.tensor = tensor
103
-
104
- def to(self, device: str) -> "BitMasks":
105
- return BitMasks(self.tensor.to(device))
106
-
107
- @property
108
- def device(self) -> torch.device:
109
- return self.tensor.device
110
-
111
- def __getitem__(self, item: Union[int, slice, torch.BoolTensor]) -> "BitMasks":
112
- """
113
- Returns:
114
- BitMasks: Create a new :class:`BitMasks` by indexing.
115
-
116
- The following usage are allowed:
117
-
118
- 1. `new_masks = masks[3]`: return a `BitMasks` which contains only one mask.
119
- 2. `new_masks = masks[2:10]`: return a slice of masks.
120
- 3. `new_masks = masks[vector]`, where vector is a torch.BoolTensor
121
- with `length = len(masks)`. Nonzero elements in the vector will be selected.
122
-
123
- Note that the returned object might share storage with this object,
124
- subject to Pytorch's indexing semantics.
125
- """
126
- if isinstance(item, int):
127
- return BitMasks(self.tensor[item].view(1, -1))
128
- m = self.tensor[item]
129
- assert m.dim() == 3, "Indexing on BitMasks with {} returns a tensor with shape {}!".format(
130
- item, m.shape
131
- )
132
- return BitMasks(m)
133
-
134
- def __iter__(self) -> torch.Tensor:
135
- yield from self.tensor
136
-
137
- def __repr__(self) -> str:
138
- s = self.__class__.__name__ + "("
139
- s += "num_instances={})".format(len(self.tensor))
140
- return s
141
-
142
- def __len__(self) -> int:
143
- return self.tensor.shape[0]
144
-
145
- def nonempty(self) -> torch.Tensor:
146
- """
147
- Find masks that are non-empty.
148
-
149
- Returns:
150
- Tensor: a BoolTensor which represents
151
- whether each mask is empty (False) or non-empty (True).
152
- """
153
- return self.tensor.flatten(1).any(dim=1)
154
-
155
- @staticmethod
156
- def from_polygon_masks(
157
- polygon_masks: Union["PolygonMasks", List[List[np.ndarray]]], height: int, width: int
158
- ) -> "BitMasks":
159
- """
160
- Args:
161
- polygon_masks (list[list[ndarray]] or PolygonMasks)
162
- height, width (int)
163
- """
164
- if isinstance(polygon_masks, PolygonMasks):
165
- polygon_masks = polygon_masks.polygons
166
- masks = [polygons_to_bitmask(p, height, width) for p in polygon_masks]
167
- return BitMasks(torch.stack([torch.from_numpy(x) for x in masks]))
168
-
169
- def crop_and_resize(self, boxes: torch.Tensor, mask_size: int) -> torch.Tensor:
170
- """
171
- Crop each bitmask by the given box, and resize results to (mask_size, mask_size).
172
- This can be used to prepare training targets for Mask R-CNN.
173
- It has less reconstruction error compared to rasterization with polygons.
174
- However we observe no difference in accuracy,
175
- but BitMasks requires more memory to store all the masks.
176
-
177
- Args:
178
- boxes (Tensor): Nx4 tensor storing the boxes for each mask
179
- mask_size (int): the size of the rasterized mask.
180
-
181
- Returns:
182
- Tensor:
183
- A bool tensor of shape (N, mask_size, mask_size), where
184
- N is the number of predicted boxes for this image.
185
- """
186
- assert len(boxes) == len(self), "{} != {}".format(len(boxes), len(self))
187
- device = self.tensor.device
188
-
189
- batch_inds = torch.arange(len(boxes), device=device).to(dtype=boxes.dtype)[:, None]
190
- rois = torch.cat([batch_inds, boxes], dim=1) # Nx5
191
-
192
- bit_masks = self.tensor.to(dtype=torch.float32)
193
- rois = rois.to(device=device)
194
- output = (
195
- ROIAlign((mask_size, mask_size), 1.0, 0, aligned=True)
196
- .forward(bit_masks[:, None, :, :], rois)
197
- .squeeze(1)
198
- )
199
- output = output >= 0.5
200
- return output
201
-
202
- def get_bounding_boxes(self) -> None:
203
- # not needed now
204
- raise NotImplementedError
205
-
206
- @staticmethod
207
- def cat(bitmasks_list: List["BitMasks"]) -> "BitMasks":
208
- """
209
- Concatenates a list of BitMasks into a single BitMasks
210
-
211
- Arguments:
212
- bitmasks_list (list[BitMasks])
213
-
214
- Returns:
215
- BitMasks: the concatenated BitMasks
216
- """
217
- assert isinstance(bitmasks_list, (list, tuple))
218
- assert len(bitmasks_list) > 0
219
- assert all(isinstance(bitmask, BitMasks) for bitmask in bitmasks_list)
220
-
221
- cat_bitmasks = type(bitmasks_list[0])(cat([bm.tensor for bm in bitmasks_list], dim=0))
222
- return cat_bitmasks
223
-
224
-
225
- class PolygonMasks:
226
- """
227
- This class stores the segmentation masks for all objects in one image, in the form of polygons.
228
-
229
- Attributes:
230
- polygons: list[list[ndarray]]. Each ndarray is a float64 vector representing a polygon.
231
- """
232
-
233
- def __init__(self, polygons: List[List[Union[torch.Tensor, np.ndarray]]]):
234
- """
235
- Arguments:
236
- polygons (list[list[np.ndarray]]): The first
237
- level of the list correspond to individual instances,
238
- the second level to all the polygons that compose the
239
- instance, and the third level to the polygon coordinates.
240
- The third level array should have the format of
241
- [x0, y0, x1, y1, ..., xn, yn] (n >= 3).
242
- """
243
- assert isinstance(polygons, list), (
244
- "Cannot create PolygonMasks: Expect a list of list of polygons per image. "
245
- "Got '{}' instead.".format(type(polygons))
246
- )
247
-
248
- def _make_array(t: Union[torch.Tensor, np.ndarray]) -> np.ndarray:
249
- # Use float64 for higher precision, because why not?
250
- # Always put polygons on CPU (self.to is a no-op) since they
251
- # are supposed to be small tensors.
252
- # May need to change this assumption if GPU placement becomes useful
253
- if isinstance(t, torch.Tensor):
254
- t = t.cpu().numpy()
255
- return np.asarray(t).astype("float64")
256
-
257
- def process_polygons(
258
- polygons_per_instance: List[Union[torch.Tensor, np.ndarray]]
259
- ) -> List[np.ndarray]:
260
- assert isinstance(polygons_per_instance, list), (
261
- "Cannot create polygons: Expect a list of polygons per instance. "
262
- "Got '{}' instead.".format(type(polygons_per_instance))
263
- )
264
- # transform the polygon to a tensor
265
- polygons_per_instance = [_make_array(p) for p in polygons_per_instance]
266
- for polygon in polygons_per_instance:
267
- assert len(polygon) % 2 == 0 and len(polygon) >= 6
268
- return polygons_per_instance
269
-
270
- self.polygons: List[List[np.ndarray]] = [
271
- process_polygons(polygons_per_instance) for polygons_per_instance in polygons
272
- ]
273
-
274
- def to(self, *args: Any, **kwargs: Any) -> "PolygonMasks":
275
- return self
276
-
277
- @property
278
- def device(self) -> torch.device:
279
- return torch.device("cpu")
280
-
281
- def get_bounding_boxes(self) -> Boxes:
282
- """
283
- Returns:
284
- Boxes: tight bounding boxes around polygon masks.
285
- """
286
- boxes = torch.zeros(len(self.polygons), 4, dtype=torch.float32)
287
- for idx, polygons_per_instance in enumerate(self.polygons):
288
- minxy = torch.as_tensor([float("inf"), float("inf")], dtype=torch.float32)
289
- maxxy = torch.zeros(2, dtype=torch.float32)
290
- for polygon in polygons_per_instance:
291
- coords = torch.from_numpy(polygon).view(-1, 2).to(dtype=torch.float32)
292
- minxy = torch.min(minxy, torch.min(coords, dim=0).values)
293
- maxxy = torch.max(maxxy, torch.max(coords, dim=0).values)
294
- boxes[idx, :2] = minxy
295
- boxes[idx, 2:] = maxxy
296
- return Boxes(boxes)
297
-
298
- def nonempty(self) -> torch.Tensor:
299
- """
300
- Find masks that are non-empty.
301
-
302
- Returns:
303
- Tensor:
304
- a BoolTensor which represents whether each mask is empty (False) or not (True).
305
- """
306
- keep = [1 if len(polygon) > 0 else 0 for polygon in self.polygons]
307
- return torch.from_numpy(np.asarray(keep, dtype=np.bool))
308
-
309
- def __getitem__(self, item: Union[int, slice, List[int], torch.BoolTensor]) -> "PolygonMasks":
310
- """
311
- Support indexing over the instances and return a `PolygonMasks` object.
312
- `item` can be:
313
-
314
- 1. An integer. It will return an object with only one instance.
315
- 2. A slice. It will return an object with the selected instances.
316
- 3. A list[int]. It will return an object with the selected instances,
317
- correpsonding to the indices in the list.
318
- 4. A vector mask of type BoolTensor, whose length is num_instances.
319
- It will return an object with the instances whose mask is nonzero.
320
- """
321
- if isinstance(item, int):
322
- selected_polygons = [self.polygons[item]]
323
- elif isinstance(item, slice):
324
- selected_polygons = self.polygons[item]
325
- elif isinstance(item, list):
326
- selected_polygons = [self.polygons[i] for i in item]
327
- elif isinstance(item, torch.Tensor):
328
- # Polygons is a list, so we have to move the indices back to CPU.
329
- if item.dtype == torch.bool:
330
- assert item.dim() == 1, item.shape
331
- item = item.nonzero().squeeze(1).cpu().numpy().tolist()
332
- elif item.dtype in [torch.int32, torch.int64]:
333
- item = item.cpu().numpy().tolist()
334
- else:
335
- raise ValueError("Unsupported tensor dtype={} for indexing!".format(item.dtype))
336
- selected_polygons = [self.polygons[i] for i in item]
337
- return PolygonMasks(selected_polygons)
338
-
339
- def __iter__(self) -> Iterator[List[np.ndarray]]:
340
- """
341
- Yields:
342
- list[ndarray]: the polygons for one instance.
343
- Each Tensor is a float64 vector representing a polygon.
344
- """
345
- return iter(self.polygons)
346
-
347
- def __repr__(self) -> str:
348
- s = self.__class__.__name__ + "("
349
- s += "num_instances={})".format(len(self.polygons))
350
- return s
351
-
352
- def __len__(self) -> int:
353
- return len(self.polygons)
354
-
355
- def crop_and_resize(self, boxes: torch.Tensor, mask_size: int) -> torch.Tensor:
356
- """
357
- Crop each mask by the given box, and resize results to (mask_size, mask_size).
358
- This can be used to prepare training targets for Mask R-CNN.
359
-
360
- Args:
361
- boxes (Tensor): Nx4 tensor storing the boxes for each mask
362
- mask_size (int): the size of the rasterized mask.
363
-
364
- Returns:
365
- Tensor: A bool tensor of shape (N, mask_size, mask_size), where
366
- N is the number of predicted boxes for this image.
367
- """
368
- assert len(boxes) == len(self), "{} != {}".format(len(boxes), len(self))
369
-
370
- device = boxes.device
371
- # Put boxes on the CPU, as the polygon representation is not efficient GPU-wise
372
- # (several small tensors for representing a single instance mask)
373
- boxes = boxes.to(torch.device("cpu"))
374
-
375
- results = [
376
- rasterize_polygons_within_box(poly, box.numpy(), mask_size)
377
- for poly, box in zip(self.polygons, boxes)
378
- ]
379
- """
380
- poly: list[list[float]], the polygons for one instance
381
- box: a tensor of shape (4,)
382
- """
383
- if len(results) == 0:
384
- return torch.empty(0, mask_size, mask_size, dtype=torch.bool, device=device)
385
- return torch.stack(results, dim=0).to(device=device)
386
-
387
- def area(self):
388
- """
389
- Computes area of the mask.
390
- Only works with Polygons, using the shoelace formula:
391
- https://stackoverflow.com/questions/24467972/calculate-area-of-polygon-given-x-y-coordinates
392
-
393
- Returns:
394
- Tensor: a vector, area for each instance
395
- """
396
-
397
- area = []
398
- for polygons_per_instance in self.polygons:
399
- area_per_instance = 0
400
- for p in polygons_per_instance:
401
- area_per_instance += polygon_area(p[0::2], p[1::2])
402
- area.append(area_per_instance)
403
-
404
- return torch.tensor(area)
405
-
406
- @staticmethod
407
- def cat(polymasks_list: List["PolygonMasks"]) -> "PolygonMasks":
408
- """
409
- Concatenates a list of PolygonMasks into a single PolygonMasks
410
-
411
- Arguments:
412
- polymasks_list (list[PolygonMasks])
413
-
414
- Returns:
415
- PolygonMasks: the concatenated PolygonMasks
416
- """
417
- assert isinstance(polymasks_list, (list, tuple))
418
- assert len(polymasks_list) > 0
419
- assert all(isinstance(polymask, PolygonMasks) for polymask in polymasks_list)
420
-
421
- cat_polymasks = type(polymasks_list[0])(
422
- list(itertools.chain.from_iterable(pm.polygons for pm in polymasks_list))
423
- )
424
- return cat_polymasks
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/projects/README.md DELETED
@@ -1,31 +0,0 @@
1
-
2
- Here are a few projects that are built on detectron2.
3
- They are examples of how to use detectron2 as a library, to make your projects more
4
- maintainable.
5
-
6
- ## Projects by Facebook
7
-
8
- Note that these are research projects, and therefore may not have the same level
9
- of support or stability of detectron2.
10
-
11
- + [DensePose: Dense Human Pose Estimation In The Wild](DensePose)
12
- + [Scale-Aware Trident Networks for Object Detection](TridentNet)
13
- + [TensorMask: A Foundation for Dense Object Segmentation](TensorMask)
14
- + [Mesh R-CNN](https://github.com/facebookresearch/meshrcnn)
15
- + [PointRend: Image Segmentation as Rendering](PointRend)
16
- + [Momentum Contrast for Unsupervised Visual Representation Learning](https://github.com/facebookresearch/moco/tree/master/detection)
17
-
18
-
19
- ## External Projects
20
-
21
- External projects in the community that use detectron2:
22
-
23
- <!--
24
- - If you want to contribute, note that:
25
- - 1. please add your project to the end of the list and try to use only one line
26
- - 2. the project must provide models trained on standard datasets
27
- -->
28
-
29
- + [VoVNet backbones](https://github.com/youngwanLEE/vovnet-detectron2).
30
- + [AdelaiDet](https://github.com/aim-uofa/adet), a detection toolbox from the Universtiy of Adelaide.
31
- + [CenterMask : Real-Time Anchor-Free Instance Segmentation](https://github.com/youngwanLEE/centermask2)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/Dual-Key_Backdoor_Attacks/openvqa/openvqa/ops/layer_norm.py DELETED
@@ -1,21 +0,0 @@
1
- # --------------------------------------------------------
2
- # OpenVQA
3
- # Written by Yuhao Cui https://github.com/cuiyuhao1996
4
- # --------------------------------------------------------
5
-
6
- import torch.nn as nn
7
- import torch
8
-
9
- class LayerNorm(nn.Module):
10
- def __init__(self, size, eps=1e-6):
11
- super(LayerNorm, self).__init__()
12
- self.eps = eps
13
-
14
- self.a_2 = nn.Parameter(torch.ones(size))
15
- self.b_2 = nn.Parameter(torch.zeros(size))
16
-
17
- def forward(self, x):
18
- mean = x.mean(-1, keepdim=True)
19
- std = x.std(-1, keepdim=True)
20
-
21
- return self.a_2 * (x - mean) / (std + self.eps) + self.b_2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/LIVE/thrust/thrust/iterator/detail/permutation_iterator_base.h DELETED
@@ -1,53 +0,0 @@
1
- /*
2
- * Copyright 2008-2013 NVIDIA Corporation
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- #pragma once
18
-
19
- #include <thrust/iterator/iterator_adaptor.h>
20
- #include <thrust/iterator/iterator_traits.h>
21
- #include <thrust/detail/type_traits.h>
22
- #include <thrust/iterator/detail/minimum_system.h>
23
-
24
- namespace thrust
25
- {
26
-
27
- template<typename,typename> class permutation_iterator;
28
-
29
-
30
- namespace detail
31
- {
32
-
33
- template<typename ElementIterator,
34
- typename IndexIterator>
35
- struct permutation_iterator_base
36
- {
37
- typedef typename thrust::iterator_system<ElementIterator>::type System1;
38
- typedef typename thrust::iterator_system<IndexIterator>::type System2;
39
-
40
- typedef thrust::iterator_adaptor<
41
- permutation_iterator<ElementIterator,IndexIterator>,
42
- IndexIterator,
43
- typename thrust::iterator_value<ElementIterator>::type,
44
- typename detail::minimum_system<System1,System2>::type,
45
- thrust::use_default,
46
- typename thrust::iterator_reference<ElementIterator>::type
47
- > type;
48
- }; // end permutation_iterator_base
49
-
50
- } // end detail
51
-
52
- } // end thrust
53
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/transfiner/configs/new_baselines/mask_rcnn_R_50_FPN_100ep_LSJ.py DELETED
@@ -1,72 +0,0 @@
1
- import detectron2.data.transforms as T
2
- from detectron2.config.lazy import LazyCall as L
3
- from detectron2.layers.batch_norm import NaiveSyncBatchNorm
4
- from detectron2.solver import WarmupParamScheduler
5
- from fvcore.common.param_scheduler import MultiStepParamScheduler
6
-
7
- from ..common.data.coco import dataloader
8
- from ..common.models.mask_rcnn_fpn import model
9
- from ..common.optim import SGD as optimizer
10
- from ..common.train import train
11
-
12
- # train from scratch
13
- train.init_checkpoint = ""
14
- train.amp.enabled = True
15
- train.ddp.fp16_compression = True
16
- model.backbone.bottom_up.freeze_at = 0
17
-
18
- # SyncBN
19
- # fmt: off
20
- model.backbone.bottom_up.stem.norm = \
21
- model.backbone.bottom_up.stages.norm = \
22
- model.backbone.norm = "SyncBN"
23
-
24
- # Using NaiveSyncBatchNorm becase heads may have empty input. That is not supported by
25
- # torch.nn.SyncBatchNorm. We can remove this after
26
- # https://github.com/pytorch/pytorch/issues/36530 is fixed.
27
- model.roi_heads.box_head.conv_norm = \
28
- model.roi_heads.mask_head.conv_norm = lambda c: NaiveSyncBatchNorm(c,
29
- stats_mode="N")
30
- # fmt: on
31
-
32
- # 2conv in RPN:
33
- # https://github.com/tensorflow/tpu/blob/b24729de804fdb751b06467d3dce0637fa652060/models/official/detection/modeling/architecture/heads.py#L95-L97 # noqa: E501, B950
34
- model.proposal_generator.head.conv_dims = [-1, -1]
35
-
36
- # 4conv1fc box head
37
- model.roi_heads.box_head.conv_dims = [256, 256, 256, 256]
38
- model.roi_heads.box_head.fc_dims = [1024]
39
-
40
- # resize_and_crop_image in:
41
- # https://github.com/tensorflow/tpu/blob/b24729de804fdb751b06467d3dce0637fa652060/models/official/detection/utils/input_utils.py#L127 # noqa: E501, B950
42
- image_size = 1024
43
- dataloader.train.mapper.augmentations = [
44
- L(T.ResizeScale)(
45
- min_scale=0.1, max_scale=2.0, target_height=image_size, target_width=image_size
46
- ),
47
- L(T.FixedSizeCrop)(crop_size=(image_size, image_size)),
48
- L(T.RandomFlip)(horizontal=True),
49
- ]
50
-
51
- # recompute boxes due to cropping
52
- dataloader.train.mapper.recompute_boxes = True
53
-
54
- # larger batch-size.
55
- dataloader.train.total_batch_size = 64
56
-
57
- # Equivalent to 100 epochs.
58
- # 100 ep = 184375 iters * 64 images/iter / 118000 images/ep
59
- train.max_iter = 184375
60
-
61
- lr_multiplier = L(WarmupParamScheduler)(
62
- scheduler=L(MultiStepParamScheduler)(
63
- values=[1.0, 0.1, 0.01],
64
- milestones=[163889, 177546],
65
- num_updates=train.max_iter,
66
- ),
67
- warmup_length=500 / train.max_iter,
68
- warmup_factor=0.067,
69
- )
70
-
71
- optimizer.lr = 0.1
72
- optimizer.weight_decay = 4e-5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/ChandraMohanNayal/AutoGPT/tests/unit/test_browse_scrape_links.py DELETED
@@ -1,118 +0,0 @@
1
- # Generated by CodiumAI
2
-
3
- # Dependencies:
4
- # pip install pytest-mock
5
- import pytest
6
-
7
- from autogpt.commands.web_requests import scrape_links
8
-
9
- """
10
- Code Analysis
11
-
12
- Objective:
13
- The objective of the 'scrape_links' function is to scrape hyperlinks from a
14
- given URL and return them in a formatted way.
15
-
16
- Inputs:
17
- - url: a string representing the URL to be scraped.
18
-
19
- Flow:
20
- 1. Send a GET request to the given URL using the requests library and the user agent header from the config file.
21
- 2. Check if the response contains an HTTP error. If it does, return "error".
22
- 3. Parse the HTML content of the response using the BeautifulSoup library.
23
- 4. Remove any script and style tags from the parsed HTML.
24
- 5. Extract all hyperlinks from the parsed HTML using the 'extract_hyperlinks' function.
25
- 6. Format the extracted hyperlinks using the 'format_hyperlinks' function.
26
- 7. Return the formatted hyperlinks.
27
-
28
- Outputs:
29
- - A list of formatted hyperlinks.
30
-
31
- Additional aspects:
32
- - The function uses the 'requests' and 'BeautifulSoup' libraries to send HTTP
33
- requests and parse HTML content, respectively.
34
- - The 'extract_hyperlinks' function is called to extract hyperlinks from the parsed HTML.
35
- - The 'format_hyperlinks' function is called to format the extracted hyperlinks.
36
- - The function checks for HTTP errors and returns "error" if any are found.
37
- """
38
-
39
-
40
- class TestScrapeLinks:
41
- # Tests that the function returns a list of formatted hyperlinks when
42
- # provided with a valid url that returns a webpage with hyperlinks.
43
- def test_valid_url_with_hyperlinks(self):
44
- url = "https://www.google.com"
45
- result = scrape_links(url)
46
- assert len(result) > 0
47
- assert isinstance(result, list)
48
- assert isinstance(result[0], str)
49
-
50
- # Tests that the function returns correctly formatted hyperlinks when given a valid url.
51
- def test_valid_url(self, mocker):
52
- # Mock the requests.get() function to return a response with sample HTML containing hyperlinks
53
- mock_response = mocker.Mock()
54
- mock_response.status_code = 200
55
- mock_response.text = (
56
- "<html><body><a href='https://www.google.com'>Google</a></body></html>"
57
- )
58
- mocker.patch("requests.Session.get", return_value=mock_response)
59
-
60
- # Call the function with a valid URL
61
- result = scrape_links("https://www.example.com")
62
-
63
- # Assert that the function returns correctly formatted hyperlinks
64
- assert result == ["Google (https://www.google.com)"]
65
-
66
- # Tests that the function returns "error" when given an invalid url.
67
- def test_invalid_url(self, mocker):
68
- # Mock the requests.get() function to return an HTTP error response
69
- mock_response = mocker.Mock()
70
- mock_response.status_code = 404
71
- mocker.patch("requests.Session.get", return_value=mock_response)
72
-
73
- # Call the function with an invalid URL
74
- result = scrape_links("https://www.invalidurl.com")
75
-
76
- # Assert that the function returns "error"
77
- assert "Error:" in result
78
-
79
- # Tests that the function returns an empty list when the html contains no hyperlinks.
80
- def test_no_hyperlinks(self, mocker):
81
- # Mock the requests.get() function to return a response with sample HTML containing no hyperlinks
82
- mock_response = mocker.Mock()
83
- mock_response.status_code = 200
84
- mock_response.text = "<html><body><p>No hyperlinks here</p></body></html>"
85
- mocker.patch("requests.Session.get", return_value=mock_response)
86
-
87
- # Call the function with a URL containing no hyperlinks
88
- result = scrape_links("https://www.example.com")
89
-
90
- # Assert that the function returns an empty list
91
- assert result == []
92
-
93
- # Tests that scrape_links() correctly extracts and formats hyperlinks from
94
- # a sample HTML containing a few hyperlinks.
95
- def test_scrape_links_with_few_hyperlinks(self, mocker):
96
- # Mock the requests.get() function to return a response with a sample HTML containing hyperlinks
97
- mock_response = mocker.Mock()
98
- mock_response.status_code = 200
99
- mock_response.text = """
100
- <html>
101
- <body>
102
- <div id="google-link"><a href="https://www.google.com">Google</a></div>
103
- <div id="github"><a href="https://github.com">GitHub</a></div>
104
- <div id="CodiumAI"><a href="https://www.codium.ai">CodiumAI</a></div>
105
- </body>
106
- </html>
107
- """
108
- mocker.patch("requests.Session.get", return_value=mock_response)
109
-
110
- # Call the function being tested
111
- result = scrape_links("https://www.example.com")
112
-
113
- # Assert that the function returns a list of formatted hyperlinks
114
- assert isinstance(result, list)
115
- assert len(result) == 3
116
- assert result[0] == "Google (https://www.google.com)"
117
- assert result[1] == "GitHub (https://github.com)"
118
- assert result[2] == "CodiumAI (https://www.codium.ai)"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/ClassCat/mnist-classification/README.md DELETED
@@ -1,12 +0,0 @@
1
- ---
2
- title: Mnist Classification
3
- emoji: 📊
4
- colorFrom: yellow
5
- colorTo: red
6
- sdk: gradio
7
- sdk_version: 3.16.1
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CyberPeace-Institute/SecureBERT-NER-Space/README.md DELETED
@@ -1,12 +0,0 @@
1
- ---
2
- title: SecureBERT NER Space
3
- emoji: 🏢
4
- colorFrom: gray
5
- colorTo: gray
6
- sdk: streamlit
7
- sdk_version: 1.21.0
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Cyril666/my_abi/modules/model_abinet_iter.py DELETED
@@ -1,34 +0,0 @@
1
- import torch
2
- import torch.nn as nn
3
- from fastai.vision import *
4
-
5
- from .model_vision import BaseVision
6
- from .model_language import BCNLanguage
7
- from .model_alignment import BaseAlignment
8
-
9
-
10
- class ABINetIterModel(nn.Module):
11
- def __init__(self, config):
12
- super().__init__()
13
- self.iter_size = ifnone(config.model_iter_size, 1)
14
- self.max_length = config.dataset_max_length + 1 # additional stop token
15
- self.vision = BaseVision(config)
16
- self.language = BCNLanguage(config)
17
- self.alignment = BaseAlignment(config)
18
-
19
- def forward(self, images, *args):
20
- v_res = self.vision(images)
21
- a_res = v_res
22
- all_l_res, all_a_res = [], []
23
- for _ in range(self.iter_size):
24
- tokens = torch.softmax(a_res['logits'], dim=-1)
25
- lengths = a_res['pt_lengths']
26
- lengths.clamp_(2, self.max_length) # TODO:move to langauge model
27
- l_res = self.language(tokens, lengths)
28
- all_l_res.append(l_res)
29
- a_res = self.alignment(l_res['feature'], v_res['feature'])
30
- all_a_res.append(a_res)
31
- if self.training:
32
- return all_a_res, all_l_res, v_res
33
- else:
34
- return a_res, all_l_res[-1], v_res
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/DESUCLUB/BLLAMA/generate.py DELETED
@@ -1,200 +0,0 @@
1
- import torch
2
- from peft import PeftModel
3
- import transformers
4
- import gradio as gr
5
- import BLIPIntepret
6
- assert (
7
- "LlamaTokenizer" in transformers._import_structure["models.llama"]
8
- ), "LLaMA is now in HuggingFace's main branch.\nPlease reinstall it: pip uninstall transformers && pip install git+https://github.com/huggingface/transformers.git"
9
- from transformers import LlamaTokenizer, LlamaForCausalLM, GenerationConfig
10
-
11
- tokenizer = LlamaTokenizer.from_pretrained("decapoda-research/llama-7b-hf")
12
-
13
- BASE_MODEL = "decapoda-research/llama-7b-hf"
14
- LORA_WEIGHTS = "tloen/alpaca-lora-7b"
15
-
16
- if torch.cuda.is_available():
17
- device = "cuda"
18
- print('Using GPU')
19
- else:
20
- device = "cpu"
21
-
22
- try:
23
- if torch.backends.mps.is_available():
24
- device = "mps"
25
- except:
26
- pass
27
-
28
- if device == "cuda":
29
- model = LlamaForCausalLM.from_pretrained(
30
- BASE_MODEL,
31
- load_in_8bit=True,
32
- torch_dtype=torch.float16,
33
- device_map="auto",
34
- )
35
- model = PeftModel.from_pretrained(model, LORA_WEIGHTS, torch_dtype=torch.float16)
36
- elif device == "mps":
37
- model = LlamaForCausalLM.from_pretrained(
38
- BASE_MODEL,
39
- device_map={"": device},
40
- torch_dtype=torch.float16,
41
- )
42
- model = PeftModel.from_pretrained(
43
- model,
44
- LORA_WEIGHTS,
45
- device_map={"": device},
46
- torch_dtype=torch.float16,
47
- )
48
- else:
49
- model = LlamaForCausalLM.from_pretrained(
50
- BASE_MODEL, device_map={"": device}, low_cpu_mem_usage=True
51
- )
52
- model = PeftModel.from_pretrained(
53
- model,
54
- LORA_WEIGHTS,
55
- device_map={"": device},
56
- )
57
-
58
- BLIPmodel,BLIPprocessor = BLIPIntepret.init_BLIP(device)
59
- def generate_prompt(instruction, input=None, context = None):
60
- if context and input:
61
- print('Context and Input combined')
62
- return f"""Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
63
-
64
- ### Instruction:
65
- {context}
66
- {instruction}
67
-
68
- ### Input:
69
- {input}
70
-
71
- ### Response:"""
72
-
73
- elif input:
74
- print('Input only mode')
75
- return f"""Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
76
-
77
- ### Instruction:
78
- {instruction}
79
-
80
- ### Input:
81
- {input}
82
-
83
- ### Response:"""
84
- elif context:
85
- print('Context only mode')
86
- return f"""Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
87
-
88
- ### Instruction:
89
- {context}
90
- {instruction}
91
-
92
- ### Response:"""
93
-
94
- else:
95
- print('Instruction Mode')
96
- return f"""Below is an instruction that describes a task. Write a response that appropriately completes the request.
97
-
98
- ### Instruction:
99
- {instruction}
100
-
101
- ### Response:"""
102
-
103
-
104
- model.eval()
105
- if torch.__version__ >= "2":
106
- model = torch.compile(model)
107
-
108
-
109
-
110
-
111
- def evaluate(
112
- instruction,
113
- input=None,
114
- image = None,
115
- temperature=0.1,
116
- top_p=0.75,
117
- top_k=40,
118
- num_beams=4,
119
- max_new_tokens=128,
120
- **kwargs,
121
- ):
122
- if image is None:
123
- context = None
124
- else:
125
- context = BLIPIntepret.infer_BLIP2(BLIPmodel,BLIPprocessor, image, device)
126
- context+= '\nThe above are the context of an image that you will use alongside the response.'
127
- prompt = generate_prompt(instruction, input, context)
128
- inputs = tokenizer(prompt, return_tensors="pt")
129
- input_ids = inputs["input_ids"].to(device)
130
- generation_config = GenerationConfig(
131
- temperature=temperature,
132
- top_p=top_p,
133
- top_k=top_k,
134
- num_beams=num_beams,
135
- **kwargs,
136
- )
137
- with torch.no_grad():
138
- generation_output = model.generate(
139
- input_ids=input_ids,
140
- generation_config=generation_config,
141
- return_dict_in_generate=True,
142
- output_scores=True,
143
- max_new_tokens=max_new_tokens,
144
- )
145
- s = generation_output.sequences[0]
146
- output = tokenizer.decode(s)
147
- return output.split("### Response:")[1].strip()
148
-
149
-
150
- gr.Interface(
151
- fn=evaluate,
152
- inputs=[
153
- gr.components.Textbox(
154
- lines=2, label="Instruction", placeholder="Tell me about alpacas."
155
- ),
156
- gr.components.Textbox(lines=2, label="Input", placeholder="none"),
157
- gr.components.Image(shape = (200,200), placeholder = "Image"),
158
- gr.components.Slider(minimum=0, maximum=1, value=0.1, label="Temperature"),
159
- gr.components.Slider(minimum=0, maximum=1, value=0.75, label="Top p"),
160
- gr.components.Slider(minimum=0, maximum=100, step=1, value=40, label="Top k"),
161
- gr.components.Slider(minimum=1, maximum=4, step=1, value=4, label="Beams"),
162
- gr.components.Slider(
163
- minimum=1, maximum=2000, step=1, value=128, label="Max tokens"
164
- ),
165
- ],
166
- outputs=[
167
- gr.inputs.Textbox(
168
- lines=5,
169
- label="Output",
170
- )
171
- ],
172
- title="🦙🌲 BLLAMA",
173
- description="BLLAMA is a pipeline that uses both ALPACA-LORA as well as BLIP-2 to allow LLAMA to generate text in the context of simple images. You can visit the Github repo [here](https://github.com/DESU-CLUB/BLLAMA)\n\n\
174
- The original ALPACA-LORA can be found [here](https://github.com/tloen/alpaca-lora) and the BLIP-2 model can be found on huggingface.\
175
- \n## Credits\n\
176
- I would like to credit tloen, the creator of ALPACA-LORA, as well as huggingface for their own implementation of LLAMA and BLIP-2. \
177
- \nI would also like to credit the original creators of [LLAMA](https://github.com/facebookresearch/llama), Meta AI, as well as Stanford University, who created [ALPACA](https://github.com/tatsu-lab/stanford_alpaca)\
178
- ",
179
- ).launch()
180
-
181
- # Old testing code follows.
182
-
183
- """
184
- if __name__ == "__main__":
185
- # testing code for readme
186
- for instruction in [
187
- "Tell me about alpacas.",
188
- "Tell me about the president of Mexico in 2019.",
189
- "Tell me about the king of France in 2019.",
190
- "List all Canadian provinces in alphabetical order.",
191
- "Write a Python program that prints the first 10 Fibonacci numbers.",
192
- "Write a program that prints the numbers from 1 to 100. But for multiples of three print 'Fizz' instead of the number and for the multiples of five print 'Buzz'. For numbers which are multiples of both three and five print 'FizzBuzz'.",
193
- "Tell me five words that rhyme with 'shock'.",
194
- "Translate the sentence 'I have no mouth but I must scream' into Spanish.",
195
- "Count up from 1 to 500.",
196
- ]:
197
- print("Instruction:", instruction)
198
- print("Response:", evaluate(instruction))
199
- print()
200
- """