parquet-converter commited on
Commit
bc52a38
·
1 Parent(s): 9d49f17

Update parquet files (step 12 of 476)

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/1acneusushi/gradio-2dmoleculeeditor/data/Deep Freeze Standard Crack incl Serial key Download 2020 Tips and Tricks.md +0 -119
  2. spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Candy Crush Saga APK How to Unlock All Levels and Features.md +0 -121
  3. spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download 60 Seconds! Reatomized Mod APK with Unlimited Food and Water.md +0 -213
  4. spaces/1phancelerku/anime-remove-background/Angry Birds 2 MOD APK 3.10.0 Unlimited Money and Gems - HappyMod.md +0 -108
  5. spaces/1phancelerku/anime-remove-background/Coin Master MOD APK New Version 2022 Unlock All Levels Cards and Characters.md +0 -117
  6. spaces/2ndelement/voicevox/voicevox_engine/dev/core/__init__.py +0 -17
  7. spaces/801artistry/RVC801/infer/lib/uvr5_pack/lib_v5/nets_61968KB.py +0 -122
  8. spaces/ADOPLE/AdopleAI-Website-DocumentQA/app.py +0 -130
  9. spaces/AI-Zero-to-Hero/03-GR-AI-Text2ArtGenerator/app.py +0 -228
  10. spaces/AIGC-Audio/AudioGPT/NeuralSeq/modules/hifigan/mel_utils.py +0 -80
  11. spaces/ALSv/FSW/roop/processors/__init__.py +0 -0
  12. spaces/ATang0729/Forecast4Muses/Model/Model6/Model6_2_ProfileRecogition/mmpretrain/configs/.ipynb_checkpoints/resnext101_4xb16_1024e_4channel-checkpoint.py +0 -88
  13. spaces/Ababababababbababa/Ashaar/poetry_diacritizer/__init__.py +0 -1
  14. spaces/Adapter/CoAdapter/ldm/modules/encoders/__init__.py +0 -0
  15. spaces/Adr740/CV_XPLORER_POC/data.py +0 -4
  16. spaces/AfrodreamsAI/afrodreams/models/download_models.py +0 -31
  17. spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/circularprogresscanvas/Factory.js +0 -13
  18. spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/rotate/Factory.d.ts +0 -7
  19. spaces/AkitoP/umamusume_bert_vits2/bert/chinese-roberta-wwm-ext-large/README.md +0 -57
  20. spaces/AlanMars/QYL-AI-Space/modules/utils.py +0 -669
  21. spaces/Altinas/vits-uma-genshin-honkais/app.py +0 -124
  22. spaces/Amon1/ChatGPTForAcadamic/crazy_functions/批量总结PDF文档pdfminer.py +0 -151
  23. spaces/Amrrs/DragGan-Inversion/stylegan_human/interpolation.py +0 -155
  24. spaces/Amrrs/DragGan-Inversion/stylegan_human/stylemixing_video.py +0 -167
  25. spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/pipelines/score_sde_ve/test_score_sde_ve.py +0 -91
  26. spaces/Andy1621/uniformer_image_detection/mmdet/models/losses/iou_loss.py +0 -436
  27. spaces/Andy1621/uniformer_image_detection/mmdet/models/roi_heads/mask_heads/fcn_mask_head.py +0 -377
  28. spaces/AntX-ai/README/README.md +0 -13
  29. spaces/Arnaudding001/OpenAI_whisperLive/download.py +0 -72
  30. spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_internal/cli/main_parser.py +0 -134
  31. spaces/Banbri/zcvzcv/src/app/layouts/index.tsx +0 -370
  32. spaces/Bart92/RVC_HF/julius/core.py +0 -122
  33. spaces/Benson/text-generation/Examples/Bar Bar Din Ye Aaye Audio Cancin Mp3.md +0 -65
  34. spaces/Benson/text-generation/Examples/Descargar Gratis Pintura 3d Para Ventanas 7.md +0 -49
  35. spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/detectron2/utils/video_visualizer.py +0 -235
  36. spaces/CVPR/Dual-Key_Backdoor_Attacks/openvqa/openvqa/models/mmnasnet/net.py +0 -137
  37. spaces/CVPR/LIVE/thrust/thrust/remove.h +0 -806
  38. spaces/CVPR/LIVE/thrust/thrust/system/cpp/detail/remove.h +0 -23
  39. spaces/CVPR/LIVE/thrust/thrust/system/omp/detail/adjacent_difference.h +0 -50
  40. spaces/CVPR/monoscene_lite/monoscene/modules.py +0 -194
  41. spaces/ChandraMohanNayal/AutoGPT/autogpt/speech/macos_tts.py +0 -21
  42. spaces/CognitiveLabs/GPT-auto-webscraping/chains/code_generator/base.py +0 -19
  43. spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/fontTools/cffLib/__init__.py +0 -0
  44. spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/gradio/templates/frontend/assets/index-9fc2c1bb.js +0 -2
  45. spaces/DaFujaTyping/hf-Chat-ui/src/lib/types/UrlDependency.ts +0 -4
  46. spaces/Danielzero/GPT3.5/modules/config.py +0 -173
  47. spaces/DarkyMan/URPM/README.md +0 -14
  48. spaces/Datasculptor/StyleGAN-NADA/util.py +0 -136
  49. spaces/DeepLabCut/DeepLabCutModelZoo-SuperAnimals/dlc_utils.py +0 -32
  50. spaces/Dilmurat/bingo/Dockerfile +0 -7
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Deep Freeze Standard Crack incl Serial key Download 2020 Tips and Tricks.md DELETED
@@ -1,119 +0,0 @@
1
- <br />
2
- <h1>Deep Freeze Standard Crack incl Serial key Download 2020</h1>
3
- <p>Are you looking for a way to protect your computer from unwanted changes, viruses, and other threats? Do you want to keep your system running smoothly and efficiently without spending hours on maintenance and troubleshooting? If yes, then you need Deep Freeze Standard, a powerful software that can freeze your system and restore it to a clean state with a simple reboot. In this article, we will tell you what Deep Freeze Standard is, what features it offers, how to download and install it, and how to use it. Read on to find out more.</p>
4
- <h2>What is Deep Freeze Standard?</h2>
5
- <p>Deep Freeze Standard is a software that helps you preserve your system configuration and data by freezing your hard drives or partitions. This means that any changes made to your system, whether intentional or accidental, will be erased when you restart your computer. This way, you can prevent malware infections, system crashes, software conflicts, and other problems that can affect your system performance and security. Deep Freeze Standard is ideal for home users, students, and small businesses who want to keep their computers in optimal condition without spending too much time and money on IT support.</p>
6
- <h2>Deep Freeze Standard Crack incl Serial key Download 2020</h2><br /><p><b><b>Download File</b> &#9881; <a href="https://byltly.com/2uKwFJ">https://byltly.com/2uKwFJ</a></b></p><br /><br />
7
- <h3>Features of Deep Freeze Standard</h3>
8
- <p>Deep Freeze Standard offers many features that make it a reliable and convenient solution for system protection. Here are some of them:</p>
9
- <h4>Protects your system from malware and ransomware</h4>
10
- <p>With Deep Freeze Standard, you don't have to worry about viruses, worms, trojans, spyware, adware, ransomware, or any other malicious software that can harm your system and data. Even if your system gets infected by malware, you can easily get rid of it by rebooting your computer. Deep Freeze Standard will erase all the traces of malware and restore your system to its original state.</p>
11
- <h4>Restores your system to a pristine state with a simple reboot</h4>
12
- <p>Deep Freeze Standard allows you to undo any changes made to your system with a simple reboot. Whether you install new software, update drivers, modify settings, delete files, or make any other alterations to your system, you can revert them all by restarting your computer. Deep Freeze Standard will wipe out all the changes and bring back your system to the way it was before.</p>
13
- <h4>Saves your time and money by reducing IT support costs</h4>
14
- <p>With Deep Freeze Standard, you can save yourself from the hassle of troubleshooting and fixing various system issues that can arise due to user errors, software glitches, hardware failures, or external attacks. You don't have to waste your time on scanning for viruses, repairing registry errors, defragmenting disks, or restoring corrupted files. You also don't have to spend money on hiring IT professionals or buying expensive antivirus software or backup tools. Deep Freeze Standard will take care of everything for you.</p>
15
- <h3>How to download and install Deep Freeze Standard?</h3>
16
- <p>If you want to download and install Deep Freeze Standard on your computer, you can follow these easy steps:</p>
17
- <h4>Download the setup file from the official website or a trusted source</h4>
18
- <p>The first thing you need to do is to download the setup file of Deep Freeze Standard from its official website or a trusted source. You can find the link below:</p>
19
- <p><a href="https://www.faronics.com/products/deep-freeze/standard">https://www.faronics.com/products/deep-freeze/standard</a></p>
20
- <p>How to get Deep Freeze Standard Crack with Serial key for free<br />
21
- Deep Freeze Standard Crack + Serial key full version download<br />
22
- Download Deep Freeze Standard Crack and Serial key 2020 latest<br />
23
- Deep Freeze Standard Crack Serial key activation code generator<br />
24
- Deep Freeze Standard Crack Serial key license key free download<br />
25
- Deep Freeze Standard Crack Serial key torrent download link<br />
26
- Deep Freeze Standard Crack Serial key patch download 2020<br />
27
- Deep Freeze Standard Crack Serial key registration key online<br />
28
- Deep Freeze Standard Crack Serial key product key crack<br />
29
- Deep Freeze Standard Crack Serial key keygen download 2020<br />
30
- Deep Freeze Standard Crack with Serial key review and features<br />
31
- Deep Freeze Standard Crack with Serial key system requirements and compatibility<br />
32
- Deep Freeze Standard Crack with Serial key installation guide and tutorial<br />
33
- Deep Freeze Standard Crack with Serial key troubleshooting and support<br />
34
- Deep Freeze Standard Crack with Serial key pros and cons comparison<br />
35
- Deep Freeze Standard Crack with Serial key alternative software download<br />
36
- Deep Freeze Standard Crack with Serial key discount coupon code offer<br />
37
- Deep Freeze Standard Crack with Serial key free trial download link<br />
38
- Deep Freeze Standard Crack with Serial key update and upgrade download<br />
39
- Deep Freeze Standard Crack with Serial key user manual and documentation<br />
40
- Deep Freeze Standard Crack with Serial key video demo and walkthrough<br />
41
- Deep Freeze Standard Crack with Serial key customer testimonials and feedback<br />
42
- Deep Freeze Standard Crack with Serial key FAQs and tips<br />
43
- Deep Freeze Standard Crack with Serial key blog posts and articles<br />
44
- Deep Freeze Standard Crack with Serial key forum discussions and comments<br />
45
- Deep Freeze Standard Crack with Serial key social media mentions and shares<br />
46
- Deep Freeze Standard Crack with Serial key YouTube videos and playlists<br />
47
- Deep Freeze Standard Crack with Serial key podcasts and audio files<br />
48
- Deep Freeze Standard Crack with Serial key ebooks and PDFs download<br />
49
- Deep Freeze Standard Crack with Serial key infographics and images download<br />
50
- Deep Freeze Standard Crack with Serial key slideshare presentations and slides download<br />
51
- Deep Freeze Standard Crack with Serial key webinars and online courses download<br />
52
- Deep Freeze Standard Crack with Serial key case studies and success stories download<br />
53
- Deep Freeze Standard Crack with Serial key white papers and reports download<br />
54
- Deep Freeze Standard Crack with Serial key press releases and news articles download<br />
55
- Deep Freeze Standard Crack with Serial key awards and recognition download<br />
56
- Deep Freeze Standard Crack with Serial key affiliate program and referral link download<br />
57
- Deep Freeze Standard Crack with Serial key reseller program and partner link download<br />
58
- Deep Freeze Standard Crack with Serial key developer program and API link download<br />
59
- Deep Freeze Standard Crack with Serial key giveaway and contest link download<br />
60
- Download 2020 latest version of Deep Freeze Standard + crack serial keys <br />
61
- How to crack serial keys for deep freeze standard software 2020 <br />
62
- Best site to download deep freeze standard crack serial keys 2020 <br />
63
- Where to find deep freeze standard crack serial keys for free 2020 <br />
64
- How to use deep freeze standard crack serial keys to activate software 2020 <br />
65
- Benefits of using deep freeze standard crack serial keys for PC protection 2020 <br />
66
- Risks of using deep freeze standard crack serial keys for PC protection 2020 <br />
67
- How to uninstall deep freeze standard crack serial keys from PC 2020 <br />
68
- How to backup deep freeze standard crack serial keys before uninstalling 2020 <br />
69
- How to restore deep freeze standard crack serial keys after uninstalling 2020</p>
70
- <p>Make sure you download the correct version for your operating system (Windows 10/8.1/8/7/Vista/XP) and architecture (32-bit or 64-bit).</p>
71
- <h4>Run the setup file and follow the instructions on the screen</h4>
72
- <p>The next thing you need to do is to run the setup file that you downloaded and follow the instructions on the screen. You will be asked to accept the license agreement, choose the installation folder, select the components to install, and enter some information such as your name and email address.</p>
73
- <h4>Enter the serial key when prompted to activate the full version</h4>
74
- <p>The last thing you need to do is to enter the serial key when prompted to activate the full version of Deep Freeze Standard. You can find the serial key below:</p>
75
- <p><code>D37D-E6ED-64FF-9B2A-BFBD-9EA6-A50C-6C88</code></p>
76
- <p>This serial key will unlock all the features of Deep Freeze Standard and allow you to use it without any limitations.</p>
77
- <h3>How to use Deep Freeze Standard?</h3>
78
- <p>Once you have installed and activated Deep Freeze Standard on your computer, you can start using it right away. Here are some basic steps on how to use it:</p>
79
- <h4>Select the drives or partitions you want to freeze</h4>
80
- <p>The first thing you need to do is to select the drives or partitions that you want to freeze with Deep Freeze Standard. You can do this by opening the Deep Freeze Configuration Administrator from the Start menu or desktop shortcut. You will see a list of all the available drives or partitions on your computer. You can check or uncheck them according to your preference. You can also choose whether you want to freeze them permanently or temporarily (thawed).</p>
81
- <h4>Configure the settings and options according to your preferences</h4>
82
- <p>The next thing you need to do is to configure the settings and options of Deep Freeze Standard according to your preferences. You can do this by clicking on the Settings button in the Configuration Administrator window. You will see various tabs such as General Settings, Boot Control, Passwords, Workstation Tasks, etc. You can adjust them as per your needs. For example, you can set a password for accessing or changing Deep Freeze settings, schedule automatic updates or maintenance tasks for thawed periods, enable stealth mode for hiding Deep Freeze icon from system tray and notifications area etc.</p>
83
- <h4>Reboot your system to apply the changes</h4>
84
- <p>The last thing you need to do is to reboot your system to apply the changes that you made with Deep Freeze Standard. You can do this by clicking on the Reboot button in the Configuration Administrator window or by using the normal Windows restart option. Once your system reboots, it will be frozen and protected by Deep Freeze Standard. You will see a small blue bear icon in the system tray and notifications area indicating that Deep Freeze is active.</p>
85
- <h4>Enjoy a worry-free computing experience with Deep Freeze Standard</h4>
86
- <p>Now that you have used Deep Freeze Standard on your computer, you can enjoy a worry-free computing experience. You don't have to worry about any unwanted changes, viruses, or other threats that can affect your system performance and security. You can use your computer as normal, install new software, update drivers, modify settings, delete files, or make any other alterations to your system. But remember, all these changes will be erased when you restart your computer. Your system will be restored to its original state, the way it was before. If you want to make any permanent changes, you have to thaw your drives or partitions first, then make the changes, and then freeze them again.</p>
87
- <h2>Conclusion</h2>
88
- <p>In conclusion, Deep Freeze Standard is a powerful software that can freeze your system and restore it to a clean state with a simple reboot. It offers many features that make it a reliable and convenient solution for system protection. It protects your system from malware and ransomware, restores your system to a pristine state with a simple reboot, and saves your time and money by reducing IT support costs. You can download and install Deep Freeze Standard easily by following the steps given in this article. You can also use Deep Freeze Standard easily by selecting the drives or partitions you want to freeze, configuring the settings and options according to your preferences, rebooting your system to apply the changes, <p>enjoying a worry-free computing experience with Deep Freeze Standard. We hope this article was helpful and informative for you. If you have any questions or feedback, please feel free to leave a comment below.</p>
89
- <h2>FAQs</h2>
90
- <p>Here are some frequently asked questions about Deep Freeze Standard:</p>
91
- <table>
92
- <tr>
93
- <th>Question</th>
94
- <th>Answer</th>
95
- </tr>
96
- <tr>
97
- <td>Is Deep Freeze Standard compatible with Windows 10?</td>
98
- <td>Yes, Deep Freeze Standard is compatible with Windows 10 and other versions of Windows such as 8.1, 8, 7, Vista, and XP.</td>
99
- </tr>
100
- <tr>
101
- <td>How much disk space does Deep Freeze Standard require?</td>
102
- <td>Deep Freeze Standard requires a minimum of 10% free hard disk space on the drives or partitions that you want to freeze.</td>
103
- </tr>
104
- <tr>
105
- <td>How can I uninstall Deep Freeze Standard from my computer?</td>
106
- <td>To uninstall Deep Freeze Standard from your computer, you have to thaw all the drives or partitions that you have frozen first. Then, you can use the Windows Control Panel or the Deep Freeze Configuration Administrator to uninstall the software.</td>
107
- </tr>
108
- <tr>
109
- <td>Can I use Deep Freeze Standard on multiple computers?</td>
110
- <td>Yes, you can use Deep Freeze Standard on multiple computers with a single license. However, you have to activate the software on each computer separately using the same serial key.</td>
111
- </tr>
112
- <tr>
113
- <td>What is the difference between Deep Freeze Standard and Deep Freeze Enterprise?</td>
114
- <td>Deep Freeze Standard is designed for home users, students, and small businesses who want to protect their individual computers. Deep Freeze Enterprise is designed for large organizations and enterprises who want to manage and protect multiple computers across a network.</td>
115
- </tr>
116
- </table>
117
- </p> 0a6ba089eb<br />
118
- <br />
119
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Candy Crush Saga APK How to Unlock All Levels and Features.md DELETED
@@ -1,121 +0,0 @@
1
-
2
- <h1>Candy Crush Saga APK Unlimited: How to Download and Play the Best Match-Three Game Ever</h1>
3
- <h2>Introduction</h2>
4
- <p>If you are looking for a fun and addictive match-three game to play on your mobile device, you have probably heard of Candy Crush Saga. This game has been one of the most popular and successful games in the genre, with millions of players around the world. But did you know that you can download and play Candy Crush Saga APK unlimited, which gives you access to all the features and levels of the game without any restrictions? In this article, we will show you how to download and install Candy Crush Saga APK unlimited, and how to play and enjoy this amazing game.</p>
5
- <h2>candy crush saga apk unlimited</h2><br /><p><b><b>Download File</b> &#9733;&#9733;&#9733; <a href="https://urlin.us/2uT14X">https://urlin.us/2uT14X</a></b></p><br /><br />
6
- <h3>What is Candy Crush Saga?</h3>
7
- <p>Candy Crush Saga is a match-three puzzle game developed by King, a leading mobile game developer. The game was released in 2012 and has since become a global phenomenon, with over a billion downloads and hundreds of millions of active players. The game is available for free on Android, iOS, Windows Phone, and Facebook platforms.</p>
8
- <p>The game is simple but challenging. You have to match three or more candies of the same color to clear them from the board and score points. You have to complete different objectives and goals in each level, such as reaching a certain score, clearing jelly or chocolate, collecting ingredients, or freeing animals. You have a limited number of moves or time to complete each level, so you have to plan your moves carefully and use strategy. The game has thousands of levels, each with different layouts, obstacles, and features. The game also has various game modes, such as classic, timed, order, mixed, ingredients, jelly, chocolate, candy order, rainbow rapids, and more.</p>
9
- <h3>Why download Candy Crush Saga APK unlimited?</h3>
10
- <p>While Candy Crush Saga is free to play, it also has some limitations and drawbacks that can affect your gaming experience. For example, you have to wait for lives to refill before you can play again if you fail a level. You also have to deal with annoying ads that pop up every now and then. Moreover, some levels are very hard to beat without using boosters or extra moves, which cost real money to buy.</p>
11
- <p>That's why downloading Candy Crush Saga APK unlimited is a great idea. This is a modified version of the game that gives you unlimited lives, moves, boosters, gold bars, and access to all the levels and features of the game. You don't have to worry about running out of lives or moves, or spending money on in-app purchases. You can play as much as you want, whenever you want, and enjoy the game to the fullest.</p>
12
- <h2>How to download and install Candy Crush Saga APK unlimited</h2>
13
- <p>Downloading and installing Candy Crush Saga APK unlimited is easy and fast. Just follow these simple steps:</p>
14
- <h3>Step 1: Find a reliable source</h3>
15
- <p>The first thing you need to do is find a reliable source that offers Candy Crush Saga APK unlimited for download. There are many websites that claim to provide this file, but not all of them are safe or trustworthy. Some of them may contain viruses or malware that can harm your device or steal your personal information. Some of them may also provide fake or outdated files that don't work properly.</p>
16
- <p>candy crush saga mod apk unlimited lives and boosters<br />
17
- candy crush saga hack apk unlimited moves and gold<br />
18
- candy crush saga latest version apk unlimited everything<br />
19
- candy crush saga apk download unlimited all levels unlocked<br />
20
- candy crush saga free apk unlimited lollipop hammer<br />
21
- candy crush saga cracked apk unlimited time<br />
22
- candy crush saga premium apk unlimited money and stars<br />
23
- candy crush saga full apk unlimited switch and bomb<br />
24
- candy crush saga cheat apk unlimited jelly and fish<br />
25
- candy crush saga pro apk unlimited tickets and wheel spins<br />
26
- candy crush saga mega mod apk unlimited power ups and extra moves<br />
27
- candy crush saga unlocked apk unlimited charms and episodes<br />
28
- candy crush saga offline apk unlimited play without internet<br />
29
- candy crush saga original apk unlimited fun and challenges<br />
30
- candy crush saga updated apk unlimited new features and events<br />
31
- candy crush saga old version apk unlimited nostalgia and memories<br />
32
- candy crush saga android apk unlimited compatibility and performance<br />
33
- candy crush saga ios apk unlimited access and support<br />
34
- candy crush saga pc apk unlimited screen size and resolution<br />
35
- candy crush saga online apk unlimited multiplayer and social interaction<br />
36
- candy crush soda saga apk unlimited soda and candies<br />
37
- candy crush jelly saga apk unlimited jelly and bosses<br />
38
- candy crush friends saga apk unlimited friends and costumes<br />
39
- candy crush dreamworld saga apk unlimited dreamworld and odus<br />
40
- candy crush farm heroes saga apk unlimited farm heroes and cropsies<br />
41
- download candy crush saga mod apk unlimited for free<br />
42
- install candy crush saga hack apk unlimited without root<br />
43
- update candy crush saga latest version apk unlimited easily<br />
44
- play candy crush saga full apk unlimited with no ads<br />
45
- enjoy candy crush saga premium apk unlimited with no bugs<br />
46
- how to get candy crush saga cracked apk unlimited safely<br />
47
- where to find candy crush saga pro apk unlimited legally<br />
48
- when to use candy crush saga mega mod apk unlimited effectively<br />
49
- why to choose candy crush saga unlocked apk unlimited over others<br />
50
- what to do with candy crush soda saga mod apk unlimited rewards<br />
51
- tips and tricks for candy crush jelly saga hack apk unlimited gameplay<br />
52
- guides and walkthroughs for candy crush friends saga latest version apk unlimited levels<br />
53
- reviews and ratings for candy crush dreamworld saga full apk unlimited experience<br />
54
- news and updates for candy crush farm heroes saga premium apk unlimited content</p>
55
- <p>One of the best sources that we recommend is [APKdone](^1^), a website that provides high-quality APK files for various games and apps. This website is secure, fast, and easy to use. You can download Candy Crush Saga APK unlimited from this website by clicking on this [link](^1^).</p>
56
- <h3>Step 2: <h3>Step 2: Enable unknown sources</h3>
57
- <p>The next thing you need to do is enable unknown sources on your device. This is a security setting that allows you to install apps from sources other than the official Google Play Store. Since Candy Crush Saga APK unlimited is not available on the Play Store, you need to enable this option to install it.</p>
58
- <p>To enable unknown sources, go to your device's settings and look for the security or privacy section. There, you will find an option to allow installation of apps from unknown sources. Tap on it and toggle it on. You may see a warning message that tells you about the risks of installing apps from unknown sources. Tap on OK or Continue to proceed.</p>
59
- <h3>Step 3: Download and install the APK file</h3>
60
- <p>The final step is to download and install the APK file of Candy Crush Saga APK unlimited. To do this, go back to the website where you downloaded the file and tap on it. You will see a download progress bar on your screen. Wait for the download to finish and then tap on the file again. You will see a prompt asking you if you want to install the app. Tap on Install and wait for the installation to complete. You may see another prompt asking you if you want to open the app or done. Tap on Open to launch the game.</p>
61
- <p>Congratulations! You have successfully downloaded and installed Candy Crush Saga APK unlimited on your device. You can now enjoy playing this awesome game with unlimited lives, moves, boosters, gold bars, and access to all the levels and features.</p>
62
- <h2>How to play Candy Crush Saga APK unlimited</h2>
63
- <p>Now that you have Candy Crush Saga APK unlimited on your device, you may be wondering how to play it. Don't worry, we will guide you through the basics of the game and give you some tips and tricks to master it.</p>
64
- <h3>The basics of the game</h3>
65
- <p>The game is very easy to play. All you have to do is swipe your finger on the screen to match three or more candies of the same color. When you match candies, they will disappear from the board and new ones will fall from above. You will also score points for each match you make.</p>
66
- <p>Each level has a different objective and goal that you have to complete within a limited number of moves or time. For example, some levels require you to reach a certain score, while others require you to clear jelly or chocolate from the board, collect ingredients, or free animals. You can see your objective and goal at the top of the screen before you start each level.</p>
67
- <p>If you complete the level's objective and goal, you will pass the level and move on to the next one. You will also earn stars based on how well you performed. The more stars you earn, the better your rating will be. If you fail to complete the level's objective and goal, you will lose a life and have to try again. You have five lives in total, which refill over time or can be refilled instantly by using gold bars.</p>
68
- <h3>The different game modes</h3>
69
- <p>Candy Crush Saga has various game modes that add variety and challenge to the game. Each game mode has its own rules and features that make it unique and fun. Here are some of the game modes that you can encounter in Candy Crush Saga:</p>
70
- <ul>
71
- <li><b>Classic:</b> This is the most common and basic game mode in Candy Crush Saga. In this mode, you just have to match candies and reach a certain score within a limited number of moves.</li>
72
- <li><b>Timed:</b> This is similar to classic mode, but with a twist. In this mode, you have a limited amount of time instead of moves to reach a certain score. You can extend your time by making matches or using boosters.</li>
73
- <li><b>Order:</b> This is a game mode where you have to collect a specific number of candies or candy combinations within a limited number of moves. For example, you may have to collect 10 striped candies or 5 wrapped candies.</li>
74
- <li><b>Mixed:</b> This is a game mode where you have to complete two or more different objectives within a limited number of moves. For example, you may have to reach a certain score and clear jelly from the board.</li>
75
- <li><b>Ingredients:</b> This is a game mode where you have to bring down ingredients such as cherries or hazelnuts from the top of the board to the bottom within a limited number of moves. You can see how many ingredients you need to collect at the top of the screen.</li>
76
- <li><b>Jelly:</b> This is a game mode where you have to clear jelly from the board by matching candies on top of it within a limited number of moves. Jelly can be single-layered or double-layered, meaning you have to match candies on top of it twice to clear it. Some jelly can also be covered by blockers such as chocolate or licorice.</li>
77
- <li><b>Chocolate:</b> This is a game mode where you have to clear chocolate from the board by matching candies next to it within a limited number of moves. Chocolate can spread and cover more candies if you don't clear it quickly. Some chocolate can also be protected by chocolate spawners, which produce more chocolate every few moves.</li>
78
- <li><b>Candy order:</b> This is a game mode where you have to collect a specific number of candy orders within a limited number of moves. Candy orders are special combinations of candies that you have to create by matching them. For example, you may have to create a striped candy + wrapped candy combination or a color bomb + color bomb combination.</li>
79
- <li><b>Rainbow rapids:</b> This is a game mode where you have to fill the rainbow rapids with colorful soda by matching candies within a limited number of moves. The rainbow rapids are pipes that connect different parts of the board. You have to match candies of the same color as the soda in the pipes to fill them up.</li>
80
- </ul>
81
- <h3>The special candies and boosters</h3>
82
- <p>Candy Crush Saga has various special candies and boosters that can help you complete the levels faster and easier. Special candies are created by matching more than three candies of the same color in different patterns. Boosters are items that you can use before or during the game to enhance your gameplay. Here are some of the special candies and boosters that you can encounter in Candy Crush Saga:</p>
83
- <ul>
84
- <li><b>Striped candy:</b> This is created by matching four candies of the same color in a row or column. When you activate it, it will clear an entire row or column of candies, depending on its orientation.</li>
85
- <li><b>Wrapped candy:</b> This is created by matching five candies of the same color in an L or T shape. When you activate it, it will explode twice and clear a 3x3 area of candies around it.</li>
86
- <li><b>Color bomb:</b> This is created by matching five candies of the same color in a row or column. When you activate it, it will explode and clear all the candies of the same color as the one you swap it with.</li>
87
- <li><b>Fish candy:</b> This is created by matching four candies of the same color in a square shape. When you activate it, it will swim to a random candy on the board and clear it. Fish candies are especially useful for clearing isolated or hard-to-reach candies.</li>
88
- <li><b>Lollipop hammer:</b> This is a booster that you can use before or during the game to smash any candy on the board. You can use it to clear blockers, jelly, chocolate, or any other obstacle that is preventing you from completing the level.</li>
89
- <li><b>Free switch:</b> This is a booster that you can use before or during the game to switch any two adjacent candies on the board without using a move. You can use it to create special candies, clear blockers, or complete candy orders.</li>
90
- <li><b>Sweet teeth:</b> This is a booster that you can use before or during the game to clear all the chocolate on the board. You can use it to prevent chocolate from spreading and covering more candies.</li>
91
- <li><b>Extra moves:</b> This is a booster that you can use before or during the game to add five extra moves to your current level. You can use it to complete the level's objective and goal if you are running out of moves.</li>
92
- </ul>
93
- <h3>The tips and tricks to master the game</h3>
94
- <p>Candy Crush Saga is a game that requires skill, strategy, and luck. While there is no definitive way to win every level, there are some tips and tricks that can help you improve your chances of success. Here are some of them:</p>
95
- <ul>
96
- <li><b>Plan your moves ahead:</b> Before you make any move, look at the board and see if you can create any special candies or combinations that can help you clear more candies or complete your objective. Also, try to predict how the board will change after your move and see if you can create any cascades or chain reactions that can score more points or clear more obstacles.</li>
97
- <li><b>Focus on your objective:</b> Don't get distracted by scoring points or clearing unnecessary candies. Always keep an eye on your objective and goal and focus on completing them as soon as possible. For example, if your objective is to collect ingredients, don't waste your moves on clearing jelly or chocolate that are not blocking your ingredients.</li>
98
- <li><b>Use special candies and boosters wisely:</b> Special candies and boosters are very helpful and powerful, but they are also limited and costly. Don't use them randomly or unnecessarily. Save them for the levels that are hard or tricky, and use them at the right time and place. For example, don't use a lollipop hammer to clear a single candy when you can use a striped candy to clear a whole row or column.</li>
99
- <li><b>Learn from your mistakes:</b> Sometimes, you may fail a level or get stuck on a difficult one. Don't get frustrated or give up. Instead, try to learn from your mistakes and see what you can do better next time. Analyze your moves and see where you went wrong or what you missed. Try a different strategy or approach and see if it works better.</li>
100
- <li><b>Have fun:</b> The most important tip of all is to have fun while playing Candy Crush Saga. Don't take the game too seriously or stress yourself out over it. Enjoy the colorful graphics, the catchy music, the cute characters, and the satisfying gameplay. Remember, it's just a game and it's meant to entertain you and make you happy.</li>
101
- </ul>
102
- <h2>Conclusion</h2>
103
- <p>Candy Crush Saga is one of the best match-three games ever created. It has everything you need for a fun and addictive gaming experience: a simple but challenging gameplay, a variety of game modes and levels, a lot of special candies and boosters, and a lot of rewards and surprises. And with Candy Crush Saga APK unlimited, you can enjoy all these features without any limitations or restrictions.</p>
104
- <p>If you want to download and play Candy Crush Saga APK unlimited, just follow the steps we have outlined in this article. Find a reliable source, enable unknown sources, download and install the APK file, and start playing. You will be amazed by how much more fun and exciting the game becomes with unlimited lives, moves, boosters, gold bars, and access to all the levels and features.</p>
105
- <p>So what are you waiting for? Download Candy Crush Saga APK unlimited today and join the millions of players who are already hooked on this amazing game. You won't regret it!</p>
106
- <h3>FAQs</h3>
107
- <p>Here are some of the frequently asked questions about Candy Crush Saga APK unlimited:</p>
108
- <ul>
109
- <li><b>Q: Is Candy Crush Saga APK unlimited safe to download and install?</b></li>
110
- <li><b>A: Yes, as long as you download it from a reliable source like APKdone. This website provides high-quality APK files that are free of viruses or malware. However, you should always be careful when downloading any file from the internet and scan it with an antivirus program before installing it.</b></li>
111
- <li><b>Q: Will I lose my progress or data if I download Candy Crush Saga APK unlimited?</b></li>
112
- <li><b>A: No, you won't lose your progress or data if you download Candy Crush Saga APK unlimited. The game will sync your progress and data with your Facebook account or Google Play Games account, so you can continue playing where you left off on any device. However, you should always backup your data before installing any new app or file on your device.</b></li>
113
- <li><b>Q: Will I get banned or penalized if I play Candy Crush Saga APK unlimited?</b></li>
114
- <li><b>A: No, you won't get banned or penalized if you play Candy Crush Saga APK unlimited. The game doesn't have any anti-cheat system or mechanism that can detect or prevent you from playing the modified version of the game. However, you should always play fair and respect the rules and terms of service of the game.</b></li>
115
- <li><b>Q: Can I play Candy Crush Saga APK unlimited offline?</b></li>
116
- <li><b>A: Yes, you can play Candy Crush Saga APK unlimited offline. The game doesn't require an internet connection to run or function properly. However, some features of the game may not be available or updated when you play offline, such as leaderboards, events, quests, or social features.</b></li>
117
- <li><b>Q: Can I play Candy Crush Saga APK unlimited with my friends?</b></li>
118
- <li><b>A: Yes, you can play Candy Crush Saga APK unlimited with your friends. The game has a lot of social features that allow you to connect and interact with your friends who also play the game. You can send and receive lives, moves, boosters, gold bars, messages, invitations, challenges, gifts, and more. You can also compete with them on the leaderboards and see who is the best player among your friends.</b></li>
119
- </ul></p> 197e85843d<br />
120
- <br />
121
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download 60 Seconds! Reatomized Mod APK with Unlimited Food and Water.md DELETED
@@ -1,213 +0,0 @@
1
-
2
- <h1>60 Seconds Reatomized APK Hack: How to Survive the Nuclear Apocalypse with Unlimited Resources</h1>
3
- <p>Have you ever wondered what it would be like to live in a post-apocalyptic world? How would you cope with the dangers of radiation, mutants, raiders, and starvation? How would you protect your family and make tough choices that could mean life or death?</p>
4
- <h2>60 seconds reatomized apk hack</h2><br /><p><b><b>Download File</b> >>> <a href="https://urlin.us/2uSVVE">https://urlin.us/2uSVVE</a></b></p><br /><br />
5
- <p>If you are looking for a game that can answer these questions in a humorous and thrilling way, then you should check out <strong>60 Seconds Reatomized</strong>, a remastered edition of the classic atomic adventure game. In this game, you have to scavenge for supplies, build a shelter, and survive the aftermath of a nuclear war.</p>
6
- <p>But what if you want to enjoy the game without worrying about the harsh realities of survival? What if you want to have unlimited resources and features that can make your life easier and more fun? Well, then you should try out <strong>60 Seconds Reatomized APK Hack</strong>, a modified version of the game that gives you everything you need to survive and more.</p>
7
- <p>In this article, we will tell you everything you need to know about 60 Seconds Reatomized APK Hack, including what it is, how to download and install it, how to play it, what are its benefits and risks, and some frequently asked questions. Let's get started!</p>
8
- <h2>What is 60 Seconds Reatomized?</h2>
9
- <h3>A remastered edition of the classic atomic adventure game</h3>
10
- <p>60 Seconds Reatomized is a game developed by Robot Gentleman, a Polish indie studio that specializes in creating dark comedy games. It is a remastered edition of their previous game, 60 Seconds!, which was released in 2015.</p>
11
- <p>The game is set in an alternate history where the Cold War has escalated into a nuclear war between the United States and the Soviet Union. You play as Ted, a suburban dad who has to collect items and family members in 60 seconds before a nuclear bomb hits his neighborhood. Then, you have to manage your resources and make decisions in your fallout shelter while dealing with random events and challenges.</p>
12
- <p>60 seconds reatomized mod apk unlimited money<br />
13
- 60 seconds reatomized apk download for android<br />
14
- 60 seconds reatomized hack version free download<br />
15
- 60 seconds reatomized cheats codes android<br />
16
- 60 seconds reatomized mod apk latest version<br />
17
- 60 seconds reatomized apk obb data download<br />
18
- 60 seconds reatomized hack tool online<br />
19
- 60 seconds reatomized mod menu apk android<br />
20
- 60 seconds reatomized apk full unlocked<br />
21
- 60 seconds reatomized hack no verification<br />
22
- 60 seconds reatomized mod apk all characters<br />
23
- 60 seconds reatomized apk revdl<br />
24
- 60 seconds reatomized hack apk ios<br />
25
- 60 seconds reatomized mod apk rexdl<br />
26
- 60 seconds reatomized apk pure download<br />
27
- 60 seconds reatomized hack generator<br />
28
- 60 seconds reatomized mod apk no root<br />
29
- 60 seconds reatomized apk uptodown<br />
30
- 60 seconds reatomized hack apk mediafıre<br />
31
- 60 seconds reatomized mod apk happymod<br />
32
- 60 seconds reatomized apk moddroid<br />
33
- 60 seconds reatomized hack online<br />
34
- 60 seconds reatomized mod apk offline<br />
35
- 60 seconds reatomized apk apkpure<br />
36
- 60 seconds reatomized hack without human verification<br />
37
- 60 seconds reatomized mod apk unlimited food and water<br />
38
- 60 seconds reatomized apk android oyun club<br />
39
- 60 seconds reatomized hack ios download<br />
40
- 60 seconds reatomized mod apk android republic<br />
41
- 60 seconds reatomized apk an1.com<br />
42
- 60 seconds reatomized hack app download<br />
43
- 60 seconds reatomized mod apk god mode<br />
44
- 60 seconds reatomized apk mob.org<br />
45
- 60 seconds reatomized hack no survey<br />
46
- 60 seconds reatomized mod apk platinmods</p>
47
- <p>The game features four different modes:</p>
48
- <ul>
49
- <li><strong>Atomic Drill</strong>: A tutorial mode that teaches you how to play the game.</li>
50
- <li><strong>Apocalypse</strong>: The main mode where you have to scavenge for items and family members in 60 seconds before the blast.</li>
51
- <li><strong>Survival</strong>: The mode where you have to manage your resources and make decisions in the shelter.</li>
52
- <li><strong>Scavenge</strong>: The mode where you can explore the wasteland and encounter random events.</li>
53
- </ul>
54
- <p>The game also has different difficulty levels, ranging from easy to hard, and multiple endings, depending on your choices and actions. The game is full of dark humor, quirky characters, and unexpected twists that will keep you entertained and engaged.</p>
55
- <h3>A dark comedy game with multiple endings and challenges</h3>
56
- <p>60 Seconds Reatomized is not your typical survival game. It is a game that combines elements of strategy, simulation, adventure, and comedy. It is a game that will make you laugh, cry, and scream as you face the consequences of your decisions.</p>
57
- <p>The game has a lot of replay value, as each playthrough will be different depending on the items and family members you collect, the events and challenges you encounter, and the choices you make. The game has over 1000 unique events and 1000 unique endings that will keep you surprised and curious.</p>
58
- <p>The game also has a lot of achievements and challenges that will test your skills and creativity. For example, you can try to survive with only one family member, or with only one item, or with no items at all. You can also try to unlock all the characters, modes, and endings that the game has to offer.</p>
59
- <h2>What is 60 Seconds Reatomized APK Hack?</h2>
60
- <h3>A modified version of the game that gives you unlimited resources and features</h3>
61
- <p>60 Seconds Reatomized APK Hack is a modified version of the original game that gives you access to unlimited resources and features that are not available in the official version. It is a hack that allows you to enjoy the game without worrying about scavenging, rationing, and surviving.</p>
62
- <p>An APK file is an Android application package file that contains all the files and data needed to install an app on an Android device. A hack is a modification or alteration of an app that changes its functionality or appearance. By downloading and installing an APK hack file, you can bypass the restrictions and limitations imposed by the app developers or the Google Play Store.</p>
63
- <h3>A way to enjoy the game without worrying about scavenging, rationing, and surviving</h3>
64
- <p>60 Seconds Reatomized APK Hack is a way to enjoy the game without worrying about the harsh realities of survival. It is a way to have fun and experiment with different scenarios and outcomes without facing any consequences.</p>
65
- <p>With 60 Seconds Reatomized APK Hack, you can have unlimited water, food, ammo, and medkits in your shelter. You can also have unlocked characters, modes, and achievements in your game. You can also enjoy improved graphics, sound, and performance in your device.</p>
66
- <p>With 60 Seconds Reatomized APK Hack, you can play the game however you want. You can be a hero or a villain, a leader or a follower, a survivor or a victim. You can make any decision you want without worrying about the results. You can explore the wasteland without fear of danger or death. You can have fun without stress or worry.</p> <h2>How to Download and Install 60 Seconds Reatomized APK Hack?</h2>
67
- <h3>Step 1: Download the APK file from a trusted source</h3>
68
- <p>The first step to download and install 60 Seconds Reatomized APK Hack is to find a reliable and safe source that provides the APK file. There are many websites and platforms that offer APK files for various apps and games, but not all of them are trustworthy and secure. Some of them may contain malware or viruses that can harm your device or steal your personal information.</p>
69
- <p>Therefore, you should be careful and cautious when choosing a source for downloading the APK file. You should do some research and check the reviews and ratings of the source before downloading anything. You should also scan the APK file with an antivirus software before installing it.</p>
70
- <p>One of the sources that we recommend for downloading 60 Seconds Reatomized APK Hack is [APKPure], a website that provides free and safe APK files for Android users. You can visit their website and search for 60 Seconds Reatomized APK Hack, or you can use this link to download it directly: [https://apkpure.com/60-seconds-reatomized-apk-hack/com.robotgentleman.game60seconds].</p>
71
- <h3>Step 2: Enable unknown sources on your device</h3>
72
- <p>The second step to download and install 60 Seconds Reatomized APK Hack is to enable unknown sources on your device. This is a setting that allows you to install apps and games from sources other than the Google Play Store. By default, this setting is disabled on most Android devices, as a security measure to prevent unauthorized or harmful installations.</p>
73
- <p>To enable unknown sources on your device, you need to follow these steps:</p>
74
- <ol>
75
- <li>Go to your device's settings and look for the security or privacy option.</li>
76
- <li>Tap on it and find the option that says unknown sources or allow installation from unknown sources.</li>
77
- <li>Toggle it on and confirm your choice.</li>
78
- </ol>
79
- <p>Once you have enabled unknown sources on your device, you are ready to install the APK file.</p>
80
- <h3>Step 3: Install the APK file and launch the game</h3>
81
- <p>The third and final step to download and install 60 Seconds Reatomized APK Hack is to install the APK file and launch the game. To do this, you need to follow these steps:</p>
82
- <ol>
83
- <li>Locate the APK file that you have downloaded from the source. You can use a file manager app or your device's downloads folder to find it.</li>
84
- <li>Tap on the APK file and follow the instructions on the screen to install it.</li>
85
- <li>Wait for the installation process to finish and then tap on the game icon to launch it.</li>
86
- </ol>
87
- <p>Congratulations! You have successfully downloaded and installed 60 Seconds Reatomized APK Hack on your device. You can now enjoy the game with unlimited resources and features.</p> <h2>How to Play 60 Seconds Reatomized APK Hack?</h2>
88
- <h3>Choose your mode and difficulty level</h3>
89
- <p>The first thing you need to do to play 60 Seconds Reatomized APK Hack is to choose your mode and difficulty level. You can choose from four different modes: Atomic Drill, Apocalypse, Survival, and Scavenge. Each mode has its own objectives and challenges that will affect your gameplay.</p>
90
- <p>You can also choose from three different difficulty levels: Easy, Normal, and Hard. Each difficulty level will affect the amount of items and family members you can collect, the frequency and severity of events and challenges, and the chances of survival and success.</p>
91
- <p>You can change your mode and difficulty level at any time from the main menu or the pause menu. You can also customize your game settings, such as sound, graphics, language, and controls, from the options menu.</p>
92
- <h3>Collect items and family members in 60 seconds before the blast</h3>
93
- <p>The second thing you need to do to play 60 Seconds Reatomized APK Hack is to collect items and family members in 60 seconds before the blast. This is the most crucial and exciting part of the game, as you have to act fast and smart to gather everything you need for survival.</p>
94
- <p>You start the game in your house, where you can see various items and family members scattered around. You have to use the joystick or the arrow keys to move around, and the grab button or the space bar to pick up items and family members. You can only carry up to four items or one family member at a time, so you have to plan your route and prioritize your choices.</p>
95
- <p>You have to drag the items and family members to the fallout shelter, which is located in a random room in your house. You have to open the door of the shelter and drop the items and family members inside. You have to repeat this process until you have collected everything you want or until the time runs out.</p>
96
- <p>You can see a countdown timer on the top of the screen, which shows you how much time you have left before the bomb explodes. You can also see a map on the bottom of the screen, which shows you where you are, where the shelter is, and where the items and family members are.</p>
97
- <p>You have to be careful not to bump into obstacles or enemies, such as furniture, walls, doors, windows, spiders, roaches, rats, or bandits. These will slow you down or damage you, which will reduce your health bar. If your health bar reaches zero, you will die and lose the game.</p>
98
- <p>You have to be quick and efficient in collecting items and family members, as they will determine your chances of survival in the shelter. There are different types of items that have different functions and values:</p>
99
- <table>
100
- <tr>
101
- <th>Type</th>
102
- <th>Function</th>
103
- <th>Value</th>
104
- </tr>
105
- <tr>
106
- <td>Water</td>
107
- <td>Hydrates your family members</td>
108
- <td>High</td>
109
- </tr>
110
- <tr>
111
- <td>Food</td>
112
- <td>Nourishes your family members</td>
113
- <td>High</td>
114
- </tr>
115
- <tr>
116
- <td>Ammo</td>
117
- <td>Defends your shelter from intruders</td>
118
- <td>Medium</td>
119
- </tr>
120
- <tr>
121
- <td>Medkit</td>
122
- <td>Heals your family members from injuries or illnesses</td>
123
- <td>Medium</td>
124
- </tr>
125
- <tr>
126
- <td>Radio</td>
127
- <td>Communicates with other survivors or rescuers</td>
128
- <td>Medium</td>
129
- </tr>
130
- <tr>
131
- <td>Map</td>
132
- <td>Guides your exploration of the wasteland</td>
133
- <td>Medium</td>
134
- </tr>
135
- <tr>
136
- <td>Axe</td>
137
- <td>Cuts wood or breaks doors or locks</td>
138
- <td>Low</td>
139
- </tr>
140
- <tr>
141
- <td>Rifle</td>
142
- <td>Hunts animals or fights enemies in the wasteland</td>
143
- <td>Low</td>
144
- </tr>
145
- <tr>
146
- <td>Suitcase</td>
147
- <td>Holds extra items for scavenging trips</td>
148
- <td>Low</td>
149
- </tr>
150
- <tr>
151
- <td>Guitar</td </table>
152
- <p>Once you have collected everything you want or need, you have to enter the shelter and close the door before the bomb explodes. If you fail to do so, you will die and lose the game.</p>
153
- <h3>Manage your resources and make decisions in the shelter</h3>
154
- <p>The third thing you need to do to play 60 Seconds Reatomized APK Hack is to manage your resources and make decisions in the shelter. This is the most challenging and interesting part of the game, as you have to deal with the consequences of your actions and the events that happen in the wasteland.</p>
155
- <p>You have to ration your water and food among your family members, as they will get thirsty and hungry over time. You have to use your medkits to heal your family members from injuries or illnesses, as they will get sick or hurt by various causes. You have to use your ammo to defend your shelter from intruders, as they will try to rob or harm you.</p>
156
- <p>You also have to make decisions that will affect your survival and your relationship with your family members. You have to choose whether to send someone out to scavenge for more items, or to stay in the shelter and wait for rescue. You have to choose whether to help or ignore other survivors or rescuers that contact you through the radio or knock on your door. You have to choose whether to be honest or deceitful, generous or selfish, brave or cowardly, etc.</p>
157
- <p>You can see the status of your family members and your resources on the top of the screen, which shows you their health, hunger, thirst, sanity, and loyalty. You can also see the status of your items on the bottom of the screen, which shows you their quantity and quality. You can also see a journal on the right of the screen, which shows you a summary of what happened each day.</p>
158
- <p>You have to be careful not to run out of resources or lose your family members, as this will reduce your chances of survival and success. You also have to be careful not to anger or betray your family members, as this will reduce their loyalty and morale. If your family members lose their loyalty or morale, they may leave you, attack you, or kill themselves.</p>
159
- <h3>Explore the wasteland and encounter random events</h3>
160
- <p>The fourth thing you need to do to play 60 Seconds Reatomized APK Hack is to explore the wasteland and encounter random events. This is the most fun and unpredictable part of the game, as you never know what you will find or face in the post-apocalyptic world.</p>
161
- <p>You can explore the wasteland by sending one of your family members out on a scavenging trip. You can choose which family member to send, which items to give them, and which location to visit. You can also use the map to see where you are and where you can go.</p>
162
- <p>You can find various items and locations in the wasteland, such as water bottles, soup cans, gas stations, supermarkets, schools, hospitals, etc. Some of them may be useful and beneficial for your survival, while others may be useless and harmful for your health.</p>
163
- <p>You can also encounter various events and characters in the wasteland, such as mutants, raiders, bandits, soldiers, scientists, traders, etc. Some of them may be friendly and helpful for your survival, while others may be hostile and dangerous for your life.</p>
164
- <p>You can interact with these events and characters in different ways, depending on your choices and actions. You can fight or flee, trade or steal, help or ignore, etc. You can also use your items or skills to influence the outcome of these interactions.</p>
165
- <p>You can see the results of your scavenging trips on the journal on the right of the screen, which shows you what happened each day. You can also see the effects of these results on your family members and your resources on the top and bottom of the screen.</p>
166
- <p>You have to be careful not to expose yourself or your family members to too much radiation or danger in the wasteland, as this will reduce your health and increase your risk of death. You also have to be careful not to miss any opportunities or clues for rescue or escape in the wasteland, as this will reduce your chances of success and happiness.</p> <h2>What are the Benefits of 60 Seconds Reatomized APK Hack?</h2>
167
- <h3>Unlimited water, food, ammo, and medkits</h3>
168
- <p>One of the main benefits of 60 Seconds Reatomized APK Hack is that it gives you unlimited water, food, ammo, and medkits in your shelter. These are the most essential and valuable resources in the game, as they determine your survival and health.</p>
169
- <p>With unlimited water and food, you don't have to worry about rationing them among your family members, as they will never get thirsty or hungry. You can also feed them as much as you want, which will boost their morale and loyalty.</p>
170
- <p>With unlimited ammo and medkits, you don't have to worry about defending your shelter from intruders or healing your family members from injuries or illnesses, as you will always have enough to do so. You can also use them as much as you want, which will increase your security and safety.</p>
171
- <h3>Unlocked characters, modes, and achievements</h3>
172
- <p>Another benefit of 60 Seconds Reatomized APK Hack is that it gives you unlocked characters, modes, and achievements in your game. These are the most fun and rewarding features in the game, as they add variety and challenge to your gameplay.</p>
173
- <p>With unlocked characters, you can play as any of the six family members or the two pets in the game. You can also mix and match them to create different combinations and scenarios. You can also see their unique personalities and abilities in action.</p>
174
- <p>With unlocked modes, you can play any of the four modes in the game. You can also choose any difficulty level for each mode. You can also customize your game settings to suit your preferences and style.</p>
175
- <p>With unlocked achievements, you can see all the achievements that the game has to offer. You can also try to complete them all to prove your skills and creativity. You can also show off your achievements to your friends and other players.</p>
176
- <h3>Improved graphics, sound, and performance</h3>
177
- <p>A third benefit of 60 Seconds Reatomized APK Hack is that it gives you improved graphics, sound, and performance on your device. These are the most important and noticeable aspects of the game, as they affect your immersion and enjoyment.</p>
178
- <p>With improved graphics, you can see the game in high resolution and quality. You can also see more details and colors in the game environment and characters. You can also enjoy smoother animations and transitions in the game.</p>
179
- <p>With improved sound, you can hear the game in clear and crisp audio. You can also hear more sounds and effects in the game environment and characters. You can also enjoy better music and voice acting in the game.</p>
180
- <p>With improved performance, you can play the game without any lag or glitches. You can also play the game without any crashes or errors. You can also enjoy faster loading and saving times in the game.</p> <h2>What are the Risks of 60 Seconds Reatomized APK Hack?</h2>
181
- <h3>Possible malware or viruses from unverified sources</h3>
182
- <p>One of the main risks of 60 Seconds Reatomized APK Hack is that it may contain malware or viruses from unverified sources. These are malicious software or programs that can harm your device or steal your personal information.</p>
183
- <p>As we mentioned earlier, not all sources that offer APK files are trustworthy and secure. Some of them may have hidden or embedded malware or viruses in their APK files, which can infect your device or access your data once you install them.</p>
184
- <p>Therefore, you should be careful and cautious when downloading and installing APK files from unknown or suspicious sources. You should always do some research and check the reviews and ratings of the source before downloading anything. You should also scan the APK file with an antivirus software before installing it.</p>
185
- <h3>Potential bans or legal issues from the game developers</h3>
186
- <p>Another risk of 60 Seconds Reatomized APK Hack is that it may cause bans or legal issues from the game developers. These are penalties or consequences that can affect your access or rights to the game.</p>
187
- <p>As we mentioned earlier, an APK hack file is a modification or alteration of the original game that changes its functionality or appearance. By downloading and installing an APK hack file, you are bypassing the restrictions and limitations imposed by the game developers or the Google Play Store.</p>
188
- <p>This may violate the terms and conditions or the intellectual property rights of the game developers, which can result in bans or legal actions against you. You may lose your account, your progress, your achievements, or your access to the game. You may also face fines, lawsuits, or criminal charges from the game developers.</p>
189
- <p>Therefore, you should be aware and respectful of the rules and rights of the game developers when downloading and installing APK files. You should always use the official version of the game from the Google Play Store, unless you have permission or authorization from the game developers to use a modified version.</p>
190
- <h3>Reduced challenge and fun from the game mechanics</h3>
191
- <p>A third risk of 60 Seconds Reatomized APK Hack is that it may reduce the challenge and fun from the game mechanics. These are the features and elements that make the game enjoyable and engaging.</p>
192
- <p>As we mentioned earlier, 60 Seconds Reatomized is a game that combines elements of strategy, simulation, adventure, and comedy. It is a game that will make you laugh, cry, and scream as you face the consequences of your decisions.</p>
193
- <p>The game is designed to be challenging and fun, as you have to scavenge for items and family members in 60 seconds before the blast, manage your resources and make decisions in the shelter, explore the wasteland and encounter random events, and try to survive and escape the nuclear apocalypse.</p>
194
- <p>However, by using 60 Seconds Reatomized APK Hack, you are altering or removing some of these features and elements, such as scavenging, rationing, surviving, etc. You are making the game easier and simpler, which may reduce its challenge and fun.</p>
195
- <p>Therefore, you should be careful not to spoil or ruin the game experience for yourself or others when using 60 Seconds Reatomized APK Hack. You should always play the game as it was intended by the game developers, unless you want to try something different or experiment with something new.</p>
196
- <h2>Conclusion</h2>
197
- <p>60 Seconds Reatomized APK Hack is a modified version of 60 Seconds Reatomized, a remastered edition of the classic atomic adventure game. It is a hack that gives you unlimited resources and features that are not available in the official version. It is a way to enjoy the game without worrying about scavenging, rationing, and surviving.</p>
198
- <p>To download and install 60 Seconds Reatomized APK Hack, you need to find a reliable and safe source that provides the APK file, enable unknown sources on your device, and install the APK file and launch the game. To play 60 Seconds Reatomized APK Hack, you need to choose your mode and difficulty level, collect items and family members in 60 seconds before the blast, manage your resources and make decisions in the shelter, explore the wasteland and encounter random events.</p>
199
- <p>The benefits of 60 Seconds Reatomized APK Hack are unlimited water, food, ammo, and medkits; unlocked characters, modes, and achievements; improved graphics, sound, and performance. The risks of 60 Seconds Reatomized APK Hack are possible malware or viruses from unverified sources; potential bans or legal issues from the game developers; reduced challenge and fun from the game mechanics.</p>
200
- <p>We hope this article has helped you learn more about 60 Seconds Reatomized APK Hack. If you have any questions or feedback, please feel free to leave them in the comments section below. Thank you for reading and have a great day!</p>
201
- <h2>FAQs</h2>
202
- <h3>What is the difference between 60 Seconds Reatomized and 60 Seconds!?</h3>
203
- <p>60 Seconds Reatomized is a remastered edition of 60 Seconds!, which is the original game that was released in 2015. 60 Seconds Reatomized has improved graphics, sound, and performance, as well as new content, such as characters, modes, events, and endings.</p>
204
- <h3>Is 60 Seconds Reatomized APK Hack safe to use?</h3>
205
- <p>60 Seconds Reatomized APK Hack is safe to use as long as you download it from a trusted and verified source, such as [APKPure]. However, you should always be careful and cautious when downloading and installing APK files from unknown or suspicious sources, as they may contain malware or viruses that can harm your device or steal your personal information.</p>
206
- <h3>Is 60 Seconds Reatomized APK Hack legal to use?</h3>
207
- <p>60 Seconds Reatomized APK Hack is not legal to use, as it violates the terms and conditions and the intellectual property rights of the game developers. By using 60 Seconds Reatomized APK Hack, you are bypassing the restrictions and limitations imposed by the game developers or the Google Play Store, which can result in bans or legal actions against you. Therefore, you should always use the official version of the game from the Google Play Store, unless you have permission or authorization from the game developers to use a modified version.</p>
208
- <h3>How long does it take to finish 60 Seconds Reatomized?</h3>
209
- <p>The length of 60 Seconds Reatomized depends on the mode and difficulty level you choose, as well as the choices and actions you make in the game. However, on average, it takes about 10 to 20 minutes to complete one playthrough of the game.</p>
210
- <h3>Can I play 60 Seconds Reatomized with my friends?</h3>
211
- <p>Yes, you can play 60 Seconds Reatomized with your friends in a local co-op mode. In this mode, you can share your device with up to four players and take turns in scavenging, managing, and exploring. You can also compete or cooperate with each other to see who can survive longer or better.</p> 197e85843d<br />
212
- <br />
213
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1phancelerku/anime-remove-background/Angry Birds 2 MOD APK 3.10.0 Unlimited Money and Gems - HappyMod.md DELETED
@@ -1,108 +0,0 @@
1
-
2
- <h1>Angry Birds 2 APK Happymod: How to Download and Play the Modded Version of the Popular Game</h1>
3
- <p>Angry Birds 2 is one of the most popular casual games on Android, with over 100 million downloads on Google Play. The game is a sequel to the original Angry Birds game, which was released in 2009 and became a global phenomenon. In this article, we will show you how to download and play the modded version of Angry Birds 2 using Happymod, a platform for downloading modded games and apps.</p>
4
- <h2>angry birds 2 apk happymod</h2><br /><p><b><b>Download</b> &#9881; <a href="https://jinyurl.com/2uNQSZ">https://jinyurl.com/2uNQSZ</a></b></p><br /><br />
5
- <h2>What is Angry Birds 2?</h2>
6
- <p>Angry Birds 2 is a puzzle game developed by Rovio Entertainment and released in 2015. The game features two new birds named Silver and Melody, a new ability for Red, spells instead of power-ups, and gameplay that occurs in multi-stage levels. The game also has a social aspect, as players can compete with other players around the world in arenas and clans.</p>
7
- <h3>A sequel to the original Angry Birds game</h3>
8
- <p>The story of Angry Birds 2 follows the same premise as the original game. The evil pigs have stolen the eggs of the birds, and the birds must use their slingshot to launch themselves at the pigs' structures and destroy them. The game has over 1,000 levels, each with different themes, obstacles, and objectives.</p>
9
- <h3>Features new birds, spells, levels, and modes</h3>
10
- <p>Angry Birds 2 introduces some new elements to the gameplay. For example, players can choose which bird they want to use from a deck of cards before launching them. This adds more strategy and variety to the game. The game also has new birds with unique abilities, such as Silver who can loop in the air and destroy stone blocks, and Melody who can transform into different objects. The game also has spells that can help players in difficult situations, such as freezing pigs, raining rubber ducks, or summoning mighty eagles.</p>
11
- <p>angry birds 2 mod apk unlimited money and gems<br />
12
- angry birds 2 apk download for android<br />
13
- angry birds 2 hack apk latest version<br />
14
- angry birds 2 mod apk happymod free download<br />
15
- angry birds 2 apk offline installer<br />
16
- angry birds 2 mod apk unlimited everything<br />
17
- angry birds 2 apk obb data file<br />
18
- angry birds 2 hack apk no root<br />
19
- angry birds 2 mod apk revdl<br />
20
- angry birds 2 apk update new version<br />
21
- angry birds 2 mod apk unlimited lives and coins<br />
22
- angry birds 2 apk pure original<br />
23
- angry birds 2 hack apk ios<br />
24
- angry birds 2 mod apk rexdl<br />
25
- angry birds 2 apk mirror link<br />
26
- angry birds 2 mod apk all unlocked<br />
27
- angry birds 2 apk old version download<br />
28
- angry birds 2 hack apk online generator<br />
29
- angry birds 2 mod apk android 1<br />
30
- angry birds 2 apk full game free<br />
31
- angry birds 2 mod apk unlimited black pearls<br />
32
- angry birds 2 apk mod menu<br />
33
- angry birds 2 hack apk without human verification<br />
34
- angry birds 2 mod apk an1<br />
35
- angry birds 2 apk latest version download</p>
36
- <p>The game also has new levels that are divided into multiple stages. Each stage has different layouts and objectives, such as destroying a certain number of pigs or reaching a certain score. The game also has boss battles that require players to defeat powerful pigs with special attacks.</p>
37
- <p>The game also has new modes that add more challenge and fun to the game. For example, there is an arena mode where players can compete with other players in daily tournaments and climb up the leaderboards. There is also a clan mode where players can join or create clans with other players and participate in clan events.</p>
38
- <h3>Challenges players to defeat the pigs and other players</h3>
39
- <p>Angry Birds 2 is not an easy game. The game requires players to use their skills, strategy, and luck to complete the levels. The game also has a difficulty system that adjusts the level of challenge based on the player's performance. The game also has a star rating system that rewards players for achieving high scores and completing objectives.</p>
40
- <p>The game also challenges players to compete with other players in online modes. The game has a ranking system that matches players with similar skill levels and rewards them with feathers and gems. The game also has a chat system that allows players to communicate with their clan members and friends.</p>
41
- <h2>What is Happymod?</h2>
42
- <p>Happymod is a platform for downloading modded games and apps for Android devices. Modded games and apps are modified versions of the original games and apps that have extra features, such as unlimited money, unlocked items, or enhanced graphics. Happymod offers thousands of modded games and apps for free, with fast, secure, and multilingual downloads.</p>
43
- <h3>A platform for downloading modded games and apps</h3>
44
- <p>Happymod is a website and an app that allows users to download modded games and apps easily. Users can browse through different categories, such as action, arcade, casual, or simulation, and find the modded games and apps they want. Users can also search for specific games and apps using keywords or filters. Users can also view the details, screenshots, ratings, and comments of each modded game and app before downloading them.</p>
45
- <h3>Offers fast, secure, and multilingual downloads</h3>
46
- <p>Happymod provides fast and secure downloads for its users. Users can download the modded games and apps directly from the website or the app without any registration or verification. Users can also pause and resume their downloads at any time. Happymod also ensures that all the modded games and apps are safe and virus-free by scanning them with antivirus software.</p>
47
- <p>Happymod also supports multiple languages for its users. Users can choose from over 20 languages, such as English, Spanish, French, German, or Arabic, to access the website or the app. Users can also change the language settings at any time.</p>
48
- <h3>Supports many popular Android games and apps</h3>
49
- <p>Happymod supports many popular Android games and apps that users love to play or use. Some of the most downloaded modded games and apps on Happymod are:</p>
50
- <table>
51
- <tr>
52
- <th>Game/App</th>
53
- <th>Mod Features</th>
54
- </tr>
55
- <tr>
56
- <td>Angry Birds 2</td>
57
- <td>Unlimited money, gems, lives, energy; unlocked all birds, hats, spells, levels; customized gameplay</td>
58
- </tr>
59
- <tr>
60
- <td>Minecraft</td>
61
- <td>Unlocked premium skins, textures; unlimited resources; immortality; no damage; no ads</td>
62
- </tr>
63
- <tr>
64
- <td>Spotify</td>
65
- <td>Unlocked premium features; unlimited skips; no ads; high-quality audio; offline mode</td>
66
- </tr>
67
- <tr>
68
- <td>Netflix</td>
69
- <td>Unlocked premium features; unlimited movies and shows; no ads; high-quality video; offline mode</td>
70
- </tr>
71
- <tr>
72
- <td>TikTok</td>
73
- <td>Unlocked premium features; unlimited likes, followers, views; no ads; high-quality video; watermark remover</td>
74
- </tr>
75
- </table>
76
- <h2>How to Download and Install Angry Birds 2 APK Happymod?</h2>
77
- <p>If you want to download and install Angry Birds 2 APK Happymod on your Android device, you need to follow these simple steps:</p>
78
- <h3>Enable unknown sources on your device</h3>
79
- <p>Before you can install any APK file on your device, you need to enable unknown sources in your device settings. This will allow you to install apps from sources other than Google Play. To do this, go to Settings > Security > Unknown Sources and toggle it on.</p>
80
- <h3>Download the APK file from Happymod website or app</h3>
81
- <p>Next, you need to download the APK file of Angry Birds 2 APK Happymod from Happymod website or app. You can use any browser or download manager app to do this. To download from Happymod website, go to https://www.happymod.com/angry-birds-2-mod/com.rovio.baba/ and click on the Download button. To download from Happymod app, open the app and search for Angry Birds 2 in the search bar. Then tap on the Download button next to the mod you want.</p>
82
- <h3>Locate and install the APK file using a file manager app</h3>
83
- <p>Finally, you need to locate and install the APK file using a file manager app. You can use any file manager app that can access your device storage, such as ES File Explorer, Astro File Manager, or File Manager. To install the APK file, go to the folder where you downloaded the file and tap on it. Then follow the instructions on the screen to complete the installation.</p>
84
- <h2>What are the Benefits of Playing Angry Birds 2 APK Happymod?</h2>
85
- <p>Playing Angry Birds 2 APK Happymod has many benefits that can enhance your gaming experience. Here are some of them:</p>
86
- <h3>Enjoy unlimited money, gems, lives, and energy</h3>
87
- <p>One of the main benefits of playing Angry Birds 2 APK Happymod is that you can enjoy unlimited resources that can help you progress faster in the game. You can use money and gems to buy more cards, hats, spells, and chests. You can also use lives and energy to play more levels and arenas without waiting for them to refill.</p>
88
- <h3>Unlock all birds, hats, spells, and levels</h3>
89
- <p>Another benefit of playing Angry Birds 2 APK Happymod is that you can unlock all the content that the game has to offer. You can unlock all the birds with their unique abilities, such as Chuck, Bomb, Matilda, Terence, Stella, Bubbles, Hal, and more. You can also unlock all the hats that can boost your birds' powers, such as cowboy hats, pirate hats, ninja hats, and more. You can also unlock all the spells that can help you in difficult situations, such as golden duck, hot chili, pig inflator, and more. You can also unlock all the levels that are divided into different chapters and episodes.</p>
90
- <h3>Customize your gameplay with different mods</h3>
91
- <p>A third benefit of playing Angry Birds 2 APK Happymod is that you can customize your gameplay with different mods that can change the game rules or mechanics. For example, you can use mods that can make your birds fly faster, hit harder, or bounce higher. You can also use mods that can make the pigs weaker, smaller, or less intelligent. You can also use mods that can change the graphics, sounds, or interface of the game.</p>
92
- <h2>Conclusion</h2>
93
- <p>Angry Birds 2 APK Happymod is a great way to enjoy the popular game with more features and fun. You can download and install the modded version of the game using Happymod, a platform for downloading modded games and apps. You can also enjoy unlimited resources, unlock all content, and customize your gameplay with different mods. If you are a fan of Angry Birds 2 or want to try something new, you should give Angry Birds 2 APK Happymod a try.</p>
94
- <p>If you liked this article, please share it with your friends and leave a comment below. Also, don't forget to check out our other articles on Happymod for more modded games and apps.</p>
95
- <h2>FAQs</h2>
96
- <h3>Is Angry Birds 2 APK Happymod safe to use?</h3>
97
- <p>Yes, Angry Birds 2 APK Happymod is safe to use as long as you download it from a trusted source like Happymod. Happymod scans all the modded games and apps with antivirus software to ensure they are free of malware and viruses.</p>
98
- <h3>Do I need to root my device to play Angry Birds 2 APK Happymod?</h3>
99
- <p>No, you do not need to root your device to play Angry Birds 2 APK Happymod. The modded version of the game works on both rooted and non-rooted devices.</p>
100
- <h3>Can I play Angry Birds 2 APK Happymod online with other players?</h3>
101
- <p>Yes, you can play Angry Birds 2 APK Happymod online with other players in arenas and clans. However, you may encounter some issues or errors when playing online due to the modded features of the game. Therefore, we recommend playing online at your own risk.</p>
102
- <h3>How can I update Angry Birds 2 APK Happymod to the latest version?</h3>
103
- <p>To update Angry Birds 2 APK Happymod to the latest version, you need to download and install the latest APK file from Happymod website or app. You do not need to uninstall the previous version of the game before installing the new one.</p>
104
- <h3>Where can I find more modded games and apps like Angry Birds 2 APK Happymod?</h3>
105
- <p>You can find more modded games and apps like Angry Birds 2 APK Happymod on Happymod website or app. Happymod offers thousands of modded games and apps for free in various categories and genres.</p>
106
- <p></p</p> 401be4b1e0<br />
107
- <br />
108
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1phancelerku/anime-remove-background/Coin Master MOD APK New Version 2022 Unlock All Levels Cards and Characters.md DELETED
@@ -1,117 +0,0 @@
1
-
2
- <h1>Coin Master Mod Apk New Version 2022: Everything You Need to Know</h1>
3
- <p>If you are looking for a fun and addictive game that combines slot machines, card collecting, and village building, then you might want to try Coin Master. And if you want to enjoy the game without any limitations or restrictions, then you might want to download Coin Master Mod Apk New Version 2022. In this article, we will tell you everything you need to know about this hacked version of the game, including what it is, how to get it, and what are the benefits of using it.</p>
4
- <h2>What is Coin Master?</h2>
5
- <h3>A casual game with a twist</h3>
6
- <p>Coin Master is a casual game that was released in 2010 by Moon Active. The game has over 100 million downloads on Google Play Store and is one of the most popular games in the world. The game is based on a simple premise: you spin a slot machine to earn coins, which you can use to build and upgrade your village, attack and raid other players' villages, and collect cards that unlock new worlds and characters.</p>
7
- <h2>coin master mod apk new version 2022</h2><br /><p><b><b>DOWNLOAD</b> &#10001; &#10001; &#10001; <a href="https://jinyurl.com/2uNQRa">https://jinyurl.com/2uNQRa</a></b></p><br /><br />
8
- <h3>How to play Coin Master</h3>
9
- <p>The gameplay of Coin Master is easy to understand and follow. You start with five spins per hour, which you can use to spin the slot machine. The slot machine can give you various outcomes, such as coins, shields, attacks, raids, or free spins. Depending on the outcome, you can either use your coins to buy items for your village, protect your village from attacks, attack other players' villages, raid other players' coin stash, or get more spins. You can also invite your friends to play with you and exchange gifts and cards with them. The game has hundreds of levels and themes, such as pirates, Vikings, Egyptians, and more.</p>
10
- <h2>What is Coin Master Mod Apk?</h2>
11
- <h3>A hacked version of the game</h3>
12
- <p>Coin Master Mod Apk is a modified or hacked version of the original game that gives you unlimited coins, spins, shields, and other resources. With this mod apk, you don't have to wait for hours to get more spins or spend real money to buy coins. You can enjoy the game without any interruptions or limitations.</p>
13
- <h3>The benefits of using Coin Master Mod Apk</h3>
14
- <p>There are many benefits of using Coin Master Mod Apk New Version 2022. Some of them are:</p>
15
- <ul>
16
- <li>You can get unlimited coins and spins, which means you can build your village faster and unlock new levels and worlds.</li>
17
- <li>You can get unlimited shields, which means you can protect your village from attacks and raids.</li>
18
- <li>You can get access to all the cards and characters in the game, which means you can collect them all and complete your sets.</li>
19
- <li>You can get access to premium features and items that are otherwise locked or require real money.</li>
20
- <li>You can play the game offline without any internet connection.</li>
21
- </ul>
22
- <h2>How to download and install Coin Master Mod Apk New Version 2022?</h2>
23
- <h3>The steps to follow</h3>
24
- <p>If you want to download and install Coin Master Mod Apk New Version 2022 on your Android device, you need to follow these steps:</p>
25
- <ol>
26
- <li>First, you need to uninstall the original version of Coin Master from your device.</li>
27
- <li>Then, you need to download the Coin Master Mod Apk file from a trusted source. You can use this link as an example.</li>
28
- <li>Next, you need to enable the unknown sources option on your device settings. This will allow you to install apps from sources other than Google Play Store. To do this, go to Settings > Security > Unknown Sources and toggle it on.</li>
29
- <li>After that, you need to locate the Coin Master Mod Apk file on your device and tap on it to install it.</li>
30
- <li>Finally, you need to open the app and enjoy the game with unlimited resources.</li>
31
- </ol>
32
- <h3>The precautions to take</h3>
33
- <p>While Coin Master Mod Apk New Version 2022 can give you a lot of advantages, it also comes with some risks and drawbacks. Here are some precautions you need to take before using it:</p>
34
- <ul>
35
- <li>You need to make sure that you download the mod apk file from a safe and reliable source. Some sources may contain viruses or malware that can harm your device or steal your data.</li>
36
- <li>You need to be aware that using a mod apk can violate the terms and conditions of the game and result in a ban or suspension of your account. Therefore, you should use it at your own risk and discretion.</li>
37
- <li>You need to backup your game data before uninstalling the original version of Coin Master. This will help you restore your progress and achievements in case something goes wrong.</li>
38
- <li>You need to update the mod apk regularly to get the latest features and bug fixes. However, you should not update it from Google Play Store, as this will overwrite the mod apk with the original version. You should only update it from the same source where you downloaded it.</li>
39
- </ul>
40
- <h2>Conclusion</h2>
41
- <p>Coin Master is a fun and addictive game that lets you spin, build, attack, raid, and collect cards. However, if you want to enjoy the game without any limitations or restrictions, you can download Coin Master Mod Apk New Version 2022. This is a hacked version of the game that gives you unlimited coins, spins, shields, and other resources. You can download and install it easily by following the steps and precautions mentioned above. However, you should also be careful of the risks and drawbacks of using a mod apk. We hope this article has helped you learn everything you need to know about Coin Master Mod Apk New Version 2022.</p>
42
- <h2>FAQs</h2>
43
- <p>Here are some frequently asked questions about Coin Master Mod Apk New Version 2022:</p>
44
- <p>coin master mod apk unlimited spins and coins 2022<br />
45
- coin master hack mod apk download latest version 2022<br />
46
- coin master mod apk free download for android 2022<br />
47
- coin master mod apk unlimited money and spins 2022<br />
48
- coin master mod apk latest version 2022 rexdl<br />
49
- coin master mod apk 2022 no root<br />
50
- coin master mod apk unlimited everything 2022<br />
51
- coin master mod apk new version 2022 offline<br />
52
- coin master mod apk latest version 2022 android 1<br />
53
- coin master mod apk new version 2022 revdl<br />
54
- coin master mod apk unlimited coins and spins 2022<br />
55
- coin master hack mod apk 2022 free download<br />
56
- coin master mod apk new version 2022 with facebook login<br />
57
- coin master mod apk latest version 2022 happymod<br />
58
- coin master mod apk new version 2022 for ios<br />
59
- coin master mod apk unlimited spins and money 2022<br />
60
- coin master hack mod apk latest version 2022<br />
61
- coin master mod apk free spins and coins 2022<br />
62
- coin master mod apk latest version 2022 for pc<br />
63
- coin master mod apk new version 2022 online<br />
64
- coin master mod apk latest version 2022 apkpure<br />
65
- coin master mod apk new version 2022 unlimited spin<br />
66
- coin master hack mod apk download 2022<br />
67
- coin master mod apk free coins and spins 2022<br />
68
- coin master mod apk latest version 2022 with facebook connect<br />
69
- coin master mod apk new version 2022 for iphone<br />
70
- coin master mod apk unlimited coins and money 2022<br />
71
- coin master hack mod apk free download 2022<br />
72
- coin master mod apk free spin and coins 2022<br />
73
- coin master mod apk latest version 2022 for android<br />
74
- coin master mod apk new version 2022 without human verification<br />
75
- coin master mod apk latest version 2022 no verification<br />
76
- coin master hack mod apk online generator 2022<br />
77
- coin master mod apk free coins and money 2022<br />
78
- coin master mod apk latest version 2022 with unlimited spin<br />
79
- coin master mod apk new version 2022 for ipad<br />
80
- coin master mod apk unlimited money and coins 2022<br />
81
- coin master hack mod apk no survey 2022<br />
82
- coin master mod apk free spins and money 2022<br />
83
- coin master mod apk latest version 2022 for laptop</p>
84
- <ol>
85
- <li>Is Coin Master Mod Apk safe to use?</li>
86
- <p>Coin Master Mod Apk is safe to use as long as you download it from a trusted source and follow the precautions mentioned above. However, there is always a possibility of getting banned or suspended by the game developers for using a mod apk. Therefore, you should use it at your own risk and discretion.</p>
87
- <li>Can I play Coin Master Mod Apk with my friends?</li>
88
- <p>Yes, you can play Coin Master Mod Apk with your friends who also have the same mod apk installed on their devices. You can invite them to join your game and exchange gifts and cards with them. However, you cannot play with your friends who have the original version of Coin Master installed on their devices.</p>
89
- <li>What are the best features of Coin Master Mod Apk?</li>
90
- <p>Some of the best features of Coin Master Mod Apk are:</p>
91
- <ul>
92
- <li>Unlimited coins and spins</li>
93
- <li>Unlimited shields</li>
94
- <li>All cards and characters unlocked</li>
95
- <li>Premium features and items unlocked</li>
96
- <li>Offline mode available</li>
97
- </ul>
98
- <li>How can I get more coins and spins in Coin Master?</li>
99
- <p>If you don't want to use Coin Master Mod Apk, there are some other ways to get more coins and spins in Coin Master. Some of them are:</p>
100
- <ul>
101
- <li>Completing quests and achievements</li>
102
- <li>Watching video ads</li>
103
- <li>Inviting new friends</li>
104
- <li>Joining events and tournaments</li>
105
- <li>Claiming daily bonuses and rewards</li>
106
- </ul>
107
- <li>What are the alternatives to Coin Master Mod Apk?</li>
108
- <p>If you are looking for other games that are similar to Coin Master but have different themes or features, you can try these alternatives:</p>
109
- <ul>
110
- <li>Pirate Kings: A game that lets you spin, build, attack, and steal from other players' islands.</li>
111
- <li>Coin Dozer: A game that lets you push coins and prizes off a dozer machine.</li>
112
- <li>Coin Trip: A game that lets you travel around the world and collect coins from different landmarks.</li>
113
- <li>Coin Beach: A game that lets you create your own beach resort and earn coins from visitors.</li>
114
- <li>Coin Boom: A game that lets you blast coins with bombs and rockets.</li>
115
- </ul></p> 401be4b1e0<br />
116
- <br />
117
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/2ndelement/voicevox/voicevox_engine/dev/core/__init__.py DELETED
@@ -1,17 +0,0 @@
1
- from .mock import (
2
- decode_forward,
3
- initialize,
4
- metas,
5
- supported_devices,
6
- yukarin_s_forward,
7
- yukarin_sa_forward,
8
- )
9
-
10
- __all__ = [
11
- "decode_forward",
12
- "initialize",
13
- "yukarin_s_forward",
14
- "yukarin_sa_forward",
15
- "metas",
16
- "supported_devices",
17
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/801artistry/RVC801/infer/lib/uvr5_pack/lib_v5/nets_61968KB.py DELETED
@@ -1,122 +0,0 @@
1
- import torch
2
- import torch.nn.functional as F
3
- from torch import nn
4
-
5
- from . import layers_123821KB as layers
6
-
7
-
8
- class BaseASPPNet(nn.Module):
9
- def __init__(self, nin, ch, dilations=(4, 8, 16)):
10
- super(BaseASPPNet, self).__init__()
11
- self.enc1 = layers.Encoder(nin, ch, 3, 2, 1)
12
- self.enc2 = layers.Encoder(ch, ch * 2, 3, 2, 1)
13
- self.enc3 = layers.Encoder(ch * 2, ch * 4, 3, 2, 1)
14
- self.enc4 = layers.Encoder(ch * 4, ch * 8, 3, 2, 1)
15
-
16
- self.aspp = layers.ASPPModule(ch * 8, ch * 16, dilations)
17
-
18
- self.dec4 = layers.Decoder(ch * (8 + 16), ch * 8, 3, 1, 1)
19
- self.dec3 = layers.Decoder(ch * (4 + 8), ch * 4, 3, 1, 1)
20
- self.dec2 = layers.Decoder(ch * (2 + 4), ch * 2, 3, 1, 1)
21
- self.dec1 = layers.Decoder(ch * (1 + 2), ch, 3, 1, 1)
22
-
23
- def __call__(self, x):
24
- h, e1 = self.enc1(x)
25
- h, e2 = self.enc2(h)
26
- h, e3 = self.enc3(h)
27
- h, e4 = self.enc4(h)
28
-
29
- h = self.aspp(h)
30
-
31
- h = self.dec4(h, e4)
32
- h = self.dec3(h, e3)
33
- h = self.dec2(h, e2)
34
- h = self.dec1(h, e1)
35
-
36
- return h
37
-
38
-
39
- class CascadedASPPNet(nn.Module):
40
- def __init__(self, n_fft):
41
- super(CascadedASPPNet, self).__init__()
42
- self.stg1_low_band_net = BaseASPPNet(2, 32)
43
- self.stg1_high_band_net = BaseASPPNet(2, 32)
44
-
45
- self.stg2_bridge = layers.Conv2DBNActiv(34, 16, 1, 1, 0)
46
- self.stg2_full_band_net = BaseASPPNet(16, 32)
47
-
48
- self.stg3_bridge = layers.Conv2DBNActiv(66, 32, 1, 1, 0)
49
- self.stg3_full_band_net = BaseASPPNet(32, 64)
50
-
51
- self.out = nn.Conv2d(64, 2, 1, bias=False)
52
- self.aux1_out = nn.Conv2d(32, 2, 1, bias=False)
53
- self.aux2_out = nn.Conv2d(32, 2, 1, bias=False)
54
-
55
- self.max_bin = n_fft // 2
56
- self.output_bin = n_fft // 2 + 1
57
-
58
- self.offset = 128
59
-
60
- def forward(self, x, aggressiveness=None):
61
- mix = x.detach()
62
- x = x.clone()
63
-
64
- x = x[:, :, : self.max_bin]
65
-
66
- bandw = x.size()[2] // 2
67
- aux1 = torch.cat(
68
- [
69
- self.stg1_low_band_net(x[:, :, :bandw]),
70
- self.stg1_high_band_net(x[:, :, bandw:]),
71
- ],
72
- dim=2,
73
- )
74
-
75
- h = torch.cat([x, aux1], dim=1)
76
- aux2 = self.stg2_full_band_net(self.stg2_bridge(h))
77
-
78
- h = torch.cat([x, aux1, aux2], dim=1)
79
- h = self.stg3_full_band_net(self.stg3_bridge(h))
80
-
81
- mask = torch.sigmoid(self.out(h))
82
- mask = F.pad(
83
- input=mask,
84
- pad=(0, 0, 0, self.output_bin - mask.size()[2]),
85
- mode="replicate",
86
- )
87
-
88
- if self.training:
89
- aux1 = torch.sigmoid(self.aux1_out(aux1))
90
- aux1 = F.pad(
91
- input=aux1,
92
- pad=(0, 0, 0, self.output_bin - aux1.size()[2]),
93
- mode="replicate",
94
- )
95
- aux2 = torch.sigmoid(self.aux2_out(aux2))
96
- aux2 = F.pad(
97
- input=aux2,
98
- pad=(0, 0, 0, self.output_bin - aux2.size()[2]),
99
- mode="replicate",
100
- )
101
- return mask * mix, aux1 * mix, aux2 * mix
102
- else:
103
- if aggressiveness:
104
- mask[:, :, : aggressiveness["split_bin"]] = torch.pow(
105
- mask[:, :, : aggressiveness["split_bin"]],
106
- 1 + aggressiveness["value"] / 3,
107
- )
108
- mask[:, :, aggressiveness["split_bin"] :] = torch.pow(
109
- mask[:, :, aggressiveness["split_bin"] :],
110
- 1 + aggressiveness["value"],
111
- )
112
-
113
- return mask * mix
114
-
115
- def predict(self, x_mag, aggressiveness=None):
116
- h = self.forward(x_mag, aggressiveness)
117
-
118
- if self.offset > 0:
119
- h = h[:, :, :, self.offset : -self.offset]
120
- assert h.size()[3] > 0
121
-
122
- return h
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/ADOPLE/AdopleAI-Website-DocumentQA/app.py DELETED
@@ -1,130 +0,0 @@
1
- import os
2
- from langchain.chains.question_answering import load_qa_chain
3
- from langchain.document_loaders import UnstructuredFileLoader
4
- from langchain.embeddings.openai import OpenAIEmbeddings
5
- from langchain.llms import OpenAI
6
- from langchain.text_splitter import CharacterTextSplitter
7
- from langchain.vectorstores import FAISS
8
- from pypdf import PdfReader
9
- import mimetypes
10
- import validators
11
- import requests
12
- import tempfile
13
- import gradio as gr
14
- import openai
15
-
16
-
17
- def get_empty_state():
18
- return {"knowledge_base": None}
19
-
20
-
21
- def create_knowledge_base(docs):
22
- # split into chunks
23
- text_splitter = CharacterTextSplitter(
24
- separator="\n", chunk_size=500, chunk_overlap=0, length_function=len
25
- )
26
- chunks = text_splitter.split_documents(docs)
27
-
28
- # Create embeddings
29
- embeddings = OpenAIEmbeddings()
30
- knowledge_base = FAISS.from_documents(chunks, embeddings)
31
- return knowledge_base
32
-
33
-
34
- def upload_file(file_obj):
35
- try:
36
- loader = UnstructuredFileLoader(file_obj.name, strategy="fast")
37
- docs = loader.load()
38
-
39
- knowledge_base = create_knowledge_base(docs)
40
- except:
41
- text="Try Another file"
42
- return file_obj.name, text
43
-
44
- return file_obj.name, {"knowledge_base": knowledge_base}
45
-
46
-
47
- def upload_via_url(url):
48
- if validators.url(url):
49
- r = requests.get(url)
50
-
51
- if r.status_code != 200:
52
- raise ValueError(
53
- "Check the url of your file; returned status code %s" % r.status_code
54
- )
55
-
56
- content_type = r.headers.get("content-type")
57
- file_extension = mimetypes.guess_extension(content_type)
58
- temp_file = tempfile.NamedTemporaryFile(suffix=file_extension, delete=False)
59
- temp_file.write(r.content)
60
- file_path = temp_file.name
61
- loader = UnstructuredFileLoader(file_path, strategy="fast")
62
- docs = loader.load()
63
- with open(file_path, mode="rb") as f:
64
- pass
65
- knowledge_base = create_knowledge_base(docs)
66
- return file_path, {"knowledge_base": knowledge_base}
67
- else:
68
- raise ValueError("Please enter a valid URL")
69
-
70
-
71
- def answer_question(question, state):
72
-
73
- try:
74
- knowledge_base = state["knowledge_base"]
75
- docs = knowledge_base.similarity_search(question)
76
-
77
- llm = OpenAI(temperature=0.4)
78
- chain = load_qa_chain(llm, chain_type="stuff")
79
- response = chain.run(input_documents=docs, question=question)
80
- return response
81
- except:
82
- return "Please upload Proper Document"
83
-
84
-
85
- with gr.Blocks(css="style.css",theme=gr.themes.Soft()) as demo:
86
- state = gr.State(get_empty_state())
87
- # gr.HTML("""<img class="leftimage" align="left" src="https://lh5.googleusercontent.com/Oe_QQsjdEEDWZtgR5v8DHJe3aHP5rOj4FkfpCbo6CELP6xzoHh7N_nYV62cZhMQcLNlvR8xaFq7nMd4V1W-gKeIZ67QAECE9m6pRuRJah9MCdHg5N1q3oJ-4rOoxTc8ZdA=w1280" alt="Image" width="240" height="240">
88
- # <img class="rightimage" align="right" src="https://www.dmgflooringltd.co.uk/wp-content/uploads/NHS.png" alt="Image" width="180" height="180">""")
89
- with gr.Column(elem_id="col-container"):
90
- # gr.HTML(
91
- # """<hr style="border-top: 5px solid white;">"""
92
- # )
93
- gr.HTML(
94
- """<br>
95
- <h1 style="text-align:center;">
96
- ADOPLE AI Document QA
97
- </h1> """
98
- )
99
- # gr.HTML(
100
- # """<hr style="border-top: 5px solid white;">"""
101
- # )
102
-
103
- gr.Markdown("**Upload your file**")
104
- with gr.Row(elem_id="row-flex"):
105
- # with gr.Column(scale=0.85):
106
- # file_url = gr.Textbox(
107
- # value="",
108
- # label="Upload your file",
109
- # placeholder="Enter a url",
110
- # show_label=False,
111
- # visible=False
112
- # )
113
- with gr.Column(scale=0.90, min_width=160):
114
- file_output = gr.File(elem_classes="filenameshow")
115
- with gr.Column(scale=0.10, min_width=160):
116
- upload_button = gr.UploadButton(
117
- "Browse File", file_types=[".txt", ".pdf", ".doc", ".docx"],
118
- elem_classes="filenameshow")
119
- with gr.Row():
120
- with gr.Column(scale=1, min_width=0):
121
- user_question = gr.Textbox(value="",label='Question Box :',show_label=True, placeholder="Ask a question about your file:",elem_classes="spaceH")
122
- with gr.Row():
123
- with gr.Column(scale=1, min_width=0):
124
- answer = gr.Textbox(value="",label='Answer Box :',show_label=True, placeholder="",lines=5)
125
-
126
- #file_url.submit(upload_via_url, file_url, [file_output, state])
127
- upload_button.upload(upload_file, upload_button, [file_output,state])
128
- user_question.submit(answer_question, [user_question, state], [answer])
129
-
130
- demo.queue().launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AI-Zero-to-Hero/03-GR-AI-Text2ArtGenerator/app.py DELETED
@@ -1,228 +0,0 @@
1
- import os
2
-
3
- os.system("git clone --recursive https://github.com/JD-P/cloob-latent-diffusion")
4
- os.system("cd cloob-latent-diffusion;pip install omegaconf pillow pytorch-lightning einops wandb ftfy regex ./CLIP")
5
-
6
- import argparse
7
- from functools import partial
8
- from pathlib import Path
9
- import sys
10
- sys.path.append('./cloob-latent-diffusion')
11
- sys.path.append('./cloob-latent-diffusion/cloob-training')
12
- sys.path.append('./cloob-latent-diffusion/latent-diffusion')
13
- sys.path.append('./cloob-latent-diffusion/taming-transformers')
14
- sys.path.append('./cloob-latent-diffusion/v-diffusion-pytorch')
15
- from omegaconf import OmegaConf
16
- from PIL import Image
17
- import torch
18
- from torch import nn
19
- from torch.nn import functional as F
20
- from torchvision import transforms
21
- from torchvision.transforms import functional as TF
22
- from tqdm import trange
23
- from CLIP import clip
24
- from cloob_training import model_pt, pretrained
25
- import ldm.models.autoencoder
26
- from diffusion import sampling, utils
27
- import train_latent_diffusion as train
28
- from huggingface_hub import hf_hub_url, cached_download
29
- import random
30
-
31
- # Download the model files
32
- checkpoint = cached_download(hf_hub_url("huggan/distill-ccld-wa", filename="model_student.ckpt"))
33
- ae_model_path = cached_download(hf_hub_url("huggan/ccld_wa", filename="ae_model.ckpt"))
34
- ae_config_path = cached_download(hf_hub_url("huggan/ccld_wa", filename="ae_model.yaml"))
35
-
36
- # Define a few utility functions
37
-
38
-
39
- def parse_prompt(prompt, default_weight=3.):
40
- if prompt.startswith('http://') or prompt.startswith('https://'):
41
- vals = prompt.rsplit(':', 2)
42
- vals = [vals[0] + ':' + vals[1], *vals[2:]]
43
- else:
44
- vals = prompt.rsplit(':', 1)
45
- vals = vals + ['', default_weight][len(vals):]
46
- return vals[0], float(vals[1])
47
-
48
-
49
- def resize_and_center_crop(image, size):
50
- fac = max(size[0] / image.size[0], size[1] / image.size[1])
51
- image = image.resize((int(fac * image.size[0]), int(fac * image.size[1])), Image.LANCZOS)
52
- return TF.center_crop(image, size[::-1])
53
-
54
-
55
- # Load the models
56
- device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
57
- print('Using device:', device)
58
- print('loading models')
59
-
60
- # autoencoder
61
- ae_config = OmegaConf.load(ae_config_path)
62
- ae_model = ldm.models.autoencoder.AutoencoderKL(**ae_config.model.params)
63
- ae_model.eval().requires_grad_(False).to(device)
64
- ae_model.load_state_dict(torch.load(ae_model_path))
65
- n_ch, side_y, side_x = 4, 32, 32
66
-
67
- # diffusion model
68
- model = train.DiffusionModel(192, [1,1,2,2], autoencoder_scale=torch.tensor(4.3084))
69
- model.load_state_dict(torch.load(checkpoint, map_location='cpu'))
70
- model = model.to(device).eval().requires_grad_(False)
71
-
72
- # CLOOB
73
- cloob_config = pretrained.get_config('cloob_laion_400m_vit_b_16_16_epochs')
74
- cloob = model_pt.get_pt_model(cloob_config)
75
- checkpoint = pretrained.download_checkpoint(cloob_config)
76
- cloob.load_state_dict(model_pt.get_pt_params(cloob_config, checkpoint))
77
- cloob.eval().requires_grad_(False).to(device)
78
-
79
-
80
- # The key function: returns a list of n PIL images
81
- def generate(n=1, prompts=['a red circle'], images=[], seed=42, steps=15,
82
- method='plms', eta=None):
83
- zero_embed = torch.zeros([1, cloob.config['d_embed']], device=device)
84
- target_embeds, weights = [zero_embed], []
85
-
86
- for prompt in prompts:
87
- txt, weight = parse_prompt(prompt)
88
- target_embeds.append(cloob.text_encoder(cloob.tokenize(txt).to(device)).float())
89
- weights.append(weight)
90
-
91
- for prompt in images:
92
- path, weight = parse_prompt(prompt)
93
- img = Image.open(utils.fetch(path)).convert('RGB')
94
- clip_size = cloob.config['image_encoder']['image_size']
95
- img = resize_and_center_crop(img, (clip_size, clip_size))
96
- batch = TF.to_tensor(img)[None].to(device)
97
- embed = F.normalize(cloob.image_encoder(cloob.normalize(batch)).float(), dim=-1)
98
- target_embeds.append(embed)
99
- weights.append(weight)
100
-
101
- weights = torch.tensor([1 - sum(weights), *weights], device=device)
102
-
103
- torch.manual_seed(seed)
104
-
105
- def cfg_model_fn(x, t):
106
- n = x.shape[0]
107
- n_conds = len(target_embeds)
108
- x_in = x.repeat([n_conds, 1, 1, 1])
109
- t_in = t.repeat([n_conds])
110
- clip_embed_in = torch.cat([*target_embeds]).repeat_interleave(n, 0)
111
- vs = model(x_in, t_in, clip_embed_in).view([n_conds, n, *x.shape[1:]])
112
- v = vs.mul(weights[:, None, None, None, None]).sum(0)
113
- return v
114
-
115
- def run(x, steps):
116
- if method == 'ddpm':
117
- return sampling.sample(cfg_model_fn, x, steps, 1., {})
118
- if method == 'ddim':
119
- return sampling.sample(cfg_model_fn, x, steps, eta, {})
120
- if method == 'prk':
121
- return sampling.prk_sample(cfg_model_fn, x, steps, {})
122
- if method == 'plms':
123
- return sampling.plms_sample(cfg_model_fn, x, steps, {})
124
- if method == 'pie':
125
- return sampling.pie_sample(cfg_model_fn, x, steps, {})
126
- if method == 'plms2':
127
- return sampling.plms2_sample(cfg_model_fn, x, steps, {})
128
- assert False
129
-
130
- batch_size = n
131
- x = torch.randn([n, n_ch, side_y, side_x], device=device)
132
- t = torch.linspace(1, 0, steps + 1, device=device)[:-1]
133
- steps = utils.get_spliced_ddpm_cosine_schedule(t)
134
- pil_ims = []
135
- for i in trange(0, n, batch_size):
136
- cur_batch_size = min(n - i, batch_size)
137
- out_latents = run(x[i:i+cur_batch_size], steps)
138
- outs = ae_model.decode(out_latents * torch.tensor(2.55).to(device))
139
- for j, out in enumerate(outs):
140
- pil_ims.append(utils.to_pil_image(out))
141
-
142
- return pil_ims
143
-
144
-
145
- import gradio as gr
146
-
147
- def gen_ims(prompt, im_prompt=None, seed=None, n_steps=10, method='plms'):
148
- if seed == None :
149
- seed = random.randint(0, 10000)
150
- print( prompt, im_prompt, seed, n_steps)
151
- prompts = [prompt]
152
- im_prompts = []
153
- if im_prompt != None:
154
- im_prompts = [im_prompt]
155
- pil_ims = generate(n=1, prompts=prompts, images=im_prompts, seed=seed, steps=n_steps, method=method)
156
- return pil_ims[0]
157
-
158
- iface = gr.Interface(fn=gen_ims,
159
- inputs=[#gr.inputs.Slider(minimum=1, maximum=1, step=1, default=1,label="Number of images"),
160
- #gr.inputs.Slider(minimum=0, maximum=200, step=1, label='Random seed', default=0),
161
- gr.inputs.Textbox(label="Text prompt"),
162
- gr.inputs.Image(optional=True, label="Image prompt", type='filepath'),
163
- #gr.inputs.Slider(minimum=10, maximum=35, step=1, default=15,label="Number of steps")
164
- ],
165
- outputs=[gr.outputs.Image(type="pil", label="Generated Image")],
166
- examples=[
167
- ["Virgin and Child, in the style of Jacopo Bellini"],
168
- ["Katsushika Hokusai, The Dragon of Smoke Escaping from Mount Fuji"],
169
- ["Moon Light Sonata by Basuki Abdullah"],
170
- ["Twon Tree by M.C. Escher"],
171
- ["Futurism, in the style of Wassily Kandinsky"],
172
- ["Art Nouveau, in the style of John Singer Sargent"],
173
- ["Surrealism, in the style of Edgar Degas"],
174
- ["Expressionism, in the style of Wassily Kandinsky"],
175
- ["Futurism, in the style of Egon Schiele"],
176
- ["Neoclassicism, in the style of Gustav Klimt"],
177
- ["Cubism, in the style of Gustav Klimt"],
178
- ["Op Art, in the style of Marc Chagall"],
179
- ["Romanticism, in the style of M.C. Escher"],
180
- ["Futurism, in the style of M.C. Escher"],
181
- ["Abstract Art, in the style of M.C. Escher"],
182
- ["Mannerism, in the style of Paul Klee"],
183
- ["Romanesque Art, in the style of Leonardo da Vinci"],
184
- ["High Renaissance, in the style of Rembrandt"],
185
- ["Magic Realism, in the style of Gustave Dore"],
186
- ["Realism, in the style of Jean-Michel Basquiat"],
187
- ["Art Nouveau, in the style of Paul Gauguin"],
188
- ["Avant-garde, in the style of Pierre-Auguste Renoir"],
189
- ["Baroque, in the style of Edward Hopper"],
190
- ["Post-Impressionism, in the style of Wassily Kandinsky"],
191
- ["Naturalism, in the style of Rene Magritte"],
192
- ["Constructivism, in the style of Paul Cezanne"],
193
- ["Abstract Expressionism, in the style of Henri Matisse"],
194
- ["Pop Art, in the style of Vincent van Gogh"],
195
- ["Futurism, in the style of Wassily Kandinsky"],
196
- ["Futurism, in the style of Zdzislaw Beksinski"],
197
- ['Surrealism, in the style of Salvador Dali'],
198
- ["Aaron Wacker, oil on canvas"],
199
- ["abstract"],
200
- ["landscape"],
201
- ["portrait"],
202
- ["sculpture"],
203
- ["genre painting"],
204
- ["installation"],
205
- ["photo"],
206
- ["figurative"],
207
- ["illustration"],
208
- ["still life"],
209
- ["history painting"],
210
- ["cityscape"],
211
- ["marina"],
212
- ["animal painting"],
213
- ["design"],
214
- ["calligraphy"],
215
- ["symbolic painting"],
216
- ["graffiti"],
217
- ["performance"],
218
- ["mythological painting"],
219
- ["battle painting"],
220
- ["self-portrait"],
221
- ["Impressionism, oil on canvas"]
222
- ],
223
- title='Art Generator and Style Mixer from 🧠 Cloob and 🎨 WikiArt - Visual Art Encyclopedia:',
224
- description="Trained on images from the [WikiArt](https://www.wikiart.org/) dataset, comprised of visual arts",
225
- article = 'Model used is: [model card](https://huggingface.co/huggan/distill-ccld-wa)..'
226
-
227
- )
228
- iface.launch(enable_queue=True) # , debug=True for colab debugging
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AIGC-Audio/AudioGPT/NeuralSeq/modules/hifigan/mel_utils.py DELETED
@@ -1,80 +0,0 @@
1
- import numpy as np
2
- import torch
3
- import torch.utils.data
4
- from librosa.filters import mel as librosa_mel_fn
5
- from scipy.io.wavfile import read
6
-
7
- MAX_WAV_VALUE = 32768.0
8
-
9
-
10
- def load_wav(full_path):
11
- sampling_rate, data = read(full_path)
12
- return data, sampling_rate
13
-
14
-
15
- def dynamic_range_compression(x, C=1, clip_val=1e-5):
16
- return np.log(np.clip(x, a_min=clip_val, a_max=None) * C)
17
-
18
-
19
- def dynamic_range_decompression(x, C=1):
20
- return np.exp(x) / C
21
-
22
-
23
- def dynamic_range_compression_torch(x, C=1, clip_val=1e-5):
24
- return torch.log(torch.clamp(x, min=clip_val) * C)
25
-
26
-
27
- def dynamic_range_decompression_torch(x, C=1):
28
- return torch.exp(x) / C
29
-
30
-
31
- def spectral_normalize_torch(magnitudes):
32
- output = dynamic_range_compression_torch(magnitudes)
33
- return output
34
-
35
-
36
- def spectral_de_normalize_torch(magnitudes):
37
- output = dynamic_range_decompression_torch(magnitudes)
38
- return output
39
-
40
-
41
- mel_basis = {}
42
- hann_window = {}
43
-
44
-
45
- def mel_spectrogram(y, hparams, center=False, complex=False):
46
- # hop_size: 512 # For 22050Hz, 275 ~= 12.5 ms (0.0125 * sample_rate)
47
- # win_size: 2048 # For 22050Hz, 1100 ~= 50 ms (If None, win_size: fft_size) (0.05 * sample_rate)
48
- # fmin: 55 # Set this to 55 if your speaker is male! if female, 95 should help taking off noise. (To test depending on dataset. Pitch info: male~[65, 260], female~[100, 525])
49
- # fmax: 10000 # To be increased/reduced depending on data.
50
- # fft_size: 2048 # Extra window size is filled with 0 paddings to match this parameter
51
- # n_fft, num_mels, sampling_rate, hop_size, win_size, fmin, fmax,
52
- n_fft = hparams['fft_size']
53
- num_mels = hparams['audio_num_mel_bins']
54
- sampling_rate = hparams['audio_sample_rate']
55
- hop_size = hparams['hop_size']
56
- win_size = hparams['win_size']
57
- fmin = hparams['fmin']
58
- fmax = hparams['fmax']
59
- y = y.clamp(min=-1., max=1.)
60
- global mel_basis, hann_window
61
- if fmax not in mel_basis:
62
- mel = librosa_mel_fn(sampling_rate, n_fft, num_mels, fmin, fmax)
63
- mel_basis[str(fmax) + '_' + str(y.device)] = torch.from_numpy(mel).float().to(y.device)
64
- hann_window[str(y.device)] = torch.hann_window(win_size).to(y.device)
65
-
66
- y = torch.nn.functional.pad(y.unsqueeze(1), (int((n_fft - hop_size) / 2), int((n_fft - hop_size) / 2)),
67
- mode='reflect')
68
- y = y.squeeze(1)
69
-
70
- spec = torch.stft(y, n_fft, hop_length=hop_size, win_length=win_size, window=hann_window[str(y.device)],
71
- center=center, pad_mode='reflect', normalized=False, onesided=True)
72
-
73
- if not complex:
74
- spec = torch.sqrt(spec.pow(2).sum(-1) + (1e-9))
75
- spec = torch.matmul(mel_basis[str(fmax) + '_' + str(y.device)], spec)
76
- spec = spectral_normalize_torch(spec)
77
- else:
78
- B, C, T, _ = spec.shape
79
- spec = spec.transpose(1, 2) # [B, T, n_fft, 2]
80
- return spec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/ALSv/FSW/roop/processors/__init__.py DELETED
File without changes
spaces/ATang0729/Forecast4Muses/Model/Model6/Model6_2_ProfileRecogition/mmpretrain/configs/.ipynb_checkpoints/resnext101_4xb16_1024e_4channel-checkpoint.py DELETED
@@ -1,88 +0,0 @@
1
- _base_ = [ # 此配置文件将继承所有 `_base_` 中的配置
2
- '../configs/_base_/schedules/custom_schedule.py', # 训练策略配置
3
- '../configs/_base_/default_runtime.py' # 默认运行设置
4
- ]
5
-
6
- default_hooks = dict(
7
- # print log every 50 iterations.
8
- logger=dict(type='LoggerHook', interval=25),
9
- # save checkpoint per 8 epochs.
10
- checkpoint=dict(save_best='auto', interval=16)
11
- )
12
-
13
- visualizer = dict(
14
- vis_backends=[dict(type='LocalVisBackend'),
15
- dict(type='WandbVisBackend')])
16
-
17
- dataset_type = 'CustomDataset'
18
-
19
- # config of pipline
20
- train_pipeline = [
21
- dict(type='LoadImageFromFile', imdecode_backend='pillow', color_type='unchanged'), # 读取图像
22
- dict(type='RandomResizedCrop', scale=224), # 随机放缩裁剪
23
- dict(type='RandomFlip', prob=0.5, direction='horizontal'), # 随机水平翻转
24
- dict(type='PackInputs'), # 准备图像以及标签
25
- ]
26
-
27
- test_pipeline = [
28
- dict(type='LoadImageFromFile', imdecode_backend='pillow', color_type='unchanged'), # 读取图像
29
- dict(type='ResizeEdge', scale=256, edge='short'), # 缩放短边尺寸至 256px
30
- dict(type='CenterCrop', crop_size=224), # 中心裁剪
31
- dict(type='PackInputs'), # 准备图像以及标签
32
- ]
33
-
34
- # config of dataloader
35
- train_dataloader = dict(
36
- batch_size=16, # 每张 GPU 的 batchsize
37
- num_workers=5, # 每个 GPU 的线程数
38
- dataset=dict( # 训练数据集
39
- type=dataset_type,
40
- data_root='../2_preprocess_data_3000',
41
- with_label=True,
42
- ann_file='',
43
- data_prefix='train',
44
- pipeline=train_pipeline),
45
- sampler=dict(type='DefaultSampler', shuffle=True), # 默认采样器
46
- persistent_workers=True, # 是否保持进程,可以缩短每个 epoch 的准备时间
47
- )
48
-
49
- # 构造验证集 dataloader
50
- val_dataloader = dict(
51
- batch_size=16,
52
- num_workers=5,
53
- dataset=dict(
54
- type=dataset_type,
55
- data_root='../2_preprocess_data_3000',
56
- with_label=True,
57
- ann_file='',
58
- data_prefix='val',
59
- pipeline=test_pipeline),
60
- sampler=dict(type='DefaultSampler', shuffle=False),
61
- persistent_workers=True,
62
- )
63
-
64
- # set evaluator of validation dataset. Here uses top1 and top3 accuracy
65
- val_evaluator = dict(type='Accuracy', topk=(1, 3))
66
-
67
- test_dataloader = val_dataloader
68
- test_evaluator = val_evaluator
69
-
70
- model = dict(
71
- type='ImageClassifier', # 主模型类型(对于图像分类任务,使用 `ImageClassifier`)
72
- backbone=dict(
73
- type='ResNeXt', # 主干网络类型
74
- depth=101,
75
- in_channels=4, # 输入通道数
76
- ),
77
- neck=dict(type='GlobalAveragePooling'), # 颈网络类型
78
- head=dict(
79
- type='LinearClsHead', # 分类颈网络类型
80
- # 除了 `type` 之外的所有字段都来自 `LinearClsHead` 类的 __init__ 方法
81
- # 可查阅 https://mmpretrain.readthedocs.io/zh_CN/latest/api/generated/mmpretrain.models.heads.LinearClsHead.html
82
- num_classes=7, # 分类类别数
83
- in_channels=2048,
84
- loss=dict(type='CrossEntropyLoss', loss_weight=1.0), # 损失函数配置信息
85
- topk=(1, 3), # 评估指标,Top-k 准确率
86
- ))
87
-
88
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Ababababababbababa/Ashaar/poetry_diacritizer/__init__.py DELETED
@@ -1 +0,0 @@
1
- from poetry_diacritizer import predict
 
 
spaces/Adapter/CoAdapter/ldm/modules/encoders/__init__.py DELETED
File without changes
spaces/Adr740/CV_XPLORER_POC/data.py DELETED
@@ -1,4 +0,0 @@
1
-
2
-
3
- import pandas as pd
4
- data = pd.read_parquet("data2.parquet")
 
 
 
 
 
spaces/AfrodreamsAI/afrodreams/models/download_models.py DELETED
@@ -1,31 +0,0 @@
1
- import torch
2
- from os import path
3
- from sys import version_info
4
- from collections import OrderedDict
5
- from torch.utils.model_zoo import load_url
6
-
7
-
8
- # Download the VGG-19 model and fix the layer names
9
- print("Downloading the VGG-19 model")
10
- sd = load_url("https://web.eecs.umich.edu/~justincj/models/vgg19-d01eb7cb.pth")
11
- map = {'classifier.1.weight':u'classifier.0.weight', 'classifier.1.bias':u'classifier.0.bias', 'classifier.4.weight':u'classifier.3.weight', 'classifier.4.bias':u'classifier.3.bias'}
12
- sd = OrderedDict([(map[k] if k in map else k,v) for k,v in sd.items()])
13
- torch.save(sd, path.join("models", "vgg19-d01eb7cb.pth"))
14
-
15
- # Download the VGG-16 model and fix the layer names
16
- print("Downloading the VGG-16 model")
17
- sd = load_url("https://web.eecs.umich.edu/~justincj/models/vgg16-00b39a1b.pth")
18
- map = {'classifier.1.weight':u'classifier.0.weight', 'classifier.1.bias':u'classifier.0.bias', 'classifier.4.weight':u'classifier.3.weight', 'classifier.4.bias':u'classifier.3.bias'}
19
- sd = OrderedDict([(map[k] if k in map else k,v) for k,v in sd.items()])
20
- torch.save(sd, path.join("models", "vgg16-00b39a1b.pth"))
21
-
22
- # Download the NIN model
23
- print("Downloading the NIN model")
24
- if version_info[0] < 3:
25
- import urllib
26
- urllib.URLopener().retrieve("https://raw.githubusercontent.com/ProGamerGov/pytorch-nin/master/nin_imagenet.pth", path.join("models", "nin_imagenet.pth"))
27
- else:
28
- import urllib.request
29
- urllib.request.urlretrieve("https://raw.githubusercontent.com/ProGamerGov/pytorch-nin/master/nin_imagenet.pth", path.join("models", "nin_imagenet.pth"))
30
-
31
- print("All models have been successfully downloaded")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/circularprogresscanvas/Factory.js DELETED
@@ -1,13 +0,0 @@
1
- import CircularProgressCanvas from './CircularProgressCanvas.js';
2
- import ObjectFactory from '../ObjectFactory.js';
3
- import SetValue from '../../../plugins/utils/object/SetValue.js';
4
-
5
- ObjectFactory.register('circularProgressCanvas', function (x, y, radius, barColor, value, config) {
6
- var gameObject = new CircularProgressCanvas(this.scene, x, y, radius, barColor, value, config);
7
- this.scene.add.existing(gameObject);
8
- return gameObject;
9
- });
10
-
11
- SetValue(window, 'RexPlugins.UI.CircularProgressCanvas', CircularProgressCanvas);
12
-
13
- export default CircularProgressCanvas;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/rotate/Factory.d.ts DELETED
@@ -1,7 +0,0 @@
1
- // import * as Phaser from 'phaser';
2
- import Rotate from "./Rotate";
3
-
4
- export default function (
5
- gameObject: Phaser.GameObjects.GameObject | Phaser.Scene,
6
- config?: Rotate.IConfig
7
- ): Rotate;
 
 
 
 
 
 
 
 
spaces/AkitoP/umamusume_bert_vits2/bert/chinese-roberta-wwm-ext-large/README.md DELETED
@@ -1,57 +0,0 @@
1
- ---
2
- language:
3
- - zh
4
- tags:
5
- - bert
6
- license: "apache-2.0"
7
- ---
8
-
9
- # Please use 'Bert' related functions to load this model!
10
-
11
- ## Chinese BERT with Whole Word Masking
12
- For further accelerating Chinese natural language processing, we provide **Chinese pre-trained BERT with Whole Word Masking**.
13
-
14
- **[Pre-Training with Whole Word Masking for Chinese BERT](https://arxiv.org/abs/1906.08101)**
15
- Yiming Cui, Wanxiang Che, Ting Liu, Bing Qin, Ziqing Yang, Shijin Wang, Guoping Hu
16
-
17
- This repository is developed based on:https://github.com/google-research/bert
18
-
19
- You may also interested in,
20
- - Chinese BERT series: https://github.com/ymcui/Chinese-BERT-wwm
21
- - Chinese MacBERT: https://github.com/ymcui/MacBERT
22
- - Chinese ELECTRA: https://github.com/ymcui/Chinese-ELECTRA
23
- - Chinese XLNet: https://github.com/ymcui/Chinese-XLNet
24
- - Knowledge Distillation Toolkit - TextBrewer: https://github.com/airaria/TextBrewer
25
-
26
- More resources by HFL: https://github.com/ymcui/HFL-Anthology
27
-
28
- ## Citation
29
- If you find the technical report or resource is useful, please cite the following technical report in your paper.
30
- - Primary: https://arxiv.org/abs/2004.13922
31
- ```
32
- @inproceedings{cui-etal-2020-revisiting,
33
- title = "Revisiting Pre-Trained Models for {C}hinese Natural Language Processing",
34
- author = "Cui, Yiming and
35
- Che, Wanxiang and
36
- Liu, Ting and
37
- Qin, Bing and
38
- Wang, Shijin and
39
- Hu, Guoping",
40
- booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings",
41
- month = nov,
42
- year = "2020",
43
- address = "Online",
44
- publisher = "Association for Computational Linguistics",
45
- url = "https://www.aclweb.org/anthology/2020.findings-emnlp.58",
46
- pages = "657--668",
47
- }
48
- ```
49
- - Secondary: https://arxiv.org/abs/1906.08101
50
- ```
51
- @article{chinese-bert-wwm,
52
- title={Pre-Training with Whole Word Masking for Chinese BERT},
53
- author={Cui, Yiming and Che, Wanxiang and Liu, Ting and Qin, Bing and Yang, Ziqing and Wang, Shijin and Hu, Guoping},
54
- journal={arXiv preprint arXiv:1906.08101},
55
- year={2019}
56
- }
57
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AlanMars/QYL-AI-Space/modules/utils.py DELETED
@@ -1,669 +0,0 @@
1
- # -*- coding:utf-8 -*-
2
- from __future__ import annotations
3
- from typing import TYPE_CHECKING, Any, Callable, Dict, List, Tuple, Type
4
- import logging
5
- import json
6
- import os
7
- import datetime
8
- import hashlib
9
- import csv
10
- import requests
11
- import re
12
- import html
13
- import sys
14
- import subprocess
15
-
16
- import gradio as gr
17
- from pypinyin import lazy_pinyin
18
- import tiktoken
19
- import mdtex2html
20
- from markdown import markdown
21
- from pygments import highlight
22
- from pygments.lexers import get_lexer_by_name
23
- from pygments.formatters import HtmlFormatter
24
- import pandas as pd
25
-
26
- from modules.presets import *
27
- from . import shared
28
- from modules.config import retrieve_proxy, hide_history_when_not_logged_in
29
-
30
- if TYPE_CHECKING:
31
- from typing import TypedDict
32
-
33
-
34
- class DataframeData(TypedDict):
35
- headers: List[str]
36
- data: List[List[str | int | bool]]
37
-
38
-
39
- def predict(current_model, *args):
40
- iter = current_model.predict(*args)
41
- for i in iter:
42
- yield i
43
-
44
-
45
- def billing_info(current_model):
46
- return current_model.billing_info()
47
-
48
-
49
- def set_key(current_model, *args):
50
- # logging.debug(f"\n Set new key as: {args}. Old Key : {current_model.api_key}")
51
- return current_model.set_key(*args)
52
-
53
-
54
- def load_chat_history(current_model, *args):
55
- return current_model.load_chat_history(*args)
56
-
57
-
58
- def interrupt(current_model, *args):
59
- return current_model.interrupt(*args)
60
-
61
-
62
- def reset(current_model, *args):
63
- return current_model.reset(*args)
64
-
65
-
66
- def retry(current_model, *args):
67
- iter = current_model.retry(*args)
68
- for i in iter:
69
- yield i
70
-
71
-
72
- def delete_first_conversation(current_model, *args):
73
- return current_model.delete_first_conversation(*args)
74
-
75
-
76
- def delete_last_conversation(current_model, *args):
77
- return current_model.delete_last_conversation(*args)
78
-
79
-
80
- def set_system_prompt(current_model, *args):
81
- logging.debug(f"\n Set new system prompt as: {args}")
82
- return current_model.set_system_prompt(*args)
83
-
84
-
85
- def save_chat_history(current_model, *args):
86
- return current_model.save_chat_history(*args)
87
-
88
-
89
- def export_markdown(current_model, *args):
90
- return current_model.export_markdown(*args)
91
-
92
-
93
- def load_chat_history(current_model, *args):
94
- return current_model.load_chat_history(*args)
95
-
96
-
97
- def upload_chat_history(current_model, *args):
98
- return current_model.load_chat_history(*args)
99
-
100
-
101
- def set_token_upper_limit(current_model, *args):
102
- return current_model.set_token_upper_limit(*args)
103
-
104
-
105
- def set_temperature(current_model, *args):
106
- current_model.set_temperature(*args)
107
-
108
-
109
- def set_top_p(current_model, *args):
110
- current_model.set_top_p(*args)
111
-
112
-
113
- def set_n_choices(current_model, *args):
114
- current_model.set_n_choices(*args)
115
-
116
-
117
- def set_stop_sequence(current_model, *args):
118
- current_model.set_stop_sequence(*args)
119
-
120
-
121
- def set_max_tokens(current_model, *args):
122
- current_model.set_max_tokens(*args)
123
-
124
-
125
- def set_presence_penalty(current_model, *args):
126
- current_model.set_presence_penalty(*args)
127
-
128
-
129
- def set_frequency_penalty(current_model, *args):
130
- current_model.set_frequency_penalty(*args)
131
-
132
-
133
- def set_logit_bias(current_model, *args):
134
- current_model.set_logit_bias(*args)
135
-
136
-
137
- def set_user_identifier(current_model, *args):
138
- current_model.set_user_identifier(*args)
139
-
140
-
141
- def set_single_turn(current_model, *args):
142
- current_model.set_single_turn(*args)
143
-
144
-
145
- def handle_file_upload(current_model, *args):
146
- return current_model.handle_file_upload(*args)
147
-
148
-
149
- def like(current_model, *args):
150
- return current_model.like(*args)
151
-
152
-
153
- def dislike(current_model, *args):
154
- return current_model.dislike(*args)
155
-
156
-
157
- def count_token(message):
158
- encoding = tiktoken.get_encoding("cl100k_base")
159
- input_str = f"role: {message['role']}, content: {message['content']}"
160
- length = len(encoding.encode(input_str))
161
- return length
162
-
163
-
164
- def markdown_to_html_with_syntax_highlight(md_str):
165
- def replacer(match):
166
- lang = match.group(1) or "text"
167
- code = match.group(2)
168
-
169
- try:
170
- lexer = get_lexer_by_name(lang, stripall=True)
171
- except ValueError:
172
- lexer = get_lexer_by_name("text", stripall=True)
173
-
174
- formatter = HtmlFormatter()
175
- highlighted_code = highlight(code, lexer, formatter)
176
-
177
- return f'<pre><code class="{lang}">{highlighted_code}</code></pre>'
178
-
179
- code_block_pattern = r"```(\w+)?\n([\s\S]+?)\n```"
180
- md_str = re.sub(code_block_pattern, replacer, md_str, flags=re.MULTILINE)
181
-
182
- html_str = markdown(md_str)
183
- return html_str
184
-
185
-
186
- def normalize_markdown(md_text: str) -> str:
187
- lines = md_text.split("\n")
188
- normalized_lines = []
189
- inside_list = False
190
-
191
- for i, line in enumerate(lines):
192
- if re.match(r"^(\d+\.|-|\*|\+)\s", line.strip()):
193
- if not inside_list and i > 0 and lines[i - 1].strip() != "":
194
- normalized_lines.append("")
195
- inside_list = True
196
- normalized_lines.append(line)
197
- elif inside_list and line.strip() == "":
198
- if i < len(lines) - 1 and not re.match(
199
- r"^(\d+\.|-|\*|\+)\s", lines[i + 1].strip()
200
- ):
201
- normalized_lines.append(line)
202
- continue
203
- else:
204
- inside_list = False
205
- normalized_lines.append(line)
206
-
207
- return "\n".join(normalized_lines)
208
-
209
-
210
- def convert_mdtext(md_text):
211
- code_block_pattern = re.compile(r"```(.*?)(?:```|$)", re.DOTALL)
212
- inline_code_pattern = re.compile(r"`(.*?)`", re.DOTALL)
213
- code_blocks = code_block_pattern.findall(md_text)
214
- non_code_parts = code_block_pattern.split(md_text)[::2]
215
-
216
- result = []
217
- raw = f'<div class="raw-message hideM">{html.escape(md_text)}</div>'
218
- for non_code, code in zip(non_code_parts, code_blocks + [""]):
219
- if non_code.strip():
220
- non_code = normalize_markdown(non_code)
221
- result.append(markdown(non_code, extensions=["tables"]))
222
- if code.strip():
223
- # _, code = detect_language(code) # 暂时去除代码高亮功能,因为在大段代码的情况下会出现问题
224
- # code = code.replace("\n\n", "\n") # 暂时去除代码中的空行,因为在大段代码的情况下会出现问题
225
- code = f"\n```{code}\n\n```"
226
- code = markdown_to_html_with_syntax_highlight(code)
227
- result.append(code)
228
- result = "".join(result)
229
- output = f'<div class="md-message">{result}</div>'
230
- output += raw
231
- output += ALREADY_CONVERTED_MARK
232
- return output
233
-
234
-
235
- def convert_asis(userinput):
236
- return (
237
- f'<p style="white-space:pre-wrap;">{html.escape(userinput)}</p>'
238
- + ALREADY_CONVERTED_MARK
239
- )
240
-
241
-
242
- def detect_converted_mark(userinput):
243
- try:
244
- if userinput.endswith(ALREADY_CONVERTED_MARK):
245
- return True
246
- else:
247
- return False
248
- except:
249
- return True
250
-
251
-
252
- def detect_language(code):
253
- if code.startswith("\n"):
254
- first_line = ""
255
- else:
256
- first_line = code.strip().split("\n", 1)[0]
257
- language = first_line.lower() if first_line else ""
258
- code_without_language = code[len(first_line):].lstrip() if first_line else code
259
- return language, code_without_language
260
-
261
-
262
- def construct_text(role, text):
263
- return {"role": role, "content": text}
264
-
265
-
266
- def construct_user(text):
267
- return construct_text("user", text)
268
-
269
-
270
- def construct_system(text):
271
- return construct_text("system", text)
272
-
273
-
274
- def construct_assistant(text):
275
- return construct_text("assistant", text)
276
-
277
-
278
- def save_file(filename, system, history, chatbot, user_name):
279
- logging.debug(f"{user_name} 保存对话历史中……")
280
- os.makedirs(os.path.join(HISTORY_DIR, user_name), exist_ok=True)
281
- if filename.endswith(".json"):
282
- json_s = {"system": system, "history": history, "chatbot": chatbot}
283
- if "/" in filename or "\\" in filename:
284
- history_file_path = filename
285
- else:
286
- history_file_path = os.path.join(HISTORY_DIR, user_name, filename)
287
- with open(history_file_path, "w") as f:
288
- json.dump(json_s, f)
289
- elif filename.endswith(".md"):
290
- md_s = f"system: \n- {system} \n"
291
- for data in history:
292
- md_s += f"\n{data['role']}: \n- {data['content']} \n"
293
- with open(os.path.join(HISTORY_DIR, user_name, filename), "w", encoding="utf8") as f:
294
- f.write(md_s)
295
- logging.debug(f"{user_name} 保存对话历史完毕")
296
- return os.path.join(HISTORY_DIR, user_name, filename)
297
-
298
-
299
- def sorted_by_pinyin(list):
300
- return sorted(list, key=lambda char: lazy_pinyin(char)[0][0])
301
-
302
-
303
- def get_file_names(dir, plain=False, filetypes=[".json"]):
304
- logging.debug(f"获取文件名列表,目录为{dir},文件类型为{filetypes},是否为纯文本列表{plain}")
305
- files = []
306
- try:
307
- for type in filetypes:
308
- files += [f for f in os.listdir(dir) if f.endswith(type)]
309
- except FileNotFoundError:
310
- files = []
311
- files = sorted_by_pinyin(files)
312
- if files == []:
313
- files = [""]
314
- logging.debug(f"files are:{files}")
315
- if plain:
316
- return files
317
- else:
318
- return gr.Dropdown.update(choices=files)
319
-
320
-
321
- def get_history_names(plain=False, user_name=""):
322
- logging.debug(f"从用户 {user_name} 中获取历史记录文件名列表")
323
- if user_name == "" and hide_history_when_not_logged_in:
324
- return ""
325
- else:
326
- return get_file_names(os.path.join(HISTORY_DIR, user_name), plain)
327
-
328
-
329
- def load_user_prompts(user_name: str) -> list[str]:
330
- filename = "user_prompt_dict.json"
331
- logging.info(f"加载用户提示词文件{filename}")
332
-
333
- all_user_prompts = []
334
- if filename.endswith(".json"):
335
- with open(os.path.join(USERS_DIR, filename), "r", encoding="utf8") as f:
336
- all_user_prompts = json.load(f)
337
- logging.debug(f"all_user_prompts: {all_user_prompts}")
338
-
339
- current_user_prompt_ids = all_user_prompts[user_name]
340
- logging.debug(f"current_user_prompt_ids: {current_user_prompt_ids}")
341
-
342
- template_name_list = get_template_names(plain=True)
343
- logging.debug(f"template_name_list: {template_name_list}")
344
-
345
- template_id_role_dict = load_template(template_name_list[0], mode=3) # [id:act])
346
- logging.debug(f"template_id_role_dict: {template_id_role_dict}")
347
- '''
348
- template_id_role_dict = {}
349
- for template_name in template_name_list:
350
- template_id_role_dict.update(load_template(template_name, mode=3))
351
- logging.debug(f"template_id_role_dict: {template_id_role_dict}")
352
- '''
353
- current_user_prompts_role_names = []
354
- for prompt_id in current_user_prompt_ids:
355
- if template_id_role_dict.get(prompt_id): # Check if key exists and has a truthy value
356
- current_user_prompts_role_names.append(template_id_role_dict.get(prompt_id)) # Set name to value for key 'name'
357
-
358
- return current_user_prompts_role_names
359
-
360
-
361
- def load_template(filename, mode=0):
362
- logging.debug(f"Template Name: {filename}")
363
- if not filename.endswith(".json"):
364
- filename = filename + ".json"
365
-
366
- logging.debug(f"加载模板文件{filename},模式为{mode}(0为返回字典和下拉菜单,1为返回下拉菜单,2为返回字典[act:prompt],3为返回字典[id:act])")
367
- lines = []
368
- if filename.endswith(".json"):
369
- with open(os.path.join(TEMPLATES_DIR, filename), "r", encoding="utf8") as f:
370
- lines = json.load(f)
371
- lines = [[i["act"], i["prompt"], i["id"]] for i in lines]
372
- else:
373
- with open(
374
- os.path.join(TEMPLATES_DIR, filename), "r", encoding="utf8"
375
- ) as csvfile:
376
- reader = csv.reader(csvfile)
377
- lines = list(reader)
378
- lines = lines[1:]
379
-
380
- if mode == 1: # [act]
381
- return sorted_by_pinyin([row[0] for row in lines])
382
- elif mode == 2: # [act:prompt]
383
- return {row[0]: row[1] for row in lines}
384
- elif mode == 3: # [id:act])
385
- return {row[2]: row[0] for row in lines}
386
- else:
387
- choices = sorted_by_pinyin([row[0] for row in lines])
388
- '''
389
- Sometimes we want to update the configuration of the Component as well, such as the visibility.
390
- In this case, we return a gr.update() object instead of just the update Component value.
391
- '''
392
- return {row[0]: row[1] for row in lines}, gr.Dropdown.update(choices=choices)
393
-
394
-
395
- def get_template_names_without_extension(plain=False):
396
- return [os.path.splitext(f)[0] for f in get_template_names(plain=False)]
397
-
398
-
399
- def get_template_names(plain=False):
400
- logging.debug("获取模板文件名列表")
401
- return get_file_names(TEMPLATES_DIR, plain, filetypes=[".json"])
402
-
403
-
404
- def get_template_content(templates, selection, original_system_prompt):
405
- logging.debug(f"应用模板中,选择为{selection},原始系统提示为{original_system_prompt}")
406
- try:
407
- return templates[selection]
408
- except:
409
- return original_system_prompt
410
-
411
-
412
- def reset_textbox():
413
- logging.debug("重置文本框")
414
- return gr.update(value="")
415
-
416
-
417
- def reset_default():
418
- default_host = shared.state.reset_api_host()
419
- retrieve_proxy("")
420
- return gr.update(value=default_host), gr.update(value=""), "API-Host 和代理已重置"
421
-
422
-
423
- def change_api_host(host):
424
- shared.state.set_api_host(host)
425
- msg = f"API-Host更改为了{host}"
426
- logging.info(msg)
427
- return msg
428
-
429
-
430
- def change_proxy(proxy):
431
- retrieve_proxy(proxy)
432
- os.environ["HTTPS_PROXY"] = proxy
433
- msg = f"代理更改为了{proxy}"
434
- logging.info(msg)
435
- return msg
436
-
437
-
438
- def hide_middle_chars(s):
439
- if s is None:
440
- return ""
441
- if len(s) <= 8:
442
- return s
443
- else:
444
- head = s[:4]
445
- tail = s[-4:]
446
- hidden = "*" * (len(s) - 8)
447
- return head + hidden + tail
448
-
449
-
450
- def submit_key(key):
451
- key = key.strip()
452
- msg = f"API密钥更改为了{hide_middle_chars(key)}"
453
- logging.info(msg)
454
- return key, msg
455
-
456
-
457
- def replace_today(prompt):
458
- today = datetime.datetime.today().strftime("%Y-%m-%d")
459
- return prompt.replace("{current_date}", today)
460
-
461
-
462
- def get_geoip():
463
- try:
464
- with retrieve_proxy():
465
- response = requests.get("https://ipapi.co/json/", timeout=10)
466
- data = response.json()
467
- except:
468
- data = {"error": True, "reason": "连接ipapi失败", "timeout": 10}
469
- if "error" in data.keys():
470
- logging.warning(f"无法获取IP地址信息。\n{data}")
471
- if data["reason"] == "RateLimited":
472
- return (
473
- i18n("您的IP区域:未知。")
474
- )
475
- else:
476
- return i18n("获取IP地理位置失败。原因:") + f"{data['reason']}" + i18n("。你仍然可以使用聊天功能。")
477
- else:
478
- country = data["country_name"]
479
- if country == "China":
480
- text = "**您的IP区域:中国。请立即检查代理设置,在不受支持的地区使用API可能导致账号被封禁。**"
481
- else:
482
- text = i18n("您的IP区域:") + f"{country}。"
483
- logging.info(text)
484
- return text
485
-
486
-
487
- def find_n(lst, max_num):
488
- n = len(lst)
489
- total = sum(lst)
490
-
491
- if total < max_num:
492
- return n
493
-
494
- for i in range(len(lst)):
495
- if total - lst[i] < max_num:
496
- return n - i - 1
497
- total = total - lst[i]
498
- return 1
499
-
500
-
501
- def start_outputing():
502
- logging.debug("显示取消按钮,隐藏发送按钮")
503
- return gr.Button.update(visible=False), gr.Button.update(visible=True)
504
-
505
-
506
- def end_outputing():
507
- return (
508
- gr.Button.update(visible=True),
509
- gr.Button.update(visible=False),
510
- )
511
-
512
-
513
- def cancel_outputing():
514
- logging.info("中止输出……")
515
- shared.state.interrupt()
516
-
517
-
518
- def transfer_input(inputs):
519
- # 一次性返回,降低延迟
520
- textbox = reset_textbox()
521
- outputing = start_outputing()
522
- return (
523
- inputs,
524
- gr.update(value=""),
525
- gr.Button.update(visible=False),
526
- gr.Button.update(visible=True),
527
- )
528
-
529
-
530
- def run(command, desc=None, errdesc=None, custom_env=None, live=False):
531
- if desc is not None:
532
- print(desc)
533
- if live:
534
- result = subprocess.run(command, shell=True, env=os.environ if custom_env is None else custom_env)
535
- if result.returncode != 0:
536
- raise RuntimeError(f"""{errdesc or 'Error running command'}.
537
- Command: {command}
538
- Error code: {result.returncode}""")
539
-
540
- return ""
541
- result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True,
542
- env=os.environ if custom_env is None else custom_env)
543
- if result.returncode != 0:
544
- message = f"""{errdesc or 'Error running command'}.
545
- Command: {command}
546
- Error code: {result.returncode}
547
- stdout: {result.stdout.decode(encoding="utf8", errors="ignore") if len(result.stdout) > 0 else '<empty>'}
548
- stderr: {result.stderr.decode(encoding="utf8", errors="ignore") if len(result.stderr) > 0 else '<empty>'}
549
- """
550
- raise RuntimeError(message)
551
- return result.stdout.decode(encoding="utf8", errors="ignore")
552
-
553
-
554
- def versions_html():
555
- return f""""""
556
-
557
-
558
- def add_source_numbers(lst, source_name="Source", use_source=True):
559
- if use_source:
560
- return [f'[{idx + 1}]\t "{item[0]}"\n{source_name}: {item[1]}' for idx, item in enumerate(lst)]
561
- else:
562
- return [f'[{idx + 1}]\t "{item}"' for idx, item in enumerate(lst)]
563
-
564
-
565
- def add_details(lst):
566
- nodes = []
567
- for index, txt in enumerate(lst):
568
- brief = txt[:25].replace("\n", "")
569
- nodes.append(
570
- f"<details><summary>{brief}...</summary><p>{txt}</p></details>"
571
- )
572
- return nodes
573
-
574
-
575
- def sheet_to_string(sheet, sheet_name=None):
576
- result = []
577
- for index, row in sheet.iterrows():
578
- row_string = ""
579
- for column in sheet.columns:
580
- row_string += f"{column}: {row[column]}, "
581
- row_string = row_string.rstrip(", ")
582
- row_string += "."
583
- result.append(row_string)
584
- return result
585
-
586
-
587
- def excel_to_string(file_path):
588
- # 读取Excel文件中的所有工作表
589
- excel_file = pd.read_excel(file_path, engine='openpyxl', sheet_name=None)
590
-
591
- # 初始化结果字符串
592
- result = []
593
-
594
- # 遍历每一个工作表
595
- for sheet_name, sheet_data in excel_file.items():
596
- # 处理当前工作表并添加到结果字符串
597
- result += sheet_to_string(sheet_data, sheet_name=sheet_name)
598
-
599
- return result
600
-
601
-
602
- def get_last_day_of_month(any_day):
603
- # The day 28 exists in every month. 4 days later, it's always next month
604
- next_month = any_day.replace(day=28) + datetime.timedelta(days=4)
605
- # subtracting the number of the current day brings us back one month
606
- return next_month - datetime.timedelta(days=next_month.day)
607
-
608
-
609
- def get_model_source(model_name, alternative_source):
610
- if model_name == "gpt2-medium":
611
- return "https://huggingface.co/gpt2-medium"
612
-
613
-
614
- def refresh_ui_elements_on_load(current_model, selected_model_name, user_name):
615
- current_model.set_user_identifier(user_name)
616
- return toggle_like_btn_visibility(selected_model_name), *current_model.auto_load()
617
-
618
-
619
- def toggle_like_btn_visibility(selected_model_name):
620
- if selected_model_name == "xmchat":
621
- return gr.update(visible=True)
622
- else:
623
- return gr.update(visible=False)
624
-
625
-
626
- def new_auto_history_filename(dirname):
627
- latest_file = get_latest_filepath(dirname)
628
- if latest_file:
629
- with open(os.path.join(dirname, latest_file), 'r') as f:
630
- if len(f.read()) == 0:
631
- return latest_file
632
- now = datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S')
633
- return f'{now}.json'
634
-
635
-
636
- def get_latest_filepath(dirname):
637
- pattern = re.compile(r'\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}')
638
- latest_time = None
639
- latest_file = None
640
- for filename in os.listdir(dirname):
641
- if os.path.isfile(os.path.join(dirname, filename)):
642
- match = pattern.search(filename)
643
- if match and match.group(0) == filename[:19]:
644
- time_str = filename[:19]
645
- filetime = datetime.datetime.strptime(time_str, '%Y-%m-%d_%H-%M-%S')
646
- if not latest_time or filetime > latest_time:
647
- latest_time = filetime
648
- latest_file = filename
649
- return latest_file
650
-
651
-
652
- def get_history_filepath(username):
653
- dirname = os.path.join(HISTORY_DIR, username)
654
- os.makedirs(dirname, exist_ok=True)
655
- latest_file = get_latest_filepath(dirname)
656
- if not latest_file:
657
- latest_file = new_auto_history_filename(dirname)
658
-
659
- latest_file = os.path.join(dirname, latest_file)
660
- return latest_file
661
-
662
-
663
- def hide_username(user_name: str, retained_count=3):
664
- """隐藏用户名,只显示最后retained_count 位数字"""
665
- first_part = user_name.strip()[:-retained_count] # 取用户名的前n-3位
666
- last_part = user_name.strip()[-retained_count:] # 取用户名的最后3位
667
- hidden_part = '*' * len(first_part) # 用*替换第一部分
668
- new_user_name = hidden_part + last_part # 拼接第一部分和最后三位
669
- return new_user_name
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Altinas/vits-uma-genshin-honkais/app.py DELETED
@@ -1,124 +0,0 @@
1
- import time
2
- import gradio as gr
3
- import utils
4
- import commons
5
- from models import SynthesizerTrn
6
- from text import text_to_sequence
7
- from torch import no_grad, LongTensor
8
- import torch
9
-
10
- hps_ms = utils.get_hparams_from_file(r'./model/config.json')
11
- device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
12
- net_g_ms = SynthesizerTrn(
13
- len(hps_ms.symbols),
14
- hps_ms.data.filter_length // 2 + 1,
15
- hps_ms.train.segment_size // hps_ms.data.hop_length,
16
- n_speakers=hps_ms.data.n_speakers,
17
- **hps_ms.model).to(device)
18
- _ = net_g_ms.eval()
19
- speakers = hps_ms.speakers
20
- model, optimizer, learning_rate, epochs = utils.load_checkpoint(r'./model/G_953000.pth', net_g_ms, None)
21
-
22
- def get_text(text, hps):
23
- text_norm, clean_text = text_to_sequence(text, hps.symbols, hps.data.text_cleaners)
24
- if hps.data.add_blank:
25
- text_norm = commons.intersperse(text_norm, 0)
26
- text_norm = LongTensor(text_norm)
27
- return text_norm, clean_text
28
-
29
- def vits(text, language, speaker_id, noise_scale, noise_scale_w, length_scale):
30
- start = time.perf_counter()
31
- if not len(text):
32
- return "输入文本不能为空!", None, None
33
- text = text.replace('\n', ' ').replace('\r', '').replace(" ", "")
34
- if len(text) > 500:
35
- return f"输入文字过长!{len(text)}>100", None, None
36
- if language == 0:
37
- text = f"[ZH]{text}[ZH]"
38
- elif language == 1:
39
- text = f"[JA]{text}[JA]"
40
- else:
41
- text = f"{text}"
42
- stn_tst, clean_text = get_text(text, hps_ms)
43
- with no_grad():
44
- x_tst = stn_tst.unsqueeze(0)
45
- x_tst_lengths = LongTensor([stn_tst.size(0)])
46
- speaker_id = LongTensor([speaker_id])
47
- audio = net_g_ms.infer(x_tst, x_tst_lengths, sid=speaker_id, noise_scale=noise_scale, noise_scale_w=noise_scale_w,
48
- length_scale=length_scale)[0][0, 0].data.cpu().float().numpy()
49
-
50
- return "生成成功!", (22050, audio), f"生成耗时 {round(time.perf_counter()-start, 2)} s"
51
-
52
- def search_speaker(search_value):
53
- for s in speakers:
54
- if search_value == s:
55
- return s
56
- for s in speakers:
57
- if search_value in s:
58
- return s
59
-
60
- def change_lang(language):
61
- if language == 0:
62
- return 0.6, 0.668, 1.2
63
- else:
64
- return 0.6, 0.668, 1.1
65
-
66
- download_audio_js = """
67
- () =>{{
68
- let root = document.querySelector("body > gradio-app");
69
- if (root.shadowRoot != null)
70
- root = root.shadowRoot;
71
- let audio = root.querySelector("#tts-audio").querySelector("audio");
72
- let text = root.querySelector("#input-text").querySelector("textarea");
73
- if (audio == undefined)
74
- return;
75
- text = text.value;
76
- if (text == undefined)
77
- text = Math.floor(Math.random()*100000000);
78
- audio = audio.src;
79
- let oA = document.createElement("a");
80
- oA.download = text.substr(0, 20)+'.wav';
81
- oA.href = audio;
82
- document.body.appendChild(oA);
83
- oA.click();
84
- oA.remove();
85
- }}
86
- """
87
-
88
- if __name__ == '__main__':
89
- with gr.Blocks() as app:
90
- gr.Markdown(
91
- "# <center> VITS语音在线合成demo\n"
92
- "<div align='center'>主要有赛马娘,原神中文,原神日语,崩坏3的音色</div>"
93
- '<div align="center"><a><font color="#dd0000">结果有随机性,语调可能很奇怪,可多次生成取最佳效果</font></a></div>'
94
- '<div align="center"><a><font color="#dd0000">标点符号会影响生成的结果</font></a></div>'
95
- )
96
-
97
- with gr.Tabs():
98
- with gr.TabItem("vits"):
99
- with gr.Row():
100
- with gr.Column():
101
- input_text = gr.Textbox(label="Text (100 words limitation)", lines=5, value="今天晚上吃啥好呢。", elem_id=f"input-text")
102
- lang = gr.Dropdown(label="Language", choices=["中文", "日语", "中日混合(中文用[ZH][ZH]包裹起来,日文用[JA][JA]包裹起来)"],
103
- type="index", value="中文")
104
- btn = gr.Button(value="Submit")
105
- with gr.Row():
106
- search = gr.Textbox(label="Search Speaker", lines=1)
107
- btn2 = gr.Button(value="Search")
108
- sid = gr.Dropdown(label="Speaker", choices=speakers, type="index", value=speakers[228])
109
- with gr.Row():
110
- ns = gr.Slider(label="noise_scale(控制感情变化程度)", minimum=0.1, maximum=1.0, step=0.1, value=0.6, interactive=True)
111
- nsw = gr.Slider(label="noise_scale_w(控制音素发音长度)", minimum=0.1, maximum=1.0, step=0.1, value=0.668, interactive=True)
112
- ls = gr.Slider(label="length_scale(控制整体语速)", minimum=0.1, maximum=2.0, step=0.1, value=1.2, interactive=True)
113
- with gr.Column():
114
- o1 = gr.Textbox(label="Output Message")
115
- o2 = gr.Audio(label="Output Audio", elem_id=f"tts-audio")
116
- o3 = gr.Textbox(label="Extra Info")
117
- download = gr.Button("Download Audio")
118
- btn.click(vits, inputs=[input_text, lang, sid, ns, nsw, ls], outputs=[o1, o2, o3], api_name="generate")
119
- download.click(None, [], [], _js=download_audio_js.format())
120
- btn2.click(search_speaker, inputs=[search], outputs=[sid])
121
- lang.change(change_lang, inputs=[lang], outputs=[ns, nsw, ls])
122
- with gr.TabItem("可用人物一览"):
123
- gr.Radio(label="Speaker", choices=speakers, interactive=False, type="index")
124
- app.queue(concurrency_count=1).launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Amon1/ChatGPTForAcadamic/crazy_functions/批量总结PDF文档pdfminer.py DELETED
@@ -1,151 +0,0 @@
1
- from predict import predict_no_ui
2
- from toolbox import CatchException, report_execption, write_results_to_file, predict_no_ui_but_counting_down
3
-
4
- fast_debug = False
5
-
6
- def readPdf(pdfPath):
7
- """
8
- 读取pdf文件,返回文本内容
9
- """
10
- import pdfminer
11
- from pdfminer.pdfparser import PDFParser
12
- from pdfminer.pdfdocument import PDFDocument
13
- from pdfminer.pdfpage import PDFPage, PDFTextExtractionNotAllowed
14
- from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
15
- from pdfminer.pdfdevice import PDFDevice
16
- from pdfminer.layout import LAParams
17
- from pdfminer.converter import PDFPageAggregator
18
-
19
- fp = open(pdfPath, 'rb')
20
-
21
- # Create a PDF parser object associated with the file object
22
- parser = PDFParser(fp)
23
-
24
- # Create a PDF document object that stores the document structure.
25
- # Password for initialization as 2nd parameter
26
- document = PDFDocument(parser)
27
- # Check if the document allows text extraction. If not, abort.
28
- if not document.is_extractable:
29
- raise PDFTextExtractionNotAllowed
30
-
31
- # Create a PDF resource manager object that stores shared resources.
32
- rsrcmgr = PDFResourceManager()
33
-
34
- # Create a PDF device object.
35
- # device = PDFDevice(rsrcmgr)
36
-
37
- # BEGIN LAYOUT ANALYSIS.
38
- # Set parameters for analysis.
39
- laparams = LAParams(
40
- char_margin=10.0,
41
- line_margin=0.2,
42
- boxes_flow=0.2,
43
- all_texts=False,
44
- )
45
- # Create a PDF page aggregator object.
46
- device = PDFPageAggregator(rsrcmgr, laparams=laparams)
47
- # Create a PDF interpreter object.
48
- interpreter = PDFPageInterpreter(rsrcmgr, device)
49
-
50
- # loop over all pages in the document
51
- outTextList = []
52
- for page in PDFPage.create_pages(document):
53
- # read the page into a layout object
54
- interpreter.process_page(page)
55
- layout = device.get_result()
56
- for obj in layout._objs:
57
- if isinstance(obj, pdfminer.layout.LTTextBoxHorizontal):
58
- # print(obj.get_text())
59
- outTextList.append(obj.get_text())
60
-
61
- return outTextList
62
-
63
-
64
- def 解析Paper(file_manifest, project_folder, top_p, temperature, chatbot, history, systemPromptTxt):
65
- import time, glob, os
66
- from bs4 import BeautifulSoup
67
- print('begin analysis on:', file_manifest)
68
- for index, fp in enumerate(file_manifest):
69
- if ".tex" in fp:
70
- with open(fp, 'r', encoding='utf-8') as f:
71
- file_content = f.read()
72
- if ".pdf" in fp.lower():
73
- file_content = readPdf(fp)
74
- file_content = BeautifulSoup(''.join(file_content), features="lxml").body.text.encode('gbk', 'ignore').decode('gbk')
75
-
76
- prefix = "接下来请你逐文件分析下面的论文文件,概括其内容" if index==0 else ""
77
- i_say = prefix + f'请对下面的文章片段用中文做一个概述,文件名是{os.path.relpath(fp, project_folder)},文章内容是 ```{file_content}```'
78
- i_say_show_user = prefix + f'[{index}/{len(file_manifest)}] 请对下面的文章片段做一个概述: {os.path.abspath(fp)}'
79
- chatbot.append((i_say_show_user, "[Local Message] waiting gpt response."))
80
- print('[1] yield chatbot, history')
81
- yield chatbot, history, '正常'
82
-
83
- if not fast_debug:
84
- msg = '正常'
85
- # ** gpt request **
86
- gpt_say = yield from predict_no_ui_but_counting_down(i_say, i_say_show_user, chatbot, top_p, temperature, history=[]) # 带超时倒计时
87
-
88
- print('[2] end gpt req')
89
- chatbot[-1] = (i_say_show_user, gpt_say)
90
- history.append(i_say_show_user); history.append(gpt_say)
91
- print('[3] yield chatbot, history')
92
- yield chatbot, history, msg
93
- print('[4] next')
94
- if not fast_debug: time.sleep(2)
95
-
96
- all_file = ', '.join([os.path.relpath(fp, project_folder) for index, fp in enumerate(file_manifest)])
97
- i_say = f'根据以上你自己的分析,对全文进行概括,用学术性语言写一段中文摘要,然后再写一段英文摘要(包括{all_file})。'
98
- chatbot.append((i_say, "[Local Message] waiting gpt response."))
99
- yield chatbot, history, '正常'
100
-
101
- if not fast_debug:
102
- msg = '正常'
103
- # ** gpt request **
104
- gpt_say = yield from predict_no_ui_but_counting_down(i_say, i_say, chatbot, top_p, temperature, history=history) # 带超时倒计时
105
-
106
- chatbot[-1] = (i_say, gpt_say)
107
- history.append(i_say); history.append(gpt_say)
108
- yield chatbot, history, msg
109
- res = write_results_to_file(history)
110
- chatbot.append(("完成了吗?", res))
111
- yield chatbot, history, msg
112
-
113
-
114
-
115
- @CatchException
116
- def 批量总结PDF文档pdfminer(txt, top_p, temperature, chatbot, history, systemPromptTxt, WEB_PORT):
117
- history = [] # 清空历史,以免输入溢出
118
- import glob, os
119
-
120
- # 基本信息:功能、贡献者
121
- chatbot.append([
122
- "函数插件功能?",
123
- "批量总结PDF文档,此版本使用pdfminer插件,带token约简功能。函数插件贡献者: Euclid-Jie。"])
124
- yield chatbot, history, '正常'
125
-
126
- # 尝试导入依赖,如果缺少依赖,则给出安装建议
127
- try:
128
- import pdfminer, bs4
129
- except:
130
- report_execption(chatbot, history,
131
- a = f"解析项目: {txt}",
132
- b = f"导入软件依赖失败。使用该模块需要额外依赖,安装方法```pip install --upgrade pdfminer beautifulsoup4```。")
133
- yield chatbot, history, '正常'
134
- return
135
- if os.path.exists(txt):
136
- project_folder = txt
137
- else:
138
- if txt == "": txt = '空空如也的输入栏'
139
- report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到本地项目或无权访问: {txt}")
140
- yield chatbot, history, '正常'
141
- return
142
- file_manifest = [f for f in glob.glob(f'{project_folder}/**/*.tex', recursive=True)] + \
143
- [f for f in glob.glob(f'{project_folder}/**/*.pdf', recursive=True)] # + \
144
- # [f for f in glob.glob(f'{project_folder}/**/*.cpp', recursive=True)] + \
145
- # [f for f in glob.glob(f'{project_folder}/**/*.c', recursive=True)]
146
- if len(file_manifest) == 0:
147
- report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到任何.tex或pdf文件: {txt}")
148
- yield chatbot, history, '正常'
149
- return
150
- yield from 解析Paper(file_manifest, project_folder, top_p, temperature, chatbot, history, systemPromptTxt)
151
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Amrrs/DragGan-Inversion/stylegan_human/interpolation.py DELETED
@@ -1,155 +0,0 @@
1
- # Copyright (c) SenseTime Research. All rights reserved.
2
-
3
- # interpolate between two z code
4
- # score all middle latent code
5
- # https://www.aiuai.cn/aifarm1929.html
6
-
7
- import os
8
- import re
9
- from typing import List
10
- from tqdm import tqdm
11
- import click
12
- import dnnlib
13
- import numpy as np
14
- import PIL.Image
15
- import torch
16
- import click
17
- import legacy
18
- import random
19
- from typing import List, Optional
20
-
21
-
22
- def lerp(code1, code2, alpha):
23
- return code1 * alpha + code2 * (1 - alpha)
24
-
25
- # Taken and adapted from wikipedia's slerp article
26
- # https://en.wikipedia.org/wiki/Slerp
27
-
28
-
29
- def slerp(code1, code2, alpha, DOT_THRESHOLD=0.9995): # Spherical linear interpolation
30
- code1_copy = np.copy(code1)
31
- code2_copy = np.copy(code2)
32
-
33
- code1 = code1 / np.linalg.norm(code1)
34
- code2 = code2 / np.linalg.norm(code2)
35
- dot = np.sum(code1 * code2)
36
- if np.abs(dot) > DOT_THRESHOLD:
37
- return lerp(code1_copy, code2_copy, alpha)
38
-
39
- # Calculate initial angle between v0 and v1
40
- theta_0 = np.arccos(dot)
41
- sin_theta_0 = np.sin(theta_0)
42
- # Angle at timestep t
43
- theta_t = theta_0 * alpha
44
- sin_theta_t = np.sin(theta_t)
45
-
46
- s0 = np.sin(theta_0 - theta_t) / sin_theta_0
47
- s1 = sin_theta_t / sin_theta_0
48
- code3 = s0 * code1_copy + s1 * code2_copy
49
- return code3
50
-
51
-
52
- def generate_image_from_z(G, z, noise_mode, truncation_psi, device):
53
- label = torch.zeros([1, G.c_dim], device=device)
54
- w = G.mapping(z, label, truncation_psi=truncation_psi)
55
- img = G.synthesis(w, noise_mode=noise_mode, force_fp32=True)
56
- img = (img.permute(0, 2, 3, 1) * 127.5 + 128).clamp(0, 255).to(torch.uint8)
57
- img = PIL.Image.fromarray(img[0].cpu().numpy(), 'RGB')
58
- return img
59
-
60
-
61
- def get_concat_h(im1, im2):
62
- dst = PIL.Image.new('RGB', (im1.width + im2.width, im1.height))
63
- dst.paste(im1, (0, 0))
64
- dst.paste(im2, (im1.width, 0))
65
- return dst
66
-
67
-
68
- def make_latent_interp_animation(G, code1, code2, img1, img2, num_interps, noise_mode, save_mid_image, truncation_psi, device, outdir, fps):
69
- step_size = 1.0/num_interps
70
-
71
- all_imgs = []
72
- amounts = np.arange(0, 1, step_size)
73
- for seed_idx, alpha in enumerate(tqdm(amounts)):
74
- interpolated_latent_code = lerp(code1, code2, alpha)
75
- image = generate_image_from_z(
76
- G, interpolated_latent_code, noise_mode, truncation_psi, device)
77
- interp_latent_image = image.resize((512, 1024))
78
- if not os.path.exists(os.path.join(outdir, 'img')):
79
- os.makedirs(os.path.join(outdir, 'img'), exist_ok=True)
80
- if save_mid_image:
81
- interp_latent_image.save(f'{outdir}/img/seed{seed_idx:04d}.png')
82
-
83
- frame = get_concat_h(img2, interp_latent_image)
84
- frame = get_concat_h(frame, img1)
85
- all_imgs.append(frame)
86
-
87
- save_name = os.path.join(outdir, 'latent_space_traversal.gif')
88
- all_imgs[0].save(save_name, save_all=True,
89
- append_images=all_imgs[1:], duration=1000/fps, loop=0)
90
-
91
-
92
- """
93
- Create interpolated images between two given seeds using pretrained network pickle.
94
-
95
- Examples:
96
-
97
- \b
98
- python interpolation.py --network=pretrained_models/stylegan_human_v2_1024.pkl --seeds=85,100 --outdir=outputs/inter_gifs
99
-
100
- """
101
-
102
-
103
- @click.command()
104
- @click.pass_context
105
- @click.option('--network', 'network_pkl', help='Network pickle filename', required=True)
106
- @click.option('--seeds', type=legacy.num_range, help='List of 2 random seeds, e.g. 1,2')
107
- @click.option('--trunc', 'truncation_psi', type=float, help='Truncation psi', default=0.8, show_default=True)
108
- @click.option('--noise-mode', 'noise_mode', help='Noise mode', type=click.Choice(['const', 'random', 'none']), default='const', show_default=True)
109
- @click.option('--outdir', default='outputs/inter_gifs', help='Where to save the output images', type=str, required=True, metavar='DIR')
110
- @click.option('--save_mid_image', default=True, type=bool, help='select True if you want to save all interpolated images')
111
- @click.option('--fps', default=15, help='FPS for GIF', type=int)
112
- @click.option('--num_interps', default=100, help='Number of interpolation images', type=int)
113
- def main(
114
- ctx: click.Context,
115
- network_pkl: str,
116
- seeds: Optional[List[int]],
117
- truncation_psi: float,
118
- noise_mode: str,
119
- outdir: str,
120
- save_mid_image: bool,
121
- fps: int,
122
- num_interps: int
123
- ):
124
-
125
- device = torch.device('cuda')
126
- with dnnlib.util.open_url(network_pkl) as f:
127
- G = legacy.load_network_pkl(f)['G_ema'].to(device) # type: ignore
128
-
129
- outdir = os.path.join(outdir)
130
- if not os.path.exists(outdir):
131
- os.makedirs(outdir, exist_ok=True)
132
- os.makedirs(os.path.join(outdir, 'img'), exist_ok=True)
133
-
134
- if len(seeds) > 2:
135
- print("Receiving more than two seeds, only use the first two.")
136
- seeds = seeds[0:2]
137
- elif len(seeds) == 1:
138
- print('Require two seeds, randomly generate two now.')
139
- seeds = [seeds[0], random.randint(0, 10000)]
140
-
141
- z1 = torch.from_numpy(np.random.RandomState(
142
- seeds[0]).randn(1, G.z_dim)).to(device)
143
- z2 = torch.from_numpy(np.random.RandomState(
144
- seeds[1]).randn(1, G.z_dim)).to(device)
145
- img1 = generate_image_from_z(G, z1, noise_mode, truncation_psi, device)
146
- img2 = generate_image_from_z(G, z2, noise_mode, truncation_psi, device)
147
- img1.save(f'{outdir}/seed{seeds[0]:04d}.png')
148
- img2.save(f'{outdir}/seed{seeds[1]:04d}.png')
149
-
150
- make_latent_interp_animation(G, z1, z2, img1, img2, num_interps,
151
- noise_mode, save_mid_image, truncation_psi, device, outdir, fps)
152
-
153
-
154
- if __name__ == "__main__":
155
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Amrrs/DragGan-Inversion/stylegan_human/stylemixing_video.py DELETED
@@ -1,167 +0,0 @@
1
-
2
- # Copyright (c) SenseTime Research. All rights reserved.
3
-
4
- """Here we demo style-mixing results using StyleGAN2 pretrained model.
5
- Script reference: https://github.com/PDillis/stylegan2-fun """
6
-
7
-
8
- import moviepy.editor
9
- import argparse
10
- import legacy
11
-
12
- import scipy
13
- import numpy as np
14
- import PIL.Image
15
-
16
- import dnnlib
17
- import dnnlib.tflib as tflib
18
- from typing import List
19
- import re
20
- import sys
21
- import os
22
- import click
23
- import torch
24
-
25
- os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
26
-
27
-
28
- """
29
- Generate style mixing video.
30
- Examples:
31
-
32
- \b
33
- python stylemixing_video.py --network=pretrained_models/stylegan_human_v2_1024.pkl --row-seed=3859 \\
34
- --col-seeds=3098,31759,3791 --col-styles=8-12 --trunc=0.8 --outdir=outputs/stylemixing_video
35
- """
36
-
37
-
38
- @click.command()
39
- @click.option('--network', 'network_pkl', help='Path to network pickle filename', required=True)
40
- @click.option('--row-seed', 'src_seed', type=legacy.num_range, help='Random seed to use for image source row', required=True)
41
- @click.option('--col-seeds', 'dst_seeds', type=legacy.num_range, help='Random seeds to use for image columns (style)', required=True)
42
- @click.option('--col-styles', 'col_styles', type=legacy.num_range, help='Style layer range (default: %(default)s)', default='0-6')
43
- @click.option('--only-stylemix', 'only_stylemix', help='Add flag to only show the style mxied images in the video', default=False)
44
- @click.option('--trunc', 'truncation_psi', type=float, help='Truncation psi (default: %(default)s)', default=1)
45
- @click.option('--duration-sec', 'duration_sec', type=float, help='Duration of video (default: %(default)s)', default=10)
46
- @click.option('--fps', 'mp4_fps', type=int, help='FPS of generated video (default: %(default)s)', default=10)
47
- @click.option('--indent-range', 'indent_range', type=int, default=30)
48
- @click.option('--outdir', help='Root directory for run results (default: %(default)s)', default='outputs/stylemixing_video', metavar='DIR')
49
- def style_mixing_video(network_pkl: str,
50
- # Seed of the source image style (row)
51
- src_seed: List[int],
52
- # Seeds of the destination image styles (columns)
53
- dst_seeds: List[int],
54
- # Styles to transfer from first row to first column
55
- col_styles: List[int],
56
- truncation_psi=float,
57
- # True if user wishes to show only thre style transferred result
58
- only_stylemix=bool,
59
- duration_sec=float,
60
- smoothing_sec=1.0,
61
- mp4_fps=int,
62
- mp4_codec="libx264",
63
- mp4_bitrate="16M",
64
- minibatch_size=8,
65
- noise_mode='const',
66
- indent_range=int,
67
- outdir=str):
68
- # Calculate the number of frames:
69
- print('col_seeds: ', dst_seeds)
70
- num_frames = int(np.rint(duration_sec * mp4_fps))
71
- print('Loading networks from "%s"...' % network_pkl)
72
- device = torch.device('cuda')
73
- with dnnlib.util.open_url(network_pkl) as f:
74
- Gs = legacy.load_network_pkl(f)['G_ema'].to(device)
75
-
76
- print(Gs.num_ws, Gs.w_dim, Gs.img_resolution)
77
- max_style = int(2 * np.log2(Gs.img_resolution)) - 3
78
- assert max(
79
- col_styles) <= max_style, f"Maximum col-style allowed: {max_style}"
80
-
81
- # Left col latents
82
- print('Generating Source W vectors...')
83
- src_shape = [num_frames] + [Gs.z_dim]
84
- src_z = np.random.RandomState(
85
- *src_seed).randn(*src_shape).astype(np.float32) # [frames, src, component]
86
- src_z = scipy.ndimage.gaussian_filter(
87
- src_z, [smoothing_sec * mp4_fps] + [0] * (2 - 1), mode="wrap")
88
- src_z /= np.sqrt(np.mean(np.square(src_z)))
89
- # Map into the detangled latent space W and do truncation trick
90
- src_w = Gs.mapping(torch.from_numpy(src_z).to(device), None)
91
- w_avg = Gs.mapping.w_avg
92
- src_w = w_avg + (src_w - w_avg) * truncation_psi
93
-
94
- # Top row latents (fixed reference)
95
- print('Generating Destination W vectors...')
96
- dst_z = np.stack([np.random.RandomState(seed).randn(Gs.z_dim)
97
- for seed in dst_seeds])
98
- dst_w = Gs.mapping(torch.from_numpy(dst_z).to(device), None)
99
- dst_w = w_avg + (dst_w - w_avg) * truncation_psi
100
- # Get the width and height of each image:
101
- H = Gs.img_resolution # 1024
102
- W = Gs.img_resolution//2 # 512
103
-
104
- # Generate ALL the source images:
105
- src_images = Gs.synthesis(src_w, noise_mode=noise_mode)
106
- src_images = (src_images.permute(0, 2, 3, 1) * 127.5 +
107
- 128).clamp(0, 255).to(torch.uint8)
108
-
109
- # Generate the column images:
110
- dst_images = Gs.synthesis(dst_w, noise_mode=noise_mode)
111
- dst_images = (dst_images.permute(0, 2, 3, 1) * 127.5 +
112
- 128).clamp(0, 255).to(torch.uint8)
113
-
114
- print('Generating full video (including source and destination images)')
115
- # Generate our canvas where we will paste all the generated images:
116
- canvas = PIL.Image.new("RGB", ((
117
- W-indent_range) * (len(dst_seeds) + 1), H * (len(src_seed) + 1)), "white") # W, H
118
-
119
- # dst_image:[3,1024,512]
120
- for col, dst_image in enumerate(list(dst_images)):
121
- canvas.paste(PIL.Image.fromarray(dst_image.cpu().numpy(),
122
- "RGB"), ((col + 1) * (W-indent_range), 0)) # H
123
- # Aux functions: Frame generation func for moviepy.
124
-
125
- def make_frame(t):
126
- # Get the frame number according to time t:
127
- frame_idx = int(np.clip(np.round(t * mp4_fps), 0, num_frames - 1))
128
- # We wish the image belonging to the frame at time t:
129
- src_image = src_images[frame_idx] # always in the same place
130
- canvas.paste(PIL.Image.fromarray(src_image.cpu().numpy(), "RGB"),
131
- (0-indent_range, H)) # Paste it to the lower left
132
-
133
- # Now, for each of the column images:
134
- for col, dst_image in enumerate(list(dst_images)):
135
- # Select the pertinent latent w column:
136
- w_col = np.stack([dst_w[col].cpu()]) # [18, 512] -> [1, 18, 512]
137
- w_col = torch.from_numpy(w_col).to(device)
138
- # Replace the values defined by col_styles:
139
- w_col[:, col_styles] = src_w[frame_idx, col_styles] # .cpu()
140
- # Generate these synthesized images:
141
- col_images = Gs.synthesis(w_col, noise_mode=noise_mode)
142
- col_images = (col_images.permute(0, 2, 3, 1) *
143
- 127.5 + 128).clamp(0, 255).to(torch.uint8)
144
- # Paste them in their respective spot:
145
- for row, image in enumerate(list(col_images)):
146
- canvas.paste(
147
- PIL.Image.fromarray(image.cpu().numpy(), "RGB"),
148
- ((col + 1) * (W - indent_range), (row + 1) * H),
149
- )
150
- return np.array(canvas)
151
-
152
- # Generate video using make_frame:
153
- print('Generating style-mixed video...')
154
- videoclip = moviepy.editor.VideoClip(make_frame, duration=duration_sec)
155
- grid_size = [len(dst_seeds), len(src_seed)]
156
- mp4 = "{}x{}-style-mixing_{}_{}.mp4".format(
157
- *grid_size, min(col_styles), max(col_styles))
158
- if not os.path.exists(outdir):
159
- os.makedirs(outdir)
160
- videoclip.write_videofile(os.path.join(outdir, mp4),
161
- fps=mp4_fps,
162
- codec=mp4_codec,
163
- bitrate=mp4_bitrate)
164
-
165
-
166
- if __name__ == "__main__":
167
- style_mixing_video()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/pipelines/score_sde_ve/test_score_sde_ve.py DELETED
@@ -1,91 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2023 HuggingFace Inc.
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
- import unittest
17
-
18
- import numpy as np
19
- import torch
20
-
21
- from diffusers import ScoreSdeVePipeline, ScoreSdeVeScheduler, UNet2DModel
22
- from diffusers.utils.testing_utils import enable_full_determinism, require_torch, slow, torch_device
23
-
24
-
25
- enable_full_determinism()
26
-
27
-
28
- class ScoreSdeVeipelineFastTests(unittest.TestCase):
29
- @property
30
- def dummy_uncond_unet(self):
31
- torch.manual_seed(0)
32
- model = UNet2DModel(
33
- block_out_channels=(32, 64),
34
- layers_per_block=2,
35
- sample_size=32,
36
- in_channels=3,
37
- out_channels=3,
38
- down_block_types=("DownBlock2D", "AttnDownBlock2D"),
39
- up_block_types=("AttnUpBlock2D", "UpBlock2D"),
40
- )
41
- return model
42
-
43
- def test_inference(self):
44
- unet = self.dummy_uncond_unet
45
- scheduler = ScoreSdeVeScheduler()
46
-
47
- sde_ve = ScoreSdeVePipeline(unet=unet, scheduler=scheduler)
48
- sde_ve.to(torch_device)
49
- sde_ve.set_progress_bar_config(disable=None)
50
-
51
- generator = torch.manual_seed(0)
52
- image = sde_ve(num_inference_steps=2, output_type="numpy", generator=generator).images
53
-
54
- generator = torch.manual_seed(0)
55
- image_from_tuple = sde_ve(num_inference_steps=2, output_type="numpy", generator=generator, return_dict=False)[
56
- 0
57
- ]
58
-
59
- image_slice = image[0, -3:, -3:, -1]
60
- image_from_tuple_slice = image_from_tuple[0, -3:, -3:, -1]
61
-
62
- assert image.shape == (1, 32, 32, 3)
63
- expected_slice = np.array([0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0])
64
-
65
- assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2
66
- assert np.abs(image_from_tuple_slice.flatten() - expected_slice).max() < 1e-2
67
-
68
-
69
- @slow
70
- @require_torch
71
- class ScoreSdeVePipelineIntegrationTests(unittest.TestCase):
72
- def test_inference(self):
73
- model_id = "google/ncsnpp-church-256"
74
- model = UNet2DModel.from_pretrained(model_id)
75
-
76
- scheduler = ScoreSdeVeScheduler.from_pretrained(model_id)
77
-
78
- sde_ve = ScoreSdeVePipeline(unet=model, scheduler=scheduler)
79
- sde_ve.to(torch_device)
80
- sde_ve.set_progress_bar_config(disable=None)
81
-
82
- generator = torch.manual_seed(0)
83
- image = sde_ve(num_inference_steps=10, output_type="numpy", generator=generator).images
84
-
85
- image_slice = image[0, -3:, -3:, -1]
86
-
87
- assert image.shape == (1, 256, 256, 3)
88
-
89
- expected_slice = np.array([0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0])
90
-
91
- assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Andy1621/uniformer_image_detection/mmdet/models/losses/iou_loss.py DELETED
@@ -1,436 +0,0 @@
1
- import math
2
-
3
- import mmcv
4
- import torch
5
- import torch.nn as nn
6
-
7
- from mmdet.core import bbox_overlaps
8
- from ..builder import LOSSES
9
- from .utils import weighted_loss
10
-
11
-
12
- @mmcv.jit(derivate=True, coderize=True)
13
- @weighted_loss
14
- def iou_loss(pred, target, linear=False, eps=1e-6):
15
- """IoU loss.
16
-
17
- Computing the IoU loss between a set of predicted bboxes and target bboxes.
18
- The loss is calculated as negative log of IoU.
19
-
20
- Args:
21
- pred (torch.Tensor): Predicted bboxes of format (x1, y1, x2, y2),
22
- shape (n, 4).
23
- target (torch.Tensor): Corresponding gt bboxes, shape (n, 4).
24
- linear (bool, optional): If True, use linear scale of loss instead of
25
- log scale. Default: False.
26
- eps (float): Eps to avoid log(0).
27
-
28
- Return:
29
- torch.Tensor: Loss tensor.
30
- """
31
- ious = bbox_overlaps(pred, target, is_aligned=True).clamp(min=eps)
32
- if linear:
33
- loss = 1 - ious
34
- else:
35
- loss = -ious.log()
36
- return loss
37
-
38
-
39
- @mmcv.jit(derivate=True, coderize=True)
40
- @weighted_loss
41
- def bounded_iou_loss(pred, target, beta=0.2, eps=1e-3):
42
- """BIoULoss.
43
-
44
- This is an implementation of paper
45
- `Improving Object Localization with Fitness NMS and Bounded IoU Loss.
46
- <https://arxiv.org/abs/1711.00164>`_.
47
-
48
- Args:
49
- pred (torch.Tensor): Predicted bboxes.
50
- target (torch.Tensor): Target bboxes.
51
- beta (float): beta parameter in smoothl1.
52
- eps (float): eps to avoid NaN.
53
- """
54
- pred_ctrx = (pred[:, 0] + pred[:, 2]) * 0.5
55
- pred_ctry = (pred[:, 1] + pred[:, 3]) * 0.5
56
- pred_w = pred[:, 2] - pred[:, 0]
57
- pred_h = pred[:, 3] - pred[:, 1]
58
- with torch.no_grad():
59
- target_ctrx = (target[:, 0] + target[:, 2]) * 0.5
60
- target_ctry = (target[:, 1] + target[:, 3]) * 0.5
61
- target_w = target[:, 2] - target[:, 0]
62
- target_h = target[:, 3] - target[:, 1]
63
-
64
- dx = target_ctrx - pred_ctrx
65
- dy = target_ctry - pred_ctry
66
-
67
- loss_dx = 1 - torch.max(
68
- (target_w - 2 * dx.abs()) /
69
- (target_w + 2 * dx.abs() + eps), torch.zeros_like(dx))
70
- loss_dy = 1 - torch.max(
71
- (target_h - 2 * dy.abs()) /
72
- (target_h + 2 * dy.abs() + eps), torch.zeros_like(dy))
73
- loss_dw = 1 - torch.min(target_w / (pred_w + eps), pred_w /
74
- (target_w + eps))
75
- loss_dh = 1 - torch.min(target_h / (pred_h + eps), pred_h /
76
- (target_h + eps))
77
- loss_comb = torch.stack([loss_dx, loss_dy, loss_dw, loss_dh],
78
- dim=-1).view(loss_dx.size(0), -1)
79
-
80
- loss = torch.where(loss_comb < beta, 0.5 * loss_comb * loss_comb / beta,
81
- loss_comb - 0.5 * beta)
82
- return loss
83
-
84
-
85
- @mmcv.jit(derivate=True, coderize=True)
86
- @weighted_loss
87
- def giou_loss(pred, target, eps=1e-7):
88
- r"""`Generalized Intersection over Union: A Metric and A Loss for Bounding
89
- Box Regression <https://arxiv.org/abs/1902.09630>`_.
90
-
91
- Args:
92
- pred (torch.Tensor): Predicted bboxes of format (x1, y1, x2, y2),
93
- shape (n, 4).
94
- target (torch.Tensor): Corresponding gt bboxes, shape (n, 4).
95
- eps (float): Eps to avoid log(0).
96
-
97
- Return:
98
- Tensor: Loss tensor.
99
- """
100
- gious = bbox_overlaps(pred, target, mode='giou', is_aligned=True, eps=eps)
101
- loss = 1 - gious
102
- return loss
103
-
104
-
105
- @mmcv.jit(derivate=True, coderize=True)
106
- @weighted_loss
107
- def diou_loss(pred, target, eps=1e-7):
108
- r"""`Implementation of Distance-IoU Loss: Faster and Better
109
- Learning for Bounding Box Regression, https://arxiv.org/abs/1911.08287`_.
110
-
111
- Code is modified from https://github.com/Zzh-tju/DIoU.
112
-
113
- Args:
114
- pred (Tensor): Predicted bboxes of format (x1, y1, x2, y2),
115
- shape (n, 4).
116
- target (Tensor): Corresponding gt bboxes, shape (n, 4).
117
- eps (float): Eps to avoid log(0).
118
- Return:
119
- Tensor: Loss tensor.
120
- """
121
- # overlap
122
- lt = torch.max(pred[:, :2], target[:, :2])
123
- rb = torch.min(pred[:, 2:], target[:, 2:])
124
- wh = (rb - lt).clamp(min=0)
125
- overlap = wh[:, 0] * wh[:, 1]
126
-
127
- # union
128
- ap = (pred[:, 2] - pred[:, 0]) * (pred[:, 3] - pred[:, 1])
129
- ag = (target[:, 2] - target[:, 0]) * (target[:, 3] - target[:, 1])
130
- union = ap + ag - overlap + eps
131
-
132
- # IoU
133
- ious = overlap / union
134
-
135
- # enclose area
136
- enclose_x1y1 = torch.min(pred[:, :2], target[:, :2])
137
- enclose_x2y2 = torch.max(pred[:, 2:], target[:, 2:])
138
- enclose_wh = (enclose_x2y2 - enclose_x1y1).clamp(min=0)
139
-
140
- cw = enclose_wh[:, 0]
141
- ch = enclose_wh[:, 1]
142
-
143
- c2 = cw**2 + ch**2 + eps
144
-
145
- b1_x1, b1_y1 = pred[:, 0], pred[:, 1]
146
- b1_x2, b1_y2 = pred[:, 2], pred[:, 3]
147
- b2_x1, b2_y1 = target[:, 0], target[:, 1]
148
- b2_x2, b2_y2 = target[:, 2], target[:, 3]
149
-
150
- left = ((b2_x1 + b2_x2) - (b1_x1 + b1_x2))**2 / 4
151
- right = ((b2_y1 + b2_y2) - (b1_y1 + b1_y2))**2 / 4
152
- rho2 = left + right
153
-
154
- # DIoU
155
- dious = ious - rho2 / c2
156
- loss = 1 - dious
157
- return loss
158
-
159
-
160
- @mmcv.jit(derivate=True, coderize=True)
161
- @weighted_loss
162
- def ciou_loss(pred, target, eps=1e-7):
163
- r"""`Implementation of paper `Enhancing Geometric Factors into
164
- Model Learning and Inference for Object Detection and Instance
165
- Segmentation <https://arxiv.org/abs/2005.03572>`_.
166
-
167
- Code is modified from https://github.com/Zzh-tju/CIoU.
168
-
169
- Args:
170
- pred (Tensor): Predicted bboxes of format (x1, y1, x2, y2),
171
- shape (n, 4).
172
- target (Tensor): Corresponding gt bboxes, shape (n, 4).
173
- eps (float): Eps to avoid log(0).
174
- Return:
175
- Tensor: Loss tensor.
176
- """
177
- # overlap
178
- lt = torch.max(pred[:, :2], target[:, :2])
179
- rb = torch.min(pred[:, 2:], target[:, 2:])
180
- wh = (rb - lt).clamp(min=0)
181
- overlap = wh[:, 0] * wh[:, 1]
182
-
183
- # union
184
- ap = (pred[:, 2] - pred[:, 0]) * (pred[:, 3] - pred[:, 1])
185
- ag = (target[:, 2] - target[:, 0]) * (target[:, 3] - target[:, 1])
186
- union = ap + ag - overlap + eps
187
-
188
- # IoU
189
- ious = overlap / union
190
-
191
- # enclose area
192
- enclose_x1y1 = torch.min(pred[:, :2], target[:, :2])
193
- enclose_x2y2 = torch.max(pred[:, 2:], target[:, 2:])
194
- enclose_wh = (enclose_x2y2 - enclose_x1y1).clamp(min=0)
195
-
196
- cw = enclose_wh[:, 0]
197
- ch = enclose_wh[:, 1]
198
-
199
- c2 = cw**2 + ch**2 + eps
200
-
201
- b1_x1, b1_y1 = pred[:, 0], pred[:, 1]
202
- b1_x2, b1_y2 = pred[:, 2], pred[:, 3]
203
- b2_x1, b2_y1 = target[:, 0], target[:, 1]
204
- b2_x2, b2_y2 = target[:, 2], target[:, 3]
205
-
206
- w1, h1 = b1_x2 - b1_x1, b1_y2 - b1_y1 + eps
207
- w2, h2 = b2_x2 - b2_x1, b2_y2 - b2_y1 + eps
208
-
209
- left = ((b2_x1 + b2_x2) - (b1_x1 + b1_x2))**2 / 4
210
- right = ((b2_y1 + b2_y2) - (b1_y1 + b1_y2))**2 / 4
211
- rho2 = left + right
212
-
213
- factor = 4 / math.pi**2
214
- v = factor * torch.pow(torch.atan(w2 / h2) - torch.atan(w1 / h1), 2)
215
-
216
- # CIoU
217
- cious = ious - (rho2 / c2 + v**2 / (1 - ious + v))
218
- loss = 1 - cious
219
- return loss
220
-
221
-
222
- @LOSSES.register_module()
223
- class IoULoss(nn.Module):
224
- """IoULoss.
225
-
226
- Computing the IoU loss between a set of predicted bboxes and target bboxes.
227
-
228
- Args:
229
- linear (bool): If True, use linear scale of loss instead of log scale.
230
- Default: False.
231
- eps (float): Eps to avoid log(0).
232
- reduction (str): Options are "none", "mean" and "sum".
233
- loss_weight (float): Weight of loss.
234
- """
235
-
236
- def __init__(self,
237
- linear=False,
238
- eps=1e-6,
239
- reduction='mean',
240
- loss_weight=1.0):
241
- super(IoULoss, self).__init__()
242
- self.linear = linear
243
- self.eps = eps
244
- self.reduction = reduction
245
- self.loss_weight = loss_weight
246
-
247
- def forward(self,
248
- pred,
249
- target,
250
- weight=None,
251
- avg_factor=None,
252
- reduction_override=None,
253
- **kwargs):
254
- """Forward function.
255
-
256
- Args:
257
- pred (torch.Tensor): The prediction.
258
- target (torch.Tensor): The learning target of the prediction.
259
- weight (torch.Tensor, optional): The weight of loss for each
260
- prediction. Defaults to None.
261
- avg_factor (int, optional): Average factor that is used to average
262
- the loss. Defaults to None.
263
- reduction_override (str, optional): The reduction method used to
264
- override the original reduction method of the loss.
265
- Defaults to None. Options are "none", "mean" and "sum".
266
- """
267
- assert reduction_override in (None, 'none', 'mean', 'sum')
268
- reduction = (
269
- reduction_override if reduction_override else self.reduction)
270
- if (weight is not None) and (not torch.any(weight > 0)) and (
271
- reduction != 'none'):
272
- return (pred * weight).sum() # 0
273
- if weight is not None and weight.dim() > 1:
274
- # TODO: remove this in the future
275
- # reduce the weight of shape (n, 4) to (n,) to match the
276
- # iou_loss of shape (n,)
277
- assert weight.shape == pred.shape
278
- weight = weight.mean(-1)
279
- loss = self.loss_weight * iou_loss(
280
- pred,
281
- target,
282
- weight,
283
- linear=self.linear,
284
- eps=self.eps,
285
- reduction=reduction,
286
- avg_factor=avg_factor,
287
- **kwargs)
288
- return loss
289
-
290
-
291
- @LOSSES.register_module()
292
- class BoundedIoULoss(nn.Module):
293
-
294
- def __init__(self, beta=0.2, eps=1e-3, reduction='mean', loss_weight=1.0):
295
- super(BoundedIoULoss, self).__init__()
296
- self.beta = beta
297
- self.eps = eps
298
- self.reduction = reduction
299
- self.loss_weight = loss_weight
300
-
301
- def forward(self,
302
- pred,
303
- target,
304
- weight=None,
305
- avg_factor=None,
306
- reduction_override=None,
307
- **kwargs):
308
- if weight is not None and not torch.any(weight > 0):
309
- return (pred * weight).sum() # 0
310
- assert reduction_override in (None, 'none', 'mean', 'sum')
311
- reduction = (
312
- reduction_override if reduction_override else self.reduction)
313
- loss = self.loss_weight * bounded_iou_loss(
314
- pred,
315
- target,
316
- weight,
317
- beta=self.beta,
318
- eps=self.eps,
319
- reduction=reduction,
320
- avg_factor=avg_factor,
321
- **kwargs)
322
- return loss
323
-
324
-
325
- @LOSSES.register_module()
326
- class GIoULoss(nn.Module):
327
-
328
- def __init__(self, eps=1e-6, reduction='mean', loss_weight=1.0):
329
- super(GIoULoss, self).__init__()
330
- self.eps = eps
331
- self.reduction = reduction
332
- self.loss_weight = loss_weight
333
-
334
- def forward(self,
335
- pred,
336
- target,
337
- weight=None,
338
- avg_factor=None,
339
- reduction_override=None,
340
- **kwargs):
341
- if weight is not None and not torch.any(weight > 0):
342
- return (pred * weight).sum() # 0
343
- assert reduction_override in (None, 'none', 'mean', 'sum')
344
- reduction = (
345
- reduction_override if reduction_override else self.reduction)
346
- if weight is not None and weight.dim() > 1:
347
- # TODO: remove this in the future
348
- # reduce the weight of shape (n, 4) to (n,) to match the
349
- # giou_loss of shape (n,)
350
- assert weight.shape == pred.shape
351
- weight = weight.mean(-1)
352
- loss = self.loss_weight * giou_loss(
353
- pred,
354
- target,
355
- weight,
356
- eps=self.eps,
357
- reduction=reduction,
358
- avg_factor=avg_factor,
359
- **kwargs)
360
- return loss
361
-
362
-
363
- @LOSSES.register_module()
364
- class DIoULoss(nn.Module):
365
-
366
- def __init__(self, eps=1e-6, reduction='mean', loss_weight=1.0):
367
- super(DIoULoss, self).__init__()
368
- self.eps = eps
369
- self.reduction = reduction
370
- self.loss_weight = loss_weight
371
-
372
- def forward(self,
373
- pred,
374
- target,
375
- weight=None,
376
- avg_factor=None,
377
- reduction_override=None,
378
- **kwargs):
379
- if weight is not None and not torch.any(weight > 0):
380
- return (pred * weight).sum() # 0
381
- assert reduction_override in (None, 'none', 'mean', 'sum')
382
- reduction = (
383
- reduction_override if reduction_override else self.reduction)
384
- if weight is not None and weight.dim() > 1:
385
- # TODO: remove this in the future
386
- # reduce the weight of shape (n, 4) to (n,) to match the
387
- # giou_loss of shape (n,)
388
- assert weight.shape == pred.shape
389
- weight = weight.mean(-1)
390
- loss = self.loss_weight * diou_loss(
391
- pred,
392
- target,
393
- weight,
394
- eps=self.eps,
395
- reduction=reduction,
396
- avg_factor=avg_factor,
397
- **kwargs)
398
- return loss
399
-
400
-
401
- @LOSSES.register_module()
402
- class CIoULoss(nn.Module):
403
-
404
- def __init__(self, eps=1e-6, reduction='mean', loss_weight=1.0):
405
- super(CIoULoss, self).__init__()
406
- self.eps = eps
407
- self.reduction = reduction
408
- self.loss_weight = loss_weight
409
-
410
- def forward(self,
411
- pred,
412
- target,
413
- weight=None,
414
- avg_factor=None,
415
- reduction_override=None,
416
- **kwargs):
417
- if weight is not None and not torch.any(weight > 0):
418
- return (pred * weight).sum() # 0
419
- assert reduction_override in (None, 'none', 'mean', 'sum')
420
- reduction = (
421
- reduction_override if reduction_override else self.reduction)
422
- if weight is not None and weight.dim() > 1:
423
- # TODO: remove this in the future
424
- # reduce the weight of shape (n, 4) to (n,) to match the
425
- # giou_loss of shape (n,)
426
- assert weight.shape == pred.shape
427
- weight = weight.mean(-1)
428
- loss = self.loss_weight * ciou_loss(
429
- pred,
430
- target,
431
- weight,
432
- eps=self.eps,
433
- reduction=reduction,
434
- avg_factor=avg_factor,
435
- **kwargs)
436
- return loss
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Andy1621/uniformer_image_detection/mmdet/models/roi_heads/mask_heads/fcn_mask_head.py DELETED
@@ -1,377 +0,0 @@
1
- import numpy as np
2
- import torch
3
- import torch.nn as nn
4
- import torch.nn.functional as F
5
- from mmcv.cnn import Conv2d, ConvModule, build_upsample_layer
6
- from mmcv.ops.carafe import CARAFEPack
7
- from mmcv.runner import auto_fp16, force_fp32
8
- from torch.nn.modules.utils import _pair
9
-
10
- from mmdet.core import mask_target
11
- from mmdet.models.builder import HEADS, build_loss
12
-
13
- BYTES_PER_FLOAT = 4
14
- # TODO: This memory limit may be too much or too little. It would be better to
15
- # determine it based on available resources.
16
- GPU_MEM_LIMIT = 1024**3 # 1 GB memory limit
17
-
18
-
19
- @HEADS.register_module()
20
- class FCNMaskHead(nn.Module):
21
-
22
- def __init__(self,
23
- num_convs=4,
24
- roi_feat_size=14,
25
- in_channels=256,
26
- conv_kernel_size=3,
27
- conv_out_channels=256,
28
- num_classes=80,
29
- class_agnostic=False,
30
- upsample_cfg=dict(type='deconv', scale_factor=2),
31
- conv_cfg=None,
32
- norm_cfg=None,
33
- loss_mask=dict(
34
- type='CrossEntropyLoss', use_mask=True, loss_weight=1.0)):
35
- super(FCNMaskHead, self).__init__()
36
- self.upsample_cfg = upsample_cfg.copy()
37
- if self.upsample_cfg['type'] not in [
38
- None, 'deconv', 'nearest', 'bilinear', 'carafe'
39
- ]:
40
- raise ValueError(
41
- f'Invalid upsample method {self.upsample_cfg["type"]}, '
42
- 'accepted methods are "deconv", "nearest", "bilinear", '
43
- '"carafe"')
44
- self.num_convs = num_convs
45
- # WARN: roi_feat_size is reserved and not used
46
- self.roi_feat_size = _pair(roi_feat_size)
47
- self.in_channels = in_channels
48
- self.conv_kernel_size = conv_kernel_size
49
- self.conv_out_channels = conv_out_channels
50
- self.upsample_method = self.upsample_cfg.get('type')
51
- self.scale_factor = self.upsample_cfg.pop('scale_factor', None)
52
- self.num_classes = num_classes
53
- self.class_agnostic = class_agnostic
54
- self.conv_cfg = conv_cfg
55
- self.norm_cfg = norm_cfg
56
- self.fp16_enabled = False
57
- self.loss_mask = build_loss(loss_mask)
58
-
59
- self.convs = nn.ModuleList()
60
- for i in range(self.num_convs):
61
- in_channels = (
62
- self.in_channels if i == 0 else self.conv_out_channels)
63
- padding = (self.conv_kernel_size - 1) // 2
64
- self.convs.append(
65
- ConvModule(
66
- in_channels,
67
- self.conv_out_channels,
68
- self.conv_kernel_size,
69
- padding=padding,
70
- conv_cfg=conv_cfg,
71
- norm_cfg=norm_cfg))
72
- upsample_in_channels = (
73
- self.conv_out_channels if self.num_convs > 0 else in_channels)
74
- upsample_cfg_ = self.upsample_cfg.copy()
75
- if self.upsample_method is None:
76
- self.upsample = None
77
- elif self.upsample_method == 'deconv':
78
- upsample_cfg_.update(
79
- in_channels=upsample_in_channels,
80
- out_channels=self.conv_out_channels,
81
- kernel_size=self.scale_factor,
82
- stride=self.scale_factor)
83
- self.upsample = build_upsample_layer(upsample_cfg_)
84
- elif self.upsample_method == 'carafe':
85
- upsample_cfg_.update(
86
- channels=upsample_in_channels, scale_factor=self.scale_factor)
87
- self.upsample = build_upsample_layer(upsample_cfg_)
88
- else:
89
- # suppress warnings
90
- align_corners = (None
91
- if self.upsample_method == 'nearest' else False)
92
- upsample_cfg_.update(
93
- scale_factor=self.scale_factor,
94
- mode=self.upsample_method,
95
- align_corners=align_corners)
96
- self.upsample = build_upsample_layer(upsample_cfg_)
97
-
98
- out_channels = 1 if self.class_agnostic else self.num_classes
99
- logits_in_channel = (
100
- self.conv_out_channels
101
- if self.upsample_method == 'deconv' else upsample_in_channels)
102
- self.conv_logits = Conv2d(logits_in_channel, out_channels, 1)
103
- self.relu = nn.ReLU(inplace=True)
104
- self.debug_imgs = None
105
-
106
- def init_weights(self):
107
- for m in [self.upsample, self.conv_logits]:
108
- if m is None:
109
- continue
110
- elif isinstance(m, CARAFEPack):
111
- m.init_weights()
112
- else:
113
- nn.init.kaiming_normal_(
114
- m.weight, mode='fan_out', nonlinearity='relu')
115
- nn.init.constant_(m.bias, 0)
116
-
117
- @auto_fp16()
118
- def forward(self, x):
119
- for conv in self.convs:
120
- x = conv(x)
121
- if self.upsample is not None:
122
- x = self.upsample(x)
123
- if self.upsample_method == 'deconv':
124
- x = self.relu(x)
125
- mask_pred = self.conv_logits(x)
126
- return mask_pred
127
-
128
- def get_targets(self, sampling_results, gt_masks, rcnn_train_cfg):
129
- pos_proposals = [res.pos_bboxes for res in sampling_results]
130
- pos_assigned_gt_inds = [
131
- res.pos_assigned_gt_inds for res in sampling_results
132
- ]
133
- mask_targets = mask_target(pos_proposals, pos_assigned_gt_inds,
134
- gt_masks, rcnn_train_cfg)
135
- return mask_targets
136
-
137
- @force_fp32(apply_to=('mask_pred', ))
138
- def loss(self, mask_pred, mask_targets, labels):
139
- """
140
- Example:
141
- >>> from mmdet.models.roi_heads.mask_heads.fcn_mask_head import * # NOQA
142
- >>> N = 7 # N = number of extracted ROIs
143
- >>> C, H, W = 11, 32, 32
144
- >>> # Create example instance of FCN Mask Head.
145
- >>> # There are lots of variations depending on the configuration
146
- >>> self = FCNMaskHead(num_classes=C, num_convs=1)
147
- >>> inputs = torch.rand(N, self.in_channels, H, W)
148
- >>> mask_pred = self.forward(inputs)
149
- >>> sf = self.scale_factor
150
- >>> labels = torch.randint(0, C, size=(N,))
151
- >>> # With the default properties the mask targets should indicate
152
- >>> # a (potentially soft) single-class label
153
- >>> mask_targets = torch.rand(N, H * sf, W * sf)
154
- >>> loss = self.loss(mask_pred, mask_targets, labels)
155
- >>> print('loss = {!r}'.format(loss))
156
- """
157
- loss = dict()
158
- if mask_pred.size(0) == 0:
159
- loss_mask = mask_pred.sum()
160
- else:
161
- if self.class_agnostic:
162
- loss_mask = self.loss_mask(mask_pred, mask_targets,
163
- torch.zeros_like(labels))
164
- else:
165
- loss_mask = self.loss_mask(mask_pred, mask_targets, labels)
166
- loss['loss_mask'] = loss_mask
167
- return loss
168
-
169
- def get_seg_masks(self, mask_pred, det_bboxes, det_labels, rcnn_test_cfg,
170
- ori_shape, scale_factor, rescale):
171
- """Get segmentation masks from mask_pred and bboxes.
172
-
173
- Args:
174
- mask_pred (Tensor or ndarray): shape (n, #class, h, w).
175
- For single-scale testing, mask_pred is the direct output of
176
- model, whose type is Tensor, while for multi-scale testing,
177
- it will be converted to numpy array outside of this method.
178
- det_bboxes (Tensor): shape (n, 4/5)
179
- det_labels (Tensor): shape (n, )
180
- rcnn_test_cfg (dict): rcnn testing config
181
- ori_shape (Tuple): original image height and width, shape (2,)
182
- scale_factor(float | Tensor): If ``rescale is True``, box
183
- coordinates are divided by this scale factor to fit
184
- ``ori_shape``.
185
- rescale (bool): If True, the resulting masks will be rescaled to
186
- ``ori_shape``.
187
-
188
- Returns:
189
- list[list]: encoded masks. The c-th item in the outer list
190
- corresponds to the c-th class. Given the c-th outer list, the
191
- i-th item in that inner list is the mask for the i-th box with
192
- class label c.
193
-
194
- Example:
195
- >>> import mmcv
196
- >>> from mmdet.models.roi_heads.mask_heads.fcn_mask_head import * # NOQA
197
- >>> N = 7 # N = number of extracted ROIs
198
- >>> C, H, W = 11, 32, 32
199
- >>> # Create example instance of FCN Mask Head.
200
- >>> self = FCNMaskHead(num_classes=C, num_convs=0)
201
- >>> inputs = torch.rand(N, self.in_channels, H, W)
202
- >>> mask_pred = self.forward(inputs)
203
- >>> # Each input is associated with some bounding box
204
- >>> det_bboxes = torch.Tensor([[1, 1, 42, 42 ]] * N)
205
- >>> det_labels = torch.randint(0, C, size=(N,))
206
- >>> rcnn_test_cfg = mmcv.Config({'mask_thr_binary': 0, })
207
- >>> ori_shape = (H * 4, W * 4)
208
- >>> scale_factor = torch.FloatTensor((1, 1))
209
- >>> rescale = False
210
- >>> # Encoded masks are a list for each category.
211
- >>> encoded_masks = self.get_seg_masks(
212
- >>> mask_pred, det_bboxes, det_labels, rcnn_test_cfg, ori_shape,
213
- >>> scale_factor, rescale
214
- >>> )
215
- >>> assert len(encoded_masks) == C
216
- >>> assert sum(list(map(len, encoded_masks))) == N
217
- """
218
- if isinstance(mask_pred, torch.Tensor):
219
- mask_pred = mask_pred.sigmoid()
220
- else:
221
- mask_pred = det_bboxes.new_tensor(mask_pred)
222
-
223
- device = mask_pred.device
224
- cls_segms = [[] for _ in range(self.num_classes)
225
- ] # BG is not included in num_classes
226
- bboxes = det_bboxes[:, :4]
227
- labels = det_labels
228
-
229
- if rescale:
230
- img_h, img_w = ori_shape[:2]
231
- else:
232
- if isinstance(scale_factor, float):
233
- img_h = np.round(ori_shape[0] * scale_factor).astype(np.int32)
234
- img_w = np.round(ori_shape[1] * scale_factor).astype(np.int32)
235
- else:
236
- w_scale, h_scale = scale_factor[0], scale_factor[1]
237
- img_h = np.round(ori_shape[0] * h_scale.item()).astype(
238
- np.int32)
239
- img_w = np.round(ori_shape[1] * w_scale.item()).astype(
240
- np.int32)
241
- scale_factor = 1.0
242
-
243
- if not isinstance(scale_factor, (float, torch.Tensor)):
244
- scale_factor = bboxes.new_tensor(scale_factor)
245
- bboxes = bboxes / scale_factor
246
-
247
- if torch.onnx.is_in_onnx_export():
248
- # TODO: Remove after F.grid_sample is supported.
249
- from torchvision.models.detection.roi_heads \
250
- import paste_masks_in_image
251
- masks = paste_masks_in_image(mask_pred, bboxes, ori_shape[:2])
252
- thr = rcnn_test_cfg.get('mask_thr_binary', 0)
253
- if thr > 0:
254
- masks = masks >= thr
255
- return masks
256
-
257
- N = len(mask_pred)
258
- # The actual implementation split the input into chunks,
259
- # and paste them chunk by chunk.
260
- if device.type == 'cpu':
261
- # CPU is most efficient when they are pasted one by one with
262
- # skip_empty=True, so that it performs minimal number of
263
- # operations.
264
- num_chunks = N
265
- else:
266
- # GPU benefits from parallelism for larger chunks,
267
- # but may have memory issue
268
- num_chunks = int(
269
- np.ceil(N * img_h * img_w * BYTES_PER_FLOAT / GPU_MEM_LIMIT))
270
- assert (num_chunks <=
271
- N), 'Default GPU_MEM_LIMIT is too small; try increasing it'
272
- chunks = torch.chunk(torch.arange(N, device=device), num_chunks)
273
-
274
- threshold = rcnn_test_cfg.mask_thr_binary
275
- im_mask = torch.zeros(
276
- N,
277
- img_h,
278
- img_w,
279
- device=device,
280
- dtype=torch.bool if threshold >= 0 else torch.uint8)
281
-
282
- if not self.class_agnostic:
283
- mask_pred = mask_pred[range(N), labels][:, None]
284
-
285
- for inds in chunks:
286
- masks_chunk, spatial_inds = _do_paste_mask(
287
- mask_pred[inds],
288
- bboxes[inds],
289
- img_h,
290
- img_w,
291
- skip_empty=device.type == 'cpu')
292
-
293
- if threshold >= 0:
294
- masks_chunk = (masks_chunk >= threshold).to(dtype=torch.bool)
295
- else:
296
- # for visualization and debugging
297
- masks_chunk = (masks_chunk * 255).to(dtype=torch.uint8)
298
-
299
- im_mask[(inds, ) + spatial_inds] = masks_chunk
300
-
301
- for i in range(N):
302
- cls_segms[labels[i]].append(im_mask[i].detach().cpu().numpy())
303
- return cls_segms
304
-
305
-
306
- def _do_paste_mask(masks, boxes, img_h, img_w, skip_empty=True):
307
- """Paste instance masks according to boxes.
308
-
309
- This implementation is modified from
310
- https://github.com/facebookresearch/detectron2/
311
-
312
- Args:
313
- masks (Tensor): N, 1, H, W
314
- boxes (Tensor): N, 4
315
- img_h (int): Height of the image to be pasted.
316
- img_w (int): Width of the image to be pasted.
317
- skip_empty (bool): Only paste masks within the region that
318
- tightly bound all boxes, and returns the results this region only.
319
- An important optimization for CPU.
320
-
321
- Returns:
322
- tuple: (Tensor, tuple). The first item is mask tensor, the second one
323
- is the slice object.
324
- If skip_empty == False, the whole image will be pasted. It will
325
- return a mask of shape (N, img_h, img_w) and an empty tuple.
326
- If skip_empty == True, only area around the mask will be pasted.
327
- A mask of shape (N, h', w') and its start and end coordinates
328
- in the original image will be returned.
329
- """
330
- # On GPU, paste all masks together (up to chunk size)
331
- # by using the entire image to sample the masks
332
- # Compared to pasting them one by one,
333
- # this has more operations but is faster on COCO-scale dataset.
334
- device = masks.device
335
- if skip_empty:
336
- x0_int, y0_int = torch.clamp(
337
- boxes.min(dim=0).values.floor()[:2] - 1,
338
- min=0).to(dtype=torch.int32)
339
- x1_int = torch.clamp(
340
- boxes[:, 2].max().ceil() + 1, max=img_w).to(dtype=torch.int32)
341
- y1_int = torch.clamp(
342
- boxes[:, 3].max().ceil() + 1, max=img_h).to(dtype=torch.int32)
343
- else:
344
- x0_int, y0_int = 0, 0
345
- x1_int, y1_int = img_w, img_h
346
- x0, y0, x1, y1 = torch.split(boxes, 1, dim=1) # each is Nx1
347
-
348
- N = masks.shape[0]
349
-
350
- img_y = torch.arange(
351
- y0_int, y1_int, device=device, dtype=torch.float32) + 0.5
352
- img_x = torch.arange(
353
- x0_int, x1_int, device=device, dtype=torch.float32) + 0.5
354
- img_y = (img_y - y0) / (y1 - y0) * 2 - 1
355
- img_x = (img_x - x0) / (x1 - x0) * 2 - 1
356
- # img_x, img_y have shapes (N, w), (N, h)
357
- if torch.isinf(img_x).any():
358
- inds = torch.where(torch.isinf(img_x))
359
- img_x[inds] = 0
360
- if torch.isinf(img_y).any():
361
- inds = torch.where(torch.isinf(img_y))
362
- img_y[inds] = 0
363
-
364
- gx = img_x[:, None, :].expand(N, img_y.size(1), img_x.size(1))
365
- gy = img_y[:, :, None].expand(N, img_y.size(1), img_x.size(1))
366
- grid = torch.stack([gx, gy], dim=3)
367
-
368
- if torch.onnx.is_in_onnx_export():
369
- raise RuntimeError(
370
- 'Exporting F.grid_sample from Pytorch to ONNX is not supported.')
371
- img_masks = F.grid_sample(
372
- masks.to(dtype=torch.float32), grid, align_corners=False)
373
-
374
- if skip_empty:
375
- return img_masks[:, 0], (slice(y0_int, y1_int), slice(x0_int, x1_int))
376
- else:
377
- return img_masks[:, 0], ()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AntX-ai/README/README.md DELETED
@@ -1,13 +0,0 @@
1
- ---
2
- title: README
3
- emoji: 🔥
4
- colorFrom: pink
5
- colorTo: pink
6
- sdk: static
7
- pinned: false
8
- ---
9
-
10
- https://gitee.com/antx-ai
11
- AntX.AI成立于2020年,是领先的AI大模型技术服务商。致力于以AI大模型解决具体业务问题,汇聚数据沉淀知识,加速AI应用落地,打造应用、用户、数据、模型之间的数据飞轮,加速产业数字化转型。
12
- 自主研发AntX蚂蚁座大模型底座,支持情感分析、智能问答、文章总结、多模态扩展等丰富的应用开发,为零售、金融、营销等多个行业及场景提供解决方案。
13
- AntX.ai是开源社区的受益者,也是开源社区的积极贡献者。当前,AntX-7B大模型、AntX-13B大模型、I-nice聚类算法、金融交易数据集等核心代码及数据已在Hugging Face、gitee、github等社区开源。
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Arnaudding001/OpenAI_whisperLive/download.py DELETED
@@ -1,72 +0,0 @@
1
- from tempfile import mkdtemp
2
- from typing import List
3
- from yt_dlp import YoutubeDL
4
-
5
- import yt_dlp
6
- from yt_dlp.postprocessor import PostProcessor
7
-
8
- class FilenameCollectorPP(PostProcessor):
9
- def __init__(self):
10
- super(FilenameCollectorPP, self).__init__(None)
11
- self.filenames = []
12
-
13
- def run(self, information):
14
- self.filenames.append(information["filepath"])
15
- return [], information
16
-
17
- def download_url(url: str, maxDuration: int = None, destinationDirectory: str = None, playlistItems: str = "1") -> List[str]:
18
- try:
19
- return _perform_download(url, maxDuration=maxDuration, outputTemplate=None, destinationDirectory=destinationDirectory, playlistItems=playlistItems)
20
- except yt_dlp.utils.DownloadError as e:
21
- # In case of an OS error, try again with a different output template
22
- if e.msg and e.msg.find("[Errno 36] File name too long") >= 0:
23
- return _perform_download(url, maxDuration=maxDuration, outputTemplate="%(title).10s %(id)s.%(ext)s")
24
- pass
25
-
26
- def _perform_download(url: str, maxDuration: int = None, outputTemplate: str = None, destinationDirectory: str = None, playlistItems: str = "1"):
27
- # Create a temporary directory to store the downloaded files
28
- if destinationDirectory is None:
29
- destinationDirectory = mkdtemp()
30
-
31
- ydl_opts = {
32
- "format": "bestaudio/best",
33
- 'paths': {
34
- 'home': destinationDirectory
35
- }
36
- }
37
- if (playlistItems):
38
- ydl_opts['playlist_items'] = playlistItems
39
-
40
- # Add output template if specified
41
- if outputTemplate:
42
- ydl_opts['outtmpl'] = outputTemplate
43
-
44
- filename_collector = FilenameCollectorPP()
45
-
46
- with YoutubeDL(ydl_opts) as ydl:
47
- if maxDuration and maxDuration > 0:
48
- info = ydl.extract_info(url, download=False)
49
- duration = info['duration']
50
-
51
- if duration >= maxDuration:
52
- raise ExceededMaximumDuration(videoDuration=duration, maxDuration=maxDuration, message="Video is too long")
53
-
54
- ydl.add_post_processor(filename_collector)
55
- ydl.download([url])
56
-
57
- if len(filename_collector.filenames) <= 0:
58
- raise Exception("Cannot download " + url)
59
-
60
- result = []
61
-
62
- for filename in filename_collector.filenames:
63
- result.append(filename)
64
- print("Downloaded " + filename)
65
-
66
- return result
67
-
68
- class ExceededMaximumDuration(Exception):
69
- def __init__(self, videoDuration, maxDuration, message):
70
- self.videoDuration = videoDuration
71
- self.maxDuration = maxDuration
72
- super().__init__(message)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_internal/cli/main_parser.py DELETED
@@ -1,134 +0,0 @@
1
- """A single place for constructing and exposing the main parser
2
- """
3
-
4
- import os
5
- import subprocess
6
- import sys
7
- from typing import List, Optional, Tuple
8
-
9
- from pip._internal.build_env import get_runnable_pip
10
- from pip._internal.cli import cmdoptions
11
- from pip._internal.cli.parser import ConfigOptionParser, UpdatingDefaultsHelpFormatter
12
- from pip._internal.commands import commands_dict, get_similar_commands
13
- from pip._internal.exceptions import CommandError
14
- from pip._internal.utils.misc import get_pip_version, get_prog
15
-
16
- __all__ = ["create_main_parser", "parse_command"]
17
-
18
-
19
- def create_main_parser() -> ConfigOptionParser:
20
- """Creates and returns the main parser for pip's CLI"""
21
-
22
- parser = ConfigOptionParser(
23
- usage="\n%prog <command> [options]",
24
- add_help_option=False,
25
- formatter=UpdatingDefaultsHelpFormatter(),
26
- name="global",
27
- prog=get_prog(),
28
- )
29
- parser.disable_interspersed_args()
30
-
31
- parser.version = get_pip_version()
32
-
33
- # add the general options
34
- gen_opts = cmdoptions.make_option_group(cmdoptions.general_group, parser)
35
- parser.add_option_group(gen_opts)
36
-
37
- # so the help formatter knows
38
- parser.main = True # type: ignore
39
-
40
- # create command listing for description
41
- description = [""] + [
42
- f"{name:27} {command_info.summary}"
43
- for name, command_info in commands_dict.items()
44
- ]
45
- parser.description = "\n".join(description)
46
-
47
- return parser
48
-
49
-
50
- def identify_python_interpreter(python: str) -> Optional[str]:
51
- # If the named file exists, use it.
52
- # If it's a directory, assume it's a virtual environment and
53
- # look for the environment's Python executable.
54
- if os.path.exists(python):
55
- if os.path.isdir(python):
56
- # bin/python for Unix, Scripts/python.exe for Windows
57
- # Try both in case of odd cases like cygwin.
58
- for exe in ("bin/python", "Scripts/python.exe"):
59
- py = os.path.join(python, exe)
60
- if os.path.exists(py):
61
- return py
62
- else:
63
- return python
64
-
65
- # Could not find the interpreter specified
66
- return None
67
-
68
-
69
- def parse_command(args: List[str]) -> Tuple[str, List[str]]:
70
- parser = create_main_parser()
71
-
72
- # Note: parser calls disable_interspersed_args(), so the result of this
73
- # call is to split the initial args into the general options before the
74
- # subcommand and everything else.
75
- # For example:
76
- # args: ['--timeout=5', 'install', '--user', 'INITools']
77
- # general_options: ['--timeout==5']
78
- # args_else: ['install', '--user', 'INITools']
79
- general_options, args_else = parser.parse_args(args)
80
-
81
- # --python
82
- if general_options.python and "_PIP_RUNNING_IN_SUBPROCESS" not in os.environ:
83
- # Re-invoke pip using the specified Python interpreter
84
- interpreter = identify_python_interpreter(general_options.python)
85
- if interpreter is None:
86
- raise CommandError(
87
- f"Could not locate Python interpreter {general_options.python}"
88
- )
89
-
90
- pip_cmd = [
91
- interpreter,
92
- get_runnable_pip(),
93
- ]
94
- pip_cmd.extend(args)
95
-
96
- # Set a flag so the child doesn't re-invoke itself, causing
97
- # an infinite loop.
98
- os.environ["_PIP_RUNNING_IN_SUBPROCESS"] = "1"
99
- returncode = 0
100
- try:
101
- proc = subprocess.run(pip_cmd)
102
- returncode = proc.returncode
103
- except (subprocess.SubprocessError, OSError) as exc:
104
- raise CommandError(f"Failed to run pip under {interpreter}: {exc}")
105
- sys.exit(returncode)
106
-
107
- # --version
108
- if general_options.version:
109
- sys.stdout.write(parser.version)
110
- sys.stdout.write(os.linesep)
111
- sys.exit()
112
-
113
- # pip || pip help -> print_help()
114
- if not args_else or (args_else[0] == "help" and len(args_else) == 1):
115
- parser.print_help()
116
- sys.exit()
117
-
118
- # the subcommand name
119
- cmd_name = args_else[0]
120
-
121
- if cmd_name not in commands_dict:
122
- guess = get_similar_commands(cmd_name)
123
-
124
- msg = [f'unknown command "{cmd_name}"']
125
- if guess:
126
- msg.append(f'maybe you meant "{guess}"')
127
-
128
- raise CommandError(" - ".join(msg))
129
-
130
- # all the args without the subcommand
131
- cmd_args = args[:]
132
- cmd_args.remove(cmd_name)
133
-
134
- return cmd_name, cmd_args
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Banbri/zcvzcv/src/app/layouts/index.tsx DELETED
@@ -1,370 +0,0 @@
1
- "use client"
2
-
3
- import { Panel } from "@/app/interface/panel"
4
- import { pick } from "@/lib/pick"
5
- import { Grid } from "@/app/interface/grid"
6
-
7
- export function Layout0() {
8
- return (
9
- <Grid className="grid-cols-2 grid-rows-2">
10
- <div className="bg-stone-100 col-span-1 row-span-1">
11
- <Panel
12
- panel={0}
13
- width={1024}
14
- height={1024}
15
- />
16
- </div>
17
- <div className="bg-zinc-100 col-span-1 row-span-1">
18
- <Panel
19
- panel={1}
20
- width={1024}
21
- height={1024}
22
- />
23
- </div>
24
- <div className="bg-gray-100 col-span-1 row-span-1">
25
- <Panel
26
- panel={2}
27
- width={1024}
28
- height={1024}
29
- />
30
- </div>
31
- <div className="bg-slate-100 col-span-1 row-span-1">
32
- <Panel
33
- panel={3}
34
- width={1024}
35
- height={1024}
36
- />
37
- </div>
38
- </Grid>
39
- )
40
- }
41
-
42
- export function Layout1() {
43
- return (
44
- <Grid className="grid-cols-2 grid-rows-3">
45
- <div className="bg-stone-100">
46
- <Panel
47
- panel={0}
48
- width={1024}
49
- height={768}
50
- />
51
- </div>
52
- <div className="bg-zinc-100 row-span-2">
53
- <Panel
54
- panel={1}
55
- width={768}
56
- height={1024}
57
- />
58
- </div>
59
- <div className="bg-gray-100 row-span-2 col-span-1">
60
- <Panel
61
- panel={2}
62
- width={768}
63
- height={1024}
64
- />
65
- </div>
66
- <div className="bg-slate-100">
67
- <Panel
68
- panel={3}
69
- width={1024}
70
- height={768}
71
- />
72
- </div>
73
- </Grid>
74
- )
75
- }
76
-
77
- export function Layout2_todo() {
78
- return (
79
- <Grid className="grid-cols-2 grid-rows-3">
80
- <div className="bg-gray-100 row-span-3 col-span-1">
81
- <Panel
82
- panel={0}
83
- width={768}
84
- height={1024}
85
- />
86
- </div>
87
- <div className="bg-slate-100">
88
- <Panel
89
- panel={1}
90
- width={1024}
91
- height={768}
92
- />
93
- </div>
94
- <div className="bg-stone-100">
95
- <Panel
96
- panel={2}
97
- width={1024}
98
- height={768}
99
- />
100
- </div>
101
- <div className="bg-zinc-100 row-span-1 col-span-1">
102
- <Panel
103
- panel={3}
104
- width={1024}
105
- height={768}
106
- />
107
- </div>
108
- </Grid>
109
- )
110
- }
111
-
112
- export function Layout3_todo() {
113
- return (
114
- <Grid className="grid-cols-5 grid-rows-2">
115
- <div className="bg-zinc-100 col-span-3">
116
- <Panel
117
- panel={0}
118
- width={1024}
119
- height={768}
120
- />
121
- </div>
122
- <div className="bg-zinc-100 col-span-2 row-span-2">
123
- <Panel
124
- panel={1}
125
- width={768}
126
- height={1024}
127
- />
128
- </div>
129
- <div className="col-span-3 grid grid-cols-2 gap-2">
130
- <div className="bg-stone-100">
131
- <Panel
132
- panel={2}
133
- width={768}
134
- height={758}
135
- />
136
- </div>
137
- <div className="bg-slate-100">
138
- <Panel
139
- panel={3}
140
- width={768}
141
- height={758}
142
- />
143
- </div>
144
- </div>
145
- </Grid>
146
- )
147
- }
148
-
149
- export function Layout4_todo() {
150
- return (
151
- <Grid className="grid-cols-2 grid-rows-3">
152
- <div className="bg-slate-100 row-span-2">
153
- <Panel
154
- panel={0}
155
- width={768}
156
- height={1024}
157
- />
158
- </div>
159
- <div className="bg-gray-100 row-span-1 col-span-1">
160
- <Panel
161
- panel={1}
162
- width={1024}
163
- height={768}
164
- />
165
- </div>
166
- <div className="bg-zinc-100 row-span-2">
167
- <Panel
168
- panel={2}
169
- width={1024}
170
- height={768}
171
- />
172
- </div>
173
- <div className="bg-stone-100">
174
- <Panel
175
- panel={3}
176
- width={768}
177
- height={1024}
178
- />
179
- </div>
180
- </Grid>
181
- )
182
- }
183
-
184
-
185
- export function Layout2() {
186
- return (
187
- <Grid className="grid-cols-3 grid-rows-2">
188
- <div className="bg-zinc-100 col-span-1 row-span-1">
189
- <Panel
190
- panel={0}
191
- width={768}
192
- height={1024}
193
- />
194
- </div>
195
- <div className="bg-zinc-100 col-span-1 row-span-1">
196
- <Panel
197
- panel={1}
198
- width={768}
199
- height={1024}
200
- />
201
- </div>
202
- <div className="bg-stone-100 row-span-2 col-span-1">
203
- <Panel
204
- panel={2}
205
- width={512}
206
- height={1024}
207
- />
208
- </div>
209
- <div className="bg-slate-100 row-span-1 col-span-2">
210
- <Panel
211
- panel={3}
212
- width={1024}
213
- height={768}
214
- />
215
- </div>
216
- </Grid>
217
- )
218
- }
219
-
220
- export function Layout3() {
221
- return (
222
- <Grid className="grid-cols-3 grid-rows-2">
223
- <div className="bg-zinc-100 col-span-2 row-span-1">
224
- <Panel
225
- panel={0}
226
- width={1024}
227
- height={768}
228
- />
229
- </div>
230
- <div className="bg-zinc-100 col-span-1 row-span-1">
231
- <Panel
232
- panel={1}
233
- width={768}
234
- height={1024}
235
- />
236
- </div>
237
- <div className="bg-stone-100 row-span-1 col-span-1">
238
- <Panel
239
- panel={2}
240
- width={768}
241
- height={1024}
242
- />
243
- </div>
244
- <div className="bg-slate-100 row-span-1 col-span-2">
245
- <Panel
246
- panel={3}
247
- width={1024}
248
- height={768}
249
- />
250
- </div>
251
- </Grid>
252
- )
253
- }
254
-
255
- // squares + vertical
256
- export function Layout4() {
257
- return (
258
- <Grid className="grid-cols-8 grid-rows-8">
259
- <div className="bg-zinc-100 col-start-1 col-end-7 row-start-1 row-end-3">
260
- <Panel
261
- panel={0}
262
- width={512}
263
- height={1024}
264
- />
265
- </div>
266
- <div className="bg-zinc-100 col-start-3 col-end-9 row-start-3 row-end-4">
267
- <Panel
268
- panel={1}
269
- width={1024}
270
- height={768}
271
- />
272
- </div>
273
- <div className="bg-stone-100 col-start-2 col-end-8 row-start-4 row-end-6">
274
- <Panel
275
- panel={2}
276
- width={768}
277
- height={1024}
278
- />
279
- </div>
280
- <div className="bg-slate-100 col-start-1 col-end-9 row-start-6 row-end-8">
281
- <Panel
282
- panel={3}
283
- width={1024}
284
- height={512}
285
- />
286
- </div>
287
- </Grid>
288
- )
289
- }
290
-
291
- // squares + horizontal
292
- export function Layout5() {
293
- return (
294
- <Grid className="grid-cols-4 grid-rows-4">
295
- <div className="bg-zinc-100">
296
- <Panel
297
- panel={0}
298
- width={1024}
299
- height={1024}
300
- />
301
- </div>
302
- <div className="bg-zinc-100">
303
- <Panel
304
- panel={1}
305
- width={1024}
306
- height={1024}
307
- />
308
- </div>
309
- <div className="bg-stone-100">
310
- <Panel
311
- panel={2}
312
- width={1024}
313
- height={1024}
314
- />
315
- </div>
316
- <div className="bg-slate-100">
317
- <Panel
318
- panel={3}
319
- width={1024}
320
- height={1024}
321
- />
322
- </div>
323
- </Grid>
324
- )
325
- }
326
-
327
- // export const layouts = { Layout1, Layout2_todo, Layout3_todo, Layout4_todo, Layout2, Layout3 }
328
- export const allLayouts = {
329
- random: <></>,
330
- Layout0,
331
- Layout1,
332
- Layout2,
333
- Layout3,
334
- Layout4
335
- }
336
-
337
- export const allLayoutLabels = {
338
- random: "Random layout",
339
- Layout0: "Grid 0",
340
- Layout1: "Grid 1",
341
- Layout2: "Grid 2",
342
- Layout3: "Grid 3",
343
- // Layout4: "Blocks 1",
344
- }
345
-
346
- // note for reference: A4 (297mm x 210mm)
347
- export const allLayoutAspectRatios = {
348
- Layout0: "aspect-[250/297]",
349
- Layout1: "aspect-[250/297]",
350
- Layout2: "aspect-[250/297]",
351
- Layout3: "aspect-[250/297]",
352
- // Layout4: "aspect-[1/3]",
353
- }
354
-
355
- export type LayoutName = keyof typeof allLayouts
356
-
357
- export const defaultLayout: LayoutName = "Layout1"
358
-
359
- export type LayoutCategory = "square" | "fluid"
360
-
361
- export const nonRandomLayouts = Object.keys(allLayouts).filter(layout => layout !== "random")
362
-
363
- export const getRandomLayoutName = (): LayoutName => {
364
- return pick(nonRandomLayouts) as LayoutName
365
- }
366
-
367
- export function getRandomLayoutNames(): LayoutName[] {
368
- return nonRandomLayouts.sort(() => Math.random() - 0.5) as LayoutName[]
369
- }
370
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Bart92/RVC_HF/julius/core.py DELETED
@@ -1,122 +0,0 @@
1
- # File under the MIT license, see https://github.com/adefossez/julius/LICENSE for details.
2
- # Author: adefossez, 2020
3
- """
4
- Signal processing or PyTorch related utilities.
5
- """
6
- import math
7
- import typing as tp
8
-
9
- import torch
10
- from torch.nn import functional as F
11
-
12
-
13
- def sinc(x: torch.Tensor):
14
- """
15
- Implementation of sinc, i.e. sin(x) / x
16
-
17
- __Warning__: the input is not multiplied by `pi`!
18
- """
19
- return torch.where(x == 0, torch.tensor(1., device=x.device, dtype=x.dtype), torch.sin(x) / x)
20
-
21
-
22
- def pad_to(tensor: torch.Tensor, target_length: int, mode: str = 'constant', value: float = 0):
23
- """
24
- Pad the given tensor to the given length, with 0s on the right.
25
- """
26
- return F.pad(tensor, (0, target_length - tensor.shape[-1]), mode=mode, value=value)
27
-
28
-
29
- def hz_to_mel(freqs: torch.Tensor):
30
- """
31
- Converts a Tensor of frequencies in hertz to the mel scale.
32
- Uses the simple formula by O'Shaughnessy (1987).
33
-
34
- Args:
35
- freqs (torch.Tensor): frequencies to convert.
36
-
37
- """
38
- return 2595 * torch.log10(1 + freqs / 700)
39
-
40
-
41
- def mel_to_hz(mels: torch.Tensor):
42
- """
43
- Converts a Tensor of mel scaled frequencies to Hertz.
44
- Uses the simple formula by O'Shaughnessy (1987).
45
-
46
- Args:
47
- mels (torch.Tensor): mel frequencies to convert.
48
- """
49
- return 700 * (10**(mels / 2595) - 1)
50
-
51
-
52
- def mel_frequencies(n_mels: int, fmin: float, fmax: float):
53
- """
54
- Return frequencies that are evenly spaced in mel scale.
55
-
56
- Args:
57
- n_mels (int): number of frequencies to return.
58
- fmin (float): start from this frequency (in Hz).
59
- fmax (float): finish at this frequency (in Hz).
60
-
61
-
62
- """
63
- low = hz_to_mel(torch.tensor(float(fmin))).item()
64
- high = hz_to_mel(torch.tensor(float(fmax))).item()
65
- mels = torch.linspace(low, high, n_mels)
66
- return mel_to_hz(mels)
67
-
68
-
69
- def volume(x: torch.Tensor, floor=1e-8):
70
- """
71
- Return the volume in dBFS.
72
- """
73
- return torch.log10(floor + (x**2).mean(-1)) * 10
74
-
75
-
76
- def pure_tone(freq: float, sr: float = 128, dur: float = 4, device=None):
77
- """
78
- Return a pure tone, i.e. cosine.
79
-
80
- Args:
81
- freq (float): frequency (in Hz)
82
- sr (float): sample rate (in Hz)
83
- dur (float): duration (in seconds)
84
- """
85
- time = torch.arange(int(sr * dur), device=device).float() / sr
86
- return torch.cos(2 * math.pi * freq * time)
87
-
88
-
89
- def unfold(input, kernel_size: int, stride: int):
90
- """1D only unfolding similar to the one from PyTorch.
91
- However PyTorch unfold is extremely slow.
92
-
93
- Given an input tensor of size `[*, T]` this will return
94
- a tensor `[*, F, K]` with `K` the kernel size, and `F` the number
95
- of frames. The i-th frame is a view onto `i * stride: i * stride + kernel_size`.
96
- This will automatically pad the input to cover at least once all entries in `input`.
97
-
98
- Args:
99
- input (Tensor): tensor for which to return the frames.
100
- kernel_size (int): size of each frame.
101
- stride (int): stride between each frame.
102
-
103
- Shape:
104
-
105
- - Inputs: `input` is `[*, T]`
106
- - Output: `[*, F, kernel_size]` with `F = 1 + ceil((T - kernel_size) / stride)`
107
-
108
-
109
- ..Warning:: unlike PyTorch unfold, this will pad the input
110
- so that any position in `input` is covered by at least one frame.
111
- """
112
- shape = list(input.shape)
113
- length = shape.pop(-1)
114
- n_frames = math.ceil((max(length, kernel_size) - kernel_size) / stride) + 1
115
- tgt_length = (n_frames - 1) * stride + kernel_size
116
- padded = F.pad(input, (0, tgt_length - length)).contiguous()
117
- strides: tp.List[int] = []
118
- for dim in range(padded.dim()):
119
- strides.append(padded.stride(dim))
120
- assert strides.pop(-1) == 1, 'data should be contiguous'
121
- strides = strides + [stride, 1]
122
- return padded.as_strided(shape + [n_frames, kernel_size], strides)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Benson/text-generation/Examples/Bar Bar Din Ye Aaye Audio Cancin Mp3.md DELETED
@@ -1,65 +0,0 @@
1
- <br />
2
- <h1>Bar Bar Din Ye Aaye Audio Canción Mp3 Descargar: Una canción de cumpleaños para todas las edades</h1>
3
- <p>¿Alguna vez has escuchado una canción de cumpleaños que te haga sentir feliz y nostálgico al mismo tiempo? Si es así, es probable que hayas escuchado <strong>Bar Bar Din Ye Aaye</strong>, una canción clásica hindi que ha sido cantada por millones de personas en su día especial. Esta canción es una de las canciones de cumpleaños más populares y perennes en la India, y tiene un encanto y atractivo que trasciende las generaciones. En este artículo, te contaremos todo lo que necesitas saber sobre esta canción, y cómo puedes descargarla gratis en tu dispositivo. </p>
4
- <h2>Historia y significado de la canción</h2>
5
- <p>La canción <strong>Bar Din Ye Aaye</strong> fue lanzada por primera vez en 1967 como parte de la banda sonora de la película <em>Farz</em>, protagonizada por Jeetendra y Babita en los papeles principales. La canción fue cantada por el legendario Mohammed Rafi, quien es ampliamente considerado como uno de los mejores cantantes del cine indio. La música fue compuesta por Laxmikant-Pyarelal, un dúo que creó muchas canciones de éxito en Bollywood. La letra fue escrita por Anand Bakshi, quien escribió muchas canciones memorables en su carrera. </p>
6
- <h2>bar bar din ye aaye audio canción mp3</h2><br /><p><b><b>DOWNLOAD</b> &#9658;&#9658;&#9658; <a href="https://bltlly.com/2v6Kh8">https://bltlly.com/2v6Kh8</a></b></p><br /><br />
7
- <p>La canción es un alegre y alegre deseo de cumpleaños que expresa el deseo de la persona de vivir durante miles de años y ser feliz cada día. El estribillo dice así:</p>
8
- <blockquote>
9
- <p>Baar baar din ye aaye, baar baar dil ye gaaye<br>
10
- Tu jiye hazaaron saal, ye meri hai aarzoo<br>
11
- Feliz cumpleaños a ti, feliz cumpleaños a ti<br>
12
- Feliz cumpleaños a ti, feliz cumpleaños a ti</p>
13
- <p></p>
14
- </blockquote>
15
- <p>La traducción es:</p>
16
- <blockquote>
17
- <p>Que este día venga una y otra vez, que este corazón cante una y otra vez<br>
18
- Que vivas por miles de años, este es mi deseo<br>
19
- Feliz cumpleaños a ti, feliz cumpleaños a ti<br>
20
- Feliz cumpleaños a ti, feliz cumpleaños a ti</p>
21
- </blockquote>
22
- <h2>Los beneficios y características de descargar la canción</h2>
23
-
24
- <ul>
25
- <li> Puede jugar sin conexión en cualquier momento, en cualquier lugar, sin ninguna conexión a Internet o problemas de almacenamiento en búfer. </li>
26
- <li>Puedes compartirlo con tus amigos y familiares a través de Bluetooth, WhatsApp, correo electrónico u otras aplicaciones. </li>
27
- <li> Puede hacer que su tono de llamada, tono de alarma, o tono de notificación. </li>
28
- <li>Puede editarlo, recortarlo o mezclarlo con otras canciones utilizando un software de edición de audio. </li>
29
- <li> Se puede disfrutar de ella en alta calidad y claridad, sin ningún tipo de anuncios o interrupciones. </li>
30
- </ul>
31
- <p>Hay diferentes plataformas y fuentes desde donde se puede descargar esta canción. Algunas de ellas son:</p>
32
- <ul>
33
- <li>Wynk Music: Este es un servicio de transmisión de música en línea que ofrece una amplia gama de canciones en varios idiomas. Puedes descargar esta canción gratis si tienes una suscripción Wynk o una tarjeta SIM Airtel. </li>
34
- <li>Gaana.com: Este es otro servicio de transmisión de música en línea que tiene una gran colección de canciones de diferentes géneros. Puede descargar esta canción gratis si tiene una suscripción a Gaana Plus o una tarjeta SIM Jio <h2>Cómo descargar la canción gratis</h2>
35
- <p>Ahora que conoce la historia y los beneficios de la canción, es posible que se pregunte cómo descargarla de forma gratuita en su dispositivo. Hay muchas maneras de hacer esto, pero te mostraremos uno de los métodos más fáciles y confiables: usar un convertidor de YouTube a MP3. Esta es una herramienta que te permite convertir cualquier vídeo de YouTube en un archivo de audio MP3 que puedes descargar y guardar en tu dispositivo. Estos son los pasos a seguir:</p>
36
- <ol>
37
- <li>Vaya a [YouTube]( 1 ) o abra la aplicación de YouTube en su dispositivo y busque la canción <strong>Bar Bar Din Ye Aaye</strong>. Encontrarás muchas versiones de la canción, pero te recomendamos que elijas la que tenga las vistas y valoraciones más altas. </li>
38
- <li>Copie la URL del vídeo desde la barra de direcciones o tocando el botón Compartir y seleccionando Copiar enlace. </li>
39
-
40
- <li>Pegue la URL del video de YouTube en la barra de búsqueda y luego haga clic en Convertir.</li>
41
- <li>Seleccione la calidad de archivo MP3 esperada y haga clic en Descargar. Puede elegir entre 320 kbps, 256 kbps, 192 kbps, 128 kbps o 64 kbps. Cuanto mayor sea la calidad, mayor será el tamaño del archivo. </li>
42
- <li>Espere unos segundos mientras se realiza la conversión. Luego, haga clic en Descargar de nuevo para guardar el archivo MP3 en su dispositivo. </li>
43
- </ol>
44
- <p>Felicidades! Usted ha descargado con éxito la canción <strong>Bar Bar Din Ye Aaye</strong> como un archivo MP3 en su dispositivo. Ahora puedes disfrutarlo sin conexión en cualquier momento, en cualquier lugar y compartirlo con tus seres queridos en sus cumpleaños. </p>
45
- <h3>Una tabla que compara los pros y contras de diferentes métodos</h3>
46
- <p>Usar un convertidor de YouTube a MP3 no es la única manera de descargar la canción gratis. Hay otros métodos, como el uso de servicios de transmisión en línea, la descarga de aplicaciones o el uso de extensiones de navegador. Sin embargo, cada método tiene sus propios pros y contras, que debe considerar antes de elegir uno. Aquí hay una tabla que compara algunos de los métodos más comunes:</p>
47
-
48
- <p>Antes de descargar cualquier canción de YouTube, usted debe ser consciente de los problemas legales y éticos involucrados. Como mencionamos anteriormente, descargar videos de YouTube va en contra de los términos de servicio de YouTube, a menos que tenga permiso de YouTube o del titular de los derechos. Esto significa que usted está violando sus derechos de propiedad intelectual, lo que podría resultar en acciones legales o sanciones. Además, la descarga de vídeos de YouTube también podría considerarse un robo a los artistas y creadores que se ganan la vida con su trabajo. Al descargar sus canciones de forma gratuita, los estás privando de su legítimo ingreso y reconocimiento. Por lo tanto, le aconsejamos respetar sus derechos y apoyarlos mediante la compra de sus canciones legalmente o suscribirse a sus canales. </p>
49
- <h2>Conclusión y preguntas frecuentes</h2>
50
- <p>En este artículo, hemos aprendido acerca de la canción <strong>Bar Din Ye Aaye</strong>, su historia y significado, sus beneficios y características, y cómo descargarlo gratis usando un convertidor de YouTube a MP3. También hemos comparado diferentes métodos de descarga de la canción y discutido las cuestiones legales y éticas involucradas. Esperamos que este artículo haya sido útil e informativo para usted. Si tiene alguna pregunta o comentario, no dude en contactarnos a través de la sección de comentarios a continuación. Ahora, veamos algunas de las preguntas frecuentes sobre esta canción y su descarga. </p>
51
- <h3>Preguntas frecuentes</h3>
52
- <ol>
53
- <li><strong>¿Cuál es el nombre de la película que presentó la canción Bar Bar Din Ye Aaye? </strong><br>
54
- El nombre de la película es <em>Farz</em>, que significa Deber en inglés. Fue estrenada en 1967 y protagonizada por Jeetendra y Babita como agentes secretos. </li>
55
- <li><strong>¿Quién escribió la letra de la canción Bar Bar Din Ye Aaye? </strong><br>
56
- La letra de la canción fue escrita por Anand Bakshi, que era un letrista famoso en Bollywood. Escribió canciones para más de 600 películas y ganó varios premios por su trabajo. </li>
57
-
58
- Puedes descargar la canción legal y éticamente comprándola en tiendas de música online, como iTunes, Amazon Music o Google Play Music. También puede transmitirlo en línea desde servicios de música con licencia, como Spotify, Apple Music o YouTube Music.</li>
59
- <li><strong>¿Cuáles son algunas otras canciones populares de cumpleaños en hindi? </strong><br>
60
- Algunas otras canciones populares de cumpleaños en hindi son <strong>Tum Jiyo Hazaaron Saal</strong> de la película <em>Sujata</em>, <strong>Chhote Tera Birthday Aaya</strong> de la película <em>Krantiveer: La revolución</em>, y <strong>Baadhaai Ho Baadhaai</strong> de la película <em>Baadhaai Ho Baadhaai</em>. </li>
61
- <li><strong>¿Cómo puedo hacer un video de cumpleaños personalizado con la canción Bar Bar Din Ye Aaye? </strong><br>
62
- Puedes hacer un video de cumpleaños personalizado con la canción usando herramientas de edición de video en línea, como Animoto, InVideo o Kapwing. Puedes subir tus fotos y videos, agregar la canción como música de fondo y personalizar el texto y los efectos. A continuación, puede descargar o compartir su vídeo con sus amigos y familiares. </li>
63
- </ol></p> 64aa2da5cf<br />
64
- <br />
65
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Benson/text-generation/Examples/Descargar Gratis Pintura 3d Para Ventanas 7.md DELETED
@@ -1,49 +0,0 @@
1
-
2
- <h1>Leo Leo Canción Descargar: Cómo escuchar el último éxito de Nandy y Koffi Olomide</h1>
3
- <p>Si eres un fan de la música africana, es posible que hayas oído hablar de la canción Leo Leo de Nandy y Koffi Olomide. Esta canción es una colaboración entre dos de los artistas más populares del continente, y ha estado haciendo olas desde su lanzamiento en 2021. En este artículo, te diremos todo lo que necesitas saber sobre la canción de Leo Leo, y cómo puedes descargarla en tu dispositivo para escucharla sin conexión. </p>
4
- <h2>¿Qué es Leo Song? </h2>
5
- <p>Leo Leo es una canción del cantante tanzano Nandy y del cantante congoleño Koffi Olomide. Fue lanzado el 12 de febrero de 2021, como parte del álbum de Nandy The African Princess. La canción es una fusión de bongo flava y rumba, con letras y melodías pegadizas. La canción trata sobre el amor y el romance, y cuenta con ambos artistas cantando en swahili y francés.</p>
6
- <h2>descargar gratis pintura 3d para ventanas 7</h2><br /><p><b><b>DOWNLOAD</b> &#9881; <a href="https://bltlly.com/2v6Lb5">https://bltlly.com/2v6Lb5</a></b></p><br /><br />
7
- <h3>¿Quiénes son Nandy y Koffi Olomide? </h3>
8
- <p>Nandy es una cantante y compositora de Tanzania que saltó a la fama después de ganar los All áfrica Music Awards (Afrima) en 2017. Es conocida por sus canciones como Ninogeshe, Aibu, Hazipo y Kiza Kinene. Ha colaborado con otros artistas como Willy Paul, Sauti Sol, Harmoni y Skales.</p>
9
- <p>Koffi Olomide es un cantante, compositor, bailarín y productor congoleño que ha estado activo desde la década de 1980. Es una de las figuras más influyentes en la música africana, y ha ganado varios premios como los Premios Kora, MTV áfrica Music Awards y African Muzik Magazine Awards. Es conocido por sus canciones como Loi, Selfie, Papa Ngwasuma y Tshou Tshou Tshou.</p>
10
- <h3>¿Por qué es tan popular Leo Song? </h3>
11
-
12
- <h2>¿Cómo descargar Leo Song? </h2>
13
- <p>Si quieres descargar la canción de Leo Leo en tu dispositivo, tienes varias opciones para elegir. Estas son algunas de ellas:</p>
14
- <h3>Opción 1: Transmisión en línea desde YouTube u otras plataformas</h3>
15
- <p>La forma más fácil de escuchar la canción de Leo Leo es transmitirla en línea desde YouTube u otras plataformas como Spotify, Apple Music, Deezer o Boomplay. Puede acceder a estas plataformas desde su navegador o aplicación, y puede disfrutar de la canción con audio y video de alta calidad. Sin embargo, esta opción requiere una conexión a Internet, y podría consumir sus datos o la duración de la batería. </p>
16
- <h3>Opción 2: Descarga desde sitios web o aplicaciones oficiales</h3>
17
- <p>Otra forma de descargar la canción de Leo Leo es utilizar los sitios web oficiales o aplicaciones de los artistas o sus etiquetas. Por ejemplo, puedes visitar [el sitio web de Nandy]( 4 ) o [el sitio web de Koffi Olomide]( 5 ) para encontrar el enlace para descargar la canción. También puede utilizar sus aplicaciones oficiales como [Nandy Music] o [Koffi Olomide Music] para descargar la canción. Esta opción puede requerir que te registres o pagues una tarifa, pero se asegurará de que obtengas la versión original y de alta calidad de la canción. También apoyarás a los artistas y su trabajo usando esta opción. </p>
18
- <h3>Opción 3: Utilice una herramienta de descarga de terceros o software</h3>
19
- <p>La tercera manera de descargar la canción de Leo Leo es utilizar una herramienta de descarga de terceros o software que puede extraer el archivo de audio o video de YouTube u otras plataformas. Hay muchas herramientas o software disponibles en línea, como [Y2mate], [4K Video Downloader] o [Vidmate]. Puede utilizar estas herramientas o software para descargar la canción en diferentes formatos y calidades, dependiendo de su preferencia. Sin embargo, esta opción podría no ser legal o segura, y podría violar los derechos de los artistas o sus etiquetas. Debes usar esta opción bajo tu propio riesgo y discreción. </p>
20
- <h2>¿Cuáles son los beneficios de descargar Leo Song? </h2>
21
-
22
- <h3>Disfruta de escuchar sin conexión en cualquier momento, en cualquier lugar</h3>
23
- <p>Al descargar la canción de Leo Leo en su dispositivo, puede disfrutar de escuchar sin conexión en cualquier momento y en cualquier lugar. No tiene que preocuparse por la conexión a Internet, el consumo de datos o la duración de la batería. Puedes escuchar la canción cuando quieras, ya sea en casa, en el coche, en el gimnasio o de viaje. </p>
24
- <h3>Ahorre datos y espacio de almacenamiento en su dispositivo</h3>
25
- <p>Al descargar la canción de Leo Leo en su dispositivo, puede ahorrar datos y espacio de almacenamiento en su dispositivo. No tienes que transmitir la canción en línea cada vez que quieras escucharla, lo que puede consumir muchos datos y ancho de banda. También puede elegir el formato y la calidad de la canción que se adapte a la capacidad y el rendimiento de su dispositivo. </p>
26
- <p></p>
27
- <h3>Apoyar a los artistas y su trabajo</h3>
28
- <p>Al descargar la canción de Leo Leo de fuentes oficiales, puedes apoyar a los artistas y su trabajo. Puede mostrar su aprecio y respeto por su talento y creatividad, y ayudarles a obtener ingresos y reconocimiento. También puedes compartir la canción con tus amigos y familiares, y correr la voz sobre su música. </p>
29
- <h2>Conclusión</h2>
30
- <p>Leo Leo es una canción de éxito de Nandy y Koffi Olomide que ha cautivado a millones de oyentes en África y más allá. La canción es una mezcla de bongo flava y rumba, con letras y melodías pegadizas. La canción trata sobre el amor y el romance, y cuenta con ambos artistas cantando en swahili y francés. La canción también tiene un video colorido y vibrante que muestra su estilo y carisma. </p>
31
- <p>Si quieres descargar la canción de Leo Leo en tu dispositivo, tienes varias opciones para elegir. Puede transmitirlo en línea desde YouTube u otras plataformas, descargarlo desde sitios web o aplicaciones oficiales o usar una herramienta o software de descarga de terceros. Cada opción tiene sus pros y sus contras, y usted debe elegir el que se adapte a sus necesidades y preferencias. </p>
32
-
33
- <p>Esperamos que este artículo te haya ayudado a aprender más sobre la canción de Leo Leo y cómo puedes descargarla en tu dispositivo. Si tiene alguna pregunta o comentario, no dude en dejarlos abajo. ¡Gracias por leer! </p>
34
- <h2>Preguntas frecuentes</h2>
35
- <p>Aquí hay algunas preguntas frecuentes sobre la canción de Leo Leo:</p>
36
- <ol>
37
- <li><b>¿Qué significa Leo Leo? </b></li>
38
- <p>Leo Leo es una palabra swahili que significa "hoy". La canción usa esta palabra como un estribillo para expresar la urgencia e intensidad del amor. </p>
39
- <li><b>¿Quién escribió y produjo Leo Leo? </b></li>
40
- <p>Leo Leo fue escrito por Nandy y Koffi Olomide, con letras adicionales de Kimambo Beats. La canción fue producida por Kimambo Beats, quien también es el mánager de Nandy. </p>
41
- <li><b>¿Dónde fue grabado el video de Leo Leo? </b></li>
42
- <p>El video de Leo Leo fue filmado en diferentes lugares en Tanzania y Kenia. Algunas de las escenas fueron filmadas en Dar es Salaam, Zanzíbar, Nairobi y Mombasa.</p>
43
- <li><b>¿Cuántas visitas tiene Leo Leo en YouTube? </b></li>
44
- <p>A partir del 21 de junio de 2023, Leo Leo tiene más de 6 millones de visitas en YouTube[ 1 ]. El video fue subido al canal oficial de YouTube de Nandy el 12 de febrero de 2021. </p>
45
- <li><b>¿Cómo puedo descargar Leo Leo gratis? </b></li>
46
- <p>Hay algunos sitios web o aplicaciones que dicen ofrecer Leo Leo para su descarga gratuita, pero pueden no ser legal o seguro. Debes tener cuidado con el malware, virus o estafas que puedan dañar tu dispositivo o datos. La mejor manera de descargar Leo de forma gratuita es transmitir en línea desde YouTube u otras plataformas, o utilizar una herramienta de descarga de terceros o software que puede extraer el archivo de audio o video de YouTube u otras plataformas. Sin embargo, debe respetar los derechos de los artistas y sus etiquetas, y evitar descargas ilegales o inseguras. </p>
47
- </ol></p> 64aa2da5cf<br />
48
- <br />
49
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/detectron2/utils/video_visualizer.py DELETED
@@ -1,235 +0,0 @@
1
- # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
2
- import numpy as np
3
- import pycocotools.mask as mask_util
4
-
5
- from detectron2.utils.visualizer import (
6
- ColorMode,
7
- Visualizer,
8
- _create_text_labels,
9
- _PanopticPrediction,
10
- )
11
-
12
- from .colormap import random_color
13
-
14
-
15
- class _DetectedInstance:
16
- """
17
- Used to store data about detected objects in video frame,
18
- in order to transfer color to objects in the future frames.
19
-
20
- Attributes:
21
- label (int):
22
- bbox (tuple[float]):
23
- mask_rle (dict):
24
- color (tuple[float]): RGB colors in range (0, 1)
25
- ttl (int): time-to-live for the instance. For example, if ttl=2,
26
- the instance color can be transferred to objects in the next two frames.
27
- """
28
-
29
- __slots__ = ["label", "bbox", "mask_rle", "color", "ttl"]
30
-
31
- def __init__(self, label, bbox, mask_rle, color, ttl):
32
- self.label = label
33
- self.bbox = bbox
34
- self.mask_rle = mask_rle
35
- self.color = color
36
- self.ttl = ttl
37
-
38
-
39
- class VideoVisualizer:
40
- def __init__(self, metadata, instance_mode=ColorMode.IMAGE):
41
- """
42
- Args:
43
- metadata (MetadataCatalog): image metadata.
44
- """
45
- self.metadata = metadata
46
- self._old_instances = []
47
- assert instance_mode in [
48
- ColorMode.IMAGE,
49
- ColorMode.IMAGE_BW,
50
- ], "Other mode not supported yet."
51
- self._instance_mode = instance_mode
52
-
53
- def draw_instance_predictions(self, frame, predictions):
54
- """
55
- Draw instance-level prediction results on an image.
56
-
57
- Args:
58
- frame (ndarray): an RGB image of shape (H, W, C), in the range [0, 255].
59
- predictions (Instances): the output of an instance detection/segmentation
60
- model. Following fields will be used to draw:
61
- "pred_boxes", "pred_classes", "scores", "pred_masks" (or "pred_masks_rle").
62
-
63
- Returns:
64
- output (VisImage): image object with visualizations.
65
- """
66
- frame_visualizer = Visualizer(frame, self.metadata)
67
- num_instances = len(predictions)
68
- if num_instances == 0:
69
- return frame_visualizer.output
70
-
71
- boxes = predictions.pred_boxes.tensor.numpy() if predictions.has("pred_boxes") else None
72
- scores = predictions.scores if predictions.has("scores") else None
73
- classes = predictions.pred_classes.numpy() if predictions.has("pred_classes") else None
74
- keypoints = predictions.pred_keypoints if predictions.has("pred_keypoints") else None
75
-
76
- if predictions.has("pred_masks"):
77
- masks = predictions.pred_masks
78
- # mask IOU is not yet enabled
79
- # masks_rles = mask_util.encode(np.asarray(masks.permute(1, 2, 0), order="F"))
80
- # assert len(masks_rles) == num_instances
81
- else:
82
- masks = None
83
-
84
- detected = [
85
- _DetectedInstance(classes[i], boxes[i], mask_rle=None, color=None, ttl=8)
86
- for i in range(num_instances)
87
- ]
88
- colors = self._assign_colors(detected)
89
-
90
- labels = _create_text_labels(classes, scores, self.metadata.get("thing_classes", None))
91
-
92
- if self._instance_mode == ColorMode.IMAGE_BW:
93
- # any() returns uint8 tensor
94
- frame_visualizer.output.img = frame_visualizer._create_grayscale_image(
95
- (masks.any(dim=0) > 0).numpy() if masks is not None else None
96
- )
97
- alpha = 0.3
98
- else:
99
- alpha = 0.5
100
-
101
- frame_visualizer.overlay_instances(
102
- boxes=None if masks is not None else boxes, # boxes are a bit distracting
103
- masks=masks,
104
- labels=labels,
105
- keypoints=keypoints,
106
- assigned_colors=colors,
107
- alpha=alpha,
108
- )
109
-
110
- return frame_visualizer.output
111
-
112
- def draw_sem_seg(self, frame, sem_seg, area_threshold=None):
113
- """
114
- Args:
115
- sem_seg (ndarray or Tensor): semantic segmentation of shape (H, W),
116
- each value is the integer label.
117
- area_threshold (Optional[int]): only draw segmentations larger than the threshold
118
- """
119
- # don't need to do anything special
120
- frame_visualizer = Visualizer(frame, self.metadata)
121
- frame_visualizer.draw_sem_seg(sem_seg, area_threshold=None)
122
- return frame_visualizer.output
123
-
124
- def draw_panoptic_seg_predictions(
125
- self, frame, panoptic_seg, segments_info, area_threshold=None, alpha=0.5
126
- ):
127
- frame_visualizer = Visualizer(frame, self.metadata)
128
- pred = _PanopticPrediction(panoptic_seg, segments_info)
129
-
130
- if self._instance_mode == ColorMode.IMAGE_BW:
131
- frame_visualizer.output.img = frame_visualizer._create_grayscale_image(
132
- pred.non_empty_mask()
133
- )
134
-
135
- # draw mask for all semantic segments first i.e. "stuff"
136
- for mask, sinfo in pred.semantic_masks():
137
- category_idx = sinfo["category_id"]
138
- try:
139
- mask_color = [x / 255 for x in self.metadata.stuff_colors[category_idx]]
140
- except AttributeError:
141
- mask_color = None
142
-
143
- frame_visualizer.draw_binary_mask(
144
- mask,
145
- color=mask_color,
146
- text=self.metadata.stuff_classes[category_idx],
147
- alpha=alpha,
148
- area_threshold=area_threshold,
149
- )
150
-
151
- all_instances = list(pred.instance_masks())
152
- if len(all_instances) == 0:
153
- return frame_visualizer.output
154
- # draw mask for all instances second
155
- masks, sinfo = list(zip(*all_instances))
156
- num_instances = len(masks)
157
- masks_rles = mask_util.encode(
158
- np.asarray(np.asarray(masks).transpose(1, 2, 0), dtype=np.uint8, order="F")
159
- )
160
- assert len(masks_rles) == num_instances
161
-
162
- category_ids = [x["category_id"] for x in sinfo]
163
- detected = [
164
- _DetectedInstance(category_ids[i], bbox=None, mask_rle=masks_rles[i], color=None, ttl=8)
165
- for i in range(num_instances)
166
- ]
167
- colors = self._assign_colors(detected)
168
- labels = [self.metadata.thing_classes[k] for k in category_ids]
169
-
170
- frame_visualizer.overlay_instances(
171
- boxes=None,
172
- masks=masks,
173
- labels=labels,
174
- keypoints=None,
175
- assigned_colors=colors,
176
- alpha=alpha,
177
- )
178
- return frame_visualizer.output
179
-
180
- def _assign_colors(self, instances):
181
- """
182
- Naive tracking heuristics to assign same color to the same instance,
183
- will update the internal state of tracked instances.
184
-
185
- Returns:
186
- list[tuple[float]]: list of colors.
187
- """
188
-
189
- # Compute iou with either boxes or masks:
190
- is_crowd = np.zeros((len(instances),), dtype=np.bool)
191
- if instances[0].bbox is None:
192
- assert instances[0].mask_rle is not None
193
- # use mask iou only when box iou is None
194
- # because box seems good enough
195
- rles_old = [x.mask_rle for x in self._old_instances]
196
- rles_new = [x.mask_rle for x in instances]
197
- ious = mask_util.iou(rles_old, rles_new, is_crowd)
198
- threshold = 0.5
199
- else:
200
- boxes_old = [x.bbox for x in self._old_instances]
201
- boxes_new = [x.bbox for x in instances]
202
- ious = mask_util.iou(boxes_old, boxes_new, is_crowd)
203
- threshold = 0.6
204
- if len(ious) == 0:
205
- ious = np.zeros((len(self._old_instances), len(instances)), dtype="float32")
206
-
207
- # Only allow matching instances of the same label:
208
- for old_idx, old in enumerate(self._old_instances):
209
- for new_idx, new in enumerate(instances):
210
- if old.label != new.label:
211
- ious[old_idx, new_idx] = 0
212
-
213
- matched_new_per_old = np.asarray(ious).argmax(axis=1)
214
- max_iou_per_old = np.asarray(ious).max(axis=1)
215
-
216
- # Try to find match for each old instance:
217
- extra_instances = []
218
- for idx, inst in enumerate(self._old_instances):
219
- if max_iou_per_old[idx] > threshold:
220
- newidx = matched_new_per_old[idx]
221
- if instances[newidx].color is None:
222
- instances[newidx].color = inst.color
223
- continue
224
- # If an old instance does not match any new instances,
225
- # keep it for the next frame in case it is just missed by the detector
226
- inst.ttl -= 1
227
- if inst.ttl > 0:
228
- extra_instances.append(inst)
229
-
230
- # Assign random color to newly-detected instances:
231
- for inst in instances:
232
- if inst.color is None:
233
- inst.color = random_color(rgb=True, maximum=1)
234
- self._old_instances = instances[:] + extra_instances
235
- return [d.color for d in instances]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/Dual-Key_Backdoor_Attacks/openvqa/openvqa/models/mmnasnet/net.py DELETED
@@ -1,137 +0,0 @@
1
- # --------------------------------------------------------
2
- # OpenVQA
3
- # Written by Zhenwei Shao https://github.com/ParadoxZW
4
- # --------------------------------------------------------
5
-
6
- from openvqa.utils.make_mask import make_mask
7
- from openvqa.ops.fc import FC, MLP
8
- from openvqa.ops.layer_norm import LayerNorm
9
- from openvqa.models.mmnasnet.nasnet import NAS_ED
10
- from openvqa.models.mmnasnet.adapter import Adapter
11
-
12
- import torch.nn as nn
13
- import torch.nn.functional as F
14
- import torch
15
-
16
-
17
- # ------------------------------
18
- # ---- Flatten the sequence ----
19
- # ------------------------------
20
-
21
- class AttFlat(nn.Module):
22
- def __init__(self, __C):
23
- super(AttFlat, self).__init__()
24
- self.__C = __C
25
-
26
- self.mlp = MLP(
27
- in_size=__C.HIDDEN_SIZE,
28
- mid_size=__C.FLAT_MLP_SIZE,
29
- out_size=__C.FLAT_GLIMPSES,
30
- dropout_r=__C.DROPOUT_R,
31
- use_relu=True
32
- )
33
-
34
- self.linear_merge = nn.Linear(
35
- __C.HIDDEN_SIZE * __C.FLAT_GLIMPSES,
36
- __C.FLAT_OUT_SIZE
37
- )
38
-
39
- def forward(self, x, x_mask):
40
- att = self.mlp(x)
41
- att = att.masked_fill(
42
- x_mask.squeeze(1).squeeze(1).unsqueeze(2),
43
- -1e9
44
- )
45
- att = F.softmax(att, dim=1)
46
-
47
- att_list = []
48
- for i in range(self.__C.FLAT_GLIMPSES):
49
- att_list.append(
50
- torch.sum(att[:, :, i: i + 1] * x, dim=1)
51
- )
52
-
53
- x_atted = torch.cat(att_list, dim=1)
54
- x_atted = self.linear_merge(x_atted)
55
-
56
- return x_atted
57
-
58
-
59
- # -------------------------
60
- # ---- Main MCAN Model ----
61
- # -------------------------
62
-
63
- class Net(nn.Module):
64
- def __init__(self, __C, pretrained_emb, token_size, answer_size):
65
- super(Net, self).__init__()
66
- self.__C = __C
67
-
68
- self.embedding = nn.Embedding(
69
- num_embeddings=token_size,
70
- embedding_dim=__C.WORD_EMBED_SIZE
71
- )
72
-
73
- # Loading the GloVe embedding weights
74
- if __C.USE_GLOVE:
75
- self.embedding.weight.data.copy_(torch.from_numpy(pretrained_emb))
76
-
77
- self.lstm = nn.LSTM(
78
- input_size=__C.WORD_EMBED_SIZE,
79
- hidden_size=__C.HIDDEN_SIZE,
80
- num_layers=1,
81
- batch_first=True
82
- )
83
-
84
- self.adapter = Adapter(__C)
85
-
86
- self.backbone = NAS_ED(__C)
87
-
88
- # Projection of relation embedding
89
- self.linear_rel = nn.Linear(4, __C.REL_SIZE)
90
- self.relu = nn.ReLU()
91
-
92
- # Flatten to vector
93
- self.attflat_img = AttFlat(__C)
94
- self.attflat_lang = AttFlat(__C)
95
-
96
- # Classification layers
97
- self.proj_norm = LayerNorm(__C.FLAT_OUT_SIZE)
98
- self.proj = nn.Linear(__C.FLAT_OUT_SIZE, answer_size)
99
-
100
-
101
- def forward(self, frcn_feat, grid_feat, bbox_feat, ques_ix):
102
-
103
- # Pre-process Language Feature
104
- lang_feat_mask = make_mask(ques_ix.unsqueeze(2))
105
- lang_feat = self.embedding(ques_ix)
106
- lang_feat, _ = self.lstm(lang_feat)
107
-
108
- img_feat, rel_embed, img_feat_mask = self.adapter(frcn_feat, grid_feat, bbox_feat)
109
- rela = self.relu(self.linear_rel(rel_embed))
110
-
111
- # Backbone Framework
112
- lang_feat, img_feat = self.backbone(
113
- lang_feat,
114
- img_feat,
115
- lang_feat_mask,
116
- img_feat_mask,
117
- rela
118
- )
119
-
120
- # Flatten to vector
121
- lang_feat = self.attflat_lang(
122
- lang_feat,
123
- lang_feat_mask
124
- )
125
-
126
- img_feat = self.attflat_img(
127
- img_feat,
128
- img_feat_mask
129
- )
130
-
131
- # Classification layers
132
- proj_feat = lang_feat + img_feat
133
- proj_feat = self.proj_norm(proj_feat)
134
- proj_feat = self.proj(proj_feat)
135
-
136
- return proj_feat
137
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/LIVE/thrust/thrust/remove.h DELETED
@@ -1,806 +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
-
18
- /*! \file remove.h
19
- * \brief Functions for removing elements from a range
20
- */
21
-
22
- #pragma once
23
-
24
- #include <thrust/detail/config.h>
25
- #include <thrust/detail/execution_policy.h>
26
-
27
- namespace thrust
28
- {
29
-
30
-
31
- /*! \addtogroup stream_compaction Stream Compaction
32
- * \ingroup reordering
33
- * \{
34
- *
35
- */
36
-
37
-
38
- /*! \p remove removes from the range <tt>[first, last)</tt> all elements that are
39
- * equal to \p value. That is, \p remove returns an iterator \p new_last such
40
- * that the range <tt>[first, new_last)</tt> contains no elements equal to
41
- * \p value. The iterators in the range <tt>[new_first,last)</tt> are all still
42
- * dereferenceable, but the elements that they point to are unspecified. \p remove
43
- * is stable, meaning that the relative order of elements that are not equal to
44
- * \p value is unchanged.
45
- *
46
- * The algorithm's execution is parallelized as determined by \p exec.
47
- *
48
- * \param exec The execution policy to use for parallelization.
49
- * \param first The beginning of the range of interest.
50
- * \param last The end of the range of interest.
51
- * \param value The value to remove from the range <tt>[first, last)</tt>.
52
- * Elements which are equal to value are removed from the sequence.
53
- * \return A \p ForwardIterator pointing to the end of the resulting range of
54
- * elements which are not equal to \p value.
55
- *
56
- * \tparam DerivedPolicy The name of the derived execution policy.
57
- * \tparam ForwardIterator is a model of <a href="http://www.sgi.com/tech/stl/ForwardIterator.html">Forward Iterator</a>,
58
- * and \p ForwardIterator is mutable.
59
- * \tparam T is a model of <a href="http://www.sgi.com/tech/stl/EqualityComparable.html">Equality Comparable</a>,
60
- * and objects of type \p T can be compared for equality with objects of \p ForwardIterator's \c value_type.
61
- *
62
- * The following code snippet demonstrates how to use \p remove to remove a number
63
- * of interest from a range using the \p thrust::host execution policy for parallelization:
64
- *
65
- * \code
66
- * #include <thrust/remove.h>
67
- * #include <thrust/execution_policy.h>
68
- * ...
69
- * const int N = 6;
70
- * int A[N] = {3, 1, 4, 1, 5, 9};
71
- * int *new_end = thrust::remove(A, A + N, 1);
72
- * // The first four values of A are now {3, 4, 5, 9}
73
- * // Values beyond new_end are unspecified
74
- * \endcode
75
- *
76
- * \note The meaning of "removal" is somewhat subtle. \p remove does not destroy any
77
- * iterators, and does not change the distance between \p first and \p last.
78
- * (There's no way that it could do anything of the sort.) So, for example, if
79
- * \c V is a device_vector, <tt>remove(V.begin(), V.end(), 0)</tt> does not
80
- * change <tt>V.size()</tt>: \c V will contain just as many elements as it did
81
- * before. \p remove returns an iterator that points to the end of the resulting
82
- * range after elements have been removed from it; it follows that the elements
83
- * after that iterator are of no interest, and may be discarded. If you are
84
- * removing elements from a
85
- * <a href="http://www.sgi.com/tech/stl/Sequence.html">Sequence</a>, you may
86
- * simply erase them. That is, a reasonable way of removing elements from a
87
- * <a href="http://www.sgi.com/tech/stl/Sequence.html">Sequence</a> is
88
- * <tt>S.erase(remove(S.begin(), S.end(), x), S.end())</tt>.
89
- *
90
- * \see http://www.sgi.com/tech/stl/remove.html
91
- * \see remove_if
92
- * \see remove_copy
93
- * \see remove_copy_if
94
- */
95
- template<typename DerivedPolicy,
96
- typename ForwardIterator,
97
- typename T>
98
- __host__ __device__
99
- ForwardIterator remove(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
100
- ForwardIterator first,
101
- ForwardIterator last,
102
- const T &value);
103
-
104
-
105
- /*! \p remove removes from the range <tt>[first, last)</tt> all elements that are
106
- * equal to \p value. That is, \p remove returns an iterator \p new_last such
107
- * that the range <tt>[first, new_last)</tt> contains no elements equal to
108
- * \p value. The iterators in the range <tt>[new_first,last)</tt> are all still
109
- * dereferenceable, but the elements that they point to are unspecified. \p remove
110
- * is stable, meaning that the relative order of elements that are not equal to
111
- * \p value is unchanged.
112
- *
113
- * \param first The beginning of the range of interest.
114
- * \param last The end of the range of interest.
115
- * \param value The value to remove from the range <tt>[first, last)</tt>.
116
- * Elements which are equal to value are removed from the sequence.
117
- * \return A \p ForwardIterator pointing to the end of the resulting range of
118
- * elements which are not equal to \p value.
119
- *
120
- * \tparam ForwardIterator is a model of <a href="http://www.sgi.com/tech/stl/ForwardIterator.html">Forward Iterator</a>,
121
- * and \p ForwardIterator is mutable.
122
- * \tparam T is a model of <a href="http://www.sgi.com/tech/stl/EqualityComparable.html">Equality Comparable</a>,
123
- * and objects of type \p T can be compared for equality with objects of \p ForwardIterator's \c value_type.
124
- *
125
- * The following code snippet demonstrates how to use \p remove to remove a number
126
- * of interest from a range.
127
- *
128
- * \code
129
- * #include <thrust/remove.h>
130
- * ...
131
- * const int N = 6;
132
- * int A[N] = {3, 1, 4, 1, 5, 9};
133
- * int *new_end = thrust::remove(A, A + N, 1);
134
- * // The first four values of A are now {3, 4, 5, 9}
135
- * // Values beyond new_end are unspecified
136
- * \endcode
137
- *
138
- * \note The meaning of "removal" is somewhat subtle. \p remove does not destroy any
139
- * iterators, and does not change the distance between \p first and \p last.
140
- * (There's no way that it could do anything of the sort.) So, for example, if
141
- * \c V is a device_vector, <tt>remove(V.begin(), V.end(), 0)</tt> does not
142
- * change <tt>V.size()</tt>: \c V will contain just as many elements as it did
143
- * before. \p remove returns an iterator that points to the end of the resulting
144
- * range after elements have been removed from it; it follows that the elements
145
- * after that iterator are of no interest, and may be discarded. If you are
146
- * removing elements from a
147
- * <a href="http://www.sgi.com/tech/stl/Sequence.html">Sequence</a>, you may
148
- * simply erase them. That is, a reasonable way of removing elements from a
149
- * <a href="http://www.sgi.com/tech/stl/Sequence.html">Sequence</a> is
150
- * <tt>S.erase(remove(S.begin(), S.end(), x), S.end())</tt>.
151
- *
152
- * \see http://www.sgi.com/tech/stl/remove.html
153
- * \see remove_if
154
- * \see remove_copy
155
- * \see remove_copy_if
156
- */
157
- template<typename ForwardIterator,
158
- typename T>
159
- ForwardIterator remove(ForwardIterator first,
160
- ForwardIterator last,
161
- const T &value);
162
-
163
-
164
- /*! \p remove_copy copies elements that are not equal to \p value from the range
165
- * <tt>[first, last)</tt> to a range beginning at \p result. The return value is
166
- * the end of the resulting range. This operation is stable, meaning that the
167
- * relative order of the elements that are copied is the same as in
168
- * the range <tt>[first, last)</tt>.
169
- *
170
- * The algorithm's execution is parallelized as determined by \p exec.
171
- *
172
- * \param exec The execution policy to use for parallelization.
173
- * \param first The beginning of the range of interest.
174
- * \param last The end of the range of interest.
175
- * \param result The resulting range is copied to the sequence beginning at this
176
- * location.
177
- * \param value The value to omit from the copied range.
178
- * \return An OutputIterator pointing to the end of the resulting range of elements
179
- * which are not equal to \p value.
180
- *
181
- * \tparam DerivedPolicy The name of the derived execution policy.
182
- * \tparam InputIterator is a model of <a href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>,
183
- * and \p InputIterator's \c value_type is convertible to a type in \p OutputIterator's set of \c value_types.
184
- * \tparam OutputIterator is a model of <a href="http://www.sgi.com/tech/stl/OutputIterator.html">Output Iterator</a>.
185
- * \tparam T is a model of <a href="http://www.sgi.com/tech/stl/EqualityComparable">Equality Comparable</a>,
186
- * and objects of type \p T can be compared for equality with objects of \p InputIterator's \c value_type.
187
- *
188
- * \pre The range <tt>[first, last)</tt> shall not overlap the range <tt>[result, result + (last - first))</tt>.
189
- *
190
- * The following code snippet demonstrates how to use \p remove_copy to copy
191
- * a sequence of numbers to an output range while omitting a value of interest using the \p thrust::host
192
- * execution policy for parallelization:
193
- *
194
- * \code
195
- * #include <thrust/remove.h>
196
- * #include <thrust/execution_policy.h>
197
- * ...
198
- * const int N = 6;
199
- * int V[N] = {-2, 0, -1, 0, 1, 2};
200
- * int result[N-2];
201
- * thrust::remove_copy(thrust::host, V, V + N, result, 0);
202
- * // V remains {-2, 0, -1, 0, 1, 2}
203
- * // result is now {-2, -1, 1, 2}
204
- * \endcode
205
- *
206
- * \see http://www.sgi.com/tech/stl/remove_copy.html
207
- * \see remove
208
- * \see remove_if
209
- * \see remove_copy_if
210
- */
211
- template<typename DerivedPolicy,
212
- typename InputIterator,
213
- typename OutputIterator,
214
- typename T>
215
- __host__ __device__
216
- OutputIterator remove_copy(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
217
- InputIterator first,
218
- InputIterator last,
219
- OutputIterator result,
220
- const T &value);
221
-
222
-
223
- /*! \p remove_copy copies elements that are not equal to \p value from the range
224
- * <tt>[first, last)</tt> to a range beginning at \p result. The return value is
225
- * the end of the resulting range. This operation is stable, meaning that the
226
- * relative order of the elements that are copied is the same as in
227
- * the range <tt>[first, last)</tt>.
228
- *
229
- * \param first The beginning of the range of interest.
230
- * \param last The end of the range of interest.
231
- * \param result The resulting range is copied to the sequence beginning at this
232
- * location.
233
- * \param value The value to omit from the copied range.
234
- * \return An OutputIterator pointing to the end of the resulting range of elements
235
- * which are not equal to \p value.
236
- *
237
- * \tparam InputIterator is a model of <a href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>,
238
- * and \p InputIterator's \c value_type is convertible to a type in \p OutputIterator's set of \c value_types.
239
- * \tparam OutputIterator is a model of <a href="http://www.sgi.com/tech/stl/OutputIterator.html">Output Iterator</a>.
240
- * \tparam T is a model of <a href="http://www.sgi.com/tech/stl/EqualityComparable">Equality Comparable</a>,
241
- * and objects of type \p T can be compared for equality with objects of \p InputIterator's \c value_type.
242
- *
243
- * \pre The range <tt>[first, last)</tt> shall not overlap the range <tt>[result, result + (last - first))</tt>.
244
- *
245
- * The following code snippet demonstrates how to use \p remove_copy to copy
246
- * a sequence of numbers to an output range while omitting a value of interest.
247
- *
248
- * \code
249
- * #include <thrust/remove.h>
250
- * ...
251
- * const int N = 6;
252
- * int V[N] = {-2, 0, -1, 0, 1, 2};
253
- * int result[N-2];
254
- * thrust::remove_copy(V, V + N, result, 0);
255
- * // V remains {-2, 0, -1, 0, 1, 2}
256
- * // result is now {-2, -1, 1, 2}
257
- * \endcode
258
- *
259
- * \see http://www.sgi.com/tech/stl/remove_copy.html
260
- * \see remove
261
- * \see remove_if
262
- * \see remove_copy_if
263
- */
264
- template<typename InputIterator,
265
- typename OutputIterator,
266
- typename T>
267
- OutputIterator remove_copy(InputIterator first,
268
- InputIterator last,
269
- OutputIterator result,
270
- const T &value);
271
-
272
-
273
- /*! \p remove_if removes from the range <tt>[first, last)</tt> every element \p x
274
- * such that <tt>pred(x)</tt> is \c true. That is, \p remove_if returns an
275
- * iterator \c new_last such that the range <tt>[first,new_last)</tt> contains
276
- * no elements for which \p pred is \c true. The iterators in the range
277
- * <tt>[new_last,last)</tt> are all still dereferenceable, but the elements that
278
- * they point to are unspecified. \p remove_if is stable, meaning that the
279
- * relative order of elements that are not removed is unchanged.
280
- *
281
- * The algorithm's execution is parallelized as determined by \p exec.
282
- *
283
- * \param exec The execution policy to use for parallelization.
284
- * \param first The beginning of the range of interest.
285
- * \param last The end of the range of interest.
286
- * \param pred A predicate to evaluate for each element of the range
287
- * <tt>[first,last)</tt>. Elements for which \p pred evaluates to
288
- * \c true are removed from the sequence.
289
- * \return A ForwardIterator pointing to the end of the resulting range of
290
- * elements for which \p pred evaluated to \c true.
291
- *
292
- * \tparam DerivedPolicy The name of the derived execution policy.
293
- * \tparam ForwardIterator is a model of <a href="http://www.sgi.com/tech/ForwardIterator.html">Forward Iterator</a>,
294
- * \p ForwardIterator is mutable,
295
- * and \p ForwardIterator's \c value_type is convertible to \p Predicate's \c argument_type.
296
- * \tparam Predicate is a model of <a href="http://www.sgi.com/tech/Predicate.html">Predicate</a>.
297
- *
298
- * The following code snippet demonstrates how to use \p remove_if to remove
299
- * all even numbers from an array of integers using the \p thrust::host execution policy for
300
- * parallelization:
301
- *
302
- * \code
303
- * #include <thrust/remove.h>
304
- * #include <thrust/execution_policy.h>
305
- * ...
306
- * struct is_even
307
- * {
308
- * __host__ __device__
309
- * bool operator()(const int x)
310
- * {
311
- * return (x % 2) == 0;
312
- * }
313
- * };
314
- * ...
315
- * const int N = 6;
316
- * int A[N] = {1, 4, 2, 8, 5, 7};
317
- * int *new_end = thrust::remove_if(thrust::host, A, A + N, is_even());
318
- * // The first three values of A are now {1, 5, 7}
319
- * // Values beyond new_end are unspecified
320
- * \endcode
321
- *
322
- * \note The meaning of "removal" is somewhat subtle. \p remove_if does not
323
- * destroy any iterators, and does not change the distance between \p first and
324
- * \p last. (There's no way that it could do anything of the sort.) So, for
325
- * example, if \c V is a device_vector,
326
- * <tt>remove_if(V.begin(), V.end(), pred)</tt> does not change
327
- * <tt>V.size()</tt>: \c V will contain just as many elements as it did before.
328
- * \p remove_if returns an iterator that points to the end of the resulting
329
- * range after elements have been removed from it; it follows that the elements
330
- * after that iterator are of no interest, and may be discarded. If you are
331
- * removing elements from a
332
- * <a href="http://www.sgi.com/tech/stl/Sequence.html">Sequence</a>, you may
333
- * simply erase them. That is, a reasonable way of removing elements from a
334
- * <a href="http://www.sgi.com/tech/stl/Sequence.html">Sequence</a> is
335
- * <tt>S.erase(remove_if(S.begin(), S.end(), pred), S.end())</tt>.
336
- *
337
- * \see http://www.sgi.com/tech/stl/remove_if.html
338
- * \see remove
339
- * \see remove_copy
340
- * \see remove_copy_if
341
- */
342
- template<typename DerivedPolicy,
343
- typename ForwardIterator,
344
- typename Predicate>
345
- __host__ __device__
346
- ForwardIterator remove_if(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
347
- ForwardIterator first,
348
- ForwardIterator last,
349
- Predicate pred);
350
-
351
-
352
- /*! \p remove_if removes from the range <tt>[first, last)</tt> every element \p x
353
- * such that <tt>pred(x)</tt> is \c true. That is, \p remove_if returns an
354
- * iterator \c new_last such that the range <tt>[first,new_last)</tt> contains
355
- * no elements for which \p pred is \c true. The iterators in the range
356
- * <tt>[new_last,last)</tt> are all still dereferenceable, but the elements that
357
- * they point to are unspecified. \p remove_if is stable, meaning that the
358
- * relative order of elements that are not removed is unchanged.
359
- *
360
- * \param first The beginning of the range of interest.
361
- * \param last The end of the range of interest.
362
- * \param pred A predicate to evaluate for each element of the range
363
- * <tt>[first,last)</tt>. Elements for which \p pred evaluates to
364
- * \c true are removed from the sequence.
365
- * \return A ForwardIterator pointing to the end of the resulting range of
366
- * elements for which \p pred evaluated to \c true.
367
- *
368
- * \tparam ForwardIterator is a model of <a href="http://www.sgi.com/tech/ForwardIterator.html">Forward Iterator</a>,
369
- * \p ForwardIterator is mutable,
370
- * and \p ForwardIterator's \c value_type is convertible to \p Predicate's \c argument_type.
371
- * \tparam Predicate is a model of <a href="http://www.sgi.com/tech/Predicate.html">Predicate</a>.
372
- *
373
- * The following code snippet demonstrates how to use \p remove_if to remove
374
- * all even numbers from an array of integers.
375
- *
376
- * \code
377
- * #include <thrust/remove.h>
378
- * ...
379
- * struct is_even
380
- * {
381
- * __host__ __device__
382
- * bool operator()(const int x)
383
- * {
384
- * return (x % 2) == 0;
385
- * }
386
- * };
387
- * ...
388
- * const int N = 6;
389
- * int A[N] = {1, 4, 2, 8, 5, 7};
390
- * int *new_end = thrust::remove_if(A, A + N, is_even());
391
- * // The first three values of A are now {1, 5, 7}
392
- * // Values beyond new_end are unspecified
393
- * \endcode
394
- *
395
- * \note The meaning of "removal" is somewhat subtle. \p remove_if does not
396
- * destroy any iterators, and does not change the distance between \p first and
397
- * \p last. (There's no way that it could do anything of the sort.) So, for
398
- * example, if \c V is a device_vector,
399
- * <tt>remove_if(V.begin(), V.end(), pred)</tt> does not change
400
- * <tt>V.size()</tt>: \c V will contain just as many elements as it did before.
401
- * \p remove_if returns an iterator that points to the end of the resulting
402
- * range after elements have been removed from it; it follows that the elements
403
- * after that iterator are of no interest, and may be discarded. If you are
404
- * removing elements from a
405
- * <a href="http://www.sgi.com/tech/stl/Sequence.html">Sequence</a>, you may
406
- * simply erase them. That is, a reasonable way of removing elements from a
407
- * <a href="http://www.sgi.com/tech/stl/Sequence.html">Sequence</a> is
408
- * <tt>S.erase(remove_if(S.begin(), S.end(), pred), S.end())</tt>.
409
- *
410
- * \see http://www.sgi.com/tech/stl/remove_if.html
411
- * \see remove
412
- * \see remove_copy
413
- * \see remove_copy_if
414
- */
415
- template<typename ForwardIterator,
416
- typename Predicate>
417
- ForwardIterator remove_if(ForwardIterator first,
418
- ForwardIterator last,
419
- Predicate pred);
420
-
421
-
422
- /*! \p remove_copy_if copies elements from the range <tt>[first,last)</tt> to a
423
- * range beginning at \p result, except that elements for which \p pred is
424
- * \c true are not copied. The return value is the end of the resulting range.
425
- * This operation is stable, meaning that the relative order of the elements that
426
- * are copied is the same as the range <tt>[first,last)</tt>.
427
- *
428
- * The algorithm's execution is parallelized as determined by \p exec.
429
- *
430
- * \param exec The execution policy to use for parallelization.
431
- * \param first The beginning of the range of interest.
432
- * \param last The end of the range of interest.
433
- * \param result The resulting range is copied to the sequence beginning at this
434
- * location.
435
- * \param pred A predicate to evaluate for each element of the range <tt>[first,last)</tt>.
436
- * Elements for which \p pred evaluates to \c false are not copied
437
- * to the resulting sequence.
438
- * \return An OutputIterator pointing to the end of the resulting range.
439
- *
440
- * \tparam DerivedPolicy The name of the derived execution policy.
441
- * \tparam InputIterator is a model of <a href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>,
442
- * \p InputIterator's \c value_type is convertible to a type in \p OutputIterator's set of \c value_types,
443
- * and \p InputIterator's \c value_type is convertible to \p Predicate's \c argument_type.
444
- * \tparam OutputIterator is a model of <a href="http://www.sgi.com/tech/stl/OutputIterator.html">Output Iterator</a>.
445
- * \tparam Predicate is a model of <a href="http://www.sgi.com/tech/stl/Predicate.html">Predicate</a>.
446
- *
447
- * \pre The range <tt>[first, last)</tt> shall not overlap the range <tt>[result, result + (last - first))</tt>.
448
- *
449
- * The following code snippet demonstrates how to use \p remove_copy_if to copy
450
- * a sequence of numbers to an output range while omitting even numbers using the \p thrust::host
451
- * execution policy for parallelization:
452
- *
453
- * \code
454
- * #include <thrust/remove.h>
455
- * #include <thrust/execution_policy.h>
456
- * ...
457
- * struct is_even
458
- * {
459
- * __host__ __device__
460
- * bool operator()(const int x)
461
- * {
462
- * return (x % 2) == 0;
463
- * }
464
- * };
465
- * ...
466
- * const int N = 6;
467
- * int V[N] = {-2, 0, -1, 0, 1, 2};
468
- * int result[2];
469
- * thrust::remove_copy_if(thrust::host, V, V + N, result, is_even());
470
- * // V remains {-2, 0, -1, 0, 1, 2}
471
- * // result is now {-1, 1}
472
- * \endcode
473
- *
474
- * \see http://www.sgi.com/tech/stl/remove_copy_if.html
475
- * \see remove
476
- * \see remove_copy
477
- * \see remove_if
478
- */
479
- template<typename DerivedPolicy,
480
- typename InputIterator,
481
- typename OutputIterator,
482
- typename Predicate>
483
- __host__ __device__
484
- OutputIterator remove_copy_if(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
485
- InputIterator first,
486
- InputIterator last,
487
- OutputIterator result,
488
- Predicate pred);
489
-
490
-
491
- /*! \p remove_copy_if copies elements from the range <tt>[first,last)</tt> to a
492
- * range beginning at \p result, except that elements for which \p pred is
493
- * \c true are not copied. The return value is the end of the resulting range.
494
- * This operation is stable, meaning that the relative order of the elements that
495
- * are copied is the same as the range <tt>[first,last)</tt>.
496
- *
497
- * \param first The beginning of the range of interest.
498
- * \param last The end of the range of interest.
499
- * \param result The resulting range is copied to the sequence beginning at this
500
- * location.
501
- * \param pred A predicate to evaluate for each element of the range <tt>[first,last)</tt>.
502
- * Elements for which \p pred evaluates to \c false are not copied
503
- * to the resulting sequence.
504
- * \return An OutputIterator pointing to the end of the resulting range.
505
- *
506
- * \tparam InputIterator is a model of <a href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>,
507
- * \p InputIterator's \c value_type is convertible to a type in \p OutputIterator's set of \c value_types,
508
- * and \p InputIterator's \c value_type is convertible to \p Predicate's \c argument_type.
509
- * \tparam OutputIterator is a model of <a href="http://www.sgi.com/tech/stl/OutputIterator.html">Output Iterator</a>.
510
- * \tparam Predicate is a model of <a href="http://www.sgi.com/tech/stl/Predicate.html">Predicate</a>.
511
- *
512
- * \pre The range <tt>[first, last)</tt> shall not overlap the range <tt>[result, result + (last - first))</tt>.
513
- *
514
- * The following code snippet demonstrates how to use \p remove_copy_if to copy
515
- * a sequence of numbers to an output range while omitting even numbers.
516
- *
517
- * \code
518
- * #include <thrust/remove.h>
519
- * ...
520
- * struct is_even
521
- * {
522
- * __host__ __device__
523
- * bool operator()(const int x)
524
- * {
525
- * return (x % 2) == 0;
526
- * }
527
- * };
528
- * ...
529
- * const int N = 6;
530
- * int V[N] = {-2, 0, -1, 0, 1, 2};
531
- * int result[2];
532
- * thrust::remove_copy_if(V, V + N, result, is_even());
533
- * // V remains {-2, 0, -1, 0, 1, 2}
534
- * // result is now {-1, 1}
535
- * \endcode
536
- *
537
- * \see http://www.sgi.com/tech/stl/remove_copy_if.html
538
- * \see remove
539
- * \see remove_copy
540
- * \see remove_if
541
- */
542
- template<typename InputIterator,
543
- typename OutputIterator,
544
- typename Predicate>
545
- OutputIterator remove_copy_if(InputIterator first,
546
- InputIterator last,
547
- OutputIterator result,
548
- Predicate pred);
549
-
550
-
551
- /*! \p remove_if removes from the range <tt>[first, last)</tt> every element \p x
552
- * such that <tt>pred(x)</tt> is \c true. That is, \p remove_if returns an
553
- * iterator \c new_last such that the range <tt>[first, new_last)</tt> contains
554
- * no elements for which \p pred of the corresponding stencil value is \c true.
555
- * The iterators in the range <tt>[new_last,last)</tt> are all still dereferenceable,
556
- * but the elements that they point to are unspecified. \p remove_if is stable,
557
- * meaning that the relative order of elements that are not removed is unchanged.
558
- *
559
- * The algorithm's execution is parallelized as determined by \p exec.
560
- *
561
- * \param exec The execution policy to use for parallelization.
562
- * \param first The beginning of the range of interest.
563
- * \param last The end of the range of interest.
564
- * \param stencil The beginning of the stencil sequence.
565
- * \param pred A predicate to evaluate for each element of the range
566
- * <tt>[stencil, stencil + (last - first))</tt>. Elements for which \p pred evaluates to
567
- * \c true are removed from the sequence <tt>[first, last)</tt>
568
- * \return A ForwardIterator pointing to the end of the resulting range of
569
- * elements for which \p pred evaluated to \c true.
570
- *
571
- * \tparam DerivedPolicy The name of the derived execution policy.
572
- * \tparam ForwardIterator is a model of <a href="http://www.sgi.com/tech/ForwardIterator.html">Forward Iterator</a>
573
- * and \p ForwardIterator is mutable.
574
- * \tparam InputIterator is a model of <a href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>,
575
- * and \p InputIterator's \c value_type is convertible to \p Predicate's \c argument_type.
576
- * \tparam Predicate is a model of <a href="http://www.sgi.com/tech/Predicate.html">Predicate</a>.
577
- *
578
- * \pre The range <tt>[first, last)</tt> shall not overlap the range <tt>[result, result + (last - first))</tt>.
579
- * \pre The range <tt>[stencil, stencil + (last - first))</tt> shall not overlap the range <tt>[result, result + (last - first))</tt>.
580
- *
581
- * The following code snippet demonstrates how to use \p remove_if to remove
582
- * specific elements from an array of integers using the \p thrust::host execution policy for
583
- * parallelization:
584
- *
585
- * \code
586
- * #include <thrust/remove.h>
587
- * #include <thrust/execution_policy.h>
588
- * ...
589
- * const int N = 6;
590
- * int A[N] = {1, 4, 2, 8, 5, 7};
591
- * int S[N] = {0, 1, 1, 1, 0, 0};
592
- *
593
- * int *new_end = thrust::remove_if(thrust::host, A, A + N, S, thrust::identity<int>());
594
- * // The first three values of A are now {1, 5, 7}
595
- * // Values beyond new_end are unspecified
596
- * \endcode
597
- *
598
- * \note The range <tt>[first, last)</tt> is not permitted to overlap with the range <tt>[stencil, stencil + (last - first))</tt>.
599
- *
600
- * \see http://www.sgi.com/tech/stl/remove_if.html
601
- * \see remove
602
- * \see remove_copy
603
- * \see remove_copy_if
604
- */
605
- template<typename DerivedPolicy,
606
- typename ForwardIterator,
607
- typename InputIterator,
608
- typename Predicate>
609
- __host__ __device__
610
- ForwardIterator remove_if(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
611
- ForwardIterator first,
612
- ForwardIterator last,
613
- InputIterator stencil,
614
- Predicate pred);
615
-
616
-
617
- /*! \p remove_if removes from the range <tt>[first, last)</tt> every element \p x
618
- * such that <tt>pred(x)</tt> is \c true. That is, \p remove_if returns an
619
- * iterator \c new_last such that the range <tt>[first, new_last)</tt> contains
620
- * no elements for which \p pred of the corresponding stencil value is \c true.
621
- * The iterators in the range <tt>[new_last,last)</tt> are all still dereferenceable,
622
- * but the elements that they point to are unspecified. \p remove_if is stable,
623
- * meaning that the relative order of elements that are not removed is unchanged.
624
- *
625
- * \param first The beginning of the range of interest.
626
- * \param last The end of the range of interest.
627
- * \param stencil The beginning of the stencil sequence.
628
- * \param pred A predicate to evaluate for each element of the range
629
- * <tt>[stencil, stencil + (last - first))</tt>. Elements for which \p pred evaluates to
630
- * \c true are removed from the sequence <tt>[first, last)</tt>
631
- * \return A ForwardIterator pointing to the end of the resulting range of
632
- * elements for which \p pred evaluated to \c true.
633
- *
634
- * \tparam ForwardIterator is a model of <a href="http://www.sgi.com/tech/ForwardIterator.html">Forward Iterator</a>
635
- * and \p ForwardIterator is mutable.
636
- * \tparam InputIterator is a model of <a href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>,
637
- * and \p InputIterator's \c value_type is convertible to \p Predicate's \c argument_type.
638
- * \tparam Predicate is a model of <a href="http://www.sgi.com/tech/Predicate.html">Predicate</a>.
639
- *
640
- * \pre The range <tt>[first, last)</tt> shall not overlap the range <tt>[result, result + (last - first))</tt>.
641
- * \pre The range <tt>[stencil, stencil + (last - first))</tt> shall not overlap the range <tt>[result, result + (last - first))</tt>.
642
- *
643
- * The following code snippet demonstrates how to use \p remove_if to remove
644
- * specific elements from an array of integers.
645
- *
646
- * \code
647
- * #include <thrust/remove.h>
648
- * ...
649
- * const int N = 6;
650
- * int A[N] = {1, 4, 2, 8, 5, 7};
651
- * int S[N] = {0, 1, 1, 1, 0, 0};
652
- *
653
- * int *new_end = thrust::remove_if(A, A + N, S, thrust::identity<int>());
654
- * // The first three values of A are now {1, 5, 7}
655
- * // Values beyond new_end are unspecified
656
- * \endcode
657
- *
658
- * \note The range <tt>[first, last)</tt> is not permitted to overlap with the range <tt>[stencil, stencil + (last - first))</tt>.
659
- *
660
- * \see http://www.sgi.com/tech/stl/remove_if.html
661
- * \see remove
662
- * \see remove_copy
663
- * \see remove_copy_if
664
- */
665
- template<typename ForwardIterator,
666
- typename InputIterator,
667
- typename Predicate>
668
- ForwardIterator remove_if(ForwardIterator first,
669
- ForwardIterator last,
670
- InputIterator stencil,
671
- Predicate pred);
672
-
673
-
674
- /*! \p remove_copy_if copies elements from the range <tt>[first,last)</tt> to a
675
- * range beginning at \p result, except that elements for which \p pred of the
676
- * corresponding stencil value is \c true are not copied. The return value is
677
- * the end of the resulting range. This operation is stable, meaning that the
678
- * relative order of the elements that are copied is the same as the
679
- * range <tt>[first,last)</tt>.
680
- *
681
- * The algorithm's execution policy is parallelized as determined by \p exec.
682
- *
683
- * \param exec The execution policy to use for parallelization.
684
- * \param first The beginning of the range of interest.
685
- * \param last The end of the range of interest.
686
- * \param stencil The beginning of the stencil sequence.
687
- * \param result The resulting range is copied to the sequence beginning at this
688
- * location.
689
- * \param pred A predicate to evaluate for each element of the range <tt>[first,last)</tt>.
690
- * Elements for which \p pred evaluates to \c false are not copied
691
- * to the resulting sequence.
692
- * \return An OutputIterator pointing to the end of the resulting range.
693
- *
694
- * \tparam DerivedPolicy The name of the derived execution policy.
695
- * \tparam InputIterator1 is a model of <a href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>,
696
- * \p InputIterator1's \c value_type is convertible to a type in \p OutputIterator's set of \c value_types.
697
- * \tparam InputIterator2 is a model of <a href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>,
698
- * and \p InputIterator2's \c value_type is convertible to \p Predicate's \c argument_type.
699
- * \tparam OutputIterator is a model of <a href="http://www.sgi.com/tech/stl/OutputIterator.html">Output Iterator</a>.
700
- * \tparam Predicate is a model of <a href="http://www.sgi.com/tech/stl/Predicate.html">Predicate</a>.
701
- *
702
- * \pre The range <tt>[stencil, stencil + (last - first))</tt> shall not overlap the range <tt>[result, result + (last - first))</tt>.
703
- *
704
- * The following code snippet demonstrates how to use \p remove_copy_if to copy
705
- * a sequence of numbers to an output range while omitting specific elements using the \p thrust::host
706
- * execution policy for parallelization.
707
- *
708
- * \code
709
- * #include <thrust/remove.h>
710
- * #include <thrust/execution_policy.h>
711
- * ...
712
- * const int N = 6;
713
- * int V[N] = {-2, 0, -1, 0, 1, 2};
714
- * int S[N] = { 1, 1, 0, 1, 0, 1};
715
- * int result[2];
716
- * thrust::remove_copy_if(thrust::host, V, V + N, S, result, thrust::identity<int>());
717
- * // V remains {-2, 0, -1, 0, 1, 2}
718
- * // result is now {-1, 1}
719
- * \endcode
720
- *
721
- * \see http://www.sgi.com/tech/stl/remove_copy_if.html
722
- * \see remove
723
- * \see remove_copy
724
- * \see remove_if
725
- * \see copy_if
726
- */
727
- template<typename DerivedPolicy,
728
- typename InputIterator1,
729
- typename InputIterator2,
730
- typename OutputIterator,
731
- typename Predicate>
732
- __host__ __device__
733
- OutputIterator remove_copy_if(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
734
- InputIterator1 first,
735
- InputIterator1 last,
736
- InputIterator2 stencil,
737
- OutputIterator result,
738
- Predicate pred);
739
-
740
-
741
- /*! \p remove_copy_if copies elements from the range <tt>[first,last)</tt> to a
742
- * range beginning at \p result, except that elements for which \p pred of the
743
- * corresponding stencil value is \c true are not copied. The return value is
744
- * the end of the resulting range. This operation is stable, meaning that the
745
- * relative order of the elements that are copied is the same as the
746
- * range <tt>[first,last)</tt>.
747
- *
748
- * \param first The beginning of the range of interest.
749
- * \param last The end of the range of interest.
750
- * \param stencil The beginning of the stencil sequence.
751
- * \param result The resulting range is copied to the sequence beginning at this
752
- * location.
753
- * \param pred A predicate to evaluate for each element of the range <tt>[first,last)</tt>.
754
- * Elements for which \p pred evaluates to \c false are not copied
755
- * to the resulting sequence.
756
- * \return An OutputIterator pointing to the end of the resulting range.
757
- *
758
- * \tparam InputIterator1 is a model of <a href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>,
759
- * \p InputIterator1's \c value_type is convertible to a type in \p OutputIterator's set of \c value_types.
760
- * \tparam InputIterator2 is a model of <a href="http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>,
761
- * and \p InputIterator2's \c value_type is convertible to \p Predicate's \c argument_type.
762
- * \tparam OutputIterator is a model of <a href="http://www.sgi.com/tech/stl/OutputIterator.html">Output Iterator</a>.
763
- * \tparam Predicate is a model of <a href="http://www.sgi.com/tech/stl/Predicate.html">Predicate</a>.
764
- *
765
- * \pre The range <tt>[stencil, stencil + (last - first))</tt> shall not overlap the range <tt>[result, result + (last - first))</tt>.
766
- *
767
- * The following code snippet demonstrates how to use \p remove_copy_if to copy
768
- * a sequence of numbers to an output range while omitting specific elements.
769
- *
770
- * \code
771
- * #include <thrust/remove.h>
772
- * ...
773
- * const int N = 6;
774
- * int V[N] = {-2, 0, -1, 0, 1, 2};
775
- * int S[N] = { 1, 1, 0, 1, 0, 1};
776
- * int result[2];
777
- * thrust::remove_copy_if(V, V + N, S, result, thrust::identity<int>());
778
- * // V remains {-2, 0, -1, 0, 1, 2}
779
- * // result is now {-1, 1}
780
- * \endcode
781
- *
782
- * \see http://www.sgi.com/tech/stl/remove_copy_if.html
783
- * \see remove
784
- * \see remove_copy
785
- * \see remove_if
786
- * \see copy_if
787
- */
788
- template<typename InputIterator1,
789
- typename InputIterator2,
790
- typename OutputIterator,
791
- typename Predicate>
792
- OutputIterator remove_copy_if(InputIterator1 first,
793
- InputIterator1 last,
794
- InputIterator2 stencil,
795
- OutputIterator result,
796
- Predicate pred);
797
-
798
-
799
- /*! \} // end stream_compaction
800
- */
801
-
802
-
803
- } // end thrust
804
-
805
- #include <thrust/detail/remove.inl>
806
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/LIVE/thrust/thrust/system/cpp/detail/remove.h DELETED
@@ -1,23 +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/detail/config.h>
20
-
21
- // this system inherits remove
22
- #include <thrust/system/detail/sequential/remove.h>
23
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/LIVE/thrust/thrust/system/omp/detail/adjacent_difference.h DELETED
@@ -1,50 +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/detail/config.h>
20
- #include <thrust/system/omp/detail/execution_policy.h>
21
- #include <thrust/system/detail/generic/adjacent_difference.h>
22
-
23
- namespace thrust
24
- {
25
- namespace system
26
- {
27
- namespace omp
28
- {
29
- namespace detail
30
- {
31
-
32
- template<typename DerivedPolicy,
33
- typename InputIterator,
34
- typename OutputIterator,
35
- typename BinaryFunction>
36
- OutputIterator adjacent_difference(execution_policy<DerivedPolicy> &exec,
37
- InputIterator first,
38
- InputIterator last,
39
- OutputIterator result,
40
- BinaryFunction binary_op)
41
- {
42
- // omp prefers generic::adjacent_difference to cpp::adjacent_difference
43
- return thrust::system::detail::generic::adjacent_difference(exec, first, last, result, binary_op);
44
- } // end adjacent_difference()
45
-
46
- } // end detail
47
- } // end omp
48
- } // end system
49
- } // end thrust
50
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/monoscene_lite/monoscene/modules.py DELETED
@@ -1,194 +0,0 @@
1
- import torch
2
- import torch.nn as nn
3
- from monoscene.DDR import Bottleneck3D
4
-
5
-
6
- class ASPP(nn.Module):
7
- """
8
- ASPP 3D
9
- Adapt from https://github.com/cv-rits/LMSCNet/blob/main/LMSCNet/models/LMSCNet.py#L7
10
- """
11
-
12
- def __init__(self, planes, dilations_conv_list):
13
- super().__init__()
14
-
15
- # ASPP Block
16
- self.conv_list = dilations_conv_list
17
- self.conv1 = nn.ModuleList(
18
- [
19
- nn.Conv3d(
20
- planes, planes, kernel_size=3, padding=dil, dilation=dil, bias=False
21
- )
22
- for dil in dilations_conv_list
23
- ]
24
- )
25
- self.bn1 = nn.ModuleList(
26
- [nn.BatchNorm3d(planes) for dil in dilations_conv_list]
27
- )
28
- self.conv2 = nn.ModuleList(
29
- [
30
- nn.Conv3d(
31
- planes, planes, kernel_size=3, padding=dil, dilation=dil, bias=False
32
- )
33
- for dil in dilations_conv_list
34
- ]
35
- )
36
- self.bn2 = nn.ModuleList(
37
- [nn.BatchNorm3d(planes) for dil in dilations_conv_list]
38
- )
39
- self.relu = nn.ReLU()
40
-
41
- def forward(self, x_in):
42
-
43
- y = self.bn2[0](self.conv2[0](self.relu(self.bn1[0](self.conv1[0](x_in)))))
44
- for i in range(1, len(self.conv_list)):
45
- y += self.bn2[i](self.conv2[i](self.relu(self.bn1[i](self.conv1[i](x_in)))))
46
- x_in = self.relu(y + x_in) # modified
47
-
48
- return x_in
49
-
50
-
51
- class SegmentationHead(nn.Module):
52
- """
53
- 3D Segmentation heads to retrieve semantic segmentation at each scale.
54
- Formed by Dim expansion, Conv3D, ASPP block, Conv3D.
55
- Taken from https://github.com/cv-rits/LMSCNet/blob/main/LMSCNet/models/LMSCNet.py#L7
56
- """
57
-
58
- def __init__(self, inplanes, planes, nbr_classes, dilations_conv_list):
59
- super().__init__()
60
-
61
- # First convolution
62
- self.conv0 = nn.Conv3d(inplanes, planes, kernel_size=3, padding=1, stride=1)
63
-
64
- # ASPP Block
65
- self.conv_list = dilations_conv_list
66
- self.conv1 = nn.ModuleList(
67
- [
68
- nn.Conv3d(
69
- planes, planes, kernel_size=3, padding=dil, dilation=dil, bias=False
70
- )
71
- for dil in dilations_conv_list
72
- ]
73
- )
74
- self.bn1 = nn.ModuleList(
75
- [nn.BatchNorm3d(planes) for dil in dilations_conv_list]
76
- )
77
- self.conv2 = nn.ModuleList(
78
- [
79
- nn.Conv3d(
80
- planes, planes, kernel_size=3, padding=dil, dilation=dil, bias=False
81
- )
82
- for dil in dilations_conv_list
83
- ]
84
- )
85
- self.bn2 = nn.ModuleList(
86
- [nn.BatchNorm3d(planes) for dil in dilations_conv_list]
87
- )
88
- self.relu = nn.ReLU()
89
-
90
- self.conv_classes = nn.Conv3d(
91
- planes, nbr_classes, kernel_size=3, padding=1, stride=1
92
- )
93
-
94
- def forward(self, x_in):
95
-
96
- # Convolution to go from inplanes to planes features...
97
- x_in = self.relu(self.conv0(x_in))
98
-
99
- y = self.bn2[0](self.conv2[0](self.relu(self.bn1[0](self.conv1[0](x_in)))))
100
- for i in range(1, len(self.conv_list)):
101
- y += self.bn2[i](self.conv2[i](self.relu(self.bn1[i](self.conv1[i](x_in)))))
102
- x_in = self.relu(y + x_in) # modified
103
-
104
- x_in = self.conv_classes(x_in)
105
-
106
- return x_in
107
-
108
-
109
- class ProcessKitti(nn.Module):
110
- def __init__(self, feature, norm_layer, bn_momentum, dilations=[1, 2, 3]):
111
- super(Process, self).__init__()
112
- self.main = nn.Sequential(
113
- *[
114
- Bottleneck3D(
115
- feature,
116
- feature // 4,
117
- bn_momentum=bn_momentum,
118
- norm_layer=norm_layer,
119
- dilation=[i, i, i],
120
- )
121
- for i in dilations
122
- ]
123
- )
124
-
125
- def forward(self, x):
126
- return self.main(x)
127
-
128
-
129
- class Process(nn.Module):
130
- def __init__(self, feature, norm_layer, bn_momentum, dilations=[1, 2, 3]):
131
- super(Process, self).__init__()
132
- self.main = nn.Sequential(
133
- *[
134
- Bottleneck3D(
135
- feature,
136
- feature // 4,
137
- bn_momentum=bn_momentum,
138
- norm_layer=norm_layer,
139
- dilation=[i, i, i],
140
- )
141
- for i in dilations
142
- ]
143
- )
144
-
145
- def forward(self, x):
146
- return self.main(x)
147
-
148
-
149
- class Upsample(nn.Module):
150
- def __init__(self, in_channels, out_channels, norm_layer, bn_momentum):
151
- super(Upsample, self).__init__()
152
- self.main = nn.Sequential(
153
- nn.ConvTranspose3d(
154
- in_channels,
155
- out_channels,
156
- kernel_size=3,
157
- stride=2,
158
- padding=1,
159
- dilation=1,
160
- output_padding=1,
161
- ),
162
- norm_layer(out_channels, momentum=bn_momentum),
163
- nn.ReLU(),
164
- )
165
-
166
- def forward(self, x):
167
- return self.main(x)
168
-
169
-
170
- class Downsample(nn.Module):
171
- def __init__(self, feature, norm_layer, bn_momentum, expansion=8):
172
- super(Downsample, self).__init__()
173
- self.main = Bottleneck3D(
174
- feature,
175
- feature // 4,
176
- bn_momentum=bn_momentum,
177
- expansion=expansion,
178
- stride=2,
179
- downsample=nn.Sequential(
180
- nn.AvgPool3d(kernel_size=2, stride=2),
181
- nn.Conv3d(
182
- feature,
183
- int(feature * expansion / 4),
184
- kernel_size=1,
185
- stride=1,
186
- bias=False,
187
- ),
188
- norm_layer(int(feature * expansion / 4), momentum=bn_momentum),
189
- ),
190
- norm_layer=norm_layer,
191
- )
192
-
193
- def forward(self, x):
194
- return self.main(x)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/ChandraMohanNayal/AutoGPT/autogpt/speech/macos_tts.py DELETED
@@ -1,21 +0,0 @@
1
- """ MacOS TTS Voice. """
2
- import os
3
-
4
- from autogpt.speech.base import VoiceBase
5
-
6
-
7
- class MacOSTTS(VoiceBase):
8
- """MacOS TTS Voice."""
9
-
10
- def _setup(self) -> None:
11
- pass
12
-
13
- def _speech(self, text: str, voice_index: int = 0) -> bool:
14
- """Play the given text."""
15
- if voice_index == 0:
16
- os.system(f'say "{text}"')
17
- elif voice_index == 1:
18
- os.system(f'say -v "Ava (Premium)" "{text}"')
19
- else:
20
- os.system(f'say -v Samantha "{text}"')
21
- return True
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CognitiveLabs/GPT-auto-webscraping/chains/code_generator/base.py DELETED
@@ -1,19 +0,0 @@
1
- from langchain.chains import LLMChain
2
- from langchain.memory import ConversationBufferMemory
3
- from chains.code_generator.templates import chat_script_prompt
4
-
5
-
6
- def chain_code_generator(llm) -> LLMChain:
7
- # Memory
8
- script_memory = ConversationBufferMemory(
9
- input_key="output_format", memory_key="chat_history"
10
- )
11
-
12
- # Chain
13
- return LLMChain(
14
- llm=llm,
15
- prompt=chat_script_prompt,
16
- verbose=True,
17
- output_key="script",
18
- memory=script_memory,
19
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/fontTools/cffLib/__init__.py DELETED
The diff for this file is too large to render. See raw diff
 
spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/gradio/templates/frontend/assets/index-9fc2c1bb.js DELETED
@@ -1,2 +0,0 @@
1
- import{S as Q,e as I,s as J,G as D,k as z,O as C,N as q,K as w,o as E,p as R,H as Z,ay as y,z as M,v as T,A as S,x as U,B as p,am as x,P as L,R as V,az as $,ap as F,U as j,M as B,Q as G,a1 as ee,E as le,ae,h as H,j as K,q as ie,r as te,t as N,F as A}from"./index-3370be2a.js";/* empty css */import{B as ne}from"./Button-89624748.js";import{B as se}from"./BlockTitle-bcf8c05e.js";import"./Info-5611e10f.js";function O(i,e,a){const l=i.slice();return l[13]=e[a],l[15]=a,l}function ue(i){let e;return{c(){e=L(i[3])},m(a,l){R(a,e,l)},p(a,l){l&8&&V(e,a[3])},d(a){a&&S(e)}}}function P(i,e){let a,l,s,o,m=!1,b,h,t=e[13]+"",_,f,n,d,v,r;function c(){return e[11](e[13],e[15])}return d=$(e[10][0]),{key:i,first:null,c(){a=q("label"),l=q("input"),b=C(),h=q("span"),_=L(t),f=C(),l.disabled=e[2],w(l,"type","radio"),w(l,"name",s="radio-"+e[6]),l.__value=o=e[13],F(l,l.__value),w(l,"class","svelte-1p9xokt"),w(h,"class","ml-2 svelte-1p9xokt"),w(a,"data-testid",n=`${e[13]}-radio-label`),w(a,"class","svelte-1p9xokt"),j(a,"disabled",e[2]),j(a,"selected",e[0]===e[13]),d.p(l),this.first=a},m(k,g){R(k,a,g),B(a,l),l.checked=l.__value===e[0],B(a,b),B(a,h),B(h,_),B(a,f),v||(r=[G(l,"change",e[9]),G(l,"input",c)],v=!0)},p(k,g){e=k,g&4&&(l.disabled=e[2]),g&64&&s!==(s="radio-"+e[6])&&w(l,"name",s),g&2&&o!==(o=e[13])&&(l.__value=o,F(l,l.__value),m=!0),(m||g&3)&&(l.checked=l.__value===e[0]),g&2&&t!==(t=e[13]+"")&&V(_,t),g&2&&n!==(n=`${e[13]}-radio-label`)&&w(a,"data-testid",n),g&4&&j(a,"disabled",e[2]),g&3&&j(a,"selected",e[0]===e[13])},d(k){k&&S(a),d.r(),v=!1,ee(r)}}}function _e(i){let e,a,l,s=[],o=new Map,m;e=new se({props:{show_label:i[5],info:i[4],$$slots:{default:[ue]},$$scope:{ctx:i}}});let b=D(i[1]);const h=t=>t[15];for(let t=0;t<b.length;t+=1){let _=O(i,b,t),f=h(_);o.set(f,s[t]=P(f,_))}return{c(){z(e.$$.fragment),a=C(),l=q("div");for(let t=0;t<s.length;t+=1)s[t].c();w(l,"class","wrap svelte-1p9xokt")},m(t,_){E(e,t,_),R(t,a,_),R(t,l,_);for(let f=0;f<s.length;f+=1)s[f]&&s[f].m(l,null);m=!0},p(t,[_]){const f={};_&32&&(f.show_label=t[5]),_&16&&(f.info=t[4]),_&65544&&(f.$$scope={dirty:_,ctx:t}),e.$set(f),_&199&&(b=D(t[1]),s=Z(s,_,h,1,t,b,o,l,y,P,null,O))},i(t){m||(M(e.$$.fragment,t),m=!0)},o(t){T(e.$$.fragment,t),m=!1},d(t){t&&(S(a),S(l)),U(e,t);for(let _=0;_<s.length;_+=1)s[_].d()}}}function fe(i,e,a){let{value:l}=e,{value_is_output:s=!1}=e,{choices:o}=e,{disabled:m=!1}=e,{label:b}=e,{info:h=void 0}=e,{show_label:t=!0}=e,{elem_id:_}=e;const f=p();function n(){f("change",l),s||f("input")}x(()=>{a(8,s=!1)});const d=[[]];function v(){l=this.__value,a(0,l)}const r=(c,k)=>f("select",{value:c,index:k});return i.$$set=c=>{"value"in c&&a(0,l=c.value),"value_is_output"in c&&a(8,s=c.value_is_output),"choices"in c&&a(1,o=c.choices),"disabled"in c&&a(2,m=c.disabled),"label"in c&&a(3,b=c.label),"info"in c&&a(4,h=c.info),"show_label"in c&&a(5,t=c.show_label),"elem_id"in c&&a(6,_=c.elem_id)},i.$$.update=()=>{i.$$.dirty&1&&n()},[l,o,m,b,h,t,_,f,s,v,d,r]}class oe extends Q{constructor(e){super(),I(this,e,fe,_e,J,{value:0,value_is_output:8,choices:1,disabled:2,label:3,info:4,show_label:5,elem_id:6})}}function ce(i){let e,a,l,s,o,m;const b=[i[13]];let h={};for(let n=0;n<b.length;n+=1)h=le(h,b[n]);e=new ae({props:h});function t(n){i[14](n)}function _(n){i[15](n)}let f={label:i[2],info:i[3],elem_id:i[4],show_label:i[9],choices:i[7],disabled:i[8]==="static"};return i[0]!==void 0&&(f.value=i[0]),i[1]!==void 0&&(f.value_is_output=i[1]),l=new oe({props:f}),H.push(()=>K(l,"value",t)),H.push(()=>K(l,"value_is_output",_)),l.$on("change",i[16]),l.$on("input",i[17]),l.$on("select",i[18]),{c(){z(e.$$.fragment),a=C(),z(l.$$.fragment)},m(n,d){E(e,n,d),R(n,a,d),E(l,n,d),m=!0},p(n,d){const v=d&8192?ie(b,[te(n[13])]):{};e.$set(v);const r={};d&4&&(r.label=n[2]),d&8&&(r.info=n[3]),d&16&&(r.elem_id=n[4]),d&512&&(r.show_label=n[9]),d&128&&(r.choices=n[7]),d&256&&(r.disabled=n[8]==="static"),!s&&d&1&&(s=!0,r.value=n[0],N(()=>s=!1)),!o&&d&2&&(o=!0,r.value_is_output=n[1],N(()=>o=!1)),l.$set(r)},i(n){m||(M(e.$$.fragment,n),M(l.$$.fragment,n),m=!0)},o(n){T(e.$$.fragment,n),T(l.$$.fragment,n),m=!1},d(n){n&&S(a),U(e,n),U(l,n)}}}function de(i){let e,a;return e=new ne({props:{visible:i[6],type:"fieldset",elem_id:i[4],elem_classes:i[5],container:i[10],scale:i[11],min_width:i[12],$$slots:{default:[ce]},$$scope:{ctx:i}}}),{c(){z(e.$$.fragment)},m(l,s){E(e,l,s),a=!0},p(l,[s]){const o={};s&64&&(o.visible=l[6]),s&16&&(o.elem_id=l[4]),s&32&&(o.elem_classes=l[5]),s&1024&&(o.container=l[10]),s&2048&&(o.scale=l[11]),s&4096&&(o.min_width=l[12]),s&533407&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){a||(M(e.$$.fragment,l),a=!0)},o(l){T(e.$$.fragment,l),a=!1},d(l){U(e,l)}}}function he(i,e,a){let{label:l="Radio"}=e,{info:s=void 0}=e,{elem_id:o=""}=e,{elem_classes:m=[]}=e,{visible:b=!0}=e,{value:h=null}=e,{value_is_output:t=!1}=e,{choices:_=[]}=e,{mode:f}=e,{show_label:n}=e,{container:d=!1}=e,{scale:v=null}=e,{min_width:r=void 0}=e,{loading_status:c}=e;function k(u){h=u,a(0,h)}function g(u){t=u,a(1,t)}function W(u){A.call(this,i,u)}function X(u){A.call(this,i,u)}function Y(u){A.call(this,i,u)}return i.$$set=u=>{"label"in u&&a(2,l=u.label),"info"in u&&a(3,s=u.info),"elem_id"in u&&a(4,o=u.elem_id),"elem_classes"in u&&a(5,m=u.elem_classes),"visible"in u&&a(6,b=u.visible),"value"in u&&a(0,h=u.value),"value_is_output"in u&&a(1,t=u.value_is_output),"choices"in u&&a(7,_=u.choices),"mode"in u&&a(8,f=u.mode),"show_label"in u&&a(9,n=u.show_label),"container"in u&&a(10,d=u.container),"scale"in u&&a(11,v=u.scale),"min_width"in u&&a(12,r=u.min_width),"loading_status"in u&&a(13,c=u.loading_status)},[h,t,l,s,o,m,b,_,f,n,d,v,r,c,k,g,W,X,Y]}class me extends Q{constructor(e){super(),I(this,e,he,de,J,{label:2,info:3,elem_id:4,elem_classes:5,visible:6,value:0,value_is_output:1,choices:7,mode:8,show_label:9,container:10,scale:11,min_width:12,loading_status:13})}}const we=me,Be=["static","dynamic"],Re=i=>({type:{payload:"string"},description:{payload:"selected choice"},example_data:i.choices.length>1?i.choices[0]:""});export{we as Component,Re as document,Be as modes};
2
- //# sourceMappingURL=index-9fc2c1bb.js.map
 
 
 
spaces/DaFujaTyping/hf-Chat-ui/src/lib/types/UrlDependency.ts DELETED
@@ -1,4 +0,0 @@
1
- /* eslint-disable no-shadow */
2
- export enum UrlDependency {
3
- ConversationList = "conversation:list",
4
- }
 
 
 
 
 
spaces/Danielzero/GPT3.5/modules/config.py DELETED
@@ -1,173 +0,0 @@
1
- from collections import defaultdict
2
- from contextlib import contextmanager
3
- import os
4
- import logging
5
- import sys
6
- import commentjson as json
7
-
8
- from . import shared
9
- from . import presets
10
-
11
-
12
- __all__ = [
13
- "my_api_key",
14
- "authflag",
15
- "auth_list",
16
- "dockerflag",
17
- "retrieve_proxy",
18
- "log_level",
19
- "advance_docs",
20
- "update_doc_config",
21
- "multi_api_key",
22
- "server_name",
23
- "server_port",
24
- "share",
25
- ]
26
-
27
- # 添加一个统一的config文件,避免文件过多造成的疑惑(优先级最低)
28
- # 同时,也可以为后续支持自定义功能提供config的帮助
29
- if os.path.exists("config.json"):
30
- with open("config.json", "r", encoding='utf-8') as f:
31
- config = json.load(f)
32
- else:
33
- config = {}
34
-
35
- lang_config = config.get("language", "auto")
36
- language = os.environ.get("LANGUAGE", lang_config)
37
-
38
- if os.path.exists("api_key.txt"):
39
- logging.info("检测到api_key.txt文件,正在进行迁移...")
40
- with open("api_key.txt", "r") as f:
41
- config["openai_api_key"] = f.read().strip()
42
- os.rename("api_key.txt", "api_key(deprecated).txt")
43
- with open("config.json", "w", encoding='utf-8') as f:
44
- json.dump(config, f, indent=4)
45
-
46
- if os.path.exists("auth.json"):
47
- logging.info("检测到auth.json文件,正在进行迁移...")
48
- auth_list = []
49
- with open("auth.json", "r", encoding='utf-8') as f:
50
- auth = json.load(f)
51
- for _ in auth:
52
- if auth[_]["username"] and auth[_]["password"]:
53
- auth_list.append((auth[_]["username"], auth[_]["password"]))
54
- else:
55
- logging.error("请检查auth.json文件中的用户名和密码!")
56
- sys.exit(1)
57
- config["users"] = auth_list
58
- os.rename("auth.json", "auth(deprecated).json")
59
- with open("config.json", "w", encoding='utf-8') as f:
60
- json.dump(config, f, indent=4)
61
-
62
- ## 处理docker if we are running in Docker
63
- dockerflag = config.get("dockerflag", False)
64
- if os.environ.get("dockerrun") == "yes":
65
- dockerflag = True
66
-
67
- ## 处理 api-key 以及 允许的用户列表
68
- my_api_key = config.get("openai_api_key", "")
69
- my_api_key = os.environ.get("OPENAI_API_KEY", my_api_key)
70
-
71
- xmchat_api_key = config.get("xmchat_api_key", "")
72
- if os.environ.get("XMCHAT_API_KEY", None) == None:
73
- os.environ["XMCHAT_API_KEY"] = xmchat_api_key
74
-
75
- ## 多账户机制
76
- multi_api_key = config.get("multi_api_key", False) # 是否开启多账户机制
77
- if multi_api_key:
78
- api_key_list = config.get("api_key_list", [])
79
- if len(api_key_list) == 0:
80
- logging.error("多账号模式已开启,但api_key_list为空,请检查config.json")
81
- sys.exit(1)
82
- shared.state.set_api_key_queue(api_key_list)
83
-
84
- auth_list = config.get("users", []) # 实际上是使用者的列表
85
- authflag = len(auth_list) > 0 # 是否开启认证的状态值,改为判断auth_list长度
86
-
87
- # 处理自定义的api_host,优先读环境变量的配置,如果存在则自动装配
88
- api_host = os.environ.get("api_host", config.get("api_host", ""))
89
- if api_host:
90
- shared.state.set_api_host(api_host)
91
-
92
- @contextmanager
93
- def retrieve_openai_api(api_key = None):
94
- old_api_key = os.environ.get("OPENAI_API_KEY", "")
95
- if api_key is None:
96
- os.environ["OPENAI_API_KEY"] = my_api_key
97
- yield my_api_key
98
- else:
99
- os.environ["OPENAI_API_KEY"] = api_key
100
- yield api_key
101
- os.environ["OPENAI_API_KEY"] = old_api_key
102
-
103
- ## 处理log
104
- log_level = config.get("log_level", "INFO")
105
- logging.basicConfig(
106
- level=log_level,
107
- format="%(asctime)s [%(levelname)s] [%(filename)s:%(lineno)d] %(message)s",
108
- )
109
-
110
- ## 处理代理:
111
- http_proxy = config.get("http_proxy", "")
112
- https_proxy = config.get("https_proxy", "")
113
- http_proxy = os.environ.get("HTTP_PROXY", http_proxy)
114
- https_proxy = os.environ.get("HTTPS_PROXY", https_proxy)
115
-
116
- # 重置系统变量,在不需要设置的时候不设置环境变量,以免引起全局代理报错
117
- os.environ["HTTP_PROXY"] = ""
118
- os.environ["HTTPS_PROXY"] = ""
119
-
120
- local_embedding = config.get("local_embedding", False) # 是否使用本地embedding
121
-
122
- @contextmanager
123
- def retrieve_proxy(proxy=None):
124
- """
125
- 1, 如果proxy = NONE,设置环境变量,并返回最新设置的代理
126
- 2,如果proxy != NONE,更新当前的代理配置,但是不更新环境变量
127
- """
128
- global http_proxy, https_proxy
129
- if proxy is not None:
130
- http_proxy = proxy
131
- https_proxy = proxy
132
- yield http_proxy, https_proxy
133
- else:
134
- old_var = os.environ["HTTP_PROXY"], os.environ["HTTPS_PROXY"]
135
- os.environ["HTTP_PROXY"] = http_proxy
136
- os.environ["HTTPS_PROXY"] = https_proxy
137
- yield http_proxy, https_proxy # return new proxy
138
-
139
- # return old proxy
140
- os.environ["HTTP_PROXY"], os.environ["HTTPS_PROXY"] = old_var
141
-
142
-
143
- ## 处理advance docs
144
- advance_docs = defaultdict(lambda: defaultdict(dict))
145
- advance_docs.update(config.get("advance_docs", {}))
146
- def update_doc_config(two_column_pdf):
147
- global advance_docs
148
- advance_docs["pdf"]["two_column"] = two_column_pdf
149
-
150
- logging.info(f"更新后的文件参数为:{advance_docs}")
151
-
152
- ## 处理gradio.launch参数
153
- server_name = config.get("server_name", None)
154
- server_port = config.get("server_port", None)
155
- if server_name is None:
156
- if dockerflag:
157
- server_name = "0.0.0.0"
158
- else:
159
- server_name = "127.0.0.1"
160
- if server_port is None:
161
- if dockerflag:
162
- server_port = 7860
163
-
164
- assert server_port is None or type(server_port) == int, "要求port设置为int类型"
165
-
166
- # 设置默认model
167
- default_model = config.get("default_model", "")
168
- try:
169
- presets.DEFAULT_MODEL = presets.MODELS.index(default_model)
170
- except ValueError:
171
- pass
172
-
173
- share = config.get("share", False)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/DarkyMan/URPM/README.md DELETED
@@ -1,14 +0,0 @@
1
- ---
2
- title: Open Journey V4
3
- emoji: 💻
4
- colorFrom: red
5
- colorTo: indigo
6
- sdk: gradio
7
- sdk_version: 3.23.0
8
- app_file: app.py
9
- pinned: false
10
- license: mit
11
- duplicated_from: Manjushri/OpenJourney-V4-GPU
12
- ---
13
-
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Datasculptor/StyleGAN-NADA/util.py DELETED
@@ -1,136 +0,0 @@
1
- from matplotlib import pyplot as plt
2
- import torch
3
- import torch.nn.functional as F
4
- import os
5
- import dlib
6
- from PIL import Image
7
- import numpy as np
8
- import scipy
9
- import scipy.ndimage
10
- import torchvision.transforms as transforms
11
-
12
- def display_image(image, size=None, mode='nearest', unnorm=False, title=''):
13
- # image is [3,h,w] or [1,3,h,w] tensor [0,1]
14
- if not isinstance(image, torch.Tensor):
15
- image = transforms.ToTensor()(image).unsqueeze(0)
16
- if image.is_cuda:
17
- image = image.cpu()
18
- if size is not None and image.size(-1) != size:
19
- image = F.interpolate(image, size=(size,size), mode=mode)
20
- if image.dim() == 4:
21
- image = image[0]
22
- image = image.permute(1, 2, 0).detach().numpy()
23
- plt.figure()
24
- plt.title(title)
25
- plt.axis('off')
26
- plt.imshow(image)
27
-
28
- def get_landmark(filepath, predictor):
29
- """get landmark with dlib
30
- :return: np.array shape=(68, 2)
31
- """
32
- detector = dlib.get_frontal_face_detector()
33
-
34
- img = dlib.load_rgb_image(filepath)
35
- dets = detector(img, 1)
36
- assert len(dets) > 0, "Face not detected, try another face image"
37
-
38
- for k, d in enumerate(dets):
39
- shape = predictor(img, d)
40
-
41
- t = list(shape.parts())
42
- a = []
43
- for tt in t:
44
- a.append([tt.x, tt.y])
45
- lm = np.array(a)
46
- return lm
47
-
48
- def align_face(filepath, predictor, output_size=256, transform_size=1024, enable_padding=True):
49
-
50
- """
51
- :param filepath: str
52
- :return: PIL Image
53
- """
54
- lm = get_landmark(filepath, predictor)
55
-
56
- lm_chin = lm[0: 17] # left-right
57
- lm_eyebrow_left = lm[17: 22] # left-right
58
- lm_eyebrow_right = lm[22: 27] # left-right
59
- lm_nose = lm[27: 31] # top-down
60
- lm_nostrils = lm[31: 36] # top-down
61
- lm_eye_left = lm[36: 42] # left-clockwise
62
- lm_eye_right = lm[42: 48] # left-clockwise
63
- lm_mouth_outer = lm[48: 60] # left-clockwise
64
- lm_mouth_inner = lm[60: 68] # left-clockwise
65
-
66
- # Calculate auxiliary vectors.
67
- eye_left = np.mean(lm_eye_left, axis=0)
68
- eye_right = np.mean(lm_eye_right, axis=0)
69
- eye_avg = (eye_left + eye_right) * 0.5
70
- eye_to_eye = eye_right - eye_left
71
- mouth_left = lm_mouth_outer[0]
72
- mouth_right = lm_mouth_outer[6]
73
- mouth_avg = (mouth_left + mouth_right) * 0.5
74
- eye_to_mouth = mouth_avg - eye_avg
75
-
76
- # Choose oriented crop rectangle.
77
- x = eye_to_eye - np.flipud(eye_to_mouth) * [-1, 1]
78
- x /= np.hypot(*x)
79
- x *= max(np.hypot(*eye_to_eye) * 2.0, np.hypot(*eye_to_mouth) * 1.8)
80
- y = np.flipud(x) * [-1, 1]
81
- c = eye_avg + eye_to_mouth * 0.1
82
- quad = np.stack([c - x - y, c - x + y, c + x + y, c + x - y])
83
- qsize = np.hypot(*x) * 2
84
-
85
- # read image
86
- img = Image.open(filepath)
87
-
88
- transform_size = output_size
89
- enable_padding = True
90
-
91
- # Shrink.
92
- shrink = int(np.floor(qsize / output_size * 0.5))
93
- if shrink > 1:
94
- rsize = (int(np.rint(float(img.size[0]) / shrink)), int(np.rint(float(img.size[1]) / shrink)))
95
- img = img.resize(rsize, Image.ANTIALIAS)
96
- quad /= shrink
97
- qsize /= shrink
98
-
99
- # Crop.
100
- border = max(int(np.rint(qsize * 0.1)), 3)
101
- crop = (int(np.floor(min(quad[:, 0]))), int(np.floor(min(quad[:, 1]))), int(np.ceil(max(quad[:, 0]))),
102
- int(np.ceil(max(quad[:, 1]))))
103
- crop = (max(crop[0] - border, 0), max(crop[1] - border, 0), min(crop[2] + border, img.size[0]),
104
- min(crop[3] + border, img.size[1]))
105
- if crop[2] - crop[0] < img.size[0] or crop[3] - crop[1] < img.size[1]:
106
- img = img.crop(crop)
107
- quad -= crop[0:2]
108
-
109
- # Pad.
110
- pad = (int(np.floor(min(quad[:, 0]))), int(np.floor(min(quad[:, 1]))), int(np.ceil(max(quad[:, 0]))),
111
- int(np.ceil(max(quad[:, 1]))))
112
- pad = (max(-pad[0] + border, 0), max(-pad[1] + border, 0), max(pad[2] - img.size[0] + border, 0),
113
- max(pad[3] - img.size[1] + border, 0))
114
- if enable_padding and max(pad) > border - 4:
115
- pad = np.maximum(pad, int(np.rint(qsize * 0.3)))
116
- img = np.pad(np.float32(img), ((pad[1], pad[3]), (pad[0], pad[2]), (0, 0)), 'reflect')
117
- h, w, _ = img.shape
118
- y, x, _ = np.ogrid[:h, :w, :1]
119
- mask = np.maximum(1.0 - np.minimum(np.float32(x) / pad[0], np.float32(w - 1 - x) / pad[2]),
120
- 1.0 - np.minimum(np.float32(y) / pad[1], np.float32(h - 1 - y) / pad[3]))
121
- blur = qsize * 0.02
122
- img += (scipy.ndimage.gaussian_filter(img, [blur, blur, 0]) - img) * np.clip(mask * 3.0 + 1.0, 0.0, 1.0)
123
- img += (np.median(img, axis=(0, 1)) - img) * np.clip(mask, 0.0, 1.0)
124
- img = Image.fromarray(np.uint8(np.clip(np.rint(img), 0, 255)), 'RGB')
125
- quad += pad[:2]
126
-
127
- # Transform.
128
- img = img.transform((transform_size, transform_size), Image.QUAD, (quad + 0.5).flatten(), Image.BILINEAR)
129
- if output_size < transform_size:
130
- img = img.resize((output_size, output_size), Image.ANTIALIAS)
131
-
132
- # Return aligned image.
133
- return img
134
-
135
- def strip_path_extension(path):
136
- return os.path.splitext(path)[0]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/DeepLabCut/DeepLabCutModelZoo-SuperAnimals/dlc_utils.py DELETED
@@ -1,32 +0,0 @@
1
- import deeplabcut
2
- from tkinter import W
3
- import gradio as gr
4
- import numpy as np
5
- from dlclive import DLCLive, Processor
6
-
7
-
8
- ##########################################
9
- def predict_dlc(list_np_crops,
10
- kpts_likelihood_th,
11
- dlc_model_folder,
12
- dlc_proc):
13
-
14
- # run dlc thru list of crops
15
- dlc_live = DLCLive(dlc_model_folder, processor=dlc_proc)
16
- dlc_live.init_inference(list_np_crops[0])
17
-
18
- list_kpts_per_crop = []
19
- all_kypts = []
20
- np_aux = np.empty((1,3)) # can I avoid hardcoding here?
21
- for crop in list_np_crops:
22
- # scale crop here?
23
- keypts_xyp = dlc_live.get_pose(crop) # third column is llk!
24
- # set kpts below threhsold to nan
25
-
26
- #pdb.set_trace()
27
- keypts_xyp[keypts_xyp[:,-1] < kpts_likelihood_th,:] = np_aux.fill(np.nan)
28
- # add kpts of this crop to list
29
- list_kpts_per_crop.append(keypts_xyp)
30
- all_kypts.append(keypts_xyp)
31
-
32
- return list_kpts_per_crop
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Dilmurat/bingo/Dockerfile DELETED
@@ -1,7 +0,0 @@
1
- FROM weaigc/bingo:latest
2
-
3
- ARG DEBIAN_FRONTEND=noninteractive
4
-
5
- ENV BING_HEADER ""
6
-
7
- CMD npm start