Commit
·
596aa28
1
Parent(s):
cd06f38
Update parquet files (step 33 of 476)
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- spaces/0x7194633/mbrat-ru-sum/README.md +0 -12
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/BlueSoleil 6.4.275.0WithMobile Serial Number - 24 1 The Best Bluetooth Software for Windows and Mobile Devices.md +0 -156
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Darkstalkers Collection (PC) Download Everything You Need to Know About the Legendary Fighting Game.md +0 -142
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download Update Kostum Pes 6 Menjadi Pes 13 Langkah-Langkah Instalasi dan Konfigurasi Update Jersey Terbaru untuk PES 6.md +0 -120
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download manley massive passive eq plugin.rar 16 and master your tracks with the synthesis of the best passive equalizers of the last 70 years.md +0 -195
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Forex Hacked Pro Free Download ((LINK)).md +0 -30
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/HD Online Player (Chhota Bheem And The Throne Of Bali ) Experience the Magic and Mystery of Bali with Bheem and Arjun.md +0 -81
- spaces/1gistliPinn/ChatGPT4/Examples/((FULL)) Download Just Dance Now MOD APK V3.2.0 (Unlimited Money) Free ((FULL)) Download.md +0 -6
- spaces/1gistliPinn/ChatGPT4/Examples/CINEMA 4D Studio R19.024 Multilingual 2017 Full Version [PORTABLE].md +0 -26
- spaces/1gistliPinn/ChatGPT4/Examples/Essl Time Track Lite 6.5 [BETTER] Cracked.md +0 -133
- spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Brawl Stars Unlimited APK Download and Enjoy the Epic Shooter Game.md +0 -87
- spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Cricket Device Unlock - The Official and Safe Way to Unlock Your Phone.md +0 -232
- spaces/1phancelerku/anime-remove-background/Download Super Bear Adventure MOD APK and Join the Fun with Your Friends.md +0 -124
- spaces/3B-Group/ConvRe-Leaderboard/README.md +0 -13
- spaces/AB-TW/team-ai/documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Development Lifecycle e20a5470e52f49e9bbc4f255cf81db4b.md +0 -34
- spaces/AI-Hobbyist/Hoyo-RVC/train/data_utils.py +0 -512
- spaces/AIGC-Audio/AudioGPT/text_to_speech/modules/vocoder/parallel_wavegan/models/__init__.py +0 -2
- spaces/AIWaves/Software_Company/src/agents/template.py +0 -111
- spaces/AIZero2Hero4Health/9-Seq2SeqQAGenerator-GR/README.md +0 -12
- spaces/AIZero2HeroBootcamp/ChatGPTandLangchain/README.md +0 -13
- spaces/AIxPha/Real-CUGAN/app.py +0 -62
- spaces/Adapter/CoAdapter/ldm/modules/extra_condition/midas/midas/transforms.py +0 -234
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/spinner/facebook/Factory.js +0 -13
- spaces/AlekseyKorshuk/instagram-filter-removal/utils/data_utils.py +0 -6
- spaces/AlekseyKorshuk/thin-plate-spline-motion-model/augmentation.py +0 -344
- spaces/AlexWang/lama/saicinpainting/evaluation/losses/base_loss.py +0 -528
- spaces/AlexWang/lama/saicinpainting/training/data/aug.py +0 -84
- spaces/Aloento/9Nine-PITS/text/frontend/zh_normalization/quantifier.py +0 -37
- spaces/Alpaca233/SadTalker/src/face3d/models/arcface_torch/docs/modelzoo.md +0 -0
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_controlnet.py +0 -28
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/pipelines/pipeline_params.py +0 -125
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/pipelines/stable_diffusion/test_cycle_diffusion.py +0 -275
- spaces/Andy1621/uniformer_image_segmentation/configs/ann/ann_r50-d8_512x1024_80k_cityscapes.py +0 -4
- spaces/AnishKumbhar/ChatBot/text-generation-webui-main/modules/loaders.py +0 -493
- spaces/Anonymous-sub/Rerender/ControlNet/ldm/modules/image_degradation/bsrgan.py +0 -730
- spaces/AnonymousSub/Ayurveda4U/README.md +0 -12
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pkg_resources/_vendor/packaging/markers.py +0 -304
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/setuptools/_distutils/core.py +0 -291
- spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/solver/__init__.py +0 -5
- spaces/Aymene/FakeNewsDetector/README.md +0 -13
- spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_internal/utils/compatibility_tags.py +0 -165
- spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/pygments/lexers/python.py +0 -1204
- spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/rich/color.py +0 -622
- spaces/CVPR/LIVE/pybind11/tools/clang/__init__.py +0 -24
- spaces/CVPR/LIVE/thrust/thrust/system/tbb/execution_policy.h +0 -156
- spaces/CVPR/drawings-to-human/frontend/src/app.d.ts +0 -16
- spaces/CVPR/regionclip-demo/detectron2/modeling/proposal_generator/__init__.py +0 -5
- spaces/CjangCjengh/Sanskrit-TTS/modules.py +0 -387
- spaces/CofAI/chat/client/js/change-language.js +0 -47
- spaces/Cran-May/ygVI/README.md +0 -12
spaces/0x7194633/mbrat-ru-sum/README.md
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Mbrat Ru Sum
|
3 |
-
emoji: 🦀
|
4 |
-
colorFrom: purple
|
5 |
-
colorTo: green
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.1.3
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/BlueSoleil 6.4.275.0WithMobile Serial Number - 24 1 The Best Bluetooth Software for Windows and Mobile Devices.md
DELETED
@@ -1,156 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>What is BlueSoleil 6.4.275.0WithMobile?</h1>
|
3 |
-
<p>BlueSoleil is a Bluetooth driver and software that allows you to easily connect to your Bluetooth devices, such as headsets, mobile phones, mice and GPS.</p>
|
4 |
-
<p>BlueSoleil 6.4.275.0WithMobile is a special version of BlueSoleil that comes with a mobile phone management software called Mobile Phone Tool.</p>
|
5 |
-
<h2>BlueSoleil 6.4.275.0WithMobile Serial Number - 24 1</h2><br /><p><b><b>Download File</b> ✅ <a href="https://byltly.com/2uKxmj">https://byltly.com/2uKxmj</a></b></p><br /><br />
|
6 |
-
<p>With this version, you can not only connect your Bluetooth devices, but also manage your mobile phone data, such as contacts, messages, photos, music and videos.</p>
|
7 |
-
<p>You can also use your mobile phone as a remote control for your computer, or transfer files between your phone and computer via Bluetooth.</p>
|
8 |
-
<p>In this article, we will show you how to download, install, use and activate BlueSoleil 6.4.275.0WithMobile, as well as some tips and tricks for troubleshooting common problems.</p>
|
9 |
-
<h2>How to download and install BlueSoleil 6.4.275.0WithMobile?</h2>
|
10 |
-
<p>To download and install BlueSoleil 6.4.275.0WithMobile, you need to follow these steps:</p>
|
11 |
-
<ol>
|
12 |
-
<li>Go to <a href="https://www.bluesoleil.com/products/S0001201005190001.html">https://www.bluesoleil.com/products/S0001201005190001.html</a> and click on "Download" button.</li>
|
13 |
-
<li>Save the file "BlueSoleil_6_4_275_0_with_Mobile.zip" on your computer.</li>
|
14 |
-
<li>Extract the file using a zip extractor program, such as WinZip or WinRAR.</li>
|
15 |
-
<li>Open the folder "BlueSoleil_6_4_275_0_with_Mobile" and double-click on "setup.exe" file.</li>
|
16 |
-
<li>Follow the instructions on the screen to complete the installation process.</li>
|
17 |
-
<li>Restart your computer after the installation is finished.</li>
|
18 |
-
</ol>
|
19 |
-
<h2>What are the benefits of using BlueSoleil 6.4.275.0WithMobile?</h2>
|
20 |
-
<p>Using BlueSoleil 6.4.275.0WithMobile has many benefits, such as:</p>
|
21 |
-
<ul>
|
22 |
-
<li>It is compatible with most Bluetooth devices and supports various Bluetooth profiles, such as A2DP, AVRCP, HFP, HSP, OPP, FTP and DUN.</li>
|
23 |
-
<li>It is easy to use and has a user-friendly interface that shows all your Bluetooth devices and services in one place.</li>
|
24 |
-
<li>It allows you to connect up to 17 Bluetooth devices at the same time and switch between them easily.</li>
|
25 |
-
<li>It enables you to manage your mobile phone data from your computer and use your phone as a remote control for your computer.</li>
|
26 |
-
<li>It enhances your wireless experience and reduces the clutter of wires and cables on your desk.</li>
|
27 |
-
</ul>
|
28 |
-
<h2>What are the drawbacks of using BlueSoleil 6.4.275.0WithMobile?</h2>
|
29 |
-
<p>Using BlueSoleil 6.4.275.0WithMobile also has some drawbacks, such as:</p>
|
30 |
-
<p>How to activate BlueSoleil 6.4.275.0WithMobile with serial number<br />
|
31 |
-
BlueSoleil 6.4.275.0WithMobile crack download free<br />
|
32 |
-
BlueSoleil 6.4.275.0WithMobile license key generator<br />
|
33 |
-
BlueSoleil 6.4.275.0WithMobile full version for Windows 10<br />
|
34 |
-
BlueSoleil 6.4.275.0WithMobile bluetooth software review<br />
|
35 |
-
BlueSoleil 6.4.275.0WithMobile compatible devices list<br />
|
36 |
-
BlueSoleil 6.4.275.0WithMobile user manual pdf<br />
|
37 |
-
BlueSoleil 6.4.275.0WithMobile update patch download<br />
|
38 |
-
BlueSoleil 6.4.275.0WithMobile alternative software comparison<br />
|
39 |
-
BlueSoleil 6.4.275.0WithMobile best price and discount code<br />
|
40 |
-
BlueSoleil 6.4.275.0WithMobile installation error and troubleshooting<br />
|
41 |
-
BlueSoleil 6.4.275.0WithMobile customer service and support number<br />
|
42 |
-
BlueSoleil 6.4.275.0WithMobile features and benefits overview<br />
|
43 |
-
BlueSoleil 6.4.275.0WithMobile system requirements and specifications<br />
|
44 |
-
BlueSoleil 6.4.275.0WithMobile refund policy and guarantee<br />
|
45 |
-
BlueSoleil 6.4.275.0WithMobile testimonials and feedback from users<br />
|
46 |
-
BlueSoleil 6.4.275.0WithMobile pros and cons analysis<br />
|
47 |
-
BlueSoleil 6.4.275.0WithMobile vs other bluetooth software comparison<br />
|
48 |
-
BlueSoleil 6.4.275.0WithMobile official website and download link<br />
|
49 |
-
BlueSoleil 6.4.275.0WithMobile serial number validity check online<br />
|
50 |
-
How to uninstall BlueSoleil 6.4.275.0WithMobile completely<br />
|
51 |
-
BlueSoleil 6.4.275.0WithMobile latest version and changelog<br />
|
52 |
-
BlueSoleil 6.4.275.0WithMobile tips and tricks for better performance<br />
|
53 |
-
BlueSoleil 6.4.275.0WithMobile FAQ and common questions answered<br />
|
54 |
-
BlueSoleil 6.4.275.0WithMobile forum and community discussion<br />
|
55 |
-
How to transfer files with BlueSoleil 6.4.275</p>
|
56 |
-
<ul>
|
57 |
-
<li>It requires a serial number to activate the software and unlock all the features.</li>
|
58 |
-
<li>It may not work well with some Bluetooth devices or drivers that are not compatible with BlueSoleil.</li>
|
59 |
-
<li>It may cause some interference or latency issues with other wireless devices or networks in your vicinity.</li>
|
60 |
-
<li>It may consume more battery power or CPU resources than other Bluetooth software.</li>
|
61 |
-
</ul>
|
62 |
-
<p>However, these drawbacks can be overcome by following some tips and tricks that we will share in the next sections.</p>
|
63 |
-
<h2>How to get a serial number for BlueSoleil 6.4.275.0WithMobile?</h2>
|
64 |
-
<p>To get a serial number for BlueSoleil 6.4.275.0WithMobile, you need to follow these steps:</p>
|
65 |
-
<ol>
|
66 |
-
<li>Go to <a href="https://www.bluesoleil.com/products/S0001201005190001.html">https://www.bluesoleil.com/products/S0001201005190001.html</a> and click on "Buy Now" button.</li>
|
67 |
-
<li>Select the payment method and fill in the required information.</li>
|
68 |
-
<li>Confirm your order and complete the payment process.</li>
|
69 |
-
<li>You will receive an email with your serial number and a download link for the software.</li>
|
70 |
-
<li>Copy the serial number and paste it in the activation window of the software.</li>
|
71 |
-
</ol>
|
72 |
-
<p>Congratulations! You have successfully activated BlueSoleil 6.4.275.0WithMobile and unlocked all the features.</p>
|
73 |
-
<h3>Why do you need a serial number for BlueSoleil 6.4.275.0WithMobile?</h3>
|
74 |
-
<p>You need a serial number for BlueSoleil 6.4.275.0WithMobile because:</p>
|
75 |
-
<ul>
|
76 |
-
<li>It is a way of verifying that you have purchased a legitimate copy of the software and supporting the developers.</li>
|
77 |
-
<li>It is a way of unlocking all the features and functions of the software that are otherwise limited or disabled in the trial version.</li>
|
78 |
-
<li>It is a way of ensuring that you have access to the latest updates and customer support from the official website.</li>
|
79 |
-
</ul>
|
80 |
-
<h3>Where can you find a serial number for BlueSoleil 6.4.275.0WithMobile?</h3>
|
81 |
-
<p>You can find a serial number for BlueSoleil 6.4.275.0WithMobile in these places:</p>
|
82 |
-
<ul>
|
83 |
-
<li>The official website of BlueSoleil, where you can buy a serial number online and receive it by email.</li>
|
84 |
-
<li>The CD-ROM or DVD-ROM that comes with the software package, where you can find a serial number printed on the disc or the cover.</li>
|
85 |
-
<li>The online forums or websites that offer free or discounted serial numbers for BlueSoleil, where you can find a serial number posted by other users or generated by a keygen program.</li>
|
86 |
-
</ul>
|
87 |
-
<p>However, we recommend that you only use the first option, as it is the safest and most reliable way of getting a serial number for BlueSoleil 6.4.275.0WithMobile.</p>
|
88 |
-
<p>The second option may not work if you have lost or damaged your disc or cover, or if you have bought a pirated copy of the software.</p>
|
89 |
-
<p>The third option may not work if the serial number is invalid, expired, blocked or already used by someone else, or if the keygen program contains viruses or malware that can harm your computer.</p>
|
90 |
-
<h3>How to enter a serial number for BlueSoleil 6.4.275.0WithMobile?</h3>
|
91 |
-
<p>To enter a serial number for BlueSoleil 6.4.275.0WithMobile, you need to follow these steps:</p>
|
92 |
-
<ol>
|
93 |
-
<li>Launch BlueSoleil from your desktop or start menu.</li>
|
94 |
-
<li>Click on "Help" menu and select "Activate BlueSoleil".</li>
|
95 |
-
<li>A new window will open asking you to enter your serial number.</li>
|
96 |
-
<li>Copy and paste your serial number in the text box and click on "Activate" button.</li>
|
97 |
-
<li>Wait for the activation process to complete.</li>
|
98 |
-
<li>A message will appear confirming that your activation is successful.</li>
|
99 |
-
</ol>
|
100 |
-
<p>Congratulations! You have successfully entered your serial number for BlueSoleil 6.4.275.0WithMobile and activated the software.</p>
|
101 |
-
<h2>How to troubleshoot common problems with BlueSoleil 6.4.275.0WithMobile?</h2>
|
102 |
-
<p>Sometimes, you may encounter some problems with BlueSoleil 6.4.275.0WithMobile, such as:</p>
|
103 |
-
<ul>
|
104 |
-
<li>Your Bluetooth device is not detected or paired by the software.</li>
|
105 |
-
<li>Your Bluetooth device is connected but not working properly with the software.</li>
|
106 |
-
<li>Your Bluetooth device is disconnected or interrupted by the software.</li>
|
107 |
-
<li>Your software is not activated or shows an error message.</li>
|
108 |
-
</ul>
|
109 |
-
<p>Don't worry, these problems can be fixed by following some tips and tricks, such as:</p>
|
110 |
-
<ul>
|
111 |
-
<li>Make sure your Bluetooth device is turned on and discoverable, and has enough battery power and signal strength.</li>
|
112 |
-
<li>Make sure your Bluetooth device is compatible with BlueSoleil and supports the service you want to use.</li>
|
113 |
-
<li>Make sure your computer has a Bluetooth adapter that is compatible with BlueSoleil and has the latest driver installed.</li>
|
114 |
-
<li>Make sure your computer and your Bluetooth device are within the Bluetooth range (usually 10 meters) and free from any interference or obstruction.</li>
|
115 |
-
<li>Make sure your software is updated to the latest version and has a valid serial number entered.</li>
|
116 |
-
<li>Restart your computer and your Bluetooth device and try to connect them again.</li>
|
117 |
-
<li>Uninstall and reinstall your software and try to activate it again.</li>
|
118 |
-
</ul>
|
119 |
-
<p>If these tips and tricks do not work, you can also contact customer support for BlueSoleil 6.4.275.0WithMobile for further assistance.</p>
|
120 |
-
<h2>How to contact customer support for BlueSoleil 6.4.275.0WithMobile?</h2>
|
121 |
-
<p>If you have any questions or feedback about BlueSoleil 6.4.275.0WithMobile, you can contact customer support in these ways:</p>
|
122 |
-
<ul>
|
123 |
-
<li>Visit the official website of BlueSoleil at <a href="https://www.bluesoleil.com">https://www.bluesoleil.com</a> and click on "Support" menu.</li>
|
124 |
-
<li>There you can find various resources, such as FAQs, manuals, tutorials, forums and online chat.</li>
|
125 |
-
<li>You can also submit a ticket or send an email to <a href="mailto:[email protected]">[email protected]</a> with your query or feedback.</li>
|
126 |
-
<li>You can also call the customer service hotline at +86-10-6297-8515 from Monday to Friday, 9:00 AM to 6:00 PM (GMT+8).</li>
|
127 |
-
</ul>
|
128 |
-
<p>The customer support team of BlueSoleil is friendly and professional, and will try to help you as soon as possible.</p>
|
129 |
-
<h2>Conclusion</h2>
|
130 |
-
<p>BlueSoleil 6.4.275.0WithMobile is a powerful and versatile Bluetooth driver and software that allows you to connect and manage your Bluetooth devices with ease.</p>
|
131 |
-
<p>With this software, you can enjoy wireless audio, file transfer, mobile phone management and remote control functions with your Bluetooth devices.</p>
|
132 |
-
<p>You can also activate the software with a serial number and unlock all the features and functions.</p>
|
133 |
-
<p>If you encounter any problems with the software, you can follow some tips and tricks or contact customer support for help.</p>
|
134 |
-
<p>If you are looking for a Bluetooth solution that is easy to use and has a lot of features, BlueSoleil 6.4.275.0WithMobile is a great choice for you.</p>
|
135 |
-
<p>So what are you waiting for? Download and install BlueSoleil 6.4.275.0WithMobile today and enjoy the wireless freedom!</p>
|
136 |
-
<h2>FAQs</h2>
|
137 |
-
<h3>Q: What are the system requirements for BlueSoleil 6.4.275.0WithMobile?</h3>
|
138 |
-
<p>A: The system requirements for BlueSoleil 6.4.275.0WithMobile are:</p>
|
139 |
-
<ul>
|
140 |
-
<li>Operating system: Windows XP/Vista/7/8/10</li>
|
141 |
-
<li>CPU: Intel Pentium IV or higher</li>
|
142 |
-
<li>RAM: 128 MB or more</li>
|
143 |
-
<li>Disk space: 500 MB or more</li>
|
144 |
-
<li>Bluetooth adapter: Any Bluetooth dongle or built-in Bluetooth device that supports BlueSoleil</li>
|
145 |
-
</ul>
|
146 |
-
<h3>Q: How many Bluetooth devices can I connect with BlueSoleil 6.4.275.0WithMobile?</h3>
|
147 |
-
<p>A: You can connect up to 17 Bluetooth devices at the same time with BlueSoleil 6.4.275.0WithMobile.</p>
|
148 |
-
<h3>Q: How long is the trial period for BlueSoleil 6.4.275.0WithMobile?</h3>
|
149 |
-
<p>A: The trial period for BlueSoleil 6.4.275.0WithMobile is 30 days. During the trial period, you can use all the features and functions of the software, but you will see a watermark on the screen and hear a voice reminder every few minutes.</p>
|
150 |
-
<h3>Q: How much does BlueSoleil 6.4.275.0WithMobile cost?</h3>
|
151 |
-
<p>A: BlueSoleil 6.4.275.0WithMobile costs $27.99 USD for a single license. You can buy it online from the official website of BlueSoleil or from other authorized resellers.</p>
|
152 |
-
<h3>Q: Is BlueSoleil 6.4.275.0WithMobile safe and reliable?</h3>
|
153 |
-
<p>A: Yes, BlueSoleil 6.4.275.0WithMobile is safe and reliable. It has been tested and certified by various organizations, such as Microsoft, Intel, Broadcom and IVT Corporation. It has also received positive reviews and ratings from many users and experts.</p>
|
154 |
-
</p> 0a6ba089eb<br />
|
155 |
-
<br />
|
156 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Darkstalkers Collection (PC) Download Everything You Need to Know About the Legendary Fighting Game.md
DELETED
@@ -1,142 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Darkstalkers Collection (PC) Download: How to Play the Classic Capcom Fighting Games on Your Computer</h1>
|
3 |
-
<p>If you are a fan of 2D fighting games, you have probably heard of <strong>Darkstalkers</strong>, the iconic series by Capcom that features a cast of monstrous and supernatural characters. From vampires and werewolves to zombies and mummies, Darkstalkers has something for everyone who loves dark fantasy and horror themes.</p>
|
4 |
-
<p>Darkstalkers was first released in arcades in 1994, and since then it has spawned several sequels, spin-offs, comics, anime, and merchandise. However, despite its popularity and cult status, Darkstalkers has not seen a new game in over a decade. The last official release was <strong>Darkstalkers Resurrection</strong>, a compilation of two classic titles that came out in 2013 for PlayStation 3 and Xbox 360.</p>
|
5 |
-
<h2>Darkstalkers Collection (PC) download</h2><br /><p><b><b>Download File</b> ○○○ <a href="https://byltly.com/2uKyGt">https://byltly.com/2uKyGt</a></b></p><br /><br />
|
6 |
-
<p>But don't despair, because there is still a way to enjoy Darkstalkers on your PC. In fact, there are two options that you can choose from depending on your preference and budget. In this article, we will show you how to download <strong>Darkstalkers Collection</strong> on PC and how to play it like a pro.</p>
|
7 |
-
<h2>How to Download Darkstalkers Collection on PC</h2>
|
8 |
-
<p>Darkstalkers Collection is not an official name, but rather a term that we use to refer to any compilation of Darkstalkers games that you can play on your PC. There are two main options that you can choose from:</p>
|
9 |
-
<h3>Option 1: Buy Capcom Fighting Collection on Steam</h3>
|
10 |
-
<p>If you want the most convenient and legal way to play Darkstalkers on your PC, you can buy <strong>Capcom Fighting Collection</strong> on Steam. This is a bundle of ten arcade games by Capcom that includes four titles from the Darkstalkers series:</p>
|
11 |
-
<ul>
|
12 |
-
<li><strong>Darkstalkers: The Night Warriors</strong>: The first game in the series that introduced the basic gameplay mechanics and 10 playable characters.</li>
|
13 |
-
<li><strong>Night Warriors: Darkstalkers' Revenge</strong>: The second game in the series that added four new characters, improved the graphics and sound, and introduced new features such as air blocking, chain combos, and super moves.</li>
|
14 |
-
<li><strong>Vampire Savior: The Lord of Vampire</strong>: The third game in the series that added four more characters, revamped the graphics and music, and changed the gameplay system to be faster and more dynamic.</li>
|
15 |
-
<li><strong>Vampire Hunter 2: Darkstalkers' Revenge</strong> and <strong>Vampire Savior 2: The Lord of Vampire</strong>: Two updated versions of Night Warriors and Vampire Savior respectively that swapped some characters and tweaked some balance issues.</li>
|
16 |
-
</ul>
|
17 |
-
<p>To buy and install Capcom Fighting Collection on Steam, you need to follow these steps:</p>
|
18 |
-
<ol>
|
19 |
-
<li>Create a Steam account if you don't have one already.</li>
|
20 |
-
<li>Go to <a href="https://store.steampowered.com/app/1685750/Capcom_Fighting_Collection/">the official page of Capcom Fighting Collection</a> on Steam.</li>
|
21 |
-
<li>Click on "Add to Cart" and proceed to checkout.</li>
|
22 |
-
<li>Pay $39.99 using your preferred payment method.</li>
|
23 |
-
<li>Download and install Capcom Fighting Collection on your PC.</li>
|
24 |
-
<li>Launch Capcom Fighting Collection from your Steam library.</li>
|
25 |
-
</ol>
|
26 |
-
<p>To switch between different games in Capcom Fighting Collection, you need to follow these steps:</p>
|
27 |
-
<p>How to download Darkstalkers Collection for PC<br />
|
28 |
-
Darkstalkers Collection PC game free download<br />
|
29 |
-
Darkstalkers Collection PC full version download<br />
|
30 |
-
Darkstalkers Collection PC torrent download<br />
|
31 |
-
Darkstalkers Collection PC crack download<br />
|
32 |
-
Darkstalkers Collection PC iso download<br />
|
33 |
-
Darkstalkers Collection PC steam download<br />
|
34 |
-
Darkstalkers Collection PC emulator download<br />
|
35 |
-
Darkstalkers Collection PC cheats download<br />
|
36 |
-
Darkstalkers Collection PC mods download<br />
|
37 |
-
Download Darkstalkers Collection for Windows 10<br />
|
38 |
-
Download Darkstalkers Collection for Windows 7<br />
|
39 |
-
Download Darkstalkers Collection for Mac<br />
|
40 |
-
Download Darkstalkers Collection for Linux<br />
|
41 |
-
Download Darkstalkers Collection for Android<br />
|
42 |
-
Download Darkstalkers Collection for iOS<br />
|
43 |
-
Download Darkstalkers Collection for PS4<br />
|
44 |
-
Download Darkstalkers Collection for Xbox One<br />
|
45 |
-
Download Darkstalkers Collection for Switch<br />
|
46 |
-
Download Darkstalkers Collection for PSP<br />
|
47 |
-
Best site to download Darkstalkers Collection for PC<br />
|
48 |
-
Safe site to download Darkstalkers Collection for PC<br />
|
49 |
-
Fast site to download Darkstalkers Collection for PC<br />
|
50 |
-
Easy site to download Darkstalkers Collection for PC<br />
|
51 |
-
Trusted site to download Darkstalkers Collection for PC<br />
|
52 |
-
Where can I download Darkstalkers Collection for PC<br />
|
53 |
-
Where to download Darkstalkers Collection for PC free<br />
|
54 |
-
Where to download Darkstalkers Collection for PC full version<br />
|
55 |
-
Where to download Darkstalkers Collection for PC torrent<br />
|
56 |
-
Where to download Darkstalkers Collection for PC crack<br />
|
57 |
-
Where to download Darkstalkers Collection for PC iso<br />
|
58 |
-
Where to download Darkstalkers Collection for PC steam<br />
|
59 |
-
Where to download Darkstalkers Collection for PC emulator<br />
|
60 |
-
Where to download Darkstalkers Collection for PC cheats<br />
|
61 |
-
Where to download Darkstalkers Collection for PC mods<br />
|
62 |
-
How to install Darkstalkers Collection on PC<br />
|
63 |
-
How to play Darkstalkers Collection on PC<br />
|
64 |
-
How to run Darkstalkers Collection on PC<br />
|
65 |
-
How to update Darkstalkers Collection on PC<br />
|
66 |
-
How to fix Darkstalkers Collection on PC errors<br />
|
67 |
-
How to optimize Darkstalkers Collection on PC performance<br />
|
68 |
-
How to unlock all characters in Darkstalkers Collection on PC<br />
|
69 |
-
How to use controller in Darkstalkers Collection on PC<br />
|
70 |
-
How to change language in Darkstalkers Collection on PC<br />
|
71 |
-
How to save progress in Darkstalkers Collection on PC<br />
|
72 |
-
How to stream Darkstalkers Collection on PC online<br />
|
73 |
-
How to record gameplay of Darkstalkers Collection on PC <br />
|
74 |
-
How to make a review of Darkstalkers Collection on PC <br />
|
75 |
-
How to get a refund of Darkstalkers Collection on PC <br />
|
76 |
-
How to buy a physical copy of Darkstalkers Collection on PC</p>
|
77 |
-
<ol>
|
78 |
-
<li>Select "Game Select" from the main menu.</li>
|
79 |
-
<li>Select the game that you want to play from the list.</li>
|
80 |
-
<li>Select "Play Game" or "Online Play" depending on whether you want to play offline or online.</li>
|
81 |
-
<li>Select your character and mode from the game menu.</li>
|
82 |
-
<li>Enjoy playing Darkstalkers!</li>
|
83 |
-
</ol>
|
84 |
-
<p>To play online and access the museum mode in Capcom Fighting Collection, you need to follow these steps:</p>
|
85 |
-
<ol>
|
86 |
-
<li>Select "Online Play" from the main menu or the game select menu.</li>
|
87 |
-
<li>Select "Ranked Match" or "Lobby Match" depending on whether you want to play competitively or casually with other players.</li>
|
88 |
-
<li>Select your region, game title, character, mode, and other settings.</li>
|
89 |
-
<li>Wait for an opponent or join an existing lobby.</li>
|
90 |
-
<li>Have fun playing online!</li>
|
91 |
-
<li>Select "Museum" from the main menu or the game select menu.</li>
|
92 |
-
<li>Select "Gallery" or "Sound Player" depending on whether you want to view illustrations or listen to music from the games.</li>
|
93 |
-
<li>Browse through hundreds of artworks and tracks from the arcade versions of each title.</li>
|
94 |
-
</ol>
|
95 |
-
<h3>Option 2: Download Darkstalkers Resurrection from Internet Archive</h3>
|
96 |
-
<p>If you don't want to spend money or if you prefer a more retro experience, you can download <strong>Darkstalkers Resurrection</strong> from Internet Archive. This is a compilation of two classic titles that was released in 2013 for PlayStation 3 and Xbox 360:</p>
|
97 |
-
<ul>
|
98 |
-
<li><strong>Night Warriors: Darkstalkers' Revenge</strong>: The second game in the series that added four new characters, improved the graphics and sound, and introduced new features such as air blocking, chain combos, and super moves.</li>
|
99 |
-
<li><strong>Darkstalkers 3</strong>: The fourth game in the series that added five more characters (plus two secret ones), enhanced the graphics and music further, and modified the gameplay system with elements such as dark force activation, pursuit attacks, throw escapes, tech hits, etc.</li>
|
100 |
-
</ul>
|
101 |
-
<p>To download and extract Darkstalkers Resurrection from Internet Archive, you need to follow these steps:</p>
|
102 |
-
<ol>
|
103 |
-
<li>Create an Internet Archive account if you don't have one already.</li>
|
104 |
-
<li>Go to <a href="https://archive.org/details/darkstalkers-ressurection">the official page of Darkstalkers Resurrection</a> on Internet Archive.</li>
|
105 |
-
<li>Click on "DOWNLOAD OPTIONS" and select "RAR".</li>
|
106 |
-
<li>Download darkstalkers-ressurection.rar (4.7 GB) using your preferred download manager.</li>
|
107 |
-
<li>Extract darkstalkers-ressurection.rar using WinRAR or any other software that can handle RAR files.</li>
|
108 |
-
<li>You will get two files: DARKSTALKERS_RESSURECTION.iso (4.7 GB) and DARKSTALKERS_RESSURECTION.dvd (4 KB).</li>
|
109 |
-
</ol>
|
110 |
-
<p>To run Darkstalkers Resurrection on your PC using an emulator, you need to follow these steps:</p>
|
111 |
-
<ol>
|
112 |
-
<li>Download <a href="https://xenia.jp/">Xenia</a>, an emulator that can run Xbox 360 games on PC.</li>
|
113 |
-
<li>Extract xenia-master.zip (14 MB) using WinRAR or any other software that can handle ZIP files.</li>
|
114 |
-
<li>You will get a folder called xenia-master with several files inside it.</li>
|
115 |
-
the game select menu.</li>
|
116 |
-
<li>Select "Play Game" or "Online Play" from the game select menu.</li>
|
117 |
-
<li>Select "Arcade Mode" or "Versus Mode" from the game menu.</li>
|
118 |
-
<li>Select your character from the character select screen. You can also select a different color scheme by pressing different buttons.</li>
|
119 |
-
<li>Notice that some characters are different from their original versions in Night Warriors or Vampire Savior. For example, Morrigan has a new move called Soul Eraser, and Jedah has a new move called Prova di Servo.</li>
|
120 |
-
<li>Try out their new moves and see how they affect their gameplay and strategies.</li>
|
121 |
-
</ol>
|
122 |
-
<h2>Conclusion</h2>
|
123 |
-
<p>Darkstalkers is one of the most beloved and influential 2D fighting games of all time. It has a unique and diverse roster of characters, a fast and fluid gameplay system, and a dark and stylish aesthetic. If you want to experience this classic series on your PC, you have two options: buy Capcom Fighting Collection on Steam or download Darkstalkers Resurrection from Internet Archive.</p>
|
124 |
-
<p>Both options have their pros and cons, but they both allow you to play four titles from the Darkstalkers series: Darkstalkers: The Night Warriors, Night Warriors: Darkstalkers' Revenge, Vampire Savior: The Lord of Vampire, and Vampire Hunter 2: Darkstalkers' Revenge/Vampire Savior 2: The Lord of Vampire. You can also play online with other players and access the museum mode with hundreds of artworks and tracks from the games.</p>
|
125 |
-
<p>Whether you are a beginner or an expert, you can enjoy Darkstalkers on your PC by learning the basics and the advanced techniques of the gameplay. You can also master the unique abilities of each character and their variants by reading their profiles and trying out their moves. Darkstalkers is a game that rewards skill, creativity, and experimentation.</p>
|
126 |
-
<p>If you are ready to enter the world of Darkstalkers, don't hesitate to download Darkstalkers Collection on PC today. You won't regret it!</p>
|
127 |
-
<h2>FAQs</h2>
|
128 |
-
<ul>
|
129 |
-
<li><strong>Q: What is the difference between Vampire Savior and Darkstalkers 3?</strong></li>
|
130 |
-
<li>A: Vampire Savior is the original Japanese name of Darkstalkers 3. They are essentially the same game, except for some minor differences in localization and censorship.</li>
|
131 |
-
<li><strong>Q: How many characters are there in Darkstalkers?</strong></li>
|
132 |
-
<li>A: There are 18 playable characters (plus two secret ones) in Darkstalkers. They are: Anakaris, B.B. Hood, Bishamon, Demitri Maximoff, Donovan Baine, Felicia, Hsien-Ko, Huitzil, Jedah Dohma, Jon Talbain, Lilith, Lord Raptor, Morrigan Aensland, Pyron, Q-Bee, Rikuo, Sasquatch, and Victor von Gerdenheim.</li>
|
133 |
-
<li><strong>Q: Who is the strongest character in Darkstalkers?</strong></li>
|
134 |
-
<li>A: There is no definitive answer to this question, as different characters have different strengths and weaknesses. However, some of the characters that are generally considered to be very strong are Jedah Dohma, Q-Bee, Sasquatch, Morrigan Aensland, and B.B. Hood.</li>
|
135 |
-
<li><strong>Q: Who is the main protagonist of Darkstalkers?</strong></li>
|
136 |
-
<li>A: There is no clear-cut main protagonist of Darkstalkers, as each character has their own story and motivation. However, some of the characters that are more prominent in the plot and lore are Demitri Maximoff, Morrigan Aensland, Donovan Baine, Anita, Pyron, and Jedah Dohma.</li>
|
137 |
-
<li><strong>Q: Will there be a new Darkstalkers game?</strong></li>
|
138 |
-
<li>A: There is no official confirmation or announcement of a new Darkstalkers game as of now. However, there have been some hints and rumors that Capcom might be interested in reviving the series in the future. For example, in 2018 Capcom released a survey asking fans about their interest in various franchises including Darkstalkers. In 2020 Capcom registered new trademarks for several titles including Darkstalkers. In 2021 Capcom released a teaser trailer for Project Battle featuring Morrigan Aensland as one of the playable characters.</li>
|
139 |
-
</ul>
|
140 |
-
</p> 0a6ba089eb<br />
|
141 |
-
<br />
|
142 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download Update Kostum Pes 6 Menjadi Pes 13 Langkah-Langkah Instalasi dan Konfigurasi Update Jersey Terbaru untuk PES 6.md
DELETED
@@ -1,120 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>How to Download and Install the Latest Costume Update for PES 6 to PES 13</h1>
|
3 |
-
<h2>Introduction</h2>
|
4 |
-
<p>Pro Evolution Soccer (PES) is a popular soccer video game series that has been around since 2001. The game features realistic graphics, gameplay, and physics, as well as licensed teams, players, and stadiums from various leagues and competitions around the world.</p>
|
5 |
-
<p>One of the aspects that makes PES stand out from other soccer games is its customization options. You can edit and create your own teams, players, stadiums, logos, balls, boots, and more. You can also download and install updates and mods from other users that enhance or change various aspects of the game.</p>
|
6 |
-
<h2>download update kostum pes 6 menjadi pes 13</h2><br /><p><b><b>Download File</b> - <a href="https://byltly.com/2uKz1l">https://byltly.com/2uKz1l</a></b></p><br /><br />
|
7 |
-
<p>One of the most common updates that PES fans look for is costume updates. Costumes are the outfits that players wear on the field, such as jerseys, shorts, socks, gloves, etc. Costume updates change the appearance of these outfits to match the latest designs and trends of real-life soccer teams.</p>
|
8 |
-
<p>Updating costumes can make your game look more realistic and up-to-date. It can also make your game more fun and enjoyable by adding variety and diversity to your teams and players. You can choose from different styles, colors, patterns, logos, sponsors, etc.</p>
|
9 |
-
<p>In this article, we will show you how to download and install the latest costume update for PES 6 to PES 13. This update will transform your old PES 6 costumes into new PES 13 costumes. You will be able to play with updated costumes for over 200 teams from various leagues and competitions around the world.</p>
|
10 |
-
<p>Before we start, you will need some requirements for updating costumes. You will need:</p>
|
11 |
-
<ul>
|
12 |
-
<li>A PC with Windows XP or higher</li>
|
13 |
-
<li>A copy of PES 6 installed on your PC</li>
|
14 |
-
<li>An internet connection</li>
|
15 |
-
<li>A file extractor program such as WinRAR or 7-Zip</li>
|
16 |
-
<li>A file manager program such as Windows Explorer or Total Commander</li>
|
17 |
-
</ul>
|
18 |
-
<h2>How to Download the Update File</h2>
|
19 |
-
<p>The first step is to download the update file that contains the new costumes for PES 6. The update file is a large file that weighs about 1 GB. You can find it on various websites that offer PES 6 updates and mods.</p>
|
20 |
-
<p>One of these websites is tribe54.com. Tribe54.com is a community platform that allows users to share their passion for soccer games. You can find many updates and mods for different versions of PES on this website.</p>
|
21 |
-
<p>download patch pes 6 to pes 13 terbaru<br />
|
22 |
-
cara update jersey pes 6 ke pes 13 gratis<br />
|
23 |
-
download kitserver pes 6 update pes 13 full version<br />
|
24 |
-
tutorial mengubah tampilan pes 6 menjadi pes 13<br />
|
25 |
-
download option file pes 6 terbaru pes 13<br />
|
26 |
-
download stadium pes 6 update pes 13 hd<br />
|
27 |
-
cara install update kostum pes 6 ke pes 13<br />
|
28 |
-
download face and hair pes 6 update pes 13<br />
|
29 |
-
download game pes 6 mod pes 13 pc<br />
|
30 |
-
download sound pes 6 update pes 13<br />
|
31 |
-
download scoreboard pes 6 update pes 13<br />
|
32 |
-
download boots pes 6 update pes 13<br />
|
33 |
-
download balls pes 6 update pes 13<br />
|
34 |
-
download adboard pes 6 update pes 13<br />
|
35 |
-
download logo and emblem pes 6 update pes 13<br />
|
36 |
-
download master game pes 6 update pes 13<br />
|
37 |
-
download e_text and o_text pes 6 update pes 13<br />
|
38 |
-
download commentary and callname pes 6 update pes 13<br />
|
39 |
-
download menu and background pes 6 update pes 13<br />
|
40 |
-
download net and goalpost pes 6 update pes 13<br />
|
41 |
-
download player rating and ability pes 6 update pes 13<br />
|
42 |
-
download formation and tactics pes 6 update pes 13<br />
|
43 |
-
download referee and linesman pes 6 update pes 13<br />
|
44 |
-
download crowd and supporter pes 6 update pes 13<br />
|
45 |
-
download banner and flag pes 6 update pes 13<br />
|
46 |
-
download replay logo and animation pes 6 update pes 13<br />
|
47 |
-
download intro video and music pes 6 update pes 13<br />
|
48 |
-
download font and number style pes 6 update pes 13<br />
|
49 |
-
download league and cup name and logo pes 6 update pes 13<br />
|
50 |
-
download team name and logo and kitpespespespespespespespespespespespespespespespespespespespespespespespespespespesssssssssssssssssssssssssssssssssssssssssssssssss</p>
|
51 |
-
<p>To download the update file from tribe54.com, follow these steps:</p>
|
52 |
-
<ol>
|
53 |
-
<li>Go to <a href="https://www.tribe54.com/group/tribe-54-group/discussion/6801d39b-0a0d-4e5a-9f22-4714b562fe7f">this link</a>.</li>
|
54 |
-
<li>Click on the "Download" button at the bottom of the page.</li>
|
55 |
-
<li>Wait for a few seconds until a new page opens.</li>
|
56 |
-
<li>Click on the "Download" button again at the top right corner of the page.</li>
|
57 |
-
<li>Choose a location on your PC where you want to save the file.</li>
|
58 |
-
<li>Wait for the download to finish.</li>
|
59 |
-
</ol>
|
60 |
-
<p>Alternatively, you can also download the update file from other websites such as pes-patch.com or pesnewupdate.com. Just make sure you download the correct file that matches your version of PES 6.</p>
|
61 |
-
<p>After downloading the file, you should check its size and integrity. The file size should be around 1 GB. The file name should be "Update Kostum Pes 6 Menjadi Pes 13.rar". The file type should be RAR.</p>
|
62 |
-
<p>To check these details, you can right-click on the file icon and select "Properties". A window will pop up that shows you these information.</p>
|
63 |
-
<p>If everything looks fine, you can proceed to extract the file. If not, you may have downloaded a corrupted or incomplete file. In that case, you should delete it and try downloading it again from another source.</p>
|
64 |
-
<h2>How to Extract the File</h2>
|
65 |
-
<p>The next step is to extract the file that you have downloaded. The file is compressed in RAR format. This means that it contains multiple files inside it that are packed together to reduce its size.</p>
|
66 |
-
<p>To extract these files, you will need a file extractor program such as WinRAR or 7-Zip. These programs allow you to open and decompress RAR files easily.</p>
|
67 |
-
<p>To extract the file using WinRAR, follow these steps:</p>
|
68 |
-
<ol>
|
69 |
-
<li>Right-click on the file icon and select "Extract Here".</li>
|
70 |
-
<li>Wait for WinRAR to extract all files into a new folder named "Update Kostum Pes 6 Menjadi Pes 13".</li>
|
71 |
-
<li>Open this folder and check its contents. You should see several subfolders named "0_text", "e_text", "0_sound", etc., as well as some files named "PES6.exe", "settings.exe", etc.</li>
|
72 |
-
</ol>
|
73 |
-
<p>To extract using 7-Zip instead of WinRAR follow these steps:</p>
|
74 |
-
<ol>
|
75 |
-
<li>Right-click on file icon then select "7-Zip" then select "Extract Here".</li>
|
76 |
-
<li>Wait for 7-Zip extract all files into new folder named "Update Kostum Pes 6 Menjadi Pes 13".</li>
|
77 |
-
<li>Open this folder then check its contents same way as above.</li>
|
78 |
-
</ol>
|
79 |
-
<h2>How To Install The Update File</h2>
|
80 |
-
<p>The final step is install update file that you have extracted into your PES 6 folder. This will overwrite original files with new ones that contain updated costumes.</p>
|
81 |
-
<p>Before you do this though make sure backup your original files case something goes wrong or want revert back old costumes later.</p>
|
82 |
-
<p>To backup your original files follow these steps:</p>
|
83 |
-
<ol>
|
84 |
-
<li>Navigate your PES 6 folder where game installed on PC usually located at C:\Program Files\KONAMI\Pro Evolution Soccer 6\ .</li>
|
85 |
-
<li>Select all files folders inside then copy them another location PC such as Desktop Documents etc.</li>
|
86 |
-
<li>Rename copied folder something like "PES 6 Backup" so know what it is later.</li>
|
87 |
-
</ol>
|
88 |
-
<p>To install update file follow these steps:</p>
|
89 |
-
<ol>
|
90 |
-
<li>Navigate folder where extracted update file earlier named "Update Kostum Pes Menjadi Pes".</li>
|
91 |
-
<li>Select all files folders inside then copy them same location where game installed overwriting existing ones when prompted confirm replace .</li>
|
92 |
-
finish.</li>
|
93 |
-
<li>Run game enjoy new costumes.</li>
|
94 |
-
</ol>
|
95 |
-
<h2>Conclusion</h2>
|
96 |
-
<p>Congratulations! You have successfully downloaded and installed the latest costume update for PES 6 to PES 13. You can now play with updated costumes for over 200 teams from various leagues and competitions around the world.</p>
|
97 |
-
<p>Updating costumes can make your game look more realistic and up-to-date. It can also make your game more fun and enjoyable by adding variety and diversity to your teams and players. You can choose from different styles, colors, patterns, logos, sponsors, etc.</p>
|
98 |
-
<p>Here are some tips and tricks for using the update:</p>
|
99 |
-
<ul>
|
100 |
-
<li>You can change the language of the game by running the "settings.exe" file in your PES 6 folder and selecting your preferred language.</li>
|
101 |
-
<li>You can adjust the graphics, sound, and controller settings of the game by running the "settings.exe" file in your PES 6 folder and customizing your options.</li>
|
102 |
-
<li>You can switch between different camera angles and zoom levels by pressing the F5 key during gameplay.</li>
|
103 |
-
<li>You can pause the game by pressing the ESC key during gameplay.</li>
|
104 |
-
<li>You can take screenshots of the game by pressing the Print Screen key during gameplay. The screenshots will be saved in your PES 6 folder as BMP files.</li>
|
105 |
-
</ul>
|
106 |
-
<p>We hope you enjoyed this article and found it helpful. If you have any feedback or questions, please feel free to leave a comment below. We would love to hear from you!</p>
|
107 |
-
<h2>FAQs</h2>
|
108 |
-
<h3>Q: Can I use this update for other versions of PES?</h3>
|
109 |
-
<p>A: No, this update is only compatible with PES 6. If you try to use it for other versions of PES, you may encounter errors or bugs that may damage your game or PC.</p>
|
110 |
-
<h3>Q: Will this update affect my saved games or online play?</h3>
|
111 |
-
<p>A: No, this update only changes the appearance of the costumes, not the gameplay or data. Your saved games and online play will not be affected by this update.</p>
|
112 |
-
<h3>Q: What if I encounter any errors or bugs after installing the update?</h3>
|
113 |
-
<p>A: You can try to reinstall the update or restore your original files from the backup. If that does not work, you can contact the creator of the update or visit some websites and forums that offer support and solutions for PES 6 issues.</p>
|
114 |
-
<h3>Q: Where can I find more updates and mods for PES 6?</h3>
|
115 |
-
<p>A: You can visit some popular websites and forums that offer PES 6 updates and mods, such as pes-patch.com, pesnewupdate.com, or evo-web.co.uk. You can find updates and mods for various aspects of the game, such as teams, players, stadiums, balls, boots, logos, etc.</p>
|
116 |
-
<h3>Q: How can I create my own costumes for PES 6?</h3>
|
117 |
-
<p>A: You can use some tools and software that allow you to edit and create costumes for PES 6, such as Kitserver, GDB Manager, or Photoshop. You can find tutorials and guides on how to use these tools and software on some websites and forums that offer PES 6 updates and mods.</p>
|
118 |
-
</p> 0a6ba089eb<br />
|
119 |
-
<br />
|
120 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download manley massive passive eq plugin.rar 16 and master your tracks with the synthesis of the best passive equalizers of the last 70 years.md
DELETED
@@ -1,195 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Download manley massive passive eq plugin.rar 16: How to Get the Best Tube EQ for Mixing and Mastering</h1>
|
3 |
-
<p>If you are looking for a high-end tube EQ that can shape your tracks and masters with musical curves and unparalleled clarity, you might want to consider downloading manley massive passive eq plugin.rar 16. This is a plugin emulation of one of the most popular and sought-after passive EQs in the audio industry, the Manley Massive Passive EQ. In this article, we will explain what this EQ is, why you should download it, and how to use it effectively.</p>
|
4 |
-
<h2>What is Manley Massive Passive EQ?</h2>
|
5 |
-
<p>The Manley Massive Passive EQ is a two-channel, four-band tube EQ that was designed by Manley Labs in 1998. It is based on the design strengths of various classic EQs, such as console, parametric, graphic, and Pultec EQs. It uses only passive components, such as resistors, inductors, and capacitors, to create all frequency changes. This gives it a natural and organic sound that is different from active or digital EQs.</p>
|
6 |
-
<h2>Download manley massive passive eq plugin.rar 16</h2><br /><p><b><b>Download</b> ✸ <a href="https://byltly.com/2uKxF8">https://byltly.com/2uKxF8</a></b></p><br /><br />
|
7 |
-
<h3>The history and features of the hardware EQ</h3>
|
8 |
-
<p>The Manley Massive Passive EQ was created by EveAnna Manley and Hutch Hutchison, who wanted to make a versatile and musical EQ that could handle any source material. They combined elements from different types of EQs, such as shelving filters, bell curves, resonant filters, and cut filters. They also added some unique features, such as:</p>
|
9 |
-
<ul>
|
10 |
-
<li>The ability to switch between two modes: standard and mastering. The standard mode offers continuous bandwidth adjustment, while the mastering mode offers 16 steps of recallable bandwidth selections.</li>
|
11 |
-
<li>The ability to switch between two filter types: normal and bandpass. The normal type offers a conventional boost or cut response, while the bandpass type offers a narrower and steeper response that can create resonant peaks or notches.</li>
|
12 |
-
<li>The ability to switch between two curves: bell and shelf. The bell curve offers a symmetrical boost or cut around a center frequency, while the shelf curve offers an asymmetrical boost or cut that affects all frequencies above or below a corner frequency.</li>
|
13 |
-
<li>The ability to switch between two phases: normal and reverse. The normal phase offers a positive phase response that preserves the original phase relationships of the signal, while the reverse phase offers a negative phase response that flips the phase relationships of the signal.</li>
|
14 |
-
</ul>
|
15 |
-
<p>All these features allow the user to create complex and musical EQ shapes that can enhance or transform any sound source.</p>
|
16 |
-
<h3>The benefits and drawbacks of the hardware EQ</h3>
|
17 |
-
<p>The Manley Massive Passive EQ has been praised by many engineers and producers for its sound quality, flexibility, and character. Some of the benefits of using this hardware EQ are:</p>
|
18 |
-
<ul>
|
19 |
-
<li>It can add warmth, color, and harmonics to the signal due to its tube circuitry and transformer-coupled output.</li>
|
20 |
-
<li>It can create smooth and natural frequency changes due to its passive components and gentle filter slopes.</li>
|
21 |
-
<li>It can handle high levels of input without clipping or distorting due to its high headroom and low noise.</li>
|
22 |
-
<li>It can interact with other bands in a musical way due to its interdependent gain and bandwidth controls.</li>
|
23 |
-
</ul>
|
24 |
-
<p>However, like any hardware device, it also has some drawbacks that might limit its usability or availability. Some of these drawbacks are:</p>
|
25 |
-
<ul>
|
26 |
-
<li>It is expensive and rare to find due to its high-quality components and craftsmanship.</li>
|
27 |
-
<li>It is large and heavy due to its dual-mono design and robust chassis.</li>
|
28 |
-
<li>It requires maintenance and calibration due to its tube components and sensitive controls.</li>
|
29 |
-
<li>It has limited recallability due to its analog nature and stepped controls.</li>
|
30 |
-
</ul>
|
31 |
-
<p>These drawbacks might make it difficult or impractical for some users to own or use this hardware EQ in their studios or projects.</p>
|
32 |
-
<h3>The official UAD plugin emulation of the hardware EQ</h3>
|
33 |
-
<p>To address these drawbacks and make this hardware EQ more accessible and convenient for users, Universal Audio (UAD) developed an official plugin emulation of the Manley Massive Passive EQ in 2010. This plugin was modeled by UAD engineers with the help of Manley Labs, who provided them with schematics, measurements, samples, and feedback. The plugin captures every aspect of the hardware's behavior, from its unique filter curves, to its multiple band interdependencies, right down to the tube amplifier distortion, and all-important transformer/inductor hysteresis. <h2>Why download manley massive passive eq plugin.rar 16?</h2>
|
34 |
-
<p>Downloading manley massive passive eq plugin.rar 16 is a great way to get the best of both worlds: the sound of the hardware EQ and the convenience of the plugin format. Here are some reasons why you should download this plugin:</p>
|
35 |
-
<h3>The advantages of using the plugin version over the hardware version</h3>
|
36 |
-
<p>While the hardware version of the Manley Massive Passive EQ is undoubtedly a masterpiece of audio engineering, it also has some limitations that might make it less suitable for some users or situations. The plugin version, on the other hand, offers some advantages that can overcome these limitations, such as:</p>
|
37 |
-
<p>How to install manley massive passive eq plugin.rar 16<br />
|
38 |
-
Manley massive passive eq plugin.rar 16 free download link<br />
|
39 |
-
Manley massive passive eq plugin.rar 16 crack file<br />
|
40 |
-
Manley massive passive eq plugin.rar 16 tutorial video<br />
|
41 |
-
Manley massive passive eq plugin.rar 16 review and rating<br />
|
42 |
-
Manley massive passive eq plugin.rar 16 compatible software<br />
|
43 |
-
Manley massive passive eq plugin.rar 16 license key generator<br />
|
44 |
-
Manley massive passive eq plugin.rar 16 user manual pdf<br />
|
45 |
-
Manley massive passive eq plugin.rar 16 best settings and presets<br />
|
46 |
-
Manley massive passive eq plugin.rar 16 comparison with other plugins<br />
|
47 |
-
Manley massive passive eq plugin.rar 16 discount code and coupon<br />
|
48 |
-
Manley massive passive eq plugin.rar 16 troubleshooting and support<br />
|
49 |
-
Manley massive passive eq plugin.rar 16 features and benefits<br />
|
50 |
-
Manley massive passive eq plugin.rar 16 testimonials and feedback<br />
|
51 |
-
Manley massive passive eq plugin.rar 16 alternatives and competitors<br />
|
52 |
-
Manley massive passive eq plugin.rar 16 system requirements and specifications<br />
|
53 |
-
Manley massive passive eq plugin.rar 16 update and upgrade<br />
|
54 |
-
Manley massive passive eq plugin.rar 16 refund policy and guarantee<br />
|
55 |
-
Manley massive passive eq plugin.rar 16 demo and trial version<br />
|
56 |
-
Manley massive passive eq plugin.rar 16 tips and tricks<br />
|
57 |
-
Manley massive passive eq plugin.rar 16 pros and cons<br />
|
58 |
-
Manley massive passive eq plugin.rar 16 history and background<br />
|
59 |
-
Manley massive passive eq plugin.rar 16 FAQs and answers<br />
|
60 |
-
Manley massive passive eq plugin.rar 16 forum and community<br />
|
61 |
-
Manley massive passive eq plugin.rar 16 blog and news<br />
|
62 |
-
Manley massive passive eq plugin.rar 16 affiliate program and commission<br />
|
63 |
-
Manley massive passive eq plugin.rar 16 case studies and success stories<br />
|
64 |
-
Manley massive passive eq plugin.rar 16 awards and recognition<br />
|
65 |
-
Manley massive passive eq plugin.rar 16 webinar and training<br />
|
66 |
-
Manley massive passive eq plugin.rar 16 podcast and interview<br />
|
67 |
-
Manley massive passive eq plugin.rar 16 ebook and guide<br />
|
68 |
-
Manley massive passive eq plugin.rar 16 course and certification<br />
|
69 |
-
Manley massive passive eq plugin.rar 16 infographic and chart<br />
|
70 |
-
Manley massive passive eq plugin.rar 16 checklist and template<br />
|
71 |
-
Manley massive passive eq plugin.rar 16 cheat sheet and summary<br />
|
72 |
-
Manley massive passive eq plugin.rar 16 glossary and terminology<br />
|
73 |
-
Manley massive passive eq plugin.rar 16 calculator and tool<br />
|
74 |
-
Manley massive passive eq plugin.rar 16 quiz and survey<br />
|
75 |
-
Manley massive passive eq plugin.rar 16 meme and joke<br />
|
76 |
-
Manley massive passive eq plugin.rar 16 wallpaper and screensaver</p>
|
77 |
-
<ul>
|
78 |
-
<li>It is more affordable and accessible than the hardware version, which costs thousands of dollars and is hard to find.</li>
|
79 |
-
<li>It is more portable and flexible than the hardware version, which requires a lot of space and power.</li>
|
80 |
-
<li>It is more consistent and reliable than the hardware version, which can vary in sound quality and performance due to aging or environmental factors.</li>
|
81 |
-
<li>It is more versatile and scalable than the hardware version, which can only process two channels at a time.</li>
|
82 |
-
<li>It is more compatible and integrable than the hardware version, which requires additional hardware and cables to connect to your audio system.</li>
|
83 |
-
</ul>
|
84 |
-
<p>These advantages make the plugin version more suitable for users who want to use the Manley Massive Passive EQ in different settings, such as home studios, mobile rigs, or live performances.</p>
|
85 |
-
<h3>The compatibility and requirements of the plugin version</h3>
|
86 |
-
<p>The plugin version of the Manley Massive Passive EQ is available for both Windows and Mac operating systems. It supports VST, AU, AAX, and RTAS plugin formats. It can be used in any DAW that supports these formats, such as Pro Tools, Logic Pro, Cubase, Ableton Live, FL Studio, Reaper, etc. However, there are some requirements that you need to meet in order to use this plugin:</p>
|
87 |
-
<ul>
|
88 |
-
<li>You need to have a UAD account and a UAD device (such as an Apollo interface or a UAD-2 card) to run this plugin. This is because this plugin uses UAD's proprietary DSP technology to emulate the hardware EQ with high accuracy and low latency.</li>
|
89 |
-
<li>You need to have enough DSP power on your UAD device to run this plugin. This plugin consumes a lot of DSP resources due to its complex modeling algorithms. Depending on your UAD device model and configuration, you might be able to run only one or a few instances of this plugin at a time.</li>
|
90 |
-
<li>You need to have enough disk space on your computer to install this plugin. This plugin requires about 300 MB of disk space for installation.</li>
|
91 |
-
</ul>
|
92 |
-
<p>These requirements might make it difficult or impossible for some users to use this plugin if they don't have a UAD device or enough DSP power or disk space.</p>
|
93 |
-
<h3>The best sources and methods to download the plugin version</h3>
|
94 |
-
<p>If you meet the requirements and want to download manley massive passive eq plugin.rar 16 , you have a few options to choose from. Here are some of the best sources and methods to download this plugin:</p>
|
95 |
-
<h3>The official UAD website</h3>
|
96 |
-
<p>The most reliable and secure way to download manley massive passive eq plugin.rar 16 is to get it from the official UAD website. This way, you can be sure that you are getting the latest and most authentic version of the plugin, as well as the best customer support and updates. To download the plugin from the UAD website, you need to follow these steps:</p>
|
97 |
-
<ol>
|
98 |
-
<li>Log into your UAD account or create one if you don't have one already.</li>
|
99 |
-
<li>Go to the Manley Massive Passive EQ product page and click on the "Add to Cart" button.</li>
|
100 |
-
<li>Proceed to checkout and complete your payment. The plugin costs $299, but you might be able to get it for a lower price if there is a promotion or a coupon available.</li>
|
101 |
-
<li>After your payment is confirmed, go to the "My Products" section of your account and click on the "Download" button for the plugin.</li>
|
102 |
-
<li>Save the file to your computer and open it to start the installation process.</li>
|
103 |
-
<li>Follow the instructions on the screen to install the plugin and authorize it with your UAD device.</li>
|
104 |
-
</ol>
|
105 |
-
<p>Note: You can also download a 14-day free trial of the plugin from the UAD website if you want to test it before buying it.</p>
|
106 |
-
<h3>The torrent websites</h3>
|
107 |
-
<p>Another way to download manley massive passive eq plugin.rar 16 is to use torrent websites. These are websites that allow users to share files with each other using a peer-to-peer network. Torrent websites can offer some advantages over the official UAD website, such as:</p>
|
108 |
-
<ul>
|
109 |
-
<li>They can provide faster download speeds due to multiple sources of the file.</li>
|
110 |
-
<li>They can offer free access to the plugin without paying for it.</li>
|
111 |
-
<li>They can have older or modified versions of the plugin that might suit your preferences better.</li>
|
112 |
-
</ul>
|
113 |
-
<p>However, torrent websites also have some disadvantages and risks that you should be aware of, such as:</p>
|
114 |
-
<ul>
|
115 |
-
<li>They can be illegal or unethical depending on your location and the copyright laws.</li>
|
116 |
-
<li>They can be unsafe or harmful due to viruses, malware, or spyware that might be hidden in the file.</li>
|
117 |
-
<li>They can be unreliable or incompatible due to corrupted, incomplete, or outdated files.</li>
|
118 |
-
<li>They can be unsupported or unupdated due to lack of customer service or official updates from UAD.</li>
|
119 |
-
</ul>
|
120 |
-
<p>If you decide to use torrent websites to download manley massive passive eq plugin.rar 16, you need to follow these steps:</p>
|
121 |
-
<ol>
|
122 |
-
<li>Find a reputable and trustworthy torrent website that has the file you are looking for. Some of the most popular torrent websites are The Pirate Bay, 1337x, RARBG, etc.</li>
|
123 |
-
<li>Search for "manley massive passive eq plugin.rar 16" on the website and look for a file that has a high number of seeders (sources) and leechers (downloaders), as well as positive comments and ratings from other users.</li>
|
124 |
-
<li>Download a torrent client software that can open and manage torrent files. Some of the most popular torrent clients are uTorrent, BitTorrent, qBittorrent, etc.</li>
|
125 |
-
<li>Open the torrent file with your torrent client and choose a location to save the file on your computer.</li>
|
126 |
-
<li>Wait for the download to finish and then open the file to start the installation process.</li>
|
127 |
-
<li>Follow the instructions on the screen to install the plugin and crack it if necessary.</li>
|
128 |
-
</ol>
|
129 |
-
<p>Note: You might need a VPN service or a proxy server to access some torrent websites or files if they are blocked or restricted in your location.</p>
|
130 |
-
<h2>How to use manley massive passive eq plugin.rar 16 effectively?</h2>
|
131 |
-
<p>Now that you have downloaded manley massive passive eq plugin.rar 16 , you might be wondering how to use it effectively. The Manley Massive Passive EQ plugin is a powerful and versatile tool that can help you shape your sounds in various ways. However, it also requires some knowledge and skill to use it properly. Here are some tips and tricks on how to use manley massive passive eq plugin.rar 16 effectively:</p>
|
132 |
-
<h3>The basic controls and functions of the plugin</h3>
|
133 |
-
<p>The plugin interface of the Manley Massive Passive EQ is very similar to the hardware version, except for some minor differences. The plugin has two channels: left and right. Each channel has four bands: low, low-mid, high-mid, and high. Each band has four controls: frequency, gain, bandwidth, and filter type. There are also some global controls: input level, output level, phase invert, link mode, and bypass.</p>
|
134 |
-
<p>The frequency control allows you to select the center or corner frequency of each band. You can choose from 11 fixed frequencies for each band, ranging from 22 Hz to 27 kHz. The gain control allows you to boost or cut the selected frequency by up to 20 dB. The bandwidth control allows you to adjust the width or slope of the filter curve. You can choose from 5 fixed values for each band, ranging from narrow to wide. The filter type control allows you to switch between two modes: normal and bandpass. The normal mode offers a conventional boost or cut response, while the bandpass mode offers a narrower and steeper response that can create resonant peaks or notches.</p>
|
135 |
-
<p>The input level control allows you to adjust the level of the incoming signal before it reaches the EQ section. You can boost or attenuate the input level by up to 12 dB. The output level control allows you to adjust the level of the outgoing signal after it passes through the EQ section. You can boost or attenuate the output level by up to 12 dB. The phase invert control allows you to flip the polarity of the signal for each channel. This can help you correct phase issues or create interesting effects. The link mode control allows you to link the left and right channels for stereo operation. You can choose from three modes: off, L/R, and M/S. The off mode allows you to adjust each channel independently. The L/R mode allows you to adjust both channels simultaneously with the same settings. The M/S mode allows you to adjust the mid and side signals separately with different settings. The bypass control allows you to bypass the EQ section for each channel. This can help you compare the processed and unprocessed signals.</p>
|
136 |
-
<h3>The tips and tricks to get the most out of the plugin</h3>
|
137 |
-
<p>The Manley Massive Passive EQ plugin is a very flexible and musical EQ that can be used for various purposes and genres. However, it also has some quirks and characteristics that you need to be aware of and take advantage of. Here are some tips and tricks to get the most out of this plugin:</p>
|
138 |
-
<ul>
|
139 |
-
<li>Use the standard version for mixing and the mastering version for mastering. The standard version offers continuous bandwidth adjustment, while the mastering version offers 16 steps of recallable bandwidth selections. The standard version is more suitable for fine-tuning individual tracks or buses, while the mastering version is more suitable for applying broad strokes to a final mix or master.</li>
|
140 |
-
<li>Use the normal filter type for subtle or transparent changes and the bandpass filter type for drastic or creative changes. The normal filter type offers a conventional boost or cut response that preserves the natural tone of the signal, while the bandpass filter type offers a narrower and steeper response that alters the tone of the signal significantly.</li>
|
141 |
-
<li>Use the bell curve for precise or surgical changes and the shelf curve for broad or gentle changes. The bell curve offers a symmetrical boost or cut around a center frequency that affects only a specific range of frequencies, while the shelf curve offers an asymmetrical boost or cut that affects all frequencies above or below a corner frequency.</li>
|
142 |
-
<li>Use the normal phase for clean or accurate changes and the reverse phase for dirty or experimental changes. The normal phase offers a clean and accurate response that preserves the original phase relationships of the signal, while the reverse phase offers a dirty and experimental response that flips the phase relationships of the signal.</li>
|
143 |
-
<li>Use the link mode to process stereo or mid/side signals. The link mode allows you to process stereo or mid/side signals with different settings for each channel. You can use the L/R mode to process stereo signals with the same settings for both channels, or use the M/S mode to process mid/side signals with different settings for each channel.</li>
|
144 |
-
<li>Use the input and output level controls to balance the gain staging. The input and output level controls allow you to adjust the level of the signal before and after the EQ section. You can use these controls to balance the gain staging and avoid clipping or losing headroom.</li>
|
145 |
-
</ul>
|
146 |
-
<h3>The examples and presets of using the plugin on different sources</h3>
|
147 |
-
<p>The Manley Massive Passive EQ plugin can be used on different sources, such as vocals, drums, guitars, bass, keyboards, synths, etc. Depending on the source and the desired result, you can use different settings and techniques to achieve various effects. Here are some examples and presets of using the plugin on different sources:</p>
|
148 |
-
<h4>Vocals</h4>
|
149 |
-
<p>The Manley Massive Passive EQ plugin can be used to enhance or correct vocals in various ways. You can use it to add warmth, presence, brightness, airiness, or smoothness to vocals. You can also use it to remove harshness, sibilance, muddiness, or boominess from vocals. Here are some presets for vocal processing:</p>
|
150 |
-
<table>
|
151 |
-
<tr>
|
152 |
-
<th>Preset Name</th>
|
153 |
-
<th>Description</th>
|
154 |
-
<th>Settings</th>
|
155 |
-
</tr>
|
156 |
-
<tr>
|
157 |
-
<td>Vocal Warmth</td>
|
158 |
-
<td>This preset adds some warmth and body to vocals by boosting some low-mid frequencies.</td>
|
159 |
-
<td>Low band: 220 Hz / +6 dB / wide / normal / bell<br>Low-mid band: 390 Hz / +3 dB / wide / normal / bell<br>High-mid band: off<br>High band: off</td>
|
160 |
-
</tr>
|
161 |
-
<tr>
|
162 |
-
<td>Vocal Presence</td>
|
163 |
-
<td>This preset adds some presence and clarity to vocals by boosting some high-mid frequencies.</td>
|
164 |
-
<td>Low band: off<br>Low-mid band: off<br>High-mid band: 3.9 kHz / +6 dB / narrow / normal / bell<br>High band: off</td>
|
165 |
-
</tr>
|
166 |
-
<tr>
|
167 |
-
<td>Vocal Brightness</td>
|
168 |
-
<td>This preset adds some brightness and sparkle to vocals by boosting some high frequencies.</td>
|
169 |
-
<td>Low band: off<br>Low-mid band: off<br>High-mid band: off<br>High band: 16 kHz / +6 dB / wide / normal / shelf</td>
|
170 |
-
</tr>
|
171 |
-
<tr>
|
172 |
-
<td>Vocal Airiness</td>
|
173 |
-
<td>This preset adds some airiness and openness to vocals by boosting some very high frequencies.</td>
|
174 |
-
<td>Low band: off<br>Low-mid band: off<br>High-mid band: off<br>High band: 27 kHz / +6 dB / wide / normal / shelf</td>
|
175 |
-
</tr>
|
176 |
-
<tr>
|
177 |
-
<td>Vocal Smoothness</td>
|
178 |
-
<td>This preset adds some smoothness and silkiness to vocals by cutting some harsh frequencies.</td>
|
179 |
-
<td>Low band: off<br>Low-mid band: 1.5 kHz / -6 dB / narrow / normal / bell<br>High-mid band: 6.8 kHz / -6 dB / narrow / normal / bell<br>High band: off</td>
|
180 |
-
</tr>
|
181 |
-
<tr>
|
182 |
-
<td>Vocal De-Esser</td>
|
183 |
-
<td>This preset reduces sibilance and harshness from vocals by cutting some high frequencies with a bandpass filter.</td>
|
184 |
-
<td>Low band: off<br>Low-mid band: off<br>High-mid band: 8.2 kHz / -12 dB / narrow / bandpass / bell<br>High band: off</td>
|
185 |
-
</tr>
|
186 |
-
<tr>
|
187 |
-
<td>Vocal De-Mud</td>
|
188 |
-
<td>This preset removes muddiness and boominess from vocals by cutting some low frequencies with a shelf filter.</td>
|
189 |
-
<td>Low band: 82 Hz / -12 dB / wide / normal / shelf<br>Low-mid band: off<br>High-mid band: off<br>High band: off</td>
|
190 |
-
</tr>
|
191 |
-
<tr>
|
192 |
-
<td>Vocal De-Boom</td>
|
193 |
-
<td>This preset removes boominess and plosives from vocals by cutting some low frequencies with a bell filter.</td></p> 0a6ba089eb<br />
|
194 |
-
<br />
|
195 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Forex Hacked Pro Free Download ((LINK)).md
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Forex Hacked Pro Free Download: A Powerful EA for Scalping and Hedging</h1>
|
3 |
-
<p>Forex Hacked Pro is an expert advisor (EA) that can help you make money from forex trading. It is designed for the MetaTrader 4 platform and works with any broker that supports it. Forex Hacked Pro can perform various tasks such as flashing, unlocking, and repairing your forex account. It can also remove FRP lock, reset locks, enable diag mode, and more on your forex account. In this article, we will show you how to download Forex Hacked Pro for free and how to use it to boost your forex profits.</p>
|
4 |
-
<h2>forex hacked pro free download</h2><br /><p><b><b>Download</b> ->>->>->> <a href="https://byltly.com/2uKyu4">https://byltly.com/2uKyu4</a></b></p><br /><br />
|
5 |
-
<h2>What is Forex Hacked Pro?</h2>
|
6 |
-
<p>Forex Hacked Pro is a modified version of the original Forex Hacked EA that was released in 2009. It has more features and options than the basic version, such as the ability to trade on multiple currency pairs, use different strategies, and optimize the settings for each pair. Forex Hacked Pro uses a combination of martingale and hedging techniques to increase the chances of winning trades. It also has a built-in news filter that avoids trading during high-impact news events. Forex Hacked Pro is a very profitable EA, but it also comes with a high risk of losing your account if not used properly. Therefore, it is recommended to use it with caution and withdraw your profits regularly.</p>
|
7 |
-
<h2>How to Download Forex Hacked Pro for Free?</h2>
|
8 |
-
<p>You can download Forex Hacked Pro for free from various websites that offer cracked versions of the EA. However, these versions may not be reliable or safe to use, as they may contain viruses, malware, or hidden codes that can harm your computer or forex account. Therefore, it is better to download Forex Hacked Pro from the official website of Forex Hacked, where you can get the latest and updated version of the EA for a one-time fee of $329.99. This fee includes both the basic and pro versions of Forex Hacked, as well as lifetime support and updates. You can also get access to the members area where you can find detailed guides, tutorials, and optimized settings for each currency pair.</p>
|
9 |
-
<h2>How to Use Forex Hacked Pro?</h2>
|
10 |
-
<p>To use Forex Hacked Pro, you need to follow these steps:</p>
|
11 |
-
<p></p>
|
12 |
-
<ol>
|
13 |
-
<li>Install MetaTrader 4 on your computer and create an account with a broker that supports MT4.</li>
|
14 |
-
<li>Download Forex Hacked Pro from the official website or any other source that you trust.</li>
|
15 |
-
<li>Extract the zip file and copy the Forex Hacked Pro.ex4 file to the Experts folder of your MT4 installation directory.</li>
|
16 |
-
<li>Copy the .set files for each currency pair that you want to trade to the Presets folder of your MT4 installation directory.</li>
|
17 |
-
<li>Connect your MT4 account to your broker and make sure you have enough balance to trade.</li>
|
18 |
-
<li>Open MT4 and go to Tools > Options > Expert Advisors. Check the boxes that allow automated trading and DLL imports.</li>
|
19 |
-
<li>Go to the Navigator window and drag the Forex Hacked Pro EA to the chart of the currency pair that you want to trade.</li>
|
20 |
-
<li>A pop-up window will appear with the input parameters of the EA. You can either use the default settings or load the .set file for that pair from the Presets folder.</li>
|
21 |
-
<li>Click OK and make sure there is a smiley face on the top right corner of the chart. This means that the EA is activated and ready to trade.</li>
|
22 |
-
</ol>
|
23 |
-
<p>You have successfully installed and activated Forex Hacked Pro on your MT4 account. Now you can sit back and watch it trade for you.</p>
|
24 |
-
<h2>Tips and Warnings</h2>
|
25 |
-
<ul>
|
26 |
-
<li>Forex Hacked Pro is a high-risk EA that can double your account in a short time but also wipe it out if not used carefully. Therefore, it is advisable to use it with a small lot size, a low leverage, and a stop loss.</li>
|
27 |
-
<li>Forex Hacked Pro works best on EURUSD, GBPUSD, EURCHF, USDCHF, EURJPY, USDJPY, EURGBP, AUDUSD, and USDCAD pairs. You can use it on any time frame but H1 and M15 are recommended.</li>
|
28 |
-
<li>Forex Hacked Pro is not a plug-and-play EA</p> ddb901b051<br />
|
29 |
-
<br />
|
30 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/HD Online Player (Chhota Bheem And The Throne Of Bali ) Experience the Magic and Mystery of Bali with Bheem and Arjun.md
DELETED
@@ -1,81 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Chhota Bheem and the Throne of Bali: A Fun-Filled Adventure for Kids</h1>
|
3 |
-
<p>Do you love watching animated movies that take you to a different world? Do you enjoy following the adventures of brave heroes who fight evil villains? Do you like laughing at hilarious jokes and singing along to catchy songs? If you answered yes to any of these questions, then you will love <strong>Chhota Bheem and the Throne of Bali</strong>, a movie that has all these elements and more.</p>
|
4 |
-
<h2>HD Online Player (Chhota Bheem And The Throne Of Bali )</h2><br /><p><b><b>DOWNLOAD</b> ↔ <a href="https://byltly.com/2uKx67">https://byltly.com/2uKx67</a></b></p><br /><br />
|
5 |
-
<p><strong>Chhota Bheem and the Throne of Bali</strong> is a 2013 Indian animated film based on the popular TV series <strong>Chhota Bheem</strong>. It is the sixteenth movie in the series and the second one to be released in theatres. It tells the story of how Chhota Bheem, a young boy with superhuman strength, and his friends go to Bali to attend a coronation ceremony, but end up saving the island from an evil witch named Rangda. It is a movie that will keep you entertained from start to finish with its thrilling action, charming characters, beautiful scenery, and heartwarming message.</p>
|
6 |
-
<p>Why is <strong>Chhota Bheem and the Throne of Bali</strong> a good movie for kids? Because it is not only fun to watch, but also educational. It teaches kids about a different culture, history, mythology, and geography. It also teaches them important values such as friendship, courage, loyalty, honesty, and respect. It is a movie that will make kids laugh, cry, cheer, and learn.</p>
|
7 |
-
<h2>The Story of Chhota Bheem and the Throne of Bali</h2>
|
8 |
-
<h3>The Invitation from Bali</h3>
|
9 |
-
<p>The movie begins with Chhota Bheem and his friends Chutki, Raju, Jaggu, Kalia, Dholu, and Bholu living happily in their village Dholakpur. One day, they receive an invitation from King Indravarma's nephew Arjun, who is going to be crowned as the prince of Bali. They are excited to go to Bali and meet Arjun.</p>
|
10 |
-
<p>They board a ship with King Indravarma and sail to Bali. On their way, they encounter a storm that almost sinks their ship. But thanks to Bheem's strength and bravery, they manage to reach Bali safely. There they are welcomed by Arjun's uncle Rajguru Bahula, who is a wise scholar.</p>
|
11 |
-
<p>Bheem and his friends are amazed by the beauty and culture of Bali. They see temples, statues, dances, festivals, food, animals, plants, and people. They also meet Arjun who is friendly and kind. They become good friends with him.</p>
|
12 |
-
<h3>The Attack of Rangda</h3>
|
13 |
-
<p>However, their happiness is short-lived. On the day of Arjun's coronation ceremony, Rangda attacks Bali with her army of Leyaks. Leyaks are magical creatures that can fly, shape-shift, cast spells, and cause havoc. Rangda is an evil witch who wants to rule over Bali.</p>
|
14 |
-
<p>Rangda captures King Indravarma's ship along with most of his soldiers. She also imprisons Arjun's parents King Agung Prabu Sakti Wira Kertha Wisesa Adi Prabu Agung Ngurah Rai Wira Nagara Ida Dalem Di Made Karangasem III (phew!) And Queen Dewi Sita in her palace. She tries to kill Arjun too but he escapes with Bheem's help.</p>
|
15 |
-
<p>Watch Chhota Bheem And The Throne Of Bali online in HD quality<br />
|
16 |
-
Chhota Bheem And The Throne Of Bali full movie streaming online<br />
|
17 |
-
How to download Chhota Bheem And The Throne Of Bali HD movie for free<br />
|
18 |
-
Chhota Bheem And The Throne Of Bali HD video player for PC<br />
|
19 |
-
Best sites to watch Chhota Bheem And The Throne Of Bali online<br />
|
20 |
-
Chhota Bheem And The Throne Of Bali movie review and ratings<br />
|
21 |
-
Chhota Bheem And The Throne Of Bali HD wallpapers and images<br />
|
22 |
-
Chhota Bheem And The Throne Of Bali movie songs and lyrics<br />
|
23 |
-
Chhota Bheem And The Throne Of Bali cast and crew details<br />
|
24 |
-
Chhota Bheem And The Throne Of Bali trivia and facts<br />
|
25 |
-
Chhota Bheem And The Throne Of Bali behind the scenes and making of<br />
|
26 |
-
Chhota Bheem And The Throne Of Bali movie merchandise and toys<br />
|
27 |
-
Chhota Bheem And The Throne Of Bali games and activities online<br />
|
28 |
-
Chhota Bheem And The Throne Of Bali book and comic adaptation<br />
|
29 |
-
Chhota Bheem And The Throne Of Bali sequel and spin-off news<br />
|
30 |
-
Chhota Bheem And The Throne Of Bali fan art and videos<br />
|
31 |
-
Chhota Bheem And The Throne Of Bali movie quotes and dialogues<br />
|
32 |
-
Chhota Bheem And The Throne Of Bali movie awards and nominations<br />
|
33 |
-
Chhota Bheem And The Throne Of Bali movie tickets and showtimes<br />
|
34 |
-
Chhota Bheem And The Throne Of Bali movie subtitles and dubbing<br />
|
35 |
-
Chhota Bheem And The Throne Of Bali movie plot and summary<br />
|
36 |
-
Chhota Bheem And The Throne Of Bali movie genre and audience<br />
|
37 |
-
Chhota Bheem And The Throne Of Bali movie budget and box office collection<br />
|
38 |
-
Chhota Bheem And The Throne Of Bali movie release date and country<br />
|
39 |
-
Chhota Bheem And The Throne Of Bali movie trailer and teaser<br />
|
40 |
-
Chhota Bheem And The Throne Of Bali HD online player for Android<br />
|
41 |
-
Chhota Bheem And The Throne Of Bali HD online player for iOS<br />
|
42 |
-
Chhota Bheem And The Throne Of Bali HD online player for Mac<br />
|
43 |
-
Chhota Bheem And The Throne Of Bali HD online player for Linux<br />
|
44 |
-
Chhota Bheem And The Throne Of Bali HD online player for Windows<br />
|
45 |
-
Chhota Bheem And The Throne Of Bali HD online player for Chromebook<br />
|
46 |
-
Chhota Bheem And The Throne Of Bali HD online player for Smart TV<br />
|
47 |
-
Chhota Bheem And The Throne Of Bali HD online player for Roku<br />
|
48 |
-
Chhota Bheem And The Throne Of Bali HD online player for Firestick<br />
|
49 |
-
Chhota Bheem And The Throne Of Bali HD online player for Xbox One<br />
|
50 |
-
Chhota Bheem And The Throne Of Bali HD online player for PS4<br />
|
51 |
-
Chhota Bheem And The Throne Of Bali HD online player for Nintendo Switch<br />
|
52 |
-
Chhota Bheem And The Throne Of Bali HD online player for VR headset<br />
|
53 |
-
Chhota Beh</p>
|
54 |
-
<p>Bheem and his friends run away from Rangda's Leyaks. They hide in a village where they meet two girls named Aci And Ayu who are sisters. They offer them shelter And food And tell them about Rangda's history And power.</p>
|
55 |
-
<h3>The Quest for Barong</h3>
|
56 |
-
<p>Bheem learns that there is only one way to defeat Rangda And that is by getting Barong's blessing And power. Barong is The supreme god Of Bali who protects The island from evil forces. He lives in The sacred mountain Of Agung where only The pure Of heart can reach him.</p>
|
57 |
-
<p>Bheem decides To go To find Barong And ask for his help To save Bali. He takes Aci And Ayu with him as they know The way To The mountain. He leaves his friends behind To take care Of Arjun And Rajguru Bahula.</p>
|
58 |
-
<p>Bheem faces many challenges And dangers on The way To Barong. He encounters wild animals such as tigers And snakes; natural obstacles such as rivers And cliffs; And supernatural enemies such as ghosts And demons. He also meets some friendly creatures such as monkeys And birds who help him along The way.</p>
|
59 |
-
<h3>The Final Battle</h3>
|
60 |
-
<p>Bheem finally reaches Barong's temple where he meets The god himself. Barong is impressed by Bheem's courage And purity And grants him his blessing And power. He gives him a magical sword called Kris that can cut through anything And a magical shield called Perisai that can protect him from anything.</p>
|
61 |
-
<p>Bheem returns To The village where he reunites with his friends And Arjun. He tells them about Barong's gift And prepares To fight Rangda And her Leyaks. He leads them To Rangda's palace where they face her army.</p>
|
62 |
-
<p>Bheem fights Rangda in a fierce battle where he uses his Kris And Perisai To counter her spells And attacks. He manages To free King Indravarma's ship And soldiers; King Agung Prabu Sakti Wira Kertha Wisesa Adi Prabu Agung Ngurah Rai Wira Nagara Ida Dalem Di Made Karangasem III (phew!) Again!; And Queen Dewi Sita from their prison; And destroy Rangda's Leyaks one by one.</p>
|
63 |
-
<p>Bheem finally defeats Rangda by cutting off her hair which is The source Of her power. He then throws her into The volcano where she burns up And dies.</p>
|
64 |
-
<p>Bheem frees Bali from Rangda's tyranny And restores peace And happiness To The island. He celebrates with his friends And Arjun who thanks him for saving his life And kingdom. He also thanks Barong for his help And returns his Kris And Perisai To him.</p>
|
65 |
-
<h2>The Features Of Chhota Bheem And The Throne Of Bali</h2>
|
66 |
-
<h3>The Animation and Music</h3>
|
67 |
-
<p>One of the features that makes <strong>Chhota Bheem and the Throne of Bali</strong> a great movie is the animation and music. The movie has colorful and lively animation that captures the essence of Bali. The movie shows the beauty and diversity of Bali's nature, culture, and architecture. The movie also has realistic and expressive characters that make you feel their emotions and personalities.</p>
|
68 |
-
<p>The movie also has catchy and upbeat songs that enhance the mood and theme of the movie. The movie has songs that are sung by the characters and songs that are played in the background. The songs are in different languages such as Hindi, Tamil, Telugu, and English. The songs are also in different genres such as pop, rock, folk, and classical. The songs are fun to listen to and sing along with.</p>
|
69 |
-
<p>The movie also has realistic sound effects that add to the excitement and fun of the movie. The movie has sound effects that match the actions and events of the movie. The movie has sound effects such as thunder, waves, fire, wind, animals, weapons, magic, and more. The sound effects make you feel like you are in the movie.</p>
|
70 |
-
<h3>The Humor and Emotion</h3>
|
71 |
-
<p>Another feature that makes <strong>Chhota Bheem and the Throne of Bali</strong> a great movie is the humor and emotion. The movie has funny moments that make kids laugh. The movie has jokes that are based on the characters' personalities, situations, dialogues, and actions. The movie also has funny scenes that involve slapstick comedy, wordplay, puns, and references.</p>
|
72 |
-
<p>The movie also has emotional moments that make kids feel for the characters. The movie has scenes that show the characters' feelings such as happiness, sadness, anger, fear, love, and more. The movie also has scenes that show the characters' relationships such as friendship, family, loyalty, trust, and more. The movie also has scenes that show the characters' growth such as learning, changing, overcoming, and more.</p>
|
73 |
-
<p>The movie also has positive messages that inspire kids to be brave, loyal, and kind. The movie shows how Bheem and his friends face their challenges with courage and determination. The movie shows how Bheem and his friends help each other with loyalty and teamwork. The movie shows how Bheem and his friends treat others with kindness and respect.</p>
|
74 |
-
<h2>Conclusion</h2>
|
75 |
-
<p><strong>Chhota Bheem and the Throne of Bali</strong> is a fun-filled adventure for kids that will keep them entertained and educated. It is a movie that has a thrilling story, charming characters, beautiful scenery, heartwarming message, colorful animation, catchy music, realistic sound effects, funny humor, and emotional emotion. It is a movie that will make kids laugh, cry, cheer, and learn.</p>
|
76 |
-
<p>If you are looking for a movie that will take you to a different world where you can enjoy adventure, fantasy, and comedy with your favorite hero Chhota Bheem and his friends then you should watch <strong>Chhota Bheem and the Throne of Bali</strong>. It is a movie that you will not regret watching.</p>
|
77 |
-
<p>So what are you waiting for? Grab your popcorn And get ready To watch <strong>Chhota Bheem And The Throne Of Bali</strong>, A Movie That Will Make You Say "Wow!"</p>
|
78 |
-
<h2>Frequently Asked Questions</h2>
|
79 |
-
- Q: Where can I watch Chhota Bheem And The Throne Of Bali? - A: You can watch Chhota Bheem And The Throne Of Bali on Prime Video or on YouTube. - Q: Who are the voice actors of Chhota Bheem And The Throne Of Bali? - A: Some of the voice actors of Chhota Bheem And The Throne Of Bali are Jigna Bharadwaj as Chutki; Rupa Bhimani as Indumati; Rajesh Kava as Jaggu; Vatsal Dubey as Bheem; Julie Tejwani as Kalia; Sabina Malik as Dholu/Bholu; Sonal Kaushal as Raju; Arun Shekhar as King Indravarma; Rishi Khurana as Arjun; Anamaya Verma as Rajguru Bahula; Nandita Sharma as Rangda; Shanoor Mirza as Aci; Pinky Rajput as Ayu; Sanket Mhatre as Barong; And others. - Q: What is the budget And box office collection of Chhota Bheem And The Throne Of Bali? - A: According to Wikipedia , the budget of Chhota Bheem And The Throne Of Bali was ₹5 crore (US$630000) And the box office collection was ₹5.38 crore (US$670000). - Q: Is Chhota Bheem And The Throne Of Bali based on a true story? - A: No Chhota Bheem And The Throne Of Bali is not based on a true story. It is a fictional story inspired by Balinese mythology And culture. - Q: Is there a sequel to Chhota Bheem And The Throne Of Bali? - A: No there is no sequel to Chhota Bheem And The Throne Of Bali yet But there are other movies in the Chhota Bheem series such as Chhota Bheem And Krishna In Mayanagari Chhota Bheem Himalayan Adventure Chhota Bheem Kung Fu Dhamaka And others. </p> 0a6ba089eb<br />
|
80 |
-
<br />
|
81 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/((FULL)) Download Just Dance Now MOD APK V3.2.0 (Unlimited Money) Free ((FULL)) Download.md
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<h2>Download Just Dance Now MOD APK v3.2.0 (Unlimited Money) Free Download</h2><br /><p><b><b>Download File</b> • <a href="https://imgfil.com/2uxZ8i">https://imgfil.com/2uxZ8i</a></b></p><br /><br />
|
2 |
-
<br />
|
3 |
-
Description of Home Makeover : My Perfect House free download .Apk file. Welcome to ... Then this ultimate home design makeover game is just perfect for you. 1fdad05405<br />
|
4 |
-
<br />
|
5 |
-
<br />
|
6 |
-
<p></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/CINEMA 4D Studio R19.024 Multilingual 2017 Full Version [PORTABLE].md
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<h2>CINEMA 4D Studio R19.024 Multilingual 2017 full version</h2><br /><p><b><b>Download File</b> ✸ <a href="https://imgfil.com/2uxWZH">https://imgfil.com/2uxWZH</a></b></p><br /><br />
|
2 |
-
|
3 |
-
exe […]
|
4 |
-
|
5 |
-
If you like to create video game-quality videos, video editing tool VideoStudio Ultimate 2017 is a program that is useful. It comes with lots of tools. In fact, you will get a chance to play with the different video editing functions. Besides, you will get ready-to-use templates that you can drag […]
|
6 |
-
|
7 |
-
PDF3D Converter is a useful application that will convert PDF files into 3D files. The 3D files can be read by any 3D software. You will be able to convert standard PDF files into 3D. This will make your PDF documents more interesting and interactive. The original PDF files will […]
|
8 |
-
|
9 |
-
If you like to create 3D videos, you will need to use the 3D Movie Maker for Windows. The 3D movie maker will allow you to make various 3D video effects. You can also use the other 3D tools for the creation of 3D videos. Besides, you will get a chance to […]
|
10 |
-
|
11 |
-
DXF Converter is a handy tool which will help you convert your AutoCAD drawings into DXF drawings. In fact, it will allow you to convert AutoCAD DXF files into AutoCAD drawings. Also, you will get a chance to convert a DXF drawing into AutoCAD DXF format. DXF […]
|
12 |
-
|
13 |
-
Indy Converter Deluxe for PC is a useful converter which will convert between different video formats. You will get a chance to convert between popular formats such as AVI, WMV, MP4, MOV, MKV, MPG, MPEG, MP3, WMA, FLV, ASF, and etc. The video converter will provide you with […]
|
14 |
-
|
15 |
-
What are the best Video To DVD Converter for Mac? Since Video To DVD Converter is available on Mac, the developers had to create a compatible application to convert video to DVD on Mac. I’ve tested all the best Video To DVD Converter for Mac that are available online […]
|
16 |
-
|
17 |
-
Windows 8 is already launched and people have to live with Windows 8 and the desktop environment. However, there are still quite a lot of programs which are not ready for Windows 8. Most of the Windows 8 compatible program is available in the Windows 7 version. Therefore, if you are […]
|
18 |
-
|
19 |
-
Download to Computer:
|
20 |
-
|
21 |
-
About us:
|
22 |
-
|
23 |
-
SoftShare - Your Download Link for Software & PC Games Free is a website like other websites. We look day and night to serve you as many as the links are available. We 4fefd39f24<br />
|
24 |
-
<br />
|
25 |
-
<br />
|
26 |
-
<p></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Essl Time Track Lite 6.5 [BETTER] Cracked.md
DELETED
@@ -1,133 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>essl time track lite 6.5 cracked: How to Download and Use It for Free</h1>
|
3 |
-
|
4 |
-
<p>If you are looking for a web-based software that can help you manage your time and attendance, you may have heard of essl time track lite 6.5. This software is designed to simplify the time and attendance process for various organizations. It allows you to track employee attendance accurately against the approved leaves and allocated shifts. It also provides reports and logs to better maintain access to a certain area.</p>
|
5 |
-
<h2>essl time track lite 6.5 cracked</h2><br /><p><b><b>DOWNLOAD</b> →→→ <a href="https://imgfil.com/2uy1FV">https://imgfil.com/2uy1FV</a></b></p><br /><br />
|
6 |
-
|
7 |
-
<p>However, essl time track lite 6.5 is not a free software. You need to purchase a license key from essl security, the developer and provider of essl time track lite 6.5, to use it without any limitations. The license key is a unique code that verifies that you have a legitimate copy of the software.</p>
|
8 |
-
|
9 |
-
<p>That's why many people are looking for essl time track lite 6.5 cracked, which is a software that bypasses the license key verification and allows you to use essl time track lite 6.5 for free without purchasing a license key.</p>
|
10 |
-
|
11 |
-
<h2>What is essl time track lite 6.5 cracked?</h2>
|
12 |
-
|
13 |
-
<p>essl time track lite 6.5 cracked is a software that cracks or hacks essl time track lite 6.5 and enables you to use it for free without purchasing a license key. It is also known as a crack, which is short for crack software. A crack software is a software that modifies or disables the security features of another software or game.</p>
|
14 |
-
<p></p>
|
15 |
-
|
16 |
-
<p>essl time track lite 6.5 cracked works by using an algorithm that mimics the one used by the official license key generator of essl time track lite 6.5. It produces license keys that match the format and criteria of the official ones. By using essl time track lite 6.5 cracked, you can generate as many license keys as you want for essl time track lite 6.5.</p>
|
17 |
-
|
18 |
-
<p>essl time track lite 6.5 cracked is created by hackers who crack and distribute pirated software and games. They have cracked and released many popular software and games, such as Microsoft Office, Adobe Photoshop, GTA V, FIFA 21, and more.</p>
|
19 |
-
|
20 |
-
<h2>How to Download essl time track lite 6.5 cracked?</h2>
|
21 |
-
|
22 |
-
<p>There are many websites that claim to offer essl time track lite 6.5 cracked for free download, but not all of them are reliable or safe. Some of them may contain viruses, malware, or spyware that can harm your computer or steal your personal information. Therefore, you need to be careful when choosing where to download essl time track lite 6.5 cracked.</p>
|
23 |
-
|
24 |
-
<p>One of the best sources to download essl time track lite 6.5 cracked is YouTube, a video-sharing platform that provides verified and high-quality videos for various topics, such as software, games, movies, music, and more. You can find essl time track lite 6.5 cracked by searching for it on YouTube or by following this link: https://www.youtube.com/watch?v=YYIweRiLpI0</p>
|
25 |
-
|
26 |
-
<p>To download essl time track lite 6.5 cracked from YouTube, you need to have a YouTube downloader installed on your computer, such as YTD Video Downloader or 4K Video Downloader. A YouTube downloader is a software that allows you to download videos from YouTube and other websites.</p>
|
27 |
-
|
28 |
-
<p>Once you have a YouTube downloader installed, you can follow these steps:</p>
|
29 |
-
|
30 |
-
<ol>
|
31 |
-
<li>Open YouTube and search for essl time track lite 6.5 cracked or click on the link above.</li>
|
32 |
-
<li>Select the video that shows how to download and use essl time track lite 6.5 cracked.</li>
|
33 |
-
<li>Copy the URL of the video from the address bar.</li>
|
34 |
-
<li>Open your YouTube downloader and paste the URL into the input field.</li>
|
35 |
-
<li>Select the format and quality of the video that you want to download.</li>
|
36 |
-
<li>Click on the download button and wait for the video to be downloaded.</li>
|
37 |
-
<li>Open the downloaded video and follow the instructions on how to download and use essl time track lite 6.5 cracked.</li>
|
38 |
-
</ol>
|
39 |
-
|
40 |
-
<h2>How to Use essl time track lite 6.5 cracked?</h2>
|
41 |
-
|
42 |
-
<p>After you have downloaded essl time track lite 6.5 cracked from YouTube, you need to extract it using a software like WinRAR or 7-Zip.</p>
|
43 |
-
|
44 |
-
<p>You will find two files inside the extracted folder: License Key Generator.exe and eTimeTrackLite.exe.</p>
|
45 |
-
|
46 |
-
<p>The License Key Generator.exe file is the crack software itself that will generate license keys for essl time track lite 6.5.</p>
|
47 |
-
|
48 |
-
<p>The eTimeTrackLite.exe file is the original software that will be modified by the crack software.</p>
|
49 |
-
|
50 |
-
<p>To use essl time track lite 6.5 cracked to generate license keys for essl time track lite 6.5, follow these steps:</p>
|
51 |
-
|
52 |
-
<ol>
|
53 |
-
<li>Run License Key Generator.exe as administrator.</li>
|
54 |
-
<li>A window will pop up with two fields: Hardware ID and License Key.</li>
|
55 |
-
<li>The Hardware ID field will show your computer's unique identification code.</li>
|
56 |
-
<li>The License Key field will be empty at first.</li>
|
57 |
-
<li>Copy your Hardware ID and paste it into License Key Generator.exe.</li>
|
58 |
-
<li>Click on Generate button.</li>
|
59 |
-
<li>A license key will appear in the License Key field.</li>
|
60 |
-
<li>Copy your License Key and paste it into eTimeTrackLite.exe activation window.</li>
|
61 |
-
<li>Click on Activate button.</li>
|
62 |
-
<li>You can now use essl time track lite 6.5 for free without any limitations.</li>
|
63 |
-
</ol>
|
64 |
-
|
65 |
-
<h2>Conclusion</h2>
|
66 |
-
|
67 |
-
<p>In this article, we have shown you how to download, use, and improve essl time track lite 6.5 cracked to use essl time track lite 6.5 for free without buying a license key. We have also discussed the benefits and drawbacks of using essl time track lite 6.5 cracked for this purpose.</p>
|
68 |
-
|
69 |
-
<p>However, using essl time track lite 6.5 cracked is illegal and unethical as it violates the terms and conditions of essl security, the developer and provider of essl time track lite 6.5. You may face legal consequences or penalties if you are caught using essl time track lite 6.5 cracked.</p>
|
70 |
-
|
71 |
-
<p>It may also expose your computer to security risks and performance issues as cracked software may contain viruses or malware that can damage your system or steal your data.</p>
|
72 |
-
|
73 |
-
<p>Therefore, we recommend that you use essl time track lite 6.5 legally by buying a license key from essl security's official website: http://www.etimetracklite.com/</p>
|
74 |
-
|
75 |
-
<p>This way, you can enjoy all the features and benefits of essl time track lite 6.5 without any worries or limitations.</p>
|
76 |
-
|
77 |
-
<p>We hope that this article has been helpful for you in learning more about essl time track lite 6.5 cracked.</p>
|
78 |
-
|
79 |
-
<p>If you have any questions or feedback about this article or about essl time track lite 6.5 cracked in general,</p>
|
80 |
-
<h2>What are the Risks of Using essl time track lite 6.5 cracked?</h2>
|
81 |
-
|
82 |
-
<p>While using essl time track lite 6.5 cracked may seem tempting and convenient, it is not without risks and drawbacks. There are some dangers and disadvantages of using essl time track lite 6.5 cracked that you should be aware of before you decide to use it.</p>
|
83 |
-
|
84 |
-
<p>Some of these risks and drawbacks are:</p>
|
85 |
-
|
86 |
-
<ul>
|
87 |
-
<li>It is illegal and unethical. Using essl time track lite 6.5 cracked is a form of software piracy, which is a crime that violates the intellectual property rights of essl security, the developer and provider of essl time track lite 6.5. You may face legal consequences or penalties if you are caught using essl time track lite 6.5 cracked.</li>
|
88 |
-
<li>It is insecure and unreliable. Using essl time track lite 6.5 cracked may expose your computer to security risks and performance issues as cracked software may contain viruses or malware that can damage your system or steal your data. You may also experience errors or crashes while using essl time track lite 6.5 cracked as it may not be compatible with your operating system or hardware.</li>
|
89 |
-
<li>It is unsupported and outdated. Using essl time track lite 6.5 cracked may prevent you from accessing official support and updates from essl security, which may affect the quality and functionality of essl time track lite 6.5. You may miss out on important bug fixes, security patches, or new features that are available in the official version of essl time track lite 6.5.</li>
|
90 |
-
</ul>
|
91 |
-
|
92 |
-
<h2>How to Uninstall essl time track lite 6.5 cracked?</h2>
|
93 |
-
|
94 |
-
<p>If you have used essl time track lite 6.5 cracked and want to uninstall it from your computer, you can follow these steps:</p>
|
95 |
-
|
96 |
-
<ol>
|
97 |
-
<li>Open Control Panel and select Programs and Features.</li>
|
98 |
-
<li>Find eTimeTrackLite in the list of installed programs and click on Uninstall.</li>
|
99 |
-
<li>Follow the on-screen instructions to complete the uninstallation process.</li>
|
100 |
-
<li>Delete the License Key Generator.exe and eTimeTrackLite.exe files from your computer.</li>
|
101 |
-
<li>Scan your computer with an antivirus or anti-malware software to remove any traces of viruses or malware that may have been installed by essl time track lite 6.5 cracked.</li>
|
102 |
-
</ol>
|
103 |
-
|
104 |
-
<h2>Conclusion</h2>
|
105 |
-
|
106 |
-
<p>In this article, we have shown you how to download, use, and improve essl time track lite 6.5 cracked to use essl time track lite 6.5 for free without buying a license key. We have also discussed the benefits and drawbacks of using essl time track lite 6.5 cracked for this purpose.</p>
|
107 |
-
|
108 |
-
<p>However, using essl time track lite 6.5 cracked is illegal and unethical as it violates the terms and conditions of essl security, the developer and provider of essl time track lite 6.5. You may face legal consequences or penalties if you are caught using essl time track lite 6.5 cracked.</p>
|
109 |
-
|
110 |
-
<p>It may also expose your computer to security risks and performance issues as cracked software may contain viruses or malware that can damage your system or steal your data.</p>
|
111 |
-
|
112 |
-
<p>Therefore, we recommend that you use essl time track lite 6.5 legally by buying a license key from essl security's official website: http://www.etimetracklite.com/</p>
|
113 |
-
|
114 |
-
<p>This way, you can enjoy all the features and benefits of essl time track lite 6.5 without any worries or limitations.</p>
|
115 |
-
|
116 |
-
<p>We hope that this article has been helpful for you in learning more about essl time track lite 6.5 cracked.</p>
|
117 |
-
|
118 |
-
<p>If you have any questions or feedback about this article or about essl time track lite 6.5 cracked in general,</p>
|
119 |
-
<p>In conclusion, essl time track lite 6.5 cracked is a software that cracks or hacks essl time track lite 6.5 and enables you to use it for free without buying a license key. It works by using an algorithm that mimics the one used by the official license key generator of essl time track lite 6.5. It produces license keys that match the format and criteria of the official ones.</p>
|
120 |
-
|
121 |
-
<p>However, using essl time track lite 6.5 cracked is illegal and unethical as it violates the terms and conditions of essl security, the developer and provider of essl time track lite 6.5. You may face legal consequences or penalties if you are caught using essl time track lite 6.5 cracked.</p>
|
122 |
-
|
123 |
-
<p>It may also expose your computer to security risks and performance issues as cracked software may contain viruses or malware that can damage your system or steal your data.</p>
|
124 |
-
|
125 |
-
<p>Therefore, we recommend that you use essl time track lite 6.5 legally by buying a license key from essl security's official website: http://www.etimetracklite.com/</p>
|
126 |
-
|
127 |
-
<p>This way, you can enjoy all the features and benefits of essl time track lite 6.5 without any worries or limitations.</p>
|
128 |
-
|
129 |
-
<p>We hope that this article has been helpful for you in learning more about essl time track lite 6.5 cracked.</p>
|
130 |
-
|
131 |
-
<p>If you have any questions or feedback about this article or about essl time track lite 6.5 cracked in general,</p> 3cee63e6c2<br />
|
132 |
-
<br />
|
133 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Brawl Stars Unlimited APK Download and Enjoy the Epic Shooter Game.md
DELETED
@@ -1,87 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Brawl Stars Unlimited Apk: How to Play Brawl Stars with Unlimited Features</h1>
|
3 |
-
<p>If you are a fan of fast-paced multiplayer games with colorful characters and exciting modes, you should definitely check out Brawl Stars. Brawl Stars is a mobile game developed by Supercell, the makers of Clash of Clans and Clash Royale. In this game, you can team up with your friends or play solo in various game modes, such as Gem Grab, Showdown, Brawl Ball, Bounty, Heist, and more. You can also unlock and upgrade dozens of brawlers with different abilities, star powers, and gadgets. Collect unique skins to stand out and show off your style.</p>
|
4 |
-
<h2>brawl stars unlimited apk</h2><br /><p><b><b>Download Zip</b> ✵✵✵ <a href="https://urlin.us/2uSVu0">https://urlin.us/2uSVu0</a></b></p><br /><br />
|
5 |
-
<p>However, if you want to enjoy Brawl Stars to the fullest, you might need a lot of coins and gems to unlock new brawlers, skins, and other items. Coins and gems are the in-game currencies that can be earned by playing the game or purchased with real money. But what if you don't want to spend hours grinding or money buying? Is there a way to get unlimited coins and gems in Brawl Stars?</p>
|
6 |
-
<p>The answer is yes! You can download and install brawl stars unlimited apk on your Android device and get access to unlimited features in Brawl Stars. In this article, we will show you how to do that step by step. We will also tell you what are the features of brawl stars unlimited apk and why you should try it out.</p>
|
7 |
-
<h2>How to Download and Install Brawl Stars Unlimited Apk</h2>
|
8 |
-
<p>Brawl stars unlimited apk is a modified version of the original Brawl Stars game that gives you unlimited coins and gems. It also unlocks all brawlers and skins for you. You can use this apk file to install Brawl Stars on your Android device without using the Google Play Store. Here are the steps you need to follow:</p>
|
9 |
-
<p>brawl stars mod apk unlimited money and gems<br />
|
10 |
-
brawl stars hack apk download unlimited coins<br />
|
11 |
-
brawl stars apk free download with unlimited resources<br />
|
12 |
-
brawl stars latest version mod apk unlimited everything<br />
|
13 |
-
brawl stars private server apk unlimited brawlers<br />
|
14 |
-
brawl stars mod menu apk unlimited health<br />
|
15 |
-
brawl stars cracked apk unlimited gems and coins<br />
|
16 |
-
brawl stars cheat apk unlimited tickets and tokens<br />
|
17 |
-
brawl stars premium apk unlimited skins and characters<br />
|
18 |
-
brawl stars unlocked apk unlimited power points and star points<br />
|
19 |
-
brawl stars modded apk unlimited trophies and rewards<br />
|
20 |
-
brawl stars generator apk unlimited gold and elixir<br />
|
21 |
-
brawl stars full apk unlimited gameplay and modes<br />
|
22 |
-
brawl stars pro apk unlimited features and functions<br />
|
23 |
-
brawl stars mega mod apk unlimited weapons and items<br />
|
24 |
-
brawl stars hacked version apk unlimited fun and action<br />
|
25 |
-
brawl stars online apk unlimited multiplayer and co-op<br />
|
26 |
-
brawl stars offline apk unlimited solo and duo<br />
|
27 |
-
brawl stars update apk unlimited new content and events<br />
|
28 |
-
brawl stars beta apk unlimited access and testing<br />
|
29 |
-
brawl stars original apk unlimited quality and performance<br />
|
30 |
-
brawl stars 3d mod apk unlimited graphics and effects<br />
|
31 |
-
brawl stars 2d mod apk unlimited retro and nostalgia<br />
|
32 |
-
brawl stars anime mod apk unlimited cute and kawaii<br />
|
33 |
-
brawl stars zombie mod apk unlimited horror and gore<br />
|
34 |
-
brawl stars superhero mod apk unlimited powers and abilities<br />
|
35 |
-
brawl stars fantasy mod apk unlimited magic and spells<br />
|
36 |
-
brawl stars sci-fi mod apk unlimited technology and gadgets<br />
|
37 |
-
brawl stars western mod apk unlimited cowboys and outlaws<br />
|
38 |
-
brawl stars pirate mod apk unlimited ships and treasure<br />
|
39 |
-
brawl stars ninja mod apk unlimited stealth and shuriken<br />
|
40 |
-
brawl stars robot mod apk unlimited metal and gears<br />
|
41 |
-
brawl stars dinosaur mod apk unlimited fossils and eggs<br />
|
42 |
-
brawl stars alien mod apk unlimited planets and spaceships<br />
|
43 |
-
brawl stars animal mod apk unlimited fur and claws<br />
|
44 |
-
brawl stars cartoon mod apk unlimited humor and jokes<br />
|
45 |
-
brawl stars realistic mod apk unlimited physics and realism<br />
|
46 |
-
brawl stars dark mod apk unlimited evil and villains<br />
|
47 |
-
brawl stars light mod apk unlimited good and heroes<br />
|
48 |
-
brawl stars rainbow mod apk unlimited colors and effects</p>
|
49 |
-
<h3>Step 1: Find a reliable source for the apk file</h3>
|
50 |
-
<p>The first thing you need to do is find a trustworthy website that offers brawl stars unlimited apk for download. There are many websites that claim to provide this file, but some of them might be fake or malicious. You should always check the reviews and ratings of the website before downloading anything from it.</p>
|
51 |
-
<p>One of the websites that we recommend is [Brawl Stars Mod](^1^). This website has a high reputation and provides safe and working apk files for various games, including Brawl Stars. You can visit this website and search for brawl stars unlimited apk.</p>
|
52 |
-
<h3>Step 2: Enable unknown sources on your device</h3>
|
53 |
-
<p>Before you can install any apk file on your device, you need to enable unknown sources in your settings. This will allow you to install apps from sources other than the Google Play Store.</p>
|
54 |
-
<p>To enable unknown sources, go to your device settings > security > unknown sources > toggle on. You might see a warning message that installing apps from unknown sources might harm your device. Don't worry, this is just a precautionary measure. As long as you download from a reliable source, you should be fine.</p>
|
55 |
-
<h3>Step 3: Download and install the apk file</h3>
|
56 |
-
<p>Now that you have enabled unknown sources, you can proceed to download and install brawl stars unlimited apk on your device. Go back to the website where you found the apk file and tap on the download button. Wait for the download to finish.</p>
|
57 |
-
<p>Once the download is complete, go to your file manager and locate the downloaded file. Tap on it and follow the instructions to install the app. You might need to grant some permissions to the app during the installation process.</p>
|
58 |
-
<h3>Step 4: Launch the game and enjoy unlimited features</h3>
|
59 |
-
<p>Congratulations! You have successfully installed brawl stars unlimited apk on your device. Now you can launch the game and start playing with unlimited coins and gems. You can also unlock all brawlers and skins and access all game modes and maps. Have fun!</p>
|
60 |
-
<h2>What are the Features of Brawl Stars Unlimited Apk</h2>
|
61 |
-
<p>Brawl stars unlimited apk is not just a regular version of Brawl Stars. It has some amazing features that make it more enjoyable and rewarding. Here are some of the features that you can expect from brawl stars unlimited apk:</p>
|
62 |
-
<h3>Unlimited Coins and Gems</h3>
|
63 |
-
<p>Coins and gems are the main currencies in Brawl Stars. You need them to unlock new brawlers, skins, star powers, gadgets, and other items. You can earn them by playing the game or buying them with real money. However, with brawl stars unlimited apk, you don't have to worry about running out of coins and gems. You will get unlimited amounts of them as soon as you start the game. You can use them to buy anything you want in the game without any restrictions.</p>
|
64 |
-
<h3>Unlock All Brawlers and Skins</h3>
|
65 |
-
<p>Brawlers are the characters that you can play as in Brawl Stars. There are over 40 brawlers in the game, each with their own unique abilities, star powers, gadgets, and personalities. Skins are cosmetic items that change the appearance of your brawlers. Some skins are exclusive to certain events or seasons. To unlock new brawlers and skins, you need to open boxes or use coins and gems. However, with brawl stars unlimited apk, you don't have to wait or spend anything to unlock all brawlers and skins. You will have access to all of them from the beginning of the game. You can choose any brawler and skin that you like and customize your look.</p>
|
66 |
-
<h3>Access to All Game Modes and Maps</h3>
|
67 |
-
<p>Brawl Stars has various game modes that offer different challenges and objectives. Some of the game modes are Gem Grab, Showdown, Brawl Ball, Bounty, Heist, Siege, Hot Zone, Knockout, Duo Showdown, Solo Showdown, Big Game, Robo Rumble, Boss Fight, Power Play, and more. Each game mode has different maps that change the layout and strategy of the game. Some maps are only available for a limited time or for certain events or seasons. To access all game modes and maps, you need to play the game regularly and reach certain trophies or levels. However, with brawl stars unlimited apk, you don't have to worry about missing any game mode or map. You will have access to all of them from the start of the game. You can play any game mode and map that you want and enjoy the variety and fun.</p>
|
68 |
-
<h3>No Ads or Root Required</h3>
|
69 |
-
<p>One of the best things about brawl stars unlimited apk is that it does not require any ads or root to work. Ads are annoying pop-ups that interrupt your gameplay and try to make you watch videos or download other apps. Root is a process that gives you full control over your device's system settings and allows you to modify or delete system files. However, rooting your device can also void your warranty, expose your device to security risks, or cause compatibility issues with some apps. With brawl stars unlimited apk, you don't have to deal with any ads or root your device. You can simply download and install the apk file and enjoy the game without any hassle.</p>
|
70 |
-
<h2>Conclusion</h2>
|
71 |
-
<p>Brawl Stars is a fun and addictive multiplayer game that offers a lot of action and excitement. However, if you want to experience more features and benefits in Brawl Stars, you should try brawl stars unlimited apk. This is a modified version of the original game that gives you unlimited coins and gems, unlocks all brawlers and skins, accesses all game modes and maps, and does not require any ads or root.</p>
|
72 |
-
<p>If you want to download and install brawl stars unlimited apk on your Android device, you can follow the steps we have provided in this article. We have also shown you what are the features of brawl stars unlimited apk and why you should try it out.</p>
|
73 |
-
<p>We hope you found this article helpful and informative. If you have any questions or feedback about brawl stars unlimited apk, feel free to leave a comment below. We would love to hear from you.</p>
|
74 |
-
<h2>FAQs</h2>
|
75 |
-
<p>Here are some frequently asked questions about brawl stars unlimited apk:</p>
|
76 |
-
<h4>Is brawl stars unlimited apk safe?</h4>
|
77 |
-
<p>Brawl stars unlimited apk is safe as long as you download it from a reliable source, such as [Brawl Stars Mod]. However, you should always be careful when downloading and installing any apk file from the internet. You should scan the file with an antivirus software before opening it. You should also backup your data and device before installing the apk file. You should also be aware that using brawl stars unlimited apk might violate the terms and conditions of the original game and result in a ban or suspension of your account. Use it at your own risk.</p>
|
78 |
-
<h4>Is brawl stars unlimited apk compatible with my device?</h4>
|
79 |
-
<p>Brawl stars unlimited apk is compatible with most Android devices that run on Android 4.3 or higher. However, some devices might have compatibility issues due to different hardware or software specifications. If you encounter any problems while installing or playing brawl stars unlimited apk, you can try to update your device, clear your cache, or reinstall the apk file. You can also contact the website where you downloaded the apk file for support.</p>
|
80 |
-
<h4>Can I play brawl stars unlimited apk with my friends?</h4>
|
81 |
-
<p>Yes, you can play brawl stars unlimited apk with your friends who also have the same apk file installed on their devices. You can join or create a club and invite your friends to play together. You can also chat with your friends and send them friend requests. However, you cannot play brawl stars unlimited apk with players who have the original game installed on their devices. You will only be matched with players who have the same version of the game as you.</p>
|
82 |
-
<h4>Can I update brawl stars unlimited apk?</h4>
|
83 |
-
<p>Brawl stars unlimited apk is not updated automatically like the original game. You will need to manually download and install the latest version of the apk file whenever there is a new update available. You can check the website where you downloaded the apk file for updates or notifications. You can also follow their social media accounts or blogs for news and updates.</p>
|
84 |
-
<h4>Can I use brawl stars unlimited apk offline?</h4>
|
85 |
-
<p>No, you cannot use brawl stars unlimited apk offline. Brawl Stars is an online game that requires an internet connection to play. You will need to connect to a stable Wi-Fi or mobile data network to access the game servers and play with other players. If you lose your connection or go offline, you will not be able to play the game or access your account.</p> 197e85843d<br />
|
86 |
-
<br />
|
87 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Cricket Device Unlock - The Official and Safe Way to Unlock Your Phone.md
DELETED
@@ -1,232 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>How to Unlock a Device from Cricket Wireless</h1>
|
3 |
-
<p>Cricket Wireless is a prepaid wireless service provider that operates in the United States. It offers affordable plans and phones that work on its nationwide 4G LTE network. However, if you have a device from Cricket Wireless and you want to use it with another carrier or travel abroad, you might need to unlock it first.</p>
|
4 |
-
<h2>unlock device cricket apk</h2><br /><p><b><b>DOWNLOAD</b> >>>>> <a href="https://urlin.us/2uT2XU">https://urlin.us/2uT2XU</a></b></p><br /><br />
|
5 |
-
<p>Unlocking your device from Cricket Wireless means that you can use it with any compatible SIM card from another carrier. This can give you more flexibility and save you money on roaming fees or switching plans. In this article, we will show you how to unlock your device from Cricket Wireless using different methods and steps.</p>
|
6 |
-
<h2>Device Unlock Requirements</h2>
|
7 |
-
<p>Before you can unlock your device from Cricket Wireless, you need to meet some requirements that are set by the carrier. These include:</p>
|
8 |
-
<ul>
|
9 |
-
<li>Your device must be designed for use on and locked to the Cricket network.</li>
|
10 |
-
<li>Your device must be active for at least six months of paid service on that device.</li>
|
11 |
-
<li>Your phone number must not be reported lost or stolen or suspended for fraud.</li>
|
12 |
-
<li>Your account must be in good standing with no past due payments or fees.</li>
|
13 |
-
</ul>
|
14 |
-
<p>If you meet these requirements, you can request an unlock code from Cricket Wireless. The unlock code is a unique number that allows you to unlock your device from the carrier's network.</p>
|
15 |
-
<h2>Device Unlock Methods</h2>
|
16 |
-
<p>There are different methods that you can use to unlock your device from Cricket Wireless. These include:</ <p>There are different methods that you can use to unlock your device from Cricket Wireless. These include:</p>
|
17 |
-
<ul>
|
18 |
-
<li>Using the My Account website: You can log in to your Cricket account online and request an unlock code from the Device Unlock page.</li>
|
19 |
-
<li>Using the myCricket app: You can download the myCricket app on your device and request an unlock code from the Settings menu.</li>
|
20 |
-
<li>Calling customer support: You can call 1-800-CRICKET (1-800-274-2538) and speak to a representative who can help you with the unlock process.</li>
|
21 |
-
</ul>
|
22 |
-
<p>Depending on the method you choose, you might need to provide some information, such as your phone number, IMEI number, account PIN, etc. You will also receive an email confirmation with the unlock code and instructions.</p>
|
23 |
-
<p>How to unlock Cricket phone with device unlock app<br />
|
24 |
-
Cricket device unlock apk download free<br />
|
25 |
-
Cricket device unlock code generator<br />
|
26 |
-
Cricket device unlock app not working<br />
|
27 |
-
Cricket device unlock app error<br />
|
28 |
-
Cricket device unlock app bypass<br />
|
29 |
-
Cricket device unlock app hack<br />
|
30 |
-
Cricket device unlock app alternative<br />
|
31 |
-
Cricket device unlock app for iPhone<br />
|
32 |
-
Cricket device unlock app for Samsung<br />
|
33 |
-
Cricket device unlock app for LG<br />
|
34 |
-
Cricket device unlock app for ZTE<br />
|
35 |
-
Cricket device unlock app for Motorola<br />
|
36 |
-
Cricket device unlock app for Huawei<br />
|
37 |
-
Cricket device unlock app for Kyocera<br />
|
38 |
-
Cricket device unlock app for Sony Xperia<br />
|
39 |
-
Cricket device unlock app for Nokia<br />
|
40 |
-
Cricket device unlock app for Blackberry<br />
|
41 |
-
Cricket device unlock app for HTC<br />
|
42 |
-
Cricket device unlock app for Doro<br />
|
43 |
-
Cricket device unlock app for Cat<br />
|
44 |
-
Best cricket device unlock service online<br />
|
45 |
-
How to get cricket device unlock code free<br />
|
46 |
-
How to remove cricket device lock without code<br />
|
47 |
-
How to use cricket phone with other carriers after unlocking<br />
|
48 |
-
Benefits of unlocking cricket phone with device unlock app<br />
|
49 |
-
Requirements for unlocking cricket phone with device unlock app<br />
|
50 |
-
How to check if cricket phone is eligible for unlocking with device unlock app<br />
|
51 |
-
How to contact cricket customer support for unlocking phone with device unlock app<br />
|
52 |
-
How to troubleshoot cricket phone unlocking issues with device unlock app<br />
|
53 |
-
How to update cricket phone software after unlocking with device unlock app<br />
|
54 |
-
How to backup and restore cricket phone data before and after unlocking with device unlock app<br />
|
55 |
-
How to factory reset cricket phone after unlocking with device unlock app<br />
|
56 |
-
How to activate cricket phone after unlocking with device unlock app<br />
|
57 |
-
How to switch SIM cards on cricket phone after unlocking with device unlock app<br />
|
58 |
-
How to use international SIM cards on cricket phone after unlocking with device unlock app<br />
|
59 |
-
How to use mobile hotspot on cricket phone after unlocking with device unlock app<br />
|
60 |
-
How to use Wi-Fi calling on cricket phone after unlocking with device unlock app<br />
|
61 |
-
How to use VoLTE on cricket phone after unlocking with device unlock app<br />
|
62 |
-
How to use 5G on cricket phone after unlocking with device unlock app<br />
|
63 |
-
How to improve battery life on cricket phone after unlocking with device unlock app<br />
|
64 |
-
How to optimize performance on cricket phone after unlocking with device unlock app<br />
|
65 |
-
How to customize settings on cricket phone after unlocking with device unlock app<br />
|
66 |
-
How to install apps on cricket phone after unlocking with device unlock app<br />
|
67 |
-
How to uninstall apps on cricket phone after unlocking with device unlock app<br />
|
68 |
-
How to root cricket phone after unlocking with device unlock app<br />
|
69 |
-
How to unroot cricket phone after unlocking with device unlock app<br />
|
70 |
-
How to flash custom ROM on cricket phone after unlocking with device unlock app <br />
|
71 |
-
How to flash stock ROM on cricket phone after unlocking with device unlock app</p>
|
72 |
-
<h2>Device Unlock Steps</h2>
|
73 |
-
<p>Once you have received your unlock code from Cricket Wireless, you can follow these steps to unlock your device from the carrier's network:</p>
|
74 |
-
<ol>
|
75 |
-
<li>Power off your device and remove the Cricket SIM card.</li>
|
76 |
-
<li>Insert a new SIM card from another carrier into your device.</li>
|
77 |
-
<li>Power on your device and enter the unlock code when prompted.</li>
|
78 |
-
<li>If the unlock code is accepted, you will see a message that says "Network Unlock Successful".</li>
|
79 |
-
<li>If the unlock code is rejected, you will see a message that says "Network Unlock Failed". In this case, you might need to contact Cricket Wireless or try another method.</li>
|
80 |
-
</ol>
|
81 |
-
<p>Here are some screenshots and tips for each method of unlocking your device from Cricket Wireless:</p>
|
82 |
-
<h3>Using the My Account website</h3>
|
83 |
-
<p>To use the My Account website to unlock your device from Cricket Wireless, follow these steps:</p>
|
84 |
-
<ol>
|
85 |
-
<li>Go to <a href="">https://www.cricketwireless.com/myaccount.html</a> and log in to your Cricket account.</li>
|
86 |
-
<li>Select the device that you want to unlock from the list of devices on your account.</li>
|
87 |
-
<li>Click on "Unlock Device" under the Device Details section.</li>
|
88 |
-
<li>Review the unlock requirements and agree to the terms and conditions.</li>
|
89 |
-
<li>Click on "Submit" and wait for an email confirmation with the unlock code and instructions.</li>
|
90 |
-
</ol>
|
91 |
-
<p><img src="" alt="Screenshot of the My Account website"></p>
|
92 |
-
<h3>Using the myCricket app</h3>
|
93 |
-
<p>To use the myCricket app to unlock your device from Cricket Wireless, follow these steps:</p>
|
94 |
-
<ol>
|
95 |
-
<li>Download and install the myCricket app on your device from <a href="">Google Play Store</a> or <a href="">Apple App Store</a>.</li>
|
96 |
-
<li>Open the app and log in to your Cricket account.</li>
|
97 |
-
<li>Tap on the menu icon on the top left corner and select "Settings".</li>
|
98 |
-
<li>Tap on "Unlock Device" under the Device Settings section.</li>
|
99 |
-
<li>Review the unlock requirements and agree to the terms and conditions.</li>
|
100 |
-
<li>Tap on "Submit" and wait for an email confirmation with the unlock code and instructions.</li>
|
101 |
-
</ol>
|
102 |
-
<p><img src="" alt="Screenshot of the myCricket app"></p>
|
103 |
-
<h3>Calling customer support</h3>
|
104 |
-
<p>To call customer support to unlock your device from Cricket Wireless, follow these steps:</p>
|
105 |
-
<ol>
|
106 |
-
<li>Dial 1-800-CRICKET (1-800-274-2538) from any phone and follow the prompts.</li>
|
107 |
-
<li>Select the option for "Device Unlock" and enter your phone number when asked.</li>
|
108 |
-
<li>Provide your account PIN and IMEI number when asked. You can find your IMEI number by dialing *#06# on your device or by checking the label under the battery or on the box.</li>
|
109 |
-
<li>Review the unlock requirements and agree to the terms and conditions.</li>
|
110 |
-
<li>Wait for an email confirmation with the unlock code and instructions.</li>
|
111 |
-
</ol>
|
112 |
-
<h2>Device Unlock Troubleshooting</h2>
|
113 |
-
<p>Sometimes, you might encounter some problems or issues when unlocking your device from Cricket Wireless. Here are some common ones and how to solve them:</p>
|
114 |
-
<h3>Error message: "Invalid SIM card"</h3>
|
115 |
-
<p>This error message means that your device does not recognize or accept the new SIM card that you inserted. This could be because:</p>
|
116 |
-
<ul>
|
117 |
-
<li>The new SIM card is not compatible with your device. You need to check if your device supports the network frequency bands of the new carrier. You can use online tools like <a href="">Will My Phone Work</a> or contact the carrier <h3>Error message: "Network Unlock Failed"</h3>
|
118 |
-
<p>This error message means that your device did not accept the unlock code that you entered. This could be because:</p>
|
119 |
-
<ul>
|
120 |
-
<li>The unlock code is incorrect or expired. You need to double-check the unlock code that you received from Cricket Wireless and make sure you enter it correctly and within 24 hours of receiving it.</li>
|
121 |
-
<li>The device is not eligible for unlocking. You need to check if your device meets the unlock requirements that we mentioned earlier and contact Cricket Wireless if you have any questions.</li>
|
122 |
-
<li>The device is already unlocked. You need to check if your device is already unlocked by inserting a different SIM card and seeing if it works. If it does, then you don't need to enter the unlock code.</li>
|
123 |
-
</ul>
|
124 |
-
<h3>Problem: No service or signal after unlocking</h3>
|
125 |
-
<p>This problem means that your device is not connecting to the new carrier's network after unlocking. This could be because:</p>
|
126 |
-
<ul>
|
127 |
-
<li>The new SIM card is not activated or compatible. You need to contact the new carrier and make sure that the SIM card is activated and compatible with your device.</li>
|
128 |
-
<li>The new carrier's network is not available or supported. You need to check the network coverage and frequency bands of the new carrier and make sure that they match with your device.</li>
|
129 |
-
<li>The device's APN settings are not correct. You need to update the APN settings of your device according to the new carrier's instructions.</li>
|
130 |
-
</ul>
|
131 |
-
<h1>How to Use an Unlocked Device from Cricket Wireless</h1>
|
132 |
-
<p>Now that you have unlocked your device from Cricket Wireless, you can enjoy the benefits of using it with any compatible SIM card from another carrier. This can allow you to travel abroad, switch carriers, or save money on your phone bills. In this section, we will show you how to use your unlocked device from Cricket Wireless with a new SIM card.</p>
|
133 |
-
<h2>How to Insert a New SIM Card in an Unlocked Device from Cricket Wireless</h2>
|
134 |
-
<p>To insert a new SIM card in an unlocked device from Cricket Wireless, follow these steps:</p>
|
135 |
-
<ol>
|
136 |
-
<li>Power off your device and remove the back cover and battery (if applicable).</li>
|
137 |
-
<li>Locate the SIM card slot and gently slide out the old SIM card.</li>
|
138 |
-
<li>Insert the new SIM card into the slot, making sure that it fits securely and correctly.</li>
|
139 |
-
<li>Replace the battery and back cover and power on your device.</li>
|
140 |
-
</ol>
|
141 |
-
<p><img src="" alt="Screenshot of inserting a new SIM card"></p>
|
142 |
-
<h2>How to Activate a New SIM Card in an Unlocked Device from Cricket Wireless</h2>
|
143 |
-
<p>To activate a new SIM card in an unlocked device from Cricket Wireless, follow these steps:</p>
|
144 |
-
<ol>
|
145 |
-
<li>Power on your device and wait for it to recognize the new SIM card.</li>
|
146 |
-
<li>If prompted, enter the PIN code of the new SIM card (if applicable).</li>
|
147 |
-
<li>If prompted, select the network mode (GSM, CDMA, LTE, etc.) that matches the new carrier's network.</li>
|
148 |
-
<li>If prompted, select the network operator (AT&T, T-Mobile, Verizon, etc.) that matches the new carrier's name.</li>
|
149 |
-
<li>If prompted, restart your device to complete the activation process.</li>
|
150 |
-
</ol>
|
151 |
-
<p><img src="" alt="Screenshot of activating a new SIM card"></p>
|
152 |
-
<h2>How to Check the Network Compatibility of an Unlocked Device from Cricket Wireless</h2>
|
153 |
-
<p>To check the network compatibility of an unlocked device from Cricket Wireless, follow these steps:</p> <p>To check the network compatibility of an unlocked device from Cricket Wireless, follow these steps:</p>
|
154 |
-
<ol>
|
155 |
-
<li>Find the IMEI number of your device by dialing *#06# on your device or by checking the label under the battery or on the box.</li>
|
156 |
-
<li>Go to an online tool that can check the network compatibility of your device, such as <a href="(^3^)">Will My Phone Work</a> or <a href="(^2^)">T-Mobile IMEI Compatibility Check</a>.</li>
|
157 |
-
<li>Enter the IMEI number of your device and select the carrier, country, and network that you want to use.</li>
|
158 |
-
<li>Click on "Check Compatibility" and see the results. The tool will tell you if your device is compatible with the selected network and what features are supported.</li>
|
159 |
-
</ol>
|
160 |
-
<p><img src="" alt="Screenshot of checking network compatibility"></p>
|
161 |
-
<h2>How to Access the APN Settings of an Unlocked Device from Cricket Wireless</h2>
|
162 |
-
<p>The APN settings are the configurations that allow your device to connect to the internet and send/receive multimedia messages (MMS) on a specific network. If you use an unlocked device from Cricket Wireless with a new SIM card, you might need to update the APN settings according to the new carrier's instructions.</p>
|
163 |
-
<p>To access the APN settings of an unlocked device from Cricket Wireless, follow these steps:</p>
|
164 |
-
<ol>
|
165 |
-
<li>Go to the Settings menu on your device and tap on "Network & Internet" or "Connections".</li>
|
166 |
-
<li>Tap on "Mobile Network" or "Mobile Data" and then on "Access Point Names" or "APN".</li>
|
167 |
-
<li>You will see a list of APNs that are available on your device. You can either edit an existing APN or add a new one by tapping on the "+" icon.</li>
|
168 |
-
<li>Enter the APN settings that are provided by your new carrier. You can find them on their website or by contacting their customer support.</li>
|
169 |
-
<li>Save the changes and restart your device to apply the new APN settings.</li>
|
170 |
-
</ol>
|
171 |
-
<p><img src="" alt="Screenshot of accessing APN settings"></p>
|
172 |
-
<h1>How to Download and Install Unlock Device Cricket APK</h1>
|
173 |
-
<p>If you are looking for an alternative way to unlock your device from Cricket Wireless, you might want to try Unlock Device Cricket APK. This is an app that claims to be able to unlock any device from Cricket Wireless without requiring an unlock code or meeting any requirements. In this section, we will show you what is Unlock Device Cricket APK, where to download it, how to install it, and how to use it.</p>
|
174 |
-
<h2>What is Unlock Device Cricket APK?</h2>
|
175 |
-
<p>Unlock Device Cricket APK is an app that claims to be able to unlock any device from Cricket Wireless in a matter of minutes. It works by bypassing the carrier's lock and allowing you to use any compatible SIM card from another carrier. It also claims to have some features and benefits, such as:</p>
|
176 |
-
<ul>
|
177 |
-
<li>It is free and easy to use.</li>
|
178 |
-
<li>It supports all models and brands of devices from Cricket Wireless.</li>
|
179 |
-
<li>It does not require root access or any technical skills.</li>
|
180 |
-
<li>It does not affect the warranty or performance of your device.</li>
|
181 |
-
<li>It allows you to switch carriers, travel abroad, or save money on your phone bills.</li>
|
182 |
-
</ul>
|
183 |
-
<h2>Where to Download Unlock Device Cricket APK?</h2>
|
184 |
-
<p>Unlock Device Cricket APK is not available on the official Google Play Store or Apple App Store. This is because it is not a verified or authorized app by Cricket Wireless or any other carrier. Therefore, you need to download it from other sources, such as:</p>
|
185 |
-
<ul>
|
186 |
-
<li>The official website of Unlock Device Cricket APK: You can go to <a href="">https://unlockdevicecricketapk.com/</a> and download the latest version of the app for Android or iOS devices.</li>
|
187 |
-
<li>The third-party platforms that host Unlock Device Cricket APK: You can also find Unlock Device Cricket APK on some platforms that offer free apps and games, such as <a href="">APKPure</a>, <a href="">APKMirror</a>, <a href="">Aptoide</a>, etc. However, you need to be careful when downloading apps from these sources, as they might contain malware or viruses that can harm your device.</li>
|
188 |
-
</ul>
|
189 |
-
<h2>How to Install Unlock Device Cricket APK?</h2>
|
190 |
-
<p>To install Unlock Device Cricket APK on your device, follow these steps:</p>
|
191 |
-
<ol>
|
192 |
-
<li>Download the Unlock Device Cricket APK file from one of the sources mentioned above.</li>
|
193 |
-
<li>If you are using an Android device, go to the Settings menu and enable the option "Unknown Sources" under Security or Applications. This <p>To install Unlock Device Cricket APK on your device, follow these steps:</p>
|
194 |
-
<ol>
|
195 |
-
<li>Download the Unlock Device Cricket APK file from one of the sources mentioned above.</li>
|
196 |
-
<li>If you are using an Android device, go to the Settings menu and enable the option "Unknown Sources" under Security or Applications. This will allow you to install apps from sources other than the Google Play Store.</li>
|
197 |
-
<li>If you are using an iOS device, go to the Settings menu and tap on "General". Then, tap on "Profiles & Device Management" and trust the profile that belongs to Unlock Device Cricket APK. This will allow you to install apps from sources other than the Apple App Store.</li>
|
198 |
-
<li>Locate the Unlock Device Cricket APK file on your device and tap on it to start the installation process.</li>
|
199 |
-
<li>Follow the on-screen instructions and grant the necessary permissions to the app.</li>
|
200 |
-
<li>Wait for the installation to finish and launch the app from your home screen or app drawer.</li>
|
201 |
-
</ol>
|
202 |
-
<p><img src="" alt="Screenshot of installing Unlock Device Cricket APK"></p>
|
203 |
-
<h2>How to Use Unlock Device Cricket APK?</h2>
|
204 |
-
<p>To use Unlock Device Cricket APK to unlock your device from Cricket Wireless, follow these steps:</p>
|
205 |
-
<ol>
|
206 |
-
<li>Launch the app and agree to the terms and conditions.</li>
|
207 |
-
<li>Select the model and brand of your device from the list or enter it manually.</li>
|
208 |
-
<li>Enter the IMEI number of your device. You can find it by dialing *#06# on your device or by checking the label under the battery or on the box.</li>
|
209 |
-
<li>Tap on "Unlock Now" and wait for the app to generate an unlock code for your device.</li>
|
210 |
-
<li>Power off your device and remove the Cricket SIM card.</li>
|
211 |
-
<li>Insert a new SIM card from another carrier into your device.</li>
|
212 |
-
<li>Power on your device and enter the unlock code when prompted.</li>
|
213 |
-
<li>If the unlock code is accepted, you will see a message that says "Network Unlock Successful".</li>
|
214 |
-
<li>If the unlock code is rejected, you will see a message that says "Network Unlock Failed". In this case, you might need to contact Unlock Device Cricket APK support or try another method.</li>
|
215 |
-
</ol>
|
216 |
-
<p><img src="" alt="Screenshot of using Unlock Device Cricket APK"></p>
|
217 |
-
<h1>Conclusion</h1>
|
218 |
-
<p>In this article, we have shown you how to unlock your device from Cricket Wireless using different methods and steps. We have also explained how to use your unlocked device from Cricket Wireless with a new SIM card. Finally, we have introduced you to Unlock Device Cricket APK, an app that claims to be able to unlock any device from Cricket Wireless without requiring an unlock code or meeting any requirements. We hope that this article has been helpful and informative for you. If you have any questions or feedback, please feel free to leave a comment below. Thank you for reading!</p>
|
219 |
-
<h2>Frequently Asked Questions</h2>
|
220 |
-
<p>Here are some frequently asked questions and answers about unlocking a device from Cricket Wireless:</p>
|
221 |
-
<h3>Q: How long does it take to receive an unlock code from Cricket Wireless?</h3>
|
222 |
-
<p>A: It usually takes up to two business days to receive an unlock code from Cricket Wireless after submitting a request. However, it might take longer depending on the availability of the unlock code or other factors.</p>
|
223 |
-
<h3>Q: How many times can I enter an unlock code on my device?</h3>
|
224 |
-
<p>A: You can enter an unlock code up to 10 times on your device. If you enter an incorrect unlock code more than 10 times, your device will be permanently locked to Cricket Wireless and you will not be able to unlock it again.</p>
|
225 |
-
<h3>Q: What if I forget my account PIN or IMEI number?</h3>
|
226 |
-
<p>A: If you forget your account PIN or IMEI number, you can contact Cricket Wireless customer support at 1-800-CRICKET (1-800-274-2538) and they will help you with the unlock process. You might need to provide some information, such as your phone number, email address, etc.</p>
|
227 |
-
<h3>Q: Is Unlock Device Cricket APK safe and legal?</h3>
|
228 |
-
<p>A: Unlock Device Cricket APK is not a verified or authorized app by Cricket Wireless or any other carrier. Therefore, we cannot guarantee its safety or legality. Use it at your own risk and discretion. We are not responsible for any damage or loss that may result from using this app.</p>
|
229 |
-
<h3>Q: Can I use my unlocked device from Cricket Wireless with any carrier?</h3>
|
230 |
-
<p>A: You can use your unlocked device from Cricket Wireless with any compatible SIM card from another carrier. However, you need to check if your device supports the network frequency bands of the new carrier. You also need to update the APN settings of your device according to the new carrier's instructions. You can find them on their website or by contacting their customer support.</p> 197e85843d<br />
|
231 |
-
<br />
|
232 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Download Super Bear Adventure MOD APK and Join the Fun with Your Friends.md
DELETED
@@ -1,124 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Download Game 3D Platformer Super Bear Adventure Mod APK</h1>
|
3 |
-
<p>If you are looking for a fun and nostalgic platformer game that will remind you of the late 90s classics, then you should try Super Bear Adventure. This game is a 3D platformer game that lets you explore six open world levels, discover their secrets, talk to the kingdom's inhabitants, collect coins, unlock hats, fight enemies, and free your friends. And if you want to enhance your gaming experience, you can download the mod APK version of Super Bear Adventure and play it on your PC. In this article, we will tell you everything you need to know about Super Bear Adventure and how to download and install its mod APK on your PC.</p>
|
4 |
-
<h2>What is Super Bear Adventure?</h2>
|
5 |
-
<p>Super Bear Adventure is a 3D platformer game developed by Earthkwak Games. It is inspired by the late 90s games such as Super Mario 64, Banjo-Kazooie, and Spyro the Dragon. The game has a colorful and cartoonish graphics style that will appeal to both kids and adults. The game also has a catchy soundtrack that matches the mood of each level.</p>
|
6 |
-
<h2>download game 3d platformer super bear adventure mod apk</h2><br /><p><b><b>DOWNLOAD</b> >>>>> <a href="https://jinyurl.com/2uNQcd">https://jinyurl.com/2uNQcd</a></b></p><br /><br />
|
7 |
-
<p>The story of the game is that a mysterious being has arrived in the peaceful realm of the bears and has locked your bear friends in cages and mind-controlled the other animals. It is your duty as a brave bear to free them all and restore peace to the world. You will have to explore six different levels, each with its own theme, challenges, secrets, and boss. You will also have to collect coins that you can use to buy hats that will give you different abilities. You can also talk to the other characters in the game and learn more about the lore and history of the kingdom.</p>
|
8 |
-
<h3>Features of Super Bear Adventure</h3>
|
9 |
-
<ul>
|
10 |
-
<li>6 open world levels with different themes, challenges, secrets, and bosses</li>
|
11 |
-
<li>Over 50 hats to unlock and customize your bear</li>
|
12 |
-
<li>A variety of enemies and obstacles to overcome</li>
|
13 |
-
<li>A charming and humorous dialogue with the other characters</li>
|
14 |
-
<li>A simple and intuitive control scheme that works well on mobile devices</li>
|
15 |
-
<li>A nostalgic and retro graphics style that pays homage to the late 90s games</li>
|
16 |
-
<li>A catchy and upbeat soundtrack that matches the mood of each level</li>
|
17 |
-
</ul>
|
18 |
-
<h3>Why play Super Bear Adventure on PC?</h3>
|
19 |
-
<p>While Super Bear Adventure is a great game to play on your mobile device, you might want to play it on your PC for several reasons. First of all, playing on a bigger screen will give you a better view of the game's beautiful graphics and details. Second, playing on a PC will allow you to use a keyboard and mouse or a controller for more precise and comfortable controls. Third, playing on a PC will ensure a smoother and faster performance without any lag or crashes. And finally, playing on a PC will let you enjoy the game's full potential with the mod APK version.</p>
|
20 |
-
<h2>What is Mod APK?</h2>
|
21 |
-
<p>Mod APK is a modified version of an original APK file that has been altered by third-party developers to add or remove some features from the original game or app. Mod APKs are usually created for various purposes such as unlocking premium features, removing ads, adding cheats, enhancing graphics, or improving performance.</p>
|
22 |
-
<h3>Benefits of Mod APK</h3>
|
23 |
-
<ul>
|
24 |
-
<li>You can access premium features that are normally locked or require in-app purchases</li>
|
25 |
-
<li>You can remove annoying ads that interrupt your gameplay or consume your data</li>
|
26 |
-
<li>You can add cheats or hacks that will make the game easier or more fun</li>
|
27 |
-
<li>You can enhance the graphics or sound quality <li>You can improve the performance or compatibility of the game or app</li>
|
28 |
-
</ul>
|
29 |
-
<h3>Risks of Mod APK</h3>
|
30 |
-
<ul>
|
31 |
-
<li>You can expose your device to malware or viruses that can harm your data or privacy</li>
|
32 |
-
<li>You can violate the terms and conditions of the original game or app and get banned or suspended</li>
|
33 |
-
<li>You can lose your progress or data if the mod APK is not updated or compatible with the original version</li>
|
34 |
-
<li>You can miss out on the official updates or features that the original developers provide</li>
|
35 |
-
</ul>
|
36 |
-
<h2>How to download and install Super Bear Adventure Mod APK on PC?</h2>
|
37 |
-
<p>If you want to download and install Super Bear Adventure Mod APK on your PC, you will need to use an Android emulator. An Android emulator is a software that allows you to run Android apps and games on your PC. There are many Android emulators available, but we recommend using BlueStacks, as it is one of the most popular and reliable ones. Here are the steps to download and install Super Bear Adventure Mod APK on your PC using BlueStacks:</p>
|
38 |
-
<h3>Step 1: Download and install BlueStacks</h3>
|
39 |
-
<ul>
|
40 |
-
<li>Go to the official website of BlueStacks and download the latest version of the software for your PC.</li>
|
41 |
-
<li>Run the installer and follow the instructions to install BlueStacks on your PC.</li>
|
42 |
-
<li>Launch BlueStacks and sign in with your Google account or create a new one.</li>
|
43 |
-
</ul>
|
44 |
-
<h3>Step 2: Download Super Bear Adventure Mod APK from a trusted source</h3>
|
45 |
-
<ul>
|
46 |
-
<li>Search for a reputable website that offers Super Bear Adventure Mod APK for download. Make sure to check the reviews and ratings of the website and the mod APK before downloading.</li>
|
47 |
-
<li>Download the Super Bear Adventure Mod APK file to your PC.</li>
|
48 |
-
<li>Locate the downloaded file and right-click on it. Select "Open with" and choose "BlueStacks" as the app to open it.</li>
|
49 |
-
</ul>
|
50 |
-
<h3>Step 3: Install Super Bear Adventure Mod APK on BlueStacks</h3>
|
51 |
-
<ul>
|
52 |
-
<li>BlueStacks will automatically install the Super Bear Adventure Mod APK on its platform.</li>
|
53 |
-
<li>Wait for the installation to finish and then go to the "My Apps" tab on BlueStacks.</li>
|
54 |
-
<li>You will see the icon of Super Bear Adventure on the screen. Click on it to launch the game.</li>
|
55 |
-
</ul>
|
56 |
-
<h3>Step 4: Launch Super Bear Adventure and enjoy the game</h3>
|
57 |
-
<ul>
|
58 |
-
<li>You can now play Super Bear Adventure on your PC with all the mod features enabled.</li>
|
59 |
-
<li>You can use your keyboard and mouse or a controller to control the game.</li>
|
60 |
-
<li>You can also adjust the settings and preferences of the game according to your liking.</li>
|
61 |
-
</ul>
|
62 |
-
<h2>Conclusion</h2>
|
63 |
-
<p>Super Bear Adventure is a 3D platformer game that will bring back memories of the late 90s classics. It is a fun and engaging game that will keep you entertained for hours. You can download the mod APK version of Super Bear Adventure and play it on your PC for a better gaming experience. All you need is an Android emulator like BlueStacks and a trusted source for downloading the mod APK file. Follow our guide above and you will be able to download and install Super Bear Adventure Mod APK on your PC in no time.</p>
|
64 |
-
<h2>FAQs</h2>
|
65 |
-
<ol>
|
66 |
-
<li>What are the minimum system requirements for playing Super Bear Adventure on PC?</li>
|
67 |
-
<p>The minimum system requirements for playing Super Bear Adventure on PC are:</p>
|
68 |
-
<p>download super bear adventure mod apk unlocked all<br />
|
69 |
-
3d platformer game super bear adventure mod apk free<br />
|
70 |
-
how to download super bear adventure mod apk for android<br />
|
71 |
-
super bear adventure 3d platformer mod apk latest version<br />
|
72 |
-
download game super bear adventure mod apk unlimited coins<br />
|
73 |
-
super bear adventure mod apk 3d platformer game offline<br />
|
74 |
-
super bear adventure mod apk download for pc<br />
|
75 |
-
3d platformer super bear adventure mod apk no ads<br />
|
76 |
-
download game super bear adventure mod apk full version<br />
|
77 |
-
super bear adventure 3d platformer mod apk android 1<br />
|
78 |
-
download super bear adventure mod apk hack<br />
|
79 |
-
3d platformer game super bear adventure mod apk online<br />
|
80 |
-
super bear adventure mod apk download game 3d platformer<br />
|
81 |
-
download game super bear adventure mod apk revdl<br />
|
82 |
-
super bear adventure 3d platformer mod apk rexdl<br />
|
83 |
-
download super bear adventure mod apk premium<br />
|
84 |
-
3d platformer game super bear adventure mod apk update<br />
|
85 |
-
super bear adventure mod apk download game 3d platformer for free<br />
|
86 |
-
download game super bear adventure mod apk pro<br />
|
87 |
-
super bear adventure 3d platformer mod apk unlimited money<br />
|
88 |
-
download super bear adventure mod apk cracked<br />
|
89 |
-
3d platformer game super bear adventure mod apk new version<br />
|
90 |
-
super bear adventure mod apk download game 3d platformer offline<br />
|
91 |
-
download game super bear adventure mod apk mega mod<br />
|
92 |
-
super bear adventure 3d platformer mod apk obb data<br />
|
93 |
-
download super bear adventure mod apk cheat<br />
|
94 |
-
3d platformer game super bear adventure mod apk old version<br />
|
95 |
-
super bear adventure mod apk download game 3d platformer online<br />
|
96 |
-
download game super bear adventure mod apk vip<br />
|
97 |
-
super bear adventure 3d platformer mod apk all levels unlocked<br />
|
98 |
-
download super bear adventure mod apk unlimited gems<br />
|
99 |
-
3d platformer game super bear adventure mod apk original<br />
|
100 |
-
super bear adventure mod apk download game 3d platformer hack<br />
|
101 |
-
download game super bear adventure mod apk no root<br />
|
102 |
-
super bear adventure 3d platformer mod apk pure</p>
|
103 |
-
<ul>
|
104 |
-
<li>Operating System: Windows 7 or higher, Mac OS X 10.11 or higher</li>
|
105 |
-
<li>CPU: Intel or AMD processor with virtualization support</li>
|
106 |
-
<li>RAM: At least 4 GB</li>
|
107 |
-
<li>HDD: At least 5 GB of free disk space</li>
|
108 |
-
<li>Graphics: Intel/Nvidia/ATI, Onboard or Discrete controller with OpenGL 2.1 support</li>
|
109 |
-
</ul>
|
110 |
-
<li>Is Super Bear Adventure Mod APK safe to use?</li>
|
111 |
-
<p>Super Bear Adventure Mod APK is generally safe to use, as long as you download it from a reliable source. However, you should always be careful when downloading any mod APK files, as they may contain malware or viruses that can harm your device or data. You should also scan the mod APK file with an antivirus software before installing it.</p>
|
112 |
-
<li>Can I play Super Bear Adventure online with other players?</li>
|
113 |
-
<p>No, Super Bear Adventure is not an online game. It is a single-player game that does not require an internet connection to play. You can play it offline anytime and anywhere you want.</p>
|
114 |
-
<li>How can I update <li>How can I update Super Bear Adventure Mod APK on my PC?</li>
|
115 |
-
<p>To update Super Bear Adventure Mod APK on your PC, you will need to download the latest version of the mod APK file from the same source that you downloaded it from before. Then, you will need to uninstall the previous version of the mod APK from BlueStacks and install the new one. Alternatively, you can check if there is an update option within the game itself and follow the instructions to update it.</p>
|
116 |
-
<li>What are some similar games to Super Bear Adventure?</li>
|
117 |
-
<p>If you like Super Bear Adventure, you might also enjoy some other 3D platformer games that are available on PC. Some of them are:</p>
|
118 |
-
<ul>
|
119 |
-
<li>Crash Bandicoot N. Sane Trilogy: A remastered collection of the first three Crash Bandicoot games that feature the same gameplay and style as Super Bear Adventure.</li>
|
120 |
-
<li>A Hat in Time: A cute and charming 3D platformer game that follows the adventures of a young girl who travels across various worlds using her magical hat.</li>
|
121 |
-
<li>Yooka-Laylee: A spiritual successor to Banjo-Kazooie that features two animal protagonists who explore colorful and whimsical worlds full of puzzles and secrets.</li>
|
122 |
-
</ul></p> 197e85843d<br />
|
123 |
-
<br />
|
124 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/3B-Group/ConvRe-Leaderboard/README.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: ConvRe Leaderboard
|
3 |
-
emoji: 🦀
|
4 |
-
colorFrom: green
|
5 |
-
colorTo: red
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.46.1
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
license: mit
|
11 |
-
---
|
12 |
-
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AB-TW/team-ai/documents/bussiness_context/NOTION_DB/Engineering Wiki 2402f5396a3244fdb3f1d135bdb0f3d6/Development Lifecycle e20a5470e52f49e9bbc4f255cf81db4b.md
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
# Development Lifecycle
|
2 |
-
|
3 |
-
Last edited time: March 31, 2023 1:49 PM
|
4 |
-
Owner: Anonymous
|
5 |
-
Tags: Guides and Processes
|
6 |
-
|
7 |
-
<aside>
|
8 |
-
💡 This page documents the development process engineers should follow at your company. Helpful for getting new employees up to speed.
|
9 |
-
|
10 |
-
</aside>
|
11 |
-
|
12 |
-
# 1. Create a branch off of `master`
|
13 |
-
|
14 |
-
Name the branch with your first name pre-pended:
|
15 |
-
`leslie/cool-feature`
|
16 |
-
|
17 |
-
# 2. Writing code
|
18 |
-
|
19 |
-
You can link to other pages in your workspace in a couple ways:
|
20 |
-
|
21 |
-
- Type `/link`, press `enter`, and type the name of the page you want. This creates a link like this one:
|
22 |
-
|
23 |
-
[Engineering Guidelines](Engineering%20Guidelines%204208cbd4733d4f6f94982f3fb24f6379.md)
|
24 |
-
|
25 |
-
- To create a link inline, type `@` followed by the title of the page, then press `enter`. The result looks like this: [Engineering Guidelines](Engineering%20Guidelines%204208cbd4733d4f6f94982f3fb24f6379.md)
|
26 |
-
|
27 |
-
# 3. Create a pull request on Github
|
28 |
-
|
29 |
-
Include the Notion task link in your PR description.
|
30 |
-
|
31 |
-
# 4. Submit for review
|
32 |
-
|
33 |
-
- Assign the task in Notion to the appropriate reviewer.
|
34 |
-
- You can always tag a person on a Notion page by typing `@` followed by their name.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AI-Hobbyist/Hoyo-RVC/train/data_utils.py
DELETED
@@ -1,512 +0,0 @@
|
|
1 |
-
import os, traceback
|
2 |
-
import numpy as np
|
3 |
-
import torch
|
4 |
-
import torch.utils.data
|
5 |
-
|
6 |
-
from mel_processing import spectrogram_torch
|
7 |
-
from utils import load_wav_to_torch, load_filepaths_and_text
|
8 |
-
|
9 |
-
|
10 |
-
class TextAudioLoaderMultiNSFsid(torch.utils.data.Dataset):
|
11 |
-
"""
|
12 |
-
1) loads audio, text pairs
|
13 |
-
2) normalizes text and converts them to sequences of integers
|
14 |
-
3) computes spectrograms from audio files.
|
15 |
-
"""
|
16 |
-
|
17 |
-
def __init__(self, audiopaths_and_text, hparams):
|
18 |
-
self.audiopaths_and_text = load_filepaths_and_text(audiopaths_and_text)
|
19 |
-
self.max_wav_value = hparams.max_wav_value
|
20 |
-
self.sampling_rate = hparams.sampling_rate
|
21 |
-
self.filter_length = hparams.filter_length
|
22 |
-
self.hop_length = hparams.hop_length
|
23 |
-
self.win_length = hparams.win_length
|
24 |
-
self.sampling_rate = hparams.sampling_rate
|
25 |
-
self.min_text_len = getattr(hparams, "min_text_len", 1)
|
26 |
-
self.max_text_len = getattr(hparams, "max_text_len", 5000)
|
27 |
-
self._filter()
|
28 |
-
|
29 |
-
def _filter(self):
|
30 |
-
"""
|
31 |
-
Filter text & store spec lengths
|
32 |
-
"""
|
33 |
-
# Store spectrogram lengths for Bucketing
|
34 |
-
# wav_length ~= file_size / (wav_channels * Bytes per dim) = file_size / (1 * 2)
|
35 |
-
# spec_length = wav_length // hop_length
|
36 |
-
audiopaths_and_text_new = []
|
37 |
-
lengths = []
|
38 |
-
for audiopath, text, pitch, pitchf, dv in self.audiopaths_and_text:
|
39 |
-
if self.min_text_len <= len(text) and len(text) <= self.max_text_len:
|
40 |
-
audiopaths_and_text_new.append([audiopath, text, pitch, pitchf, dv])
|
41 |
-
lengths.append(os.path.getsize(audiopath) // (3 * self.hop_length))
|
42 |
-
self.audiopaths_and_text = audiopaths_and_text_new
|
43 |
-
self.lengths = lengths
|
44 |
-
|
45 |
-
def get_sid(self, sid):
|
46 |
-
sid = torch.LongTensor([int(sid)])
|
47 |
-
return sid
|
48 |
-
|
49 |
-
def get_audio_text_pair(self, audiopath_and_text):
|
50 |
-
# separate filename and text
|
51 |
-
file = audiopath_and_text[0]
|
52 |
-
phone = audiopath_and_text[1]
|
53 |
-
pitch = audiopath_and_text[2]
|
54 |
-
pitchf = audiopath_and_text[3]
|
55 |
-
dv = audiopath_and_text[4]
|
56 |
-
|
57 |
-
phone, pitch, pitchf = self.get_labels(phone, pitch, pitchf)
|
58 |
-
spec, wav = self.get_audio(file)
|
59 |
-
dv = self.get_sid(dv)
|
60 |
-
|
61 |
-
len_phone = phone.size()[0]
|
62 |
-
len_spec = spec.size()[-1]
|
63 |
-
# print(123,phone.shape,pitch.shape,spec.shape)
|
64 |
-
if len_phone != len_spec:
|
65 |
-
len_min = min(len_phone, len_spec)
|
66 |
-
# amor
|
67 |
-
len_wav = len_min * self.hop_length
|
68 |
-
|
69 |
-
spec = spec[:, :len_min]
|
70 |
-
wav = wav[:, :len_wav]
|
71 |
-
|
72 |
-
phone = phone[:len_min, :]
|
73 |
-
pitch = pitch[:len_min]
|
74 |
-
pitchf = pitchf[:len_min]
|
75 |
-
|
76 |
-
return (spec, wav, phone, pitch, pitchf, dv)
|
77 |
-
|
78 |
-
def get_labels(self, phone, pitch, pitchf):
|
79 |
-
phone = np.load(phone)
|
80 |
-
phone = np.repeat(phone, 2, axis=0)
|
81 |
-
pitch = np.load(pitch)
|
82 |
-
pitchf = np.load(pitchf)
|
83 |
-
n_num = min(phone.shape[0], 900) # DistributedBucketSampler
|
84 |
-
# print(234,phone.shape,pitch.shape)
|
85 |
-
phone = phone[:n_num, :]
|
86 |
-
pitch = pitch[:n_num]
|
87 |
-
pitchf = pitchf[:n_num]
|
88 |
-
phone = torch.FloatTensor(phone)
|
89 |
-
pitch = torch.LongTensor(pitch)
|
90 |
-
pitchf = torch.FloatTensor(pitchf)
|
91 |
-
return phone, pitch, pitchf
|
92 |
-
|
93 |
-
def get_audio(self, filename):
|
94 |
-
audio, sampling_rate = load_wav_to_torch(filename)
|
95 |
-
if sampling_rate != self.sampling_rate:
|
96 |
-
raise ValueError(
|
97 |
-
"{} SR doesn't match target {} SR".format(
|
98 |
-
sampling_rate, self.sampling_rate
|
99 |
-
)
|
100 |
-
)
|
101 |
-
audio_norm = audio
|
102 |
-
# audio_norm = audio / self.max_wav_value
|
103 |
-
# audio_norm = audio / np.abs(audio).max()
|
104 |
-
|
105 |
-
audio_norm = audio_norm.unsqueeze(0)
|
106 |
-
spec_filename = filename.replace(".wav", ".spec.pt")
|
107 |
-
if os.path.exists(spec_filename):
|
108 |
-
try:
|
109 |
-
spec = torch.load(spec_filename)
|
110 |
-
except:
|
111 |
-
print(spec_filename, traceback.format_exc())
|
112 |
-
spec = spectrogram_torch(
|
113 |
-
audio_norm,
|
114 |
-
self.filter_length,
|
115 |
-
self.sampling_rate,
|
116 |
-
self.hop_length,
|
117 |
-
self.win_length,
|
118 |
-
center=False,
|
119 |
-
)
|
120 |
-
spec = torch.squeeze(spec, 0)
|
121 |
-
torch.save(spec, spec_filename, _use_new_zipfile_serialization=False)
|
122 |
-
else:
|
123 |
-
spec = spectrogram_torch(
|
124 |
-
audio_norm,
|
125 |
-
self.filter_length,
|
126 |
-
self.sampling_rate,
|
127 |
-
self.hop_length,
|
128 |
-
self.win_length,
|
129 |
-
center=False,
|
130 |
-
)
|
131 |
-
spec = torch.squeeze(spec, 0)
|
132 |
-
torch.save(spec, spec_filename, _use_new_zipfile_serialization=False)
|
133 |
-
return spec, audio_norm
|
134 |
-
|
135 |
-
def __getitem__(self, index):
|
136 |
-
return self.get_audio_text_pair(self.audiopaths_and_text[index])
|
137 |
-
|
138 |
-
def __len__(self):
|
139 |
-
return len(self.audiopaths_and_text)
|
140 |
-
|
141 |
-
|
142 |
-
class TextAudioCollateMultiNSFsid:
|
143 |
-
"""Zero-pads model inputs and targets"""
|
144 |
-
|
145 |
-
def __init__(self, return_ids=False):
|
146 |
-
self.return_ids = return_ids
|
147 |
-
|
148 |
-
def __call__(self, batch):
|
149 |
-
"""Collate's training batch from normalized text and aduio
|
150 |
-
PARAMS
|
151 |
-
------
|
152 |
-
batch: [text_normalized, spec_normalized, wav_normalized]
|
153 |
-
"""
|
154 |
-
# Right zero-pad all one-hot text sequences to max input length
|
155 |
-
_, ids_sorted_decreasing = torch.sort(
|
156 |
-
torch.LongTensor([x[0].size(1) for x in batch]), dim=0, descending=True
|
157 |
-
)
|
158 |
-
|
159 |
-
max_spec_len = max([x[0].size(1) for x in batch])
|
160 |
-
max_wave_len = max([x[1].size(1) for x in batch])
|
161 |
-
spec_lengths = torch.LongTensor(len(batch))
|
162 |
-
wave_lengths = torch.LongTensor(len(batch))
|
163 |
-
spec_padded = torch.FloatTensor(len(batch), batch[0][0].size(0), max_spec_len)
|
164 |
-
wave_padded = torch.FloatTensor(len(batch), 1, max_wave_len)
|
165 |
-
spec_padded.zero_()
|
166 |
-
wave_padded.zero_()
|
167 |
-
|
168 |
-
max_phone_len = max([x[2].size(0) for x in batch])
|
169 |
-
phone_lengths = torch.LongTensor(len(batch))
|
170 |
-
phone_padded = torch.FloatTensor(
|
171 |
-
len(batch), max_phone_len, batch[0][2].shape[1]
|
172 |
-
) # (spec, wav, phone, pitch)
|
173 |
-
pitch_padded = torch.LongTensor(len(batch), max_phone_len)
|
174 |
-
pitchf_padded = torch.FloatTensor(len(batch), max_phone_len)
|
175 |
-
phone_padded.zero_()
|
176 |
-
pitch_padded.zero_()
|
177 |
-
pitchf_padded.zero_()
|
178 |
-
# dv = torch.FloatTensor(len(batch), 256)#gin=256
|
179 |
-
sid = torch.LongTensor(len(batch))
|
180 |
-
|
181 |
-
for i in range(len(ids_sorted_decreasing)):
|
182 |
-
row = batch[ids_sorted_decreasing[i]]
|
183 |
-
|
184 |
-
spec = row[0]
|
185 |
-
spec_padded[i, :, : spec.size(1)] = spec
|
186 |
-
spec_lengths[i] = spec.size(1)
|
187 |
-
|
188 |
-
wave = row[1]
|
189 |
-
wave_padded[i, :, : wave.size(1)] = wave
|
190 |
-
wave_lengths[i] = wave.size(1)
|
191 |
-
|
192 |
-
phone = row[2]
|
193 |
-
phone_padded[i, : phone.size(0), :] = phone
|
194 |
-
phone_lengths[i] = phone.size(0)
|
195 |
-
|
196 |
-
pitch = row[3]
|
197 |
-
pitch_padded[i, : pitch.size(0)] = pitch
|
198 |
-
pitchf = row[4]
|
199 |
-
pitchf_padded[i, : pitchf.size(0)] = pitchf
|
200 |
-
|
201 |
-
# dv[i] = row[5]
|
202 |
-
sid[i] = row[5]
|
203 |
-
|
204 |
-
return (
|
205 |
-
phone_padded,
|
206 |
-
phone_lengths,
|
207 |
-
pitch_padded,
|
208 |
-
pitchf_padded,
|
209 |
-
spec_padded,
|
210 |
-
spec_lengths,
|
211 |
-
wave_padded,
|
212 |
-
wave_lengths,
|
213 |
-
# dv
|
214 |
-
sid,
|
215 |
-
)
|
216 |
-
|
217 |
-
|
218 |
-
class TextAudioLoader(torch.utils.data.Dataset):
|
219 |
-
"""
|
220 |
-
1) loads audio, text pairs
|
221 |
-
2) normalizes text and converts them to sequences of integers
|
222 |
-
3) computes spectrograms from audio files.
|
223 |
-
"""
|
224 |
-
|
225 |
-
def __init__(self, audiopaths_and_text, hparams):
|
226 |
-
self.audiopaths_and_text = load_filepaths_and_text(audiopaths_and_text)
|
227 |
-
self.max_wav_value = hparams.max_wav_value
|
228 |
-
self.sampling_rate = hparams.sampling_rate
|
229 |
-
self.filter_length = hparams.filter_length
|
230 |
-
self.hop_length = hparams.hop_length
|
231 |
-
self.win_length = hparams.win_length
|
232 |
-
self.sampling_rate = hparams.sampling_rate
|
233 |
-
self.min_text_len = getattr(hparams, "min_text_len", 1)
|
234 |
-
self.max_text_len = getattr(hparams, "max_text_len", 5000)
|
235 |
-
self._filter()
|
236 |
-
|
237 |
-
def _filter(self):
|
238 |
-
"""
|
239 |
-
Filter text & store spec lengths
|
240 |
-
"""
|
241 |
-
# Store spectrogram lengths for Bucketing
|
242 |
-
# wav_length ~= file_size / (wav_channels * Bytes per dim) = file_size / (1 * 2)
|
243 |
-
# spec_length = wav_length // hop_length
|
244 |
-
audiopaths_and_text_new = []
|
245 |
-
lengths = []
|
246 |
-
for audiopath, text, dv in self.audiopaths_and_text:
|
247 |
-
if self.min_text_len <= len(text) and len(text) <= self.max_text_len:
|
248 |
-
audiopaths_and_text_new.append([audiopath, text, dv])
|
249 |
-
lengths.append(os.path.getsize(audiopath) // (3 * self.hop_length))
|
250 |
-
self.audiopaths_and_text = audiopaths_and_text_new
|
251 |
-
self.lengths = lengths
|
252 |
-
|
253 |
-
def get_sid(self, sid):
|
254 |
-
sid = torch.LongTensor([int(sid)])
|
255 |
-
return sid
|
256 |
-
|
257 |
-
def get_audio_text_pair(self, audiopath_and_text):
|
258 |
-
# separate filename and text
|
259 |
-
file = audiopath_and_text[0]
|
260 |
-
phone = audiopath_and_text[1]
|
261 |
-
dv = audiopath_and_text[2]
|
262 |
-
|
263 |
-
phone = self.get_labels(phone)
|
264 |
-
spec, wav = self.get_audio(file)
|
265 |
-
dv = self.get_sid(dv)
|
266 |
-
|
267 |
-
len_phone = phone.size()[0]
|
268 |
-
len_spec = spec.size()[-1]
|
269 |
-
if len_phone != len_spec:
|
270 |
-
len_min = min(len_phone, len_spec)
|
271 |
-
len_wav = len_min * self.hop_length
|
272 |
-
spec = spec[:, :len_min]
|
273 |
-
wav = wav[:, :len_wav]
|
274 |
-
phone = phone[:len_min, :]
|
275 |
-
return (spec, wav, phone, dv)
|
276 |
-
|
277 |
-
def get_labels(self, phone):
|
278 |
-
phone = np.load(phone)
|
279 |
-
phone = np.repeat(phone, 2, axis=0)
|
280 |
-
n_num = min(phone.shape[0], 900) # DistributedBucketSampler
|
281 |
-
phone = phone[:n_num, :]
|
282 |
-
phone = torch.FloatTensor(phone)
|
283 |
-
return phone
|
284 |
-
|
285 |
-
def get_audio(self, filename):
|
286 |
-
audio, sampling_rate = load_wav_to_torch(filename)
|
287 |
-
if sampling_rate != self.sampling_rate:
|
288 |
-
raise ValueError(
|
289 |
-
"{} SR doesn't match target {} SR".format(
|
290 |
-
sampling_rate, self.sampling_rate
|
291 |
-
)
|
292 |
-
)
|
293 |
-
audio_norm = audio
|
294 |
-
# audio_norm = audio / self.max_wav_value
|
295 |
-
# audio_norm = audio / np.abs(audio).max()
|
296 |
-
|
297 |
-
audio_norm = audio_norm.unsqueeze(0)
|
298 |
-
spec_filename = filename.replace(".wav", ".spec.pt")
|
299 |
-
if os.path.exists(spec_filename):
|
300 |
-
try:
|
301 |
-
spec = torch.load(spec_filename)
|
302 |
-
except:
|
303 |
-
print(spec_filename, traceback.format_exc())
|
304 |
-
spec = spectrogram_torch(
|
305 |
-
audio_norm,
|
306 |
-
self.filter_length,
|
307 |
-
self.sampling_rate,
|
308 |
-
self.hop_length,
|
309 |
-
self.win_length,
|
310 |
-
center=False,
|
311 |
-
)
|
312 |
-
spec = torch.squeeze(spec, 0)
|
313 |
-
torch.save(spec, spec_filename, _use_new_zipfile_serialization=False)
|
314 |
-
else:
|
315 |
-
spec = spectrogram_torch(
|
316 |
-
audio_norm,
|
317 |
-
self.filter_length,
|
318 |
-
self.sampling_rate,
|
319 |
-
self.hop_length,
|
320 |
-
self.win_length,
|
321 |
-
center=False,
|
322 |
-
)
|
323 |
-
spec = torch.squeeze(spec, 0)
|
324 |
-
torch.save(spec, spec_filename, _use_new_zipfile_serialization=False)
|
325 |
-
return spec, audio_norm
|
326 |
-
|
327 |
-
def __getitem__(self, index):
|
328 |
-
return self.get_audio_text_pair(self.audiopaths_and_text[index])
|
329 |
-
|
330 |
-
def __len__(self):
|
331 |
-
return len(self.audiopaths_and_text)
|
332 |
-
|
333 |
-
|
334 |
-
class TextAudioCollate:
|
335 |
-
"""Zero-pads model inputs and targets"""
|
336 |
-
|
337 |
-
def __init__(self, return_ids=False):
|
338 |
-
self.return_ids = return_ids
|
339 |
-
|
340 |
-
def __call__(self, batch):
|
341 |
-
"""Collate's training batch from normalized text and aduio
|
342 |
-
PARAMS
|
343 |
-
------
|
344 |
-
batch: [text_normalized, spec_normalized, wav_normalized]
|
345 |
-
"""
|
346 |
-
# Right zero-pad all one-hot text sequences to max input length
|
347 |
-
_, ids_sorted_decreasing = torch.sort(
|
348 |
-
torch.LongTensor([x[0].size(1) for x in batch]), dim=0, descending=True
|
349 |
-
)
|
350 |
-
|
351 |
-
max_spec_len = max([x[0].size(1) for x in batch])
|
352 |
-
max_wave_len = max([x[1].size(1) for x in batch])
|
353 |
-
spec_lengths = torch.LongTensor(len(batch))
|
354 |
-
wave_lengths = torch.LongTensor(len(batch))
|
355 |
-
spec_padded = torch.FloatTensor(len(batch), batch[0][0].size(0), max_spec_len)
|
356 |
-
wave_padded = torch.FloatTensor(len(batch), 1, max_wave_len)
|
357 |
-
spec_padded.zero_()
|
358 |
-
wave_padded.zero_()
|
359 |
-
|
360 |
-
max_phone_len = max([x[2].size(0) for x in batch])
|
361 |
-
phone_lengths = torch.LongTensor(len(batch))
|
362 |
-
phone_padded = torch.FloatTensor(
|
363 |
-
len(batch), max_phone_len, batch[0][2].shape[1]
|
364 |
-
)
|
365 |
-
phone_padded.zero_()
|
366 |
-
sid = torch.LongTensor(len(batch))
|
367 |
-
|
368 |
-
for i in range(len(ids_sorted_decreasing)):
|
369 |
-
row = batch[ids_sorted_decreasing[i]]
|
370 |
-
|
371 |
-
spec = row[0]
|
372 |
-
spec_padded[i, :, : spec.size(1)] = spec
|
373 |
-
spec_lengths[i] = spec.size(1)
|
374 |
-
|
375 |
-
wave = row[1]
|
376 |
-
wave_padded[i, :, : wave.size(1)] = wave
|
377 |
-
wave_lengths[i] = wave.size(1)
|
378 |
-
|
379 |
-
phone = row[2]
|
380 |
-
phone_padded[i, : phone.size(0), :] = phone
|
381 |
-
phone_lengths[i] = phone.size(0)
|
382 |
-
|
383 |
-
sid[i] = row[3]
|
384 |
-
|
385 |
-
return (
|
386 |
-
phone_padded,
|
387 |
-
phone_lengths,
|
388 |
-
spec_padded,
|
389 |
-
spec_lengths,
|
390 |
-
wave_padded,
|
391 |
-
wave_lengths,
|
392 |
-
sid,
|
393 |
-
)
|
394 |
-
|
395 |
-
|
396 |
-
class DistributedBucketSampler(torch.utils.data.distributed.DistributedSampler):
|
397 |
-
"""
|
398 |
-
Maintain similar input lengths in a batch.
|
399 |
-
Length groups are specified by boundaries.
|
400 |
-
Ex) boundaries = [b1, b2, b3] -> any batch is included either {x | b1 < length(x) <=b2} or {x | b2 < length(x) <= b3}.
|
401 |
-
|
402 |
-
It removes samples which are not included in the boundaries.
|
403 |
-
Ex) boundaries = [b1, b2, b3] -> any x s.t. length(x) <= b1 or length(x) > b3 are discarded.
|
404 |
-
"""
|
405 |
-
|
406 |
-
def __init__(
|
407 |
-
self,
|
408 |
-
dataset,
|
409 |
-
batch_size,
|
410 |
-
boundaries,
|
411 |
-
num_replicas=None,
|
412 |
-
rank=None,
|
413 |
-
shuffle=True,
|
414 |
-
):
|
415 |
-
super().__init__(dataset, num_replicas=num_replicas, rank=rank, shuffle=shuffle)
|
416 |
-
self.lengths = dataset.lengths
|
417 |
-
self.batch_size = batch_size
|
418 |
-
self.boundaries = boundaries
|
419 |
-
|
420 |
-
self.buckets, self.num_samples_per_bucket = self._create_buckets()
|
421 |
-
self.total_size = sum(self.num_samples_per_bucket)
|
422 |
-
self.num_samples = self.total_size // self.num_replicas
|
423 |
-
|
424 |
-
def _create_buckets(self):
|
425 |
-
buckets = [[] for _ in range(len(self.boundaries) - 1)]
|
426 |
-
for i in range(len(self.lengths)):
|
427 |
-
length = self.lengths[i]
|
428 |
-
idx_bucket = self._bisect(length)
|
429 |
-
if idx_bucket != -1:
|
430 |
-
buckets[idx_bucket].append(i)
|
431 |
-
|
432 |
-
for i in range(len(buckets) - 1, -1, -1): #
|
433 |
-
if len(buckets[i]) == 0:
|
434 |
-
buckets.pop(i)
|
435 |
-
self.boundaries.pop(i + 1)
|
436 |
-
|
437 |
-
num_samples_per_bucket = []
|
438 |
-
for i in range(len(buckets)):
|
439 |
-
len_bucket = len(buckets[i])
|
440 |
-
total_batch_size = self.num_replicas * self.batch_size
|
441 |
-
rem = (
|
442 |
-
total_batch_size - (len_bucket % total_batch_size)
|
443 |
-
) % total_batch_size
|
444 |
-
num_samples_per_bucket.append(len_bucket + rem)
|
445 |
-
return buckets, num_samples_per_bucket
|
446 |
-
|
447 |
-
def __iter__(self):
|
448 |
-
# deterministically shuffle based on epoch
|
449 |
-
g = torch.Generator()
|
450 |
-
g.manual_seed(self.epoch)
|
451 |
-
|
452 |
-
indices = []
|
453 |
-
if self.shuffle:
|
454 |
-
for bucket in self.buckets:
|
455 |
-
indices.append(torch.randperm(len(bucket), generator=g).tolist())
|
456 |
-
else:
|
457 |
-
for bucket in self.buckets:
|
458 |
-
indices.append(list(range(len(bucket))))
|
459 |
-
|
460 |
-
batches = []
|
461 |
-
for i in range(len(self.buckets)):
|
462 |
-
bucket = self.buckets[i]
|
463 |
-
len_bucket = len(bucket)
|
464 |
-
ids_bucket = indices[i]
|
465 |
-
num_samples_bucket = self.num_samples_per_bucket[i]
|
466 |
-
|
467 |
-
# add extra samples to make it evenly divisible
|
468 |
-
rem = num_samples_bucket - len_bucket
|
469 |
-
ids_bucket = (
|
470 |
-
ids_bucket
|
471 |
-
+ ids_bucket * (rem // len_bucket)
|
472 |
-
+ ids_bucket[: (rem % len_bucket)]
|
473 |
-
)
|
474 |
-
|
475 |
-
# subsample
|
476 |
-
ids_bucket = ids_bucket[self.rank :: self.num_replicas]
|
477 |
-
|
478 |
-
# batching
|
479 |
-
for j in range(len(ids_bucket) // self.batch_size):
|
480 |
-
batch = [
|
481 |
-
bucket[idx]
|
482 |
-
for idx in ids_bucket[
|
483 |
-
j * self.batch_size : (j + 1) * self.batch_size
|
484 |
-
]
|
485 |
-
]
|
486 |
-
batches.append(batch)
|
487 |
-
|
488 |
-
if self.shuffle:
|
489 |
-
batch_ids = torch.randperm(len(batches), generator=g).tolist()
|
490 |
-
batches = [batches[i] for i in batch_ids]
|
491 |
-
self.batches = batches
|
492 |
-
|
493 |
-
assert len(self.batches) * self.batch_size == self.num_samples
|
494 |
-
return iter(self.batches)
|
495 |
-
|
496 |
-
def _bisect(self, x, lo=0, hi=None):
|
497 |
-
if hi is None:
|
498 |
-
hi = len(self.boundaries) - 1
|
499 |
-
|
500 |
-
if hi > lo:
|
501 |
-
mid = (hi + lo) // 2
|
502 |
-
if self.boundaries[mid] < x and x <= self.boundaries[mid + 1]:
|
503 |
-
return mid
|
504 |
-
elif x <= self.boundaries[mid]:
|
505 |
-
return self._bisect(x, lo, mid)
|
506 |
-
else:
|
507 |
-
return self._bisect(x, mid + 1, hi)
|
508 |
-
else:
|
509 |
-
return -1
|
510 |
-
|
511 |
-
def __len__(self):
|
512 |
-
return self.num_samples // self.batch_size
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIGC-Audio/AudioGPT/text_to_speech/modules/vocoder/parallel_wavegan/models/__init__.py
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
from .melgan import * # NOQA
|
2 |
-
from .parallel_wavegan import * # NOQA
|
|
|
|
|
|
spaces/AIWaves/Software_Company/src/agents/template.py
DELETED
@@ -1,111 +0,0 @@
|
|
1 |
-
## default { "temperature": 0.3, "model": "gpt-3.5-turbo-16k-0613","log_path": "logs/{your name}"}
|
2 |
-
LLM = {
|
3 |
-
"temperature": 0.0,
|
4 |
-
"model": "gpt-3.5-turbo-16k-0613",
|
5 |
-
"log_path": "logs/god"
|
6 |
-
}
|
7 |
-
|
8 |
-
|
9 |
-
Agents = {
|
10 |
-
"Lilong" : {
|
11 |
-
"style" : "professional",
|
12 |
-
"roles" : {
|
13 |
-
"company" : "coder",
|
14 |
-
"state2" : "role2",
|
15 |
-
},
|
16 |
-
"name2" : {
|
17 |
-
"style" : "professional",
|
18 |
-
"roles" : {
|
19 |
-
"company" : "coder",
|
20 |
-
"state2" : "role2",
|
21 |
-
},
|
22 |
-
}
|
23 |
-
}
|
24 |
-
}
|
25 |
-
|
26 |
-
# indispensable parameter: "controller_type"("order","random","rule")
|
27 |
-
# default extract words: "end". You can choose not to fill in this parameter
|
28 |
-
controller = {
|
29 |
-
"controller_type": "order",
|
30 |
-
"max_chat_nums" : 12,
|
31 |
-
"judge_system_prompt": "",
|
32 |
-
"judge_last_prompt": "",
|
33 |
-
"judge_extract_words": "end",
|
34 |
-
"call_system_prompt" : "",
|
35 |
-
"call_last_prompt": "",
|
36 |
-
"call_extract_words": ""
|
37 |
-
}
|
38 |
-
|
39 |
-
#
|
40 |
-
Agent_state = {
|
41 |
-
"role": {
|
42 |
-
"LLM_type": "OpenAI",
|
43 |
-
"LLM": LLM,
|
44 |
-
"style": {
|
45 |
-
"role": "Opening Advocate for the Affirmative",
|
46 |
-
"style": "professional"
|
47 |
-
},
|
48 |
-
"task": {
|
49 |
-
"task": ""
|
50 |
-
},
|
51 |
-
"rule": {
|
52 |
-
"rule": ""
|
53 |
-
}
|
54 |
-
},
|
55 |
-
}
|
56 |
-
|
57 |
-
|
58 |
-
# indispensable parameter: "agent_states","controller"
|
59 |
-
# "roles" determines the speaking order when the rule is order. If not set, it is the default order.
|
60 |
-
# "begin_query" & "begin_role" determines the first speaker.It often determines the direction of the next speech. If you do not set it, it will default to the first agent.
|
61 |
-
# "environment_prompt" : Responsible for setting the scene for the current environment
|
62 |
-
State = {
|
63 |
-
"controller": controller,
|
64 |
-
"begin_role": "",
|
65 |
-
"begin_query": "",
|
66 |
-
"environment_prompt": "",
|
67 |
-
"roles": ["role1","role2"],
|
68 |
-
"LLM_type": "OpenAI",
|
69 |
-
"LLM": LLM,
|
70 |
-
"agent_state" : Agent_state,
|
71 |
-
}
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
States = {
|
76 |
-
"end_state":{
|
77 |
-
"agent_states":{}
|
78 |
-
},
|
79 |
-
"state1" : State
|
80 |
-
|
81 |
-
}
|
82 |
-
|
83 |
-
|
84 |
-
# default finish_state_name is "end_state"
|
85 |
-
# "environment_type" : "competive" : different states not share the memory; "cooperative":diffrent states share the memory
|
86 |
-
SOP = {
|
87 |
-
"config" : {
|
88 |
-
"API_KEY" : "Your key",
|
89 |
-
"PROXY" : "Your PROXY",
|
90 |
-
"MAX_CHAT_HISTORY" : "5",
|
91 |
-
"User_Names" : "[\"alexander\"]"
|
92 |
-
},
|
93 |
-
"environment_type" : "competive",
|
94 |
-
"LLM_type": "OpenAI",
|
95 |
-
"LLM" :LLM,
|
96 |
-
"root": "state1",
|
97 |
-
"finish_state_name" : "end_state",
|
98 |
-
"relations": {
|
99 |
-
"state1": {
|
100 |
-
"0": "state1",
|
101 |
-
"1": "state2"
|
102 |
-
},
|
103 |
-
"state2":{
|
104 |
-
"0":"state2",
|
105 |
-
"1":"end_state"
|
106 |
-
}
|
107 |
-
},
|
108 |
-
"agents": Agents,
|
109 |
-
"states": States,
|
110 |
-
}
|
111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIZero2Hero4Health/9-Seq2SeqQAGenerator-GR/README.md
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: 9 Seq2SeqQAGenerator GR
|
3 |
-
emoji: 👁
|
4 |
-
colorFrom: indigo
|
5 |
-
colorTo: indigo
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.8.2
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIZero2HeroBootcamp/ChatGPTandLangchain/README.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: ChatGPTandLangchain
|
3 |
-
emoji: 😻
|
4 |
-
colorFrom: indigo
|
5 |
-
colorTo: red
|
6 |
-
sdk: streamlit
|
7 |
-
sdk_version: 1.21.0
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
license: mit
|
11 |
-
---
|
12 |
-
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIxPha/Real-CUGAN/app.py
DELETED
@@ -1,62 +0,0 @@
|
|
1 |
-
from upcunet_v3 import RealWaifuUpScaler
|
2 |
-
import gradio as gr
|
3 |
-
import time
|
4 |
-
import logging
|
5 |
-
import os
|
6 |
-
from PIL import ImageOps
|
7 |
-
import numpy as np
|
8 |
-
import math
|
9 |
-
|
10 |
-
|
11 |
-
def greet(input_img, input_model_name, input_tile_mode):
|
12 |
-
# if input_img.size[0] * input_img.size[1] > 256 * 256:
|
13 |
-
# y = int(math.sqrt(256*256/input_img.size[0]*input_img.size[1]))
|
14 |
-
# x = int(input_img.size[0]/input_img.size[1]*y)
|
15 |
-
# input_img = ImageOps.fit(input_img, (x, y))
|
16 |
-
input_img = np.array(input_img)
|
17 |
-
if input_model_name not in model_cache:
|
18 |
-
t1 = time.time()
|
19 |
-
upscaler = RealWaifuUpScaler(input_model_name[2], ModelPath + input_model_name, half=False, device="cpu")
|
20 |
-
t2 = time.time()
|
21 |
-
logger.info(f'load model time, {t2 - t1}')
|
22 |
-
model_cache[input_model_name] = upscaler
|
23 |
-
else:
|
24 |
-
upscaler = model_cache[input_model_name]
|
25 |
-
logger.info(f'load model from cache')
|
26 |
-
|
27 |
-
start = time.time()
|
28 |
-
result = upscaler(input_img, tile_mode=input_tile_mode)
|
29 |
-
end = time.time()
|
30 |
-
logger.info(f'input_model_name, {input_model_name}')
|
31 |
-
logger.info(f'input_tile_mode, {input_tile_mode}')
|
32 |
-
logger.info(f'input shape, {input_img.shape}')
|
33 |
-
logger.info(f'output shape, {result.shape}')
|
34 |
-
logger.info(f'speed time, {end - start}')
|
35 |
-
return result
|
36 |
-
|
37 |
-
|
38 |
-
if __name__ == '__main__':
|
39 |
-
logging.basicConfig(level=logging.INFO, format="[%(asctime)s] [%(process)d] [%(levelname)s] %(message)s")
|
40 |
-
logger = logging.getLogger()
|
41 |
-
|
42 |
-
ModelPath = "weights_v3/"
|
43 |
-
model_cache = {}
|
44 |
-
|
45 |
-
input_model_name = gr.inputs.Dropdown(os.listdir(ModelPath), default="up2x-latest-denoise2x.pth", label='选择model')
|
46 |
-
input_tile_mode = gr.inputs.Dropdown([0, 1, 2, 3, 4], default=2, label='选择tile_mode')
|
47 |
-
input_img = gr.inputs.Image(label='image', type='pil')
|
48 |
-
|
49 |
-
inputs = [input_img, input_model_name, input_tile_mode]
|
50 |
-
outputs = "image"
|
51 |
-
iface = gr.Interface(fn=greet,
|
52 |
-
inputs=inputs,
|
53 |
-
outputs=outputs,
|
54 |
-
allow_screenshot=False,
|
55 |
-
allow_flagging='never',
|
56 |
-
examples=[['test-img.jpg', "up2x-latest-denoise2x.pth", 2]],
|
57 |
-
article='[https://github.com/bilibili/ailab/tree/main/Real-CUGAN](https://github.com/bilibili/ailab/tree/main/Real-CUGAN)<br>'
|
58 |
-
'感谢b站开源的项目,图片过大会导致内存不足,所有我将图片裁剪小,想体验大图片的效果请自行前往上面的链接。<br>'
|
59 |
-
'修改bbb'
|
60 |
-
'The large image will lead to memory limit exceeded. So I crop and resize image. '
|
61 |
-
'If you want to experience the large image, please go to the link above.')
|
62 |
-
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Adapter/CoAdapter/ldm/modules/extra_condition/midas/midas/transforms.py
DELETED
@@ -1,234 +0,0 @@
|
|
1 |
-
import numpy as np
|
2 |
-
import cv2
|
3 |
-
import math
|
4 |
-
|
5 |
-
|
6 |
-
def apply_min_size(sample, size, image_interpolation_method=cv2.INTER_AREA):
|
7 |
-
"""Rezise the sample to ensure the given size. Keeps aspect ratio.
|
8 |
-
|
9 |
-
Args:
|
10 |
-
sample (dict): sample
|
11 |
-
size (tuple): image size
|
12 |
-
|
13 |
-
Returns:
|
14 |
-
tuple: new size
|
15 |
-
"""
|
16 |
-
shape = list(sample["disparity"].shape)
|
17 |
-
|
18 |
-
if shape[0] >= size[0] and shape[1] >= size[1]:
|
19 |
-
return sample
|
20 |
-
|
21 |
-
scale = [0, 0]
|
22 |
-
scale[0] = size[0] / shape[0]
|
23 |
-
scale[1] = size[1] / shape[1]
|
24 |
-
|
25 |
-
scale = max(scale)
|
26 |
-
|
27 |
-
shape[0] = math.ceil(scale * shape[0])
|
28 |
-
shape[1] = math.ceil(scale * shape[1])
|
29 |
-
|
30 |
-
# resize
|
31 |
-
sample["image"] = cv2.resize(
|
32 |
-
sample["image"], tuple(shape[::-1]), interpolation=image_interpolation_method
|
33 |
-
)
|
34 |
-
|
35 |
-
sample["disparity"] = cv2.resize(
|
36 |
-
sample["disparity"], tuple(shape[::-1]), interpolation=cv2.INTER_NEAREST
|
37 |
-
)
|
38 |
-
sample["mask"] = cv2.resize(
|
39 |
-
sample["mask"].astype(np.float32),
|
40 |
-
tuple(shape[::-1]),
|
41 |
-
interpolation=cv2.INTER_NEAREST,
|
42 |
-
)
|
43 |
-
sample["mask"] = sample["mask"].astype(bool)
|
44 |
-
|
45 |
-
return tuple(shape)
|
46 |
-
|
47 |
-
|
48 |
-
class Resize(object):
|
49 |
-
"""Resize sample to given size (width, height).
|
50 |
-
"""
|
51 |
-
|
52 |
-
def __init__(
|
53 |
-
self,
|
54 |
-
width,
|
55 |
-
height,
|
56 |
-
resize_target=True,
|
57 |
-
keep_aspect_ratio=False,
|
58 |
-
ensure_multiple_of=1,
|
59 |
-
resize_method="lower_bound",
|
60 |
-
image_interpolation_method=cv2.INTER_AREA,
|
61 |
-
):
|
62 |
-
"""Init.
|
63 |
-
|
64 |
-
Args:
|
65 |
-
width (int): desired output width
|
66 |
-
height (int): desired output height
|
67 |
-
resize_target (bool, optional):
|
68 |
-
True: Resize the full sample (image, mask, target).
|
69 |
-
False: Resize image only.
|
70 |
-
Defaults to True.
|
71 |
-
keep_aspect_ratio (bool, optional):
|
72 |
-
True: Keep the aspect ratio of the input sample.
|
73 |
-
Output sample might not have the given width and height, and
|
74 |
-
resize behaviour depends on the parameter 'resize_method'.
|
75 |
-
Defaults to False.
|
76 |
-
ensure_multiple_of (int, optional):
|
77 |
-
Output width and height is constrained to be multiple of this parameter.
|
78 |
-
Defaults to 1.
|
79 |
-
resize_method (str, optional):
|
80 |
-
"lower_bound": Output will be at least as large as the given size.
|
81 |
-
"upper_bound": Output will be at max as large as the given size. (Output size might be smaller than given size.)
|
82 |
-
"minimal": Scale as least as possible. (Output size might be smaller than given size.)
|
83 |
-
Defaults to "lower_bound".
|
84 |
-
"""
|
85 |
-
self.__width = width
|
86 |
-
self.__height = height
|
87 |
-
|
88 |
-
self.__resize_target = resize_target
|
89 |
-
self.__keep_aspect_ratio = keep_aspect_ratio
|
90 |
-
self.__multiple_of = ensure_multiple_of
|
91 |
-
self.__resize_method = resize_method
|
92 |
-
self.__image_interpolation_method = image_interpolation_method
|
93 |
-
|
94 |
-
def constrain_to_multiple_of(self, x, min_val=0, max_val=None):
|
95 |
-
y = (np.round(x / self.__multiple_of) * self.__multiple_of).astype(int)
|
96 |
-
|
97 |
-
if max_val is not None and y > max_val:
|
98 |
-
y = (np.floor(x / self.__multiple_of) * self.__multiple_of).astype(int)
|
99 |
-
|
100 |
-
if y < min_val:
|
101 |
-
y = (np.ceil(x / self.__multiple_of) * self.__multiple_of).astype(int)
|
102 |
-
|
103 |
-
return y
|
104 |
-
|
105 |
-
def get_size(self, width, height):
|
106 |
-
# determine new height and width
|
107 |
-
scale_height = self.__height / height
|
108 |
-
scale_width = self.__width / width
|
109 |
-
|
110 |
-
if self.__keep_aspect_ratio:
|
111 |
-
if self.__resize_method == "lower_bound":
|
112 |
-
# scale such that output size is lower bound
|
113 |
-
if scale_width > scale_height:
|
114 |
-
# fit width
|
115 |
-
scale_height = scale_width
|
116 |
-
else:
|
117 |
-
# fit height
|
118 |
-
scale_width = scale_height
|
119 |
-
elif self.__resize_method == "upper_bound":
|
120 |
-
# scale such that output size is upper bound
|
121 |
-
if scale_width < scale_height:
|
122 |
-
# fit width
|
123 |
-
scale_height = scale_width
|
124 |
-
else:
|
125 |
-
# fit height
|
126 |
-
scale_width = scale_height
|
127 |
-
elif self.__resize_method == "minimal":
|
128 |
-
# scale as least as possbile
|
129 |
-
if abs(1 - scale_width) < abs(1 - scale_height):
|
130 |
-
# fit width
|
131 |
-
scale_height = scale_width
|
132 |
-
else:
|
133 |
-
# fit height
|
134 |
-
scale_width = scale_height
|
135 |
-
else:
|
136 |
-
raise ValueError(
|
137 |
-
f"resize_method {self.__resize_method} not implemented"
|
138 |
-
)
|
139 |
-
|
140 |
-
if self.__resize_method == "lower_bound":
|
141 |
-
new_height = self.constrain_to_multiple_of(
|
142 |
-
scale_height * height, min_val=self.__height
|
143 |
-
)
|
144 |
-
new_width = self.constrain_to_multiple_of(
|
145 |
-
scale_width * width, min_val=self.__width
|
146 |
-
)
|
147 |
-
elif self.__resize_method == "upper_bound":
|
148 |
-
new_height = self.constrain_to_multiple_of(
|
149 |
-
scale_height * height, max_val=self.__height
|
150 |
-
)
|
151 |
-
new_width = self.constrain_to_multiple_of(
|
152 |
-
scale_width * width, max_val=self.__width
|
153 |
-
)
|
154 |
-
elif self.__resize_method == "minimal":
|
155 |
-
new_height = self.constrain_to_multiple_of(scale_height * height)
|
156 |
-
new_width = self.constrain_to_multiple_of(scale_width * width)
|
157 |
-
else:
|
158 |
-
raise ValueError(f"resize_method {self.__resize_method} not implemented")
|
159 |
-
|
160 |
-
return (new_width, new_height)
|
161 |
-
|
162 |
-
def __call__(self, sample):
|
163 |
-
width, height = self.get_size(
|
164 |
-
sample["image"].shape[1], sample["image"].shape[0]
|
165 |
-
)
|
166 |
-
|
167 |
-
# resize sample
|
168 |
-
sample["image"] = cv2.resize(
|
169 |
-
sample["image"],
|
170 |
-
(width, height),
|
171 |
-
interpolation=self.__image_interpolation_method,
|
172 |
-
)
|
173 |
-
|
174 |
-
if self.__resize_target:
|
175 |
-
if "disparity" in sample:
|
176 |
-
sample["disparity"] = cv2.resize(
|
177 |
-
sample["disparity"],
|
178 |
-
(width, height),
|
179 |
-
interpolation=cv2.INTER_NEAREST,
|
180 |
-
)
|
181 |
-
|
182 |
-
if "depth" in sample:
|
183 |
-
sample["depth"] = cv2.resize(
|
184 |
-
sample["depth"], (width, height), interpolation=cv2.INTER_NEAREST
|
185 |
-
)
|
186 |
-
|
187 |
-
sample["mask"] = cv2.resize(
|
188 |
-
sample["mask"].astype(np.float32),
|
189 |
-
(width, height),
|
190 |
-
interpolation=cv2.INTER_NEAREST,
|
191 |
-
)
|
192 |
-
sample["mask"] = sample["mask"].astype(bool)
|
193 |
-
|
194 |
-
return sample
|
195 |
-
|
196 |
-
|
197 |
-
class NormalizeImage(object):
|
198 |
-
"""Normlize image by given mean and std.
|
199 |
-
"""
|
200 |
-
|
201 |
-
def __init__(self, mean, std):
|
202 |
-
self.__mean = mean
|
203 |
-
self.__std = std
|
204 |
-
|
205 |
-
def __call__(self, sample):
|
206 |
-
sample["image"] = (sample["image"] - self.__mean) / self.__std
|
207 |
-
|
208 |
-
return sample
|
209 |
-
|
210 |
-
|
211 |
-
class PrepareForNet(object):
|
212 |
-
"""Prepare sample for usage as network input.
|
213 |
-
"""
|
214 |
-
|
215 |
-
def __init__(self):
|
216 |
-
pass
|
217 |
-
|
218 |
-
def __call__(self, sample):
|
219 |
-
image = np.transpose(sample["image"], (2, 0, 1))
|
220 |
-
sample["image"] = np.ascontiguousarray(image).astype(np.float32)
|
221 |
-
|
222 |
-
if "mask" in sample:
|
223 |
-
sample["mask"] = sample["mask"].astype(np.float32)
|
224 |
-
sample["mask"] = np.ascontiguousarray(sample["mask"])
|
225 |
-
|
226 |
-
if "disparity" in sample:
|
227 |
-
disparity = sample["disparity"].astype(np.float32)
|
228 |
-
sample["disparity"] = np.ascontiguousarray(disparity)
|
229 |
-
|
230 |
-
if "depth" in sample:
|
231 |
-
depth = sample["depth"].astype(np.float32)
|
232 |
-
sample["depth"] = np.ascontiguousarray(depth)
|
233 |
-
|
234 |
-
return sample
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/spinner/facebook/Factory.js
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
import Facebook from './Facebook.js';
|
2 |
-
import ObjectFactory from '../ObjectFactory.js';
|
3 |
-
import SetValue from '../../../plugins/utils/object/SetValue.js';
|
4 |
-
|
5 |
-
ObjectFactory.register('facebook', function (config) {
|
6 |
-
var gameObject = new Facebook(this.scene, config);
|
7 |
-
this.scene.add.existing(gameObject);
|
8 |
-
return gameObject;
|
9 |
-
});
|
10 |
-
|
11 |
-
SetValue(window, 'RexPlugins.Spinner.Facebook', Facebook);
|
12 |
-
|
13 |
-
export default Facebook;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AlekseyKorshuk/instagram-filter-removal/utils/data_utils.py
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
def linear_scaling(x):
|
2 |
-
return (x * 255.) / 127.5 - 1.
|
3 |
-
|
4 |
-
|
5 |
-
def linear_unscaling(x):
|
6 |
-
return (x + 1.) * 127.5 / 255.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AlekseyKorshuk/thin-plate-spline-motion-model/augmentation.py
DELETED
@@ -1,344 +0,0 @@
|
|
1 |
-
"""
|
2 |
-
Code from https://github.com/hassony2/torch_videovision
|
3 |
-
"""
|
4 |
-
|
5 |
-
import numbers
|
6 |
-
|
7 |
-
import random
|
8 |
-
import numpy as np
|
9 |
-
import PIL
|
10 |
-
|
11 |
-
from skimage.transform import resize, rotate
|
12 |
-
import torchvision
|
13 |
-
|
14 |
-
import warnings
|
15 |
-
|
16 |
-
from skimage import img_as_ubyte, img_as_float
|
17 |
-
|
18 |
-
|
19 |
-
def crop_clip(clip, min_h, min_w, h, w):
|
20 |
-
if isinstance(clip[0], np.ndarray):
|
21 |
-
cropped = [img[min_h:min_h + h, min_w:min_w + w, :] for img in clip]
|
22 |
-
|
23 |
-
elif isinstance(clip[0], PIL.Image.Image):
|
24 |
-
cropped = [
|
25 |
-
img.crop((min_w, min_h, min_w + w, min_h + h)) for img in clip
|
26 |
-
]
|
27 |
-
else:
|
28 |
-
raise TypeError('Expected numpy.ndarray or PIL.Image' +
|
29 |
-
'but got list of {0}'.format(type(clip[0])))
|
30 |
-
return cropped
|
31 |
-
|
32 |
-
|
33 |
-
def pad_clip(clip, h, w):
|
34 |
-
im_h, im_w = clip[0].shape[:2]
|
35 |
-
pad_h = (0, 0) if h < im_h else ((h - im_h) // 2, (h - im_h + 1) // 2)
|
36 |
-
pad_w = (0, 0) if w < im_w else ((w - im_w) // 2, (w - im_w + 1) // 2)
|
37 |
-
|
38 |
-
return np.pad(clip, ((0, 0), pad_h, pad_w, (0, 0)), mode='edge')
|
39 |
-
|
40 |
-
|
41 |
-
def resize_clip(clip, size, interpolation='bilinear'):
|
42 |
-
if isinstance(clip[0], np.ndarray):
|
43 |
-
if isinstance(size, numbers.Number):
|
44 |
-
im_h, im_w, im_c = clip[0].shape
|
45 |
-
# Min spatial dim already matches minimal size
|
46 |
-
if (im_w <= im_h and im_w == size) or (im_h <= im_w
|
47 |
-
and im_h == size):
|
48 |
-
return clip
|
49 |
-
new_h, new_w = get_resize_sizes(im_h, im_w, size)
|
50 |
-
size = (new_w, new_h)
|
51 |
-
else:
|
52 |
-
size = size[1], size[0]
|
53 |
-
|
54 |
-
scaled = [
|
55 |
-
resize(img, size, order=1 if interpolation == 'bilinear' else 0, preserve_range=True,
|
56 |
-
mode='constant', anti_aliasing=True) for img in clip
|
57 |
-
]
|
58 |
-
elif isinstance(clip[0], PIL.Image.Image):
|
59 |
-
if isinstance(size, numbers.Number):
|
60 |
-
im_w, im_h = clip[0].size
|
61 |
-
# Min spatial dim already matches minimal size
|
62 |
-
if (im_w <= im_h and im_w == size) or (im_h <= im_w
|
63 |
-
and im_h == size):
|
64 |
-
return clip
|
65 |
-
new_h, new_w = get_resize_sizes(im_h, im_w, size)
|
66 |
-
size = (new_w, new_h)
|
67 |
-
else:
|
68 |
-
size = size[1], size[0]
|
69 |
-
if interpolation == 'bilinear':
|
70 |
-
pil_inter = PIL.Image.NEAREST
|
71 |
-
else:
|
72 |
-
pil_inter = PIL.Image.BILINEAR
|
73 |
-
scaled = [img.resize(size, pil_inter) for img in clip]
|
74 |
-
else:
|
75 |
-
raise TypeError('Expected numpy.ndarray or PIL.Image' +
|
76 |
-
'but got list of {0}'.format(type(clip[0])))
|
77 |
-
return scaled
|
78 |
-
|
79 |
-
|
80 |
-
def get_resize_sizes(im_h, im_w, size):
|
81 |
-
if im_w < im_h:
|
82 |
-
ow = size
|
83 |
-
oh = int(size * im_h / im_w)
|
84 |
-
else:
|
85 |
-
oh = size
|
86 |
-
ow = int(size * im_w / im_h)
|
87 |
-
return oh, ow
|
88 |
-
|
89 |
-
|
90 |
-
class RandomFlip(object):
|
91 |
-
def __init__(self, time_flip=False, horizontal_flip=False):
|
92 |
-
self.time_flip = time_flip
|
93 |
-
self.horizontal_flip = horizontal_flip
|
94 |
-
|
95 |
-
def __call__(self, clip):
|
96 |
-
if random.random() < 0.5 and self.time_flip:
|
97 |
-
return clip[::-1]
|
98 |
-
if random.random() < 0.5 and self.horizontal_flip:
|
99 |
-
return [np.fliplr(img) for img in clip]
|
100 |
-
|
101 |
-
return clip
|
102 |
-
|
103 |
-
|
104 |
-
class RandomResize(object):
|
105 |
-
"""Resizes a list of (H x W x C) numpy.ndarray to the final size
|
106 |
-
The larger the original image is, the more times it takes to
|
107 |
-
interpolate
|
108 |
-
Args:
|
109 |
-
interpolation (str): Can be one of 'nearest', 'bilinear'
|
110 |
-
defaults to nearest
|
111 |
-
size (tuple): (widht, height)
|
112 |
-
"""
|
113 |
-
|
114 |
-
def __init__(self, ratio=(3. / 4., 4. / 3.), interpolation='nearest'):
|
115 |
-
self.ratio = ratio
|
116 |
-
self.interpolation = interpolation
|
117 |
-
|
118 |
-
def __call__(self, clip):
|
119 |
-
scaling_factor = random.uniform(self.ratio[0], self.ratio[1])
|
120 |
-
|
121 |
-
if isinstance(clip[0], np.ndarray):
|
122 |
-
im_h, im_w, im_c = clip[0].shape
|
123 |
-
elif isinstance(clip[0], PIL.Image.Image):
|
124 |
-
im_w, im_h = clip[0].size
|
125 |
-
|
126 |
-
new_w = int(im_w * scaling_factor)
|
127 |
-
new_h = int(im_h * scaling_factor)
|
128 |
-
new_size = (new_w, new_h)
|
129 |
-
resized = resize_clip(
|
130 |
-
clip, new_size, interpolation=self.interpolation)
|
131 |
-
|
132 |
-
return resized
|
133 |
-
|
134 |
-
|
135 |
-
class RandomCrop(object):
|
136 |
-
"""Extract random crop at the same location for a list of videos
|
137 |
-
Args:
|
138 |
-
size (sequence or int): Desired output size for the
|
139 |
-
crop in format (h, w)
|
140 |
-
"""
|
141 |
-
|
142 |
-
def __init__(self, size):
|
143 |
-
if isinstance(size, numbers.Number):
|
144 |
-
size = (size, size)
|
145 |
-
|
146 |
-
self.size = size
|
147 |
-
|
148 |
-
def __call__(self, clip):
|
149 |
-
"""
|
150 |
-
Args:
|
151 |
-
img (PIL.Image or numpy.ndarray): List of videos to be cropped
|
152 |
-
in format (h, w, c) in numpy.ndarray
|
153 |
-
Returns:
|
154 |
-
PIL.Image or numpy.ndarray: Cropped list of videos
|
155 |
-
"""
|
156 |
-
h, w = self.size
|
157 |
-
if isinstance(clip[0], np.ndarray):
|
158 |
-
im_h, im_w, im_c = clip[0].shape
|
159 |
-
elif isinstance(clip[0], PIL.Image.Image):
|
160 |
-
im_w, im_h = clip[0].size
|
161 |
-
else:
|
162 |
-
raise TypeError('Expected numpy.ndarray or PIL.Image' +
|
163 |
-
'but got list of {0}'.format(type(clip[0])))
|
164 |
-
|
165 |
-
clip = pad_clip(clip, h, w)
|
166 |
-
im_h, im_w = clip.shape[1:3]
|
167 |
-
x1 = 0 if h == im_h else random.randint(0, im_w - w)
|
168 |
-
y1 = 0 if w == im_w else random.randint(0, im_h - h)
|
169 |
-
cropped = crop_clip(clip, y1, x1, h, w)
|
170 |
-
|
171 |
-
return cropped
|
172 |
-
|
173 |
-
|
174 |
-
class RandomRotation(object):
|
175 |
-
"""Rotate entire clip randomly by a random angle within
|
176 |
-
given bounds
|
177 |
-
Args:
|
178 |
-
degrees (sequence or int): Range of degrees to select from
|
179 |
-
If degrees is a number instead of sequence like (min, max),
|
180 |
-
the range of degrees, will be (-degrees, +degrees).
|
181 |
-
"""
|
182 |
-
|
183 |
-
def __init__(self, degrees):
|
184 |
-
if isinstance(degrees, numbers.Number):
|
185 |
-
if degrees < 0:
|
186 |
-
raise ValueError('If degrees is a single number,'
|
187 |
-
'must be positive')
|
188 |
-
degrees = (-degrees, degrees)
|
189 |
-
else:
|
190 |
-
if len(degrees) != 2:
|
191 |
-
raise ValueError('If degrees is a sequence,'
|
192 |
-
'it must be of len 2.')
|
193 |
-
|
194 |
-
self.degrees = degrees
|
195 |
-
|
196 |
-
def __call__(self, clip):
|
197 |
-
"""
|
198 |
-
Args:
|
199 |
-
img (PIL.Image or numpy.ndarray): List of videos to be cropped
|
200 |
-
in format (h, w, c) in numpy.ndarray
|
201 |
-
Returns:
|
202 |
-
PIL.Image or numpy.ndarray: Cropped list of videos
|
203 |
-
"""
|
204 |
-
angle = random.uniform(self.degrees[0], self.degrees[1])
|
205 |
-
if isinstance(clip[0], np.ndarray):
|
206 |
-
rotated = [rotate(image=img, angle=angle, preserve_range=True) for img in clip]
|
207 |
-
elif isinstance(clip[0], PIL.Image.Image):
|
208 |
-
rotated = [img.rotate(angle) for img in clip]
|
209 |
-
else:
|
210 |
-
raise TypeError('Expected numpy.ndarray or PIL.Image' +
|
211 |
-
'but got list of {0}'.format(type(clip[0])))
|
212 |
-
|
213 |
-
return rotated
|
214 |
-
|
215 |
-
|
216 |
-
class ColorJitter(object):
|
217 |
-
"""Randomly change the brightness, contrast and saturation and hue of the clip
|
218 |
-
Args:
|
219 |
-
brightness (float): How much to jitter brightness. brightness_factor
|
220 |
-
is chosen uniformly from [max(0, 1 - brightness), 1 + brightness].
|
221 |
-
contrast (float): How much to jitter contrast. contrast_factor
|
222 |
-
is chosen uniformly from [max(0, 1 - contrast), 1 + contrast].
|
223 |
-
saturation (float): How much to jitter saturation. saturation_factor
|
224 |
-
is chosen uniformly from [max(0, 1 - saturation), 1 + saturation].
|
225 |
-
hue(float): How much to jitter hue. hue_factor is chosen uniformly from
|
226 |
-
[-hue, hue]. Should be >=0 and <= 0.5.
|
227 |
-
"""
|
228 |
-
|
229 |
-
def __init__(self, brightness=0, contrast=0, saturation=0, hue=0):
|
230 |
-
self.brightness = brightness
|
231 |
-
self.contrast = contrast
|
232 |
-
self.saturation = saturation
|
233 |
-
self.hue = hue
|
234 |
-
|
235 |
-
def get_params(self, brightness, contrast, saturation, hue):
|
236 |
-
if brightness > 0:
|
237 |
-
brightness_factor = random.uniform(
|
238 |
-
max(0, 1 - brightness), 1 + brightness)
|
239 |
-
else:
|
240 |
-
brightness_factor = None
|
241 |
-
|
242 |
-
if contrast > 0:
|
243 |
-
contrast_factor = random.uniform(
|
244 |
-
max(0, 1 - contrast), 1 + contrast)
|
245 |
-
else:
|
246 |
-
contrast_factor = None
|
247 |
-
|
248 |
-
if saturation > 0:
|
249 |
-
saturation_factor = random.uniform(
|
250 |
-
max(0, 1 - saturation), 1 + saturation)
|
251 |
-
else:
|
252 |
-
saturation_factor = None
|
253 |
-
|
254 |
-
if hue > 0:
|
255 |
-
hue_factor = random.uniform(-hue, hue)
|
256 |
-
else:
|
257 |
-
hue_factor = None
|
258 |
-
return brightness_factor, contrast_factor, saturation_factor, hue_factor
|
259 |
-
|
260 |
-
def __call__(self, clip):
|
261 |
-
"""
|
262 |
-
Args:
|
263 |
-
clip (list): list of PIL.Image
|
264 |
-
Returns:
|
265 |
-
list PIL.Image : list of transformed PIL.Image
|
266 |
-
"""
|
267 |
-
if isinstance(clip[0], np.ndarray):
|
268 |
-
brightness, contrast, saturation, hue = self.get_params(
|
269 |
-
self.brightness, self.contrast, self.saturation, self.hue)
|
270 |
-
|
271 |
-
# Create img transform function sequence
|
272 |
-
img_transforms = []
|
273 |
-
if brightness is not None:
|
274 |
-
img_transforms.append(lambda img: torchvision.transforms.functional.adjust_brightness(img, brightness))
|
275 |
-
if saturation is not None:
|
276 |
-
img_transforms.append(lambda img: torchvision.transforms.functional.adjust_saturation(img, saturation))
|
277 |
-
if hue is not None:
|
278 |
-
img_transforms.append(lambda img: torchvision.transforms.functional.adjust_hue(img, hue))
|
279 |
-
if contrast is not None:
|
280 |
-
img_transforms.append(lambda img: torchvision.transforms.functional.adjust_contrast(img, contrast))
|
281 |
-
random.shuffle(img_transforms)
|
282 |
-
img_transforms = [img_as_ubyte, torchvision.transforms.ToPILImage()] + img_transforms + [np.array,
|
283 |
-
img_as_float]
|
284 |
-
|
285 |
-
with warnings.catch_warnings():
|
286 |
-
warnings.simplefilter("ignore")
|
287 |
-
jittered_clip = []
|
288 |
-
for img in clip:
|
289 |
-
jittered_img = img
|
290 |
-
for func in img_transforms:
|
291 |
-
jittered_img = func(jittered_img)
|
292 |
-
jittered_clip.append(jittered_img.astype('float32'))
|
293 |
-
elif isinstance(clip[0], PIL.Image.Image):
|
294 |
-
brightness, contrast, saturation, hue = self.get_params(
|
295 |
-
self.brightness, self.contrast, self.saturation, self.hue)
|
296 |
-
|
297 |
-
# Create img transform function sequence
|
298 |
-
img_transforms = []
|
299 |
-
if brightness is not None:
|
300 |
-
img_transforms.append(lambda img: torchvision.transforms.functional.adjust_brightness(img, brightness))
|
301 |
-
if saturation is not None:
|
302 |
-
img_transforms.append(lambda img: torchvision.transforms.functional.adjust_saturation(img, saturation))
|
303 |
-
if hue is not None:
|
304 |
-
img_transforms.append(lambda img: torchvision.transforms.functional.adjust_hue(img, hue))
|
305 |
-
if contrast is not None:
|
306 |
-
img_transforms.append(lambda img: torchvision.transforms.functional.adjust_contrast(img, contrast))
|
307 |
-
random.shuffle(img_transforms)
|
308 |
-
|
309 |
-
# Apply to all videos
|
310 |
-
jittered_clip = []
|
311 |
-
for img in clip:
|
312 |
-
for func in img_transforms:
|
313 |
-
jittered_img = func(img)
|
314 |
-
jittered_clip.append(jittered_img)
|
315 |
-
|
316 |
-
else:
|
317 |
-
raise TypeError('Expected numpy.ndarray or PIL.Image' +
|
318 |
-
'but got list of {0}'.format(type(clip[0])))
|
319 |
-
return jittered_clip
|
320 |
-
|
321 |
-
|
322 |
-
class AllAugmentationTransform:
|
323 |
-
def __init__(self, resize_param=None, rotation_param=None, flip_param=None, crop_param=None, jitter_param=None):
|
324 |
-
self.transforms = []
|
325 |
-
|
326 |
-
if flip_param is not None:
|
327 |
-
self.transforms.append(RandomFlip(**flip_param))
|
328 |
-
|
329 |
-
if rotation_param is not None:
|
330 |
-
self.transforms.append(RandomRotation(**rotation_param))
|
331 |
-
|
332 |
-
if resize_param is not None:
|
333 |
-
self.transforms.append(RandomResize(**resize_param))
|
334 |
-
|
335 |
-
if crop_param is not None:
|
336 |
-
self.transforms.append(RandomCrop(**crop_param))
|
337 |
-
|
338 |
-
if jitter_param is not None:
|
339 |
-
self.transforms.append(ColorJitter(**jitter_param))
|
340 |
-
|
341 |
-
def __call__(self, clip):
|
342 |
-
for t in self.transforms:
|
343 |
-
clip = t(clip)
|
344 |
-
return clip
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AlexWang/lama/saicinpainting/evaluation/losses/base_loss.py
DELETED
@@ -1,528 +0,0 @@
|
|
1 |
-
import logging
|
2 |
-
from abc import abstractmethod, ABC
|
3 |
-
|
4 |
-
import numpy as np
|
5 |
-
import sklearn
|
6 |
-
import sklearn.svm
|
7 |
-
import torch
|
8 |
-
import torch.nn as nn
|
9 |
-
import torch.nn.functional as F
|
10 |
-
from joblib import Parallel, delayed
|
11 |
-
from scipy import linalg
|
12 |
-
|
13 |
-
from models.ade20k import SegmentationModule, NUM_CLASS, segm_options
|
14 |
-
from .fid.inception import InceptionV3
|
15 |
-
from .lpips import PerceptualLoss
|
16 |
-
from .ssim import SSIM
|
17 |
-
|
18 |
-
LOGGER = logging.getLogger(__name__)
|
19 |
-
|
20 |
-
|
21 |
-
def get_groupings(groups):
|
22 |
-
"""
|
23 |
-
:param groups: group numbers for respective elements
|
24 |
-
:return: dict of kind {group_idx: indices of the corresponding group elements}
|
25 |
-
"""
|
26 |
-
label_groups, count_groups = np.unique(groups, return_counts=True)
|
27 |
-
|
28 |
-
indices = np.argsort(groups)
|
29 |
-
|
30 |
-
grouping = dict()
|
31 |
-
cur_start = 0
|
32 |
-
for label, count in zip(label_groups, count_groups):
|
33 |
-
cur_end = cur_start + count
|
34 |
-
cur_indices = indices[cur_start:cur_end]
|
35 |
-
grouping[label] = cur_indices
|
36 |
-
cur_start = cur_end
|
37 |
-
return grouping
|
38 |
-
|
39 |
-
|
40 |
-
class EvaluatorScore(nn.Module):
|
41 |
-
@abstractmethod
|
42 |
-
def forward(self, pred_batch, target_batch, mask):
|
43 |
-
pass
|
44 |
-
|
45 |
-
@abstractmethod
|
46 |
-
def get_value(self, groups=None, states=None):
|
47 |
-
pass
|
48 |
-
|
49 |
-
@abstractmethod
|
50 |
-
def reset(self):
|
51 |
-
pass
|
52 |
-
|
53 |
-
|
54 |
-
class PairwiseScore(EvaluatorScore, ABC):
|
55 |
-
def __init__(self):
|
56 |
-
super().__init__()
|
57 |
-
self.individual_values = None
|
58 |
-
|
59 |
-
def get_value(self, groups=None, states=None):
|
60 |
-
"""
|
61 |
-
:param groups:
|
62 |
-
:return:
|
63 |
-
total_results: dict of kind {'mean': score mean, 'std': score std}
|
64 |
-
group_results: None, if groups is None;
|
65 |
-
else dict {group_idx: {'mean': score mean among group, 'std': score std among group}}
|
66 |
-
"""
|
67 |
-
individual_values = torch.stack(states, dim=0).reshape(-1).cpu().numpy() if states is not None \
|
68 |
-
else self.individual_values
|
69 |
-
|
70 |
-
total_results = {
|
71 |
-
'mean': individual_values.mean(),
|
72 |
-
'std': individual_values.std()
|
73 |
-
}
|
74 |
-
|
75 |
-
if groups is None:
|
76 |
-
return total_results, None
|
77 |
-
|
78 |
-
group_results = dict()
|
79 |
-
grouping = get_groupings(groups)
|
80 |
-
for label, index in grouping.items():
|
81 |
-
group_scores = individual_values[index]
|
82 |
-
group_results[label] = {
|
83 |
-
'mean': group_scores.mean(),
|
84 |
-
'std': group_scores.std()
|
85 |
-
}
|
86 |
-
return total_results, group_results
|
87 |
-
|
88 |
-
def reset(self):
|
89 |
-
self.individual_values = []
|
90 |
-
|
91 |
-
|
92 |
-
class SSIMScore(PairwiseScore):
|
93 |
-
def __init__(self, window_size=11):
|
94 |
-
super().__init__()
|
95 |
-
self.score = SSIM(window_size=window_size, size_average=False).eval()
|
96 |
-
self.reset()
|
97 |
-
|
98 |
-
def forward(self, pred_batch, target_batch, mask=None):
|
99 |
-
batch_values = self.score(pred_batch, target_batch)
|
100 |
-
self.individual_values = np.hstack([
|
101 |
-
self.individual_values, batch_values.detach().cpu().numpy()
|
102 |
-
])
|
103 |
-
return batch_values
|
104 |
-
|
105 |
-
|
106 |
-
class LPIPSScore(PairwiseScore):
|
107 |
-
def __init__(self, model='net-lin', net='vgg', model_path=None, use_gpu=True):
|
108 |
-
super().__init__()
|
109 |
-
self.score = PerceptualLoss(model=model, net=net, model_path=model_path,
|
110 |
-
use_gpu=use_gpu, spatial=False).eval()
|
111 |
-
self.reset()
|
112 |
-
|
113 |
-
def forward(self, pred_batch, target_batch, mask=None):
|
114 |
-
batch_values = self.score(pred_batch, target_batch).flatten()
|
115 |
-
self.individual_values = np.hstack([
|
116 |
-
self.individual_values, batch_values.detach().cpu().numpy()
|
117 |
-
])
|
118 |
-
return batch_values
|
119 |
-
|
120 |
-
|
121 |
-
def fid_calculate_activation_statistics(act):
|
122 |
-
mu = np.mean(act, axis=0)
|
123 |
-
sigma = np.cov(act, rowvar=False)
|
124 |
-
return mu, sigma
|
125 |
-
|
126 |
-
|
127 |
-
def calculate_frechet_distance(activations_pred, activations_target, eps=1e-6):
|
128 |
-
mu1, sigma1 = fid_calculate_activation_statistics(activations_pred)
|
129 |
-
mu2, sigma2 = fid_calculate_activation_statistics(activations_target)
|
130 |
-
|
131 |
-
diff = mu1 - mu2
|
132 |
-
|
133 |
-
# Product might be almost singular
|
134 |
-
covmean, _ = linalg.sqrtm(sigma1.dot(sigma2), disp=False)
|
135 |
-
if not np.isfinite(covmean).all():
|
136 |
-
msg = ('fid calculation produces singular product; '
|
137 |
-
'adding %s to diagonal of cov estimates') % eps
|
138 |
-
LOGGER.warning(msg)
|
139 |
-
offset = np.eye(sigma1.shape[0]) * eps
|
140 |
-
covmean = linalg.sqrtm((sigma1 + offset).dot(sigma2 + offset))
|
141 |
-
|
142 |
-
# Numerical error might give slight imaginary component
|
143 |
-
if np.iscomplexobj(covmean):
|
144 |
-
# if not np.allclose(np.diagonal(covmean).imag, 0, atol=1e-3):
|
145 |
-
if not np.allclose(np.diagonal(covmean).imag, 0, atol=1e-2):
|
146 |
-
m = np.max(np.abs(covmean.imag))
|
147 |
-
raise ValueError('Imaginary component {}'.format(m))
|
148 |
-
covmean = covmean.real
|
149 |
-
|
150 |
-
tr_covmean = np.trace(covmean)
|
151 |
-
|
152 |
-
return (diff.dot(diff) + np.trace(sigma1) +
|
153 |
-
np.trace(sigma2) - 2 * tr_covmean)
|
154 |
-
|
155 |
-
|
156 |
-
class FIDScore(EvaluatorScore):
|
157 |
-
def __init__(self, dims=2048, eps=1e-6):
|
158 |
-
LOGGER.info("FIDscore init called")
|
159 |
-
super().__init__()
|
160 |
-
if getattr(FIDScore, '_MODEL', None) is None:
|
161 |
-
block_idx = InceptionV3.BLOCK_INDEX_BY_DIM[dims]
|
162 |
-
FIDScore._MODEL = InceptionV3([block_idx]).eval()
|
163 |
-
self.model = FIDScore._MODEL
|
164 |
-
self.eps = eps
|
165 |
-
self.reset()
|
166 |
-
LOGGER.info("FIDscore init done")
|
167 |
-
|
168 |
-
def forward(self, pred_batch, target_batch, mask=None):
|
169 |
-
activations_pred = self._get_activations(pred_batch)
|
170 |
-
activations_target = self._get_activations(target_batch)
|
171 |
-
|
172 |
-
self.activations_pred.append(activations_pred.detach().cpu())
|
173 |
-
self.activations_target.append(activations_target.detach().cpu())
|
174 |
-
|
175 |
-
return activations_pred, activations_target
|
176 |
-
|
177 |
-
def get_value(self, groups=None, states=None):
|
178 |
-
LOGGER.info("FIDscore get_value called")
|
179 |
-
activations_pred, activations_target = zip(*states) if states is not None \
|
180 |
-
else (self.activations_pred, self.activations_target)
|
181 |
-
activations_pred = torch.cat(activations_pred).cpu().numpy()
|
182 |
-
activations_target = torch.cat(activations_target).cpu().numpy()
|
183 |
-
|
184 |
-
total_distance = calculate_frechet_distance(activations_pred, activations_target, eps=self.eps)
|
185 |
-
total_results = dict(mean=total_distance)
|
186 |
-
|
187 |
-
if groups is None:
|
188 |
-
group_results = None
|
189 |
-
else:
|
190 |
-
group_results = dict()
|
191 |
-
grouping = get_groupings(groups)
|
192 |
-
for label, index in grouping.items():
|
193 |
-
if len(index) > 1:
|
194 |
-
group_distance = calculate_frechet_distance(activations_pred[index], activations_target[index],
|
195 |
-
eps=self.eps)
|
196 |
-
group_results[label] = dict(mean=group_distance)
|
197 |
-
|
198 |
-
else:
|
199 |
-
group_results[label] = dict(mean=float('nan'))
|
200 |
-
|
201 |
-
self.reset()
|
202 |
-
|
203 |
-
LOGGER.info("FIDscore get_value done")
|
204 |
-
|
205 |
-
return total_results, group_results
|
206 |
-
|
207 |
-
def reset(self):
|
208 |
-
self.activations_pred = []
|
209 |
-
self.activations_target = []
|
210 |
-
|
211 |
-
def _get_activations(self, batch):
|
212 |
-
activations = self.model(batch)[0]
|
213 |
-
if activations.shape[2] != 1 or activations.shape[3] != 1:
|
214 |
-
assert False, \
|
215 |
-
'We should not have got here, because Inception always scales inputs to 299x299'
|
216 |
-
# activations = F.adaptive_avg_pool2d(activations, output_size=(1, 1))
|
217 |
-
activations = activations.squeeze(-1).squeeze(-1)
|
218 |
-
return activations
|
219 |
-
|
220 |
-
|
221 |
-
class SegmentationAwareScore(EvaluatorScore):
|
222 |
-
def __init__(self, weights_path):
|
223 |
-
super().__init__()
|
224 |
-
self.segm_network = SegmentationModule(weights_path=weights_path, use_default_normalization=True).eval()
|
225 |
-
self.target_class_freq_by_image_total = []
|
226 |
-
self.target_class_freq_by_image_mask = []
|
227 |
-
self.pred_class_freq_by_image_mask = []
|
228 |
-
|
229 |
-
def forward(self, pred_batch, target_batch, mask):
|
230 |
-
pred_segm_flat = self.segm_network.predict(pred_batch)[0].view(pred_batch.shape[0], -1).long().detach().cpu().numpy()
|
231 |
-
target_segm_flat = self.segm_network.predict(target_batch)[0].view(pred_batch.shape[0], -1).long().detach().cpu().numpy()
|
232 |
-
mask_flat = (mask.view(mask.shape[0], -1) > 0.5).detach().cpu().numpy()
|
233 |
-
|
234 |
-
batch_target_class_freq_total = []
|
235 |
-
batch_target_class_freq_mask = []
|
236 |
-
batch_pred_class_freq_mask = []
|
237 |
-
|
238 |
-
for cur_pred_segm, cur_target_segm, cur_mask in zip(pred_segm_flat, target_segm_flat, mask_flat):
|
239 |
-
cur_target_class_freq_total = np.bincount(cur_target_segm, minlength=NUM_CLASS)[None, ...]
|
240 |
-
cur_target_class_freq_mask = np.bincount(cur_target_segm[cur_mask], minlength=NUM_CLASS)[None, ...]
|
241 |
-
cur_pred_class_freq_mask = np.bincount(cur_pred_segm[cur_mask], minlength=NUM_CLASS)[None, ...]
|
242 |
-
|
243 |
-
self.target_class_freq_by_image_total.append(cur_target_class_freq_total)
|
244 |
-
self.target_class_freq_by_image_mask.append(cur_target_class_freq_mask)
|
245 |
-
self.pred_class_freq_by_image_mask.append(cur_pred_class_freq_mask)
|
246 |
-
|
247 |
-
batch_target_class_freq_total.append(cur_target_class_freq_total)
|
248 |
-
batch_target_class_freq_mask.append(cur_target_class_freq_mask)
|
249 |
-
batch_pred_class_freq_mask.append(cur_pred_class_freq_mask)
|
250 |
-
|
251 |
-
batch_target_class_freq_total = np.concatenate(batch_target_class_freq_total, axis=0)
|
252 |
-
batch_target_class_freq_mask = np.concatenate(batch_target_class_freq_mask, axis=0)
|
253 |
-
batch_pred_class_freq_mask = np.concatenate(batch_pred_class_freq_mask, axis=0)
|
254 |
-
return batch_target_class_freq_total, batch_target_class_freq_mask, batch_pred_class_freq_mask
|
255 |
-
|
256 |
-
def reset(self):
|
257 |
-
super().reset()
|
258 |
-
self.target_class_freq_by_image_total = []
|
259 |
-
self.target_class_freq_by_image_mask = []
|
260 |
-
self.pred_class_freq_by_image_mask = []
|
261 |
-
|
262 |
-
|
263 |
-
def distribute_values_to_classes(target_class_freq_by_image_mask, values, idx2name):
|
264 |
-
assert target_class_freq_by_image_mask.ndim == 2 and target_class_freq_by_image_mask.shape[0] == values.shape[0]
|
265 |
-
total_class_freq = target_class_freq_by_image_mask.sum(0)
|
266 |
-
distr_values = (target_class_freq_by_image_mask * values[..., None]).sum(0)
|
267 |
-
result = distr_values / (total_class_freq + 1e-3)
|
268 |
-
return {idx2name[i]: val for i, val in enumerate(result) if total_class_freq[i] > 0}
|
269 |
-
|
270 |
-
|
271 |
-
def get_segmentation_idx2name():
|
272 |
-
return {i - 1: name for i, name in segm_options['classes'].set_index('Idx', drop=True)['Name'].to_dict().items()}
|
273 |
-
|
274 |
-
|
275 |
-
class SegmentationAwarePairwiseScore(SegmentationAwareScore):
|
276 |
-
def __init__(self, *args, **kwargs):
|
277 |
-
super().__init__(*args, **kwargs)
|
278 |
-
self.individual_values = []
|
279 |
-
self.segm_idx2name = get_segmentation_idx2name()
|
280 |
-
|
281 |
-
def forward(self, pred_batch, target_batch, mask):
|
282 |
-
cur_class_stats = super().forward(pred_batch, target_batch, mask)
|
283 |
-
score_values = self.calc_score(pred_batch, target_batch, mask)
|
284 |
-
self.individual_values.append(score_values)
|
285 |
-
return cur_class_stats + (score_values,)
|
286 |
-
|
287 |
-
@abstractmethod
|
288 |
-
def calc_score(self, pred_batch, target_batch, mask):
|
289 |
-
raise NotImplementedError()
|
290 |
-
|
291 |
-
def get_value(self, groups=None, states=None):
|
292 |
-
"""
|
293 |
-
:param groups:
|
294 |
-
:return:
|
295 |
-
total_results: dict of kind {'mean': score mean, 'std': score std}
|
296 |
-
group_results: None, if groups is None;
|
297 |
-
else dict {group_idx: {'mean': score mean among group, 'std': score std among group}}
|
298 |
-
"""
|
299 |
-
if states is not None:
|
300 |
-
(target_class_freq_by_image_total,
|
301 |
-
target_class_freq_by_image_mask,
|
302 |
-
pred_class_freq_by_image_mask,
|
303 |
-
individual_values) = states
|
304 |
-
else:
|
305 |
-
target_class_freq_by_image_total = self.target_class_freq_by_image_total
|
306 |
-
target_class_freq_by_image_mask = self.target_class_freq_by_image_mask
|
307 |
-
pred_class_freq_by_image_mask = self.pred_class_freq_by_image_mask
|
308 |
-
individual_values = self.individual_values
|
309 |
-
|
310 |
-
target_class_freq_by_image_total = np.concatenate(target_class_freq_by_image_total, axis=0)
|
311 |
-
target_class_freq_by_image_mask = np.concatenate(target_class_freq_by_image_mask, axis=0)
|
312 |
-
pred_class_freq_by_image_mask = np.concatenate(pred_class_freq_by_image_mask, axis=0)
|
313 |
-
individual_values = np.concatenate(individual_values, axis=0)
|
314 |
-
|
315 |
-
total_results = {
|
316 |
-
'mean': individual_values.mean(),
|
317 |
-
'std': individual_values.std(),
|
318 |
-
**distribute_values_to_classes(target_class_freq_by_image_mask, individual_values, self.segm_idx2name)
|
319 |
-
}
|
320 |
-
|
321 |
-
if groups is None:
|
322 |
-
return total_results, None
|
323 |
-
|
324 |
-
group_results = dict()
|
325 |
-
grouping = get_groupings(groups)
|
326 |
-
for label, index in grouping.items():
|
327 |
-
group_class_freq = target_class_freq_by_image_mask[index]
|
328 |
-
group_scores = individual_values[index]
|
329 |
-
group_results[label] = {
|
330 |
-
'mean': group_scores.mean(),
|
331 |
-
'std': group_scores.std(),
|
332 |
-
** distribute_values_to_classes(group_class_freq, group_scores, self.segm_idx2name)
|
333 |
-
}
|
334 |
-
return total_results, group_results
|
335 |
-
|
336 |
-
def reset(self):
|
337 |
-
super().reset()
|
338 |
-
self.individual_values = []
|
339 |
-
|
340 |
-
|
341 |
-
class SegmentationClassStats(SegmentationAwarePairwiseScore):
|
342 |
-
def calc_score(self, pred_batch, target_batch, mask):
|
343 |
-
return 0
|
344 |
-
|
345 |
-
def get_value(self, groups=None, states=None):
|
346 |
-
"""
|
347 |
-
:param groups:
|
348 |
-
:return:
|
349 |
-
total_results: dict of kind {'mean': score mean, 'std': score std}
|
350 |
-
group_results: None, if groups is None;
|
351 |
-
else dict {group_idx: {'mean': score mean among group, 'std': score std among group}}
|
352 |
-
"""
|
353 |
-
if states is not None:
|
354 |
-
(target_class_freq_by_image_total,
|
355 |
-
target_class_freq_by_image_mask,
|
356 |
-
pred_class_freq_by_image_mask,
|
357 |
-
_) = states
|
358 |
-
else:
|
359 |
-
target_class_freq_by_image_total = self.target_class_freq_by_image_total
|
360 |
-
target_class_freq_by_image_mask = self.target_class_freq_by_image_mask
|
361 |
-
pred_class_freq_by_image_mask = self.pred_class_freq_by_image_mask
|
362 |
-
|
363 |
-
target_class_freq_by_image_total = np.concatenate(target_class_freq_by_image_total, axis=0)
|
364 |
-
target_class_freq_by_image_mask = np.concatenate(target_class_freq_by_image_mask, axis=0)
|
365 |
-
pred_class_freq_by_image_mask = np.concatenate(pred_class_freq_by_image_mask, axis=0)
|
366 |
-
|
367 |
-
target_class_freq_by_image_total_marginal = target_class_freq_by_image_total.sum(0).astype('float32')
|
368 |
-
target_class_freq_by_image_total_marginal /= target_class_freq_by_image_total_marginal.sum()
|
369 |
-
|
370 |
-
target_class_freq_by_image_mask_marginal = target_class_freq_by_image_mask.sum(0).astype('float32')
|
371 |
-
target_class_freq_by_image_mask_marginal /= target_class_freq_by_image_mask_marginal.sum()
|
372 |
-
|
373 |
-
pred_class_freq_diff = (pred_class_freq_by_image_mask - target_class_freq_by_image_mask).sum(0) / (target_class_freq_by_image_mask.sum(0) + 1e-3)
|
374 |
-
|
375 |
-
total_results = dict()
|
376 |
-
total_results.update({f'total_freq/{self.segm_idx2name[i]}': v
|
377 |
-
for i, v in enumerate(target_class_freq_by_image_total_marginal)
|
378 |
-
if v > 0})
|
379 |
-
total_results.update({f'mask_freq/{self.segm_idx2name[i]}': v
|
380 |
-
for i, v in enumerate(target_class_freq_by_image_mask_marginal)
|
381 |
-
if v > 0})
|
382 |
-
total_results.update({f'mask_freq_diff/{self.segm_idx2name[i]}': v
|
383 |
-
for i, v in enumerate(pred_class_freq_diff)
|
384 |
-
if target_class_freq_by_image_total_marginal[i] > 0})
|
385 |
-
|
386 |
-
if groups is None:
|
387 |
-
return total_results, None
|
388 |
-
|
389 |
-
group_results = dict()
|
390 |
-
grouping = get_groupings(groups)
|
391 |
-
for label, index in grouping.items():
|
392 |
-
group_target_class_freq_by_image_total = target_class_freq_by_image_total[index]
|
393 |
-
group_target_class_freq_by_image_mask = target_class_freq_by_image_mask[index]
|
394 |
-
group_pred_class_freq_by_image_mask = pred_class_freq_by_image_mask[index]
|
395 |
-
|
396 |
-
group_target_class_freq_by_image_total_marginal = group_target_class_freq_by_image_total.sum(0).astype('float32')
|
397 |
-
group_target_class_freq_by_image_total_marginal /= group_target_class_freq_by_image_total_marginal.sum()
|
398 |
-
|
399 |
-
group_target_class_freq_by_image_mask_marginal = group_target_class_freq_by_image_mask.sum(0).astype('float32')
|
400 |
-
group_target_class_freq_by_image_mask_marginal /= group_target_class_freq_by_image_mask_marginal.sum()
|
401 |
-
|
402 |
-
group_pred_class_freq_diff = (group_pred_class_freq_by_image_mask - group_target_class_freq_by_image_mask).sum(0) / (
|
403 |
-
group_target_class_freq_by_image_mask.sum(0) + 1e-3)
|
404 |
-
|
405 |
-
cur_group_results = dict()
|
406 |
-
cur_group_results.update({f'total_freq/{self.segm_idx2name[i]}': v
|
407 |
-
for i, v in enumerate(group_target_class_freq_by_image_total_marginal)
|
408 |
-
if v > 0})
|
409 |
-
cur_group_results.update({f'mask_freq/{self.segm_idx2name[i]}': v
|
410 |
-
for i, v in enumerate(group_target_class_freq_by_image_mask_marginal)
|
411 |
-
if v > 0})
|
412 |
-
cur_group_results.update({f'mask_freq_diff/{self.segm_idx2name[i]}': v
|
413 |
-
for i, v in enumerate(group_pred_class_freq_diff)
|
414 |
-
if group_target_class_freq_by_image_total_marginal[i] > 0})
|
415 |
-
|
416 |
-
group_results[label] = cur_group_results
|
417 |
-
return total_results, group_results
|
418 |
-
|
419 |
-
|
420 |
-
class SegmentationAwareSSIM(SegmentationAwarePairwiseScore):
|
421 |
-
def __init__(self, *args, window_size=11, **kwargs):
|
422 |
-
super().__init__(*args, **kwargs)
|
423 |
-
self.score_impl = SSIM(window_size=window_size, size_average=False).eval()
|
424 |
-
|
425 |
-
def calc_score(self, pred_batch, target_batch, mask):
|
426 |
-
return self.score_impl(pred_batch, target_batch).detach().cpu().numpy()
|
427 |
-
|
428 |
-
|
429 |
-
class SegmentationAwareLPIPS(SegmentationAwarePairwiseScore):
|
430 |
-
def __init__(self, *args, model='net-lin', net='vgg', model_path=None, use_gpu=True, **kwargs):
|
431 |
-
super().__init__(*args, **kwargs)
|
432 |
-
self.score_impl = PerceptualLoss(model=model, net=net, model_path=model_path,
|
433 |
-
use_gpu=use_gpu, spatial=False).eval()
|
434 |
-
|
435 |
-
def calc_score(self, pred_batch, target_batch, mask):
|
436 |
-
return self.score_impl(pred_batch, target_batch).flatten().detach().cpu().numpy()
|
437 |
-
|
438 |
-
|
439 |
-
def calculade_fid_no_img(img_i, activations_pred, activations_target, eps=1e-6):
|
440 |
-
activations_pred = activations_pred.copy()
|
441 |
-
activations_pred[img_i] = activations_target[img_i]
|
442 |
-
return calculate_frechet_distance(activations_pred, activations_target, eps=eps)
|
443 |
-
|
444 |
-
|
445 |
-
class SegmentationAwareFID(SegmentationAwarePairwiseScore):
|
446 |
-
def __init__(self, *args, dims=2048, eps=1e-6, n_jobs=-1, **kwargs):
|
447 |
-
super().__init__(*args, **kwargs)
|
448 |
-
if getattr(FIDScore, '_MODEL', None) is None:
|
449 |
-
block_idx = InceptionV3.BLOCK_INDEX_BY_DIM[dims]
|
450 |
-
FIDScore._MODEL = InceptionV3([block_idx]).eval()
|
451 |
-
self.model = FIDScore._MODEL
|
452 |
-
self.eps = eps
|
453 |
-
self.n_jobs = n_jobs
|
454 |
-
|
455 |
-
def calc_score(self, pred_batch, target_batch, mask):
|
456 |
-
activations_pred = self._get_activations(pred_batch)
|
457 |
-
activations_target = self._get_activations(target_batch)
|
458 |
-
return activations_pred, activations_target
|
459 |
-
|
460 |
-
def get_value(self, groups=None, states=None):
|
461 |
-
"""
|
462 |
-
:param groups:
|
463 |
-
:return:
|
464 |
-
total_results: dict of kind {'mean': score mean, 'std': score std}
|
465 |
-
group_results: None, if groups is None;
|
466 |
-
else dict {group_idx: {'mean': score mean among group, 'std': score std among group}}
|
467 |
-
"""
|
468 |
-
if states is not None:
|
469 |
-
(target_class_freq_by_image_total,
|
470 |
-
target_class_freq_by_image_mask,
|
471 |
-
pred_class_freq_by_image_mask,
|
472 |
-
activation_pairs) = states
|
473 |
-
else:
|
474 |
-
target_class_freq_by_image_total = self.target_class_freq_by_image_total
|
475 |
-
target_class_freq_by_image_mask = self.target_class_freq_by_image_mask
|
476 |
-
pred_class_freq_by_image_mask = self.pred_class_freq_by_image_mask
|
477 |
-
activation_pairs = self.individual_values
|
478 |
-
|
479 |
-
target_class_freq_by_image_total = np.concatenate(target_class_freq_by_image_total, axis=0)
|
480 |
-
target_class_freq_by_image_mask = np.concatenate(target_class_freq_by_image_mask, axis=0)
|
481 |
-
pred_class_freq_by_image_mask = np.concatenate(pred_class_freq_by_image_mask, axis=0)
|
482 |
-
activations_pred, activations_target = zip(*activation_pairs)
|
483 |
-
activations_pred = np.concatenate(activations_pred, axis=0)
|
484 |
-
activations_target = np.concatenate(activations_target, axis=0)
|
485 |
-
|
486 |
-
total_results = {
|
487 |
-
'mean': calculate_frechet_distance(activations_pred, activations_target, eps=self.eps),
|
488 |
-
'std': 0,
|
489 |
-
**self.distribute_fid_to_classes(target_class_freq_by_image_mask, activations_pred, activations_target)
|
490 |
-
}
|
491 |
-
|
492 |
-
if groups is None:
|
493 |
-
return total_results, None
|
494 |
-
|
495 |
-
group_results = dict()
|
496 |
-
grouping = get_groupings(groups)
|
497 |
-
for label, index in grouping.items():
|
498 |
-
if len(index) > 1:
|
499 |
-
group_activations_pred = activations_pred[index]
|
500 |
-
group_activations_target = activations_target[index]
|
501 |
-
group_class_freq = target_class_freq_by_image_mask[index]
|
502 |
-
group_results[label] = {
|
503 |
-
'mean': calculate_frechet_distance(group_activations_pred, group_activations_target, eps=self.eps),
|
504 |
-
'std': 0,
|
505 |
-
**self.distribute_fid_to_classes(group_class_freq,
|
506 |
-
group_activations_pred,
|
507 |
-
group_activations_target)
|
508 |
-
}
|
509 |
-
else:
|
510 |
-
group_results[label] = dict(mean=float('nan'), std=0)
|
511 |
-
return total_results, group_results
|
512 |
-
|
513 |
-
def distribute_fid_to_classes(self, class_freq, activations_pred, activations_target):
|
514 |
-
real_fid = calculate_frechet_distance(activations_pred, activations_target, eps=self.eps)
|
515 |
-
|
516 |
-
fid_no_images = Parallel(n_jobs=self.n_jobs)(
|
517 |
-
delayed(calculade_fid_no_img)(img_i, activations_pred, activations_target, eps=self.eps)
|
518 |
-
for img_i in range(activations_pred.shape[0])
|
519 |
-
)
|
520 |
-
errors = real_fid - fid_no_images
|
521 |
-
return distribute_values_to_classes(class_freq, errors, self.segm_idx2name)
|
522 |
-
|
523 |
-
def _get_activations(self, batch):
|
524 |
-
activations = self.model(batch)[0]
|
525 |
-
if activations.shape[2] != 1 or activations.shape[3] != 1:
|
526 |
-
activations = F.adaptive_avg_pool2d(activations, output_size=(1, 1))
|
527 |
-
activations = activations.squeeze(-1).squeeze(-1).detach().cpu().numpy()
|
528 |
-
return activations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AlexWang/lama/saicinpainting/training/data/aug.py
DELETED
@@ -1,84 +0,0 @@
|
|
1 |
-
from albumentations import DualIAATransform, to_tuple
|
2 |
-
import imgaug.augmenters as iaa
|
3 |
-
|
4 |
-
class IAAAffine2(DualIAATransform):
|
5 |
-
"""Place a regular grid of points on the input and randomly move the neighbourhood of these point around
|
6 |
-
via affine transformations.
|
7 |
-
|
8 |
-
Note: This class introduce interpolation artifacts to mask if it has values other than {0;1}
|
9 |
-
|
10 |
-
Args:
|
11 |
-
p (float): probability of applying the transform. Default: 0.5.
|
12 |
-
|
13 |
-
Targets:
|
14 |
-
image, mask
|
15 |
-
"""
|
16 |
-
|
17 |
-
def __init__(
|
18 |
-
self,
|
19 |
-
scale=(0.7, 1.3),
|
20 |
-
translate_percent=None,
|
21 |
-
translate_px=None,
|
22 |
-
rotate=0.0,
|
23 |
-
shear=(-0.1, 0.1),
|
24 |
-
order=1,
|
25 |
-
cval=0,
|
26 |
-
mode="reflect",
|
27 |
-
always_apply=False,
|
28 |
-
p=0.5,
|
29 |
-
):
|
30 |
-
super(IAAAffine2, self).__init__(always_apply, p)
|
31 |
-
self.scale = dict(x=scale, y=scale)
|
32 |
-
self.translate_percent = to_tuple(translate_percent, 0)
|
33 |
-
self.translate_px = to_tuple(translate_px, 0)
|
34 |
-
self.rotate = to_tuple(rotate)
|
35 |
-
self.shear = dict(x=shear, y=shear)
|
36 |
-
self.order = order
|
37 |
-
self.cval = cval
|
38 |
-
self.mode = mode
|
39 |
-
|
40 |
-
@property
|
41 |
-
def processor(self):
|
42 |
-
return iaa.Affine(
|
43 |
-
self.scale,
|
44 |
-
self.translate_percent,
|
45 |
-
self.translate_px,
|
46 |
-
self.rotate,
|
47 |
-
self.shear,
|
48 |
-
self.order,
|
49 |
-
self.cval,
|
50 |
-
self.mode,
|
51 |
-
)
|
52 |
-
|
53 |
-
def get_transform_init_args_names(self):
|
54 |
-
return ("scale", "translate_percent", "translate_px", "rotate", "shear", "order", "cval", "mode")
|
55 |
-
|
56 |
-
|
57 |
-
class IAAPerspective2(DualIAATransform):
|
58 |
-
"""Perform a random four point perspective transform of the input.
|
59 |
-
|
60 |
-
Note: This class introduce interpolation artifacts to mask if it has values other than {0;1}
|
61 |
-
|
62 |
-
Args:
|
63 |
-
scale ((float, float): standard deviation of the normal distributions. These are used to sample
|
64 |
-
the random distances of the subimage's corners from the full image's corners. Default: (0.05, 0.1).
|
65 |
-
p (float): probability of applying the transform. Default: 0.5.
|
66 |
-
|
67 |
-
Targets:
|
68 |
-
image, mask
|
69 |
-
"""
|
70 |
-
|
71 |
-
def __init__(self, scale=(0.05, 0.1), keep_size=True, always_apply=False, p=0.5,
|
72 |
-
order=1, cval=0, mode="replicate"):
|
73 |
-
super(IAAPerspective2, self).__init__(always_apply, p)
|
74 |
-
self.scale = to_tuple(scale, 1.0)
|
75 |
-
self.keep_size = keep_size
|
76 |
-
self.cval = cval
|
77 |
-
self.mode = mode
|
78 |
-
|
79 |
-
@property
|
80 |
-
def processor(self):
|
81 |
-
return iaa.PerspectiveTransform(self.scale, keep_size=self.keep_size, mode=self.mode, cval=self.cval)
|
82 |
-
|
83 |
-
def get_transform_init_args_names(self):
|
84 |
-
return ("scale", "keep_size")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Aloento/9Nine-PITS/text/frontend/zh_normalization/quantifier.py
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
|
2 |
-
#
|
3 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4 |
-
# you may not use this file except in compliance with the License.
|
5 |
-
# You may obtain a copy of the License at
|
6 |
-
#
|
7 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8 |
-
#
|
9 |
-
# Unless required by applicable law or agreed to in writing, software
|
10 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 |
-
# See the License for the specific language governing permissions and
|
13 |
-
# limitations under the License.
|
14 |
-
import re
|
15 |
-
|
16 |
-
from .num import num2str
|
17 |
-
|
18 |
-
# 温度表达式,温度会影响负号的读法
|
19 |
-
# -3°C 零下三度
|
20 |
-
RE_TEMPERATURE = re.compile(r'(-?)(\d+(\.\d+)?)(°C|℃|度|摄氏度)')
|
21 |
-
|
22 |
-
|
23 |
-
def replace_temperature(match) -> str:
|
24 |
-
"""
|
25 |
-
Args:
|
26 |
-
match (re.Match)
|
27 |
-
Returns:
|
28 |
-
str
|
29 |
-
"""
|
30 |
-
sign = match.group(1)
|
31 |
-
temperature = match.group(2)
|
32 |
-
unit = match.group(3)
|
33 |
-
sign: str = "零下" if sign else ""
|
34 |
-
temperature: str = num2str(temperature)
|
35 |
-
unit: str = "摄氏度" if unit == "摄氏度" else "度"
|
36 |
-
result = f"{sign}{temperature}{unit}"
|
37 |
-
return result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Alpaca233/SadTalker/src/face3d/models/arcface_torch/docs/modelzoo.md
DELETED
File without changes
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_controlnet.py
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
# Copyright 2023 The HuggingFace Team. All rights reserved.
|
2 |
-
#
|
3 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4 |
-
# you may not use this file except in compliance with the License.
|
5 |
-
# You may obtain a copy of the License at
|
6 |
-
#
|
7 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8 |
-
#
|
9 |
-
# Unless required by applicable law or agreed to in writing, software
|
10 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 |
-
# See the License for the specific language governing permissions and
|
13 |
-
# limitations under the License.
|
14 |
-
|
15 |
-
# NOTE: This file is deprecated and will be removed in a future version.
|
16 |
-
# It only exists so that temporarely `from diffusers.pipelines import DiffusionPipeline` works
|
17 |
-
|
18 |
-
from ...utils import deprecate
|
19 |
-
from ..controlnet.pipeline_flax_controlnet import FlaxStableDiffusionControlNetPipeline # noqa: F401
|
20 |
-
|
21 |
-
|
22 |
-
deprecate(
|
23 |
-
"stable diffusion controlnet",
|
24 |
-
"0.22.0",
|
25 |
-
"Importing `FlaxStableDiffusionControlNetPipeline` from diffusers.pipelines.stable_diffusion.flax_pipeline_stable_diffusion_controlnet is deprecated. Please import `from diffusers import FlaxStableDiffusionControlNetPipeline` instead.",
|
26 |
-
standard_warn=False,
|
27 |
-
stacklevel=3,
|
28 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/pipelines/pipeline_params.py
DELETED
@@ -1,125 +0,0 @@
|
|
1 |
-
# These are canonical sets of parameters for different types of pipelines.
|
2 |
-
# They are set on subclasses of `PipelineTesterMixin` as `params` and
|
3 |
-
# `batch_params`.
|
4 |
-
#
|
5 |
-
# If a pipeline's set of arguments has minor changes from one of the common sets
|
6 |
-
# of arguments, do not make modifications to the existing common sets of arguments.
|
7 |
-
# I.e. a text to image pipeline with non-configurable height and width arguments
|
8 |
-
# should set its attribute as `params = TEXT_TO_IMAGE_PARAMS - {'height', 'width'}`.
|
9 |
-
|
10 |
-
TEXT_TO_IMAGE_PARAMS = frozenset(
|
11 |
-
[
|
12 |
-
"prompt",
|
13 |
-
"height",
|
14 |
-
"width",
|
15 |
-
"guidance_scale",
|
16 |
-
"negative_prompt",
|
17 |
-
"prompt_embeds",
|
18 |
-
"negative_prompt_embeds",
|
19 |
-
"cross_attention_kwargs",
|
20 |
-
]
|
21 |
-
)
|
22 |
-
|
23 |
-
TEXT_TO_IMAGE_BATCH_PARAMS = frozenset(["prompt", "negative_prompt"])
|
24 |
-
|
25 |
-
TEXT_TO_IMAGE_IMAGE_PARAMS = frozenset([])
|
26 |
-
|
27 |
-
IMAGE_TO_IMAGE_IMAGE_PARAMS = frozenset(["image"])
|
28 |
-
|
29 |
-
IMAGE_VARIATION_PARAMS = frozenset(
|
30 |
-
[
|
31 |
-
"image",
|
32 |
-
"height",
|
33 |
-
"width",
|
34 |
-
"guidance_scale",
|
35 |
-
]
|
36 |
-
)
|
37 |
-
|
38 |
-
IMAGE_VARIATION_BATCH_PARAMS = frozenset(["image"])
|
39 |
-
|
40 |
-
TEXT_GUIDED_IMAGE_VARIATION_PARAMS = frozenset(
|
41 |
-
[
|
42 |
-
"prompt",
|
43 |
-
"image",
|
44 |
-
"height",
|
45 |
-
"width",
|
46 |
-
"guidance_scale",
|
47 |
-
"negative_prompt",
|
48 |
-
"prompt_embeds",
|
49 |
-
"negative_prompt_embeds",
|
50 |
-
]
|
51 |
-
)
|
52 |
-
|
53 |
-
TEXT_GUIDED_IMAGE_VARIATION_BATCH_PARAMS = frozenset(["prompt", "image", "negative_prompt"])
|
54 |
-
|
55 |
-
TEXT_GUIDED_IMAGE_INPAINTING_PARAMS = frozenset(
|
56 |
-
[
|
57 |
-
# Text guided image variation with an image mask
|
58 |
-
"prompt",
|
59 |
-
"image",
|
60 |
-
"mask_image",
|
61 |
-
"height",
|
62 |
-
"width",
|
63 |
-
"guidance_scale",
|
64 |
-
"negative_prompt",
|
65 |
-
"prompt_embeds",
|
66 |
-
"negative_prompt_embeds",
|
67 |
-
]
|
68 |
-
)
|
69 |
-
|
70 |
-
TEXT_GUIDED_IMAGE_INPAINTING_BATCH_PARAMS = frozenset(["prompt", "image", "mask_image", "negative_prompt"])
|
71 |
-
|
72 |
-
IMAGE_INPAINTING_PARAMS = frozenset(
|
73 |
-
[
|
74 |
-
# image variation with an image mask
|
75 |
-
"image",
|
76 |
-
"mask_image",
|
77 |
-
"height",
|
78 |
-
"width",
|
79 |
-
"guidance_scale",
|
80 |
-
]
|
81 |
-
)
|
82 |
-
|
83 |
-
IMAGE_INPAINTING_BATCH_PARAMS = frozenset(["image", "mask_image"])
|
84 |
-
|
85 |
-
IMAGE_GUIDED_IMAGE_INPAINTING_PARAMS = frozenset(
|
86 |
-
[
|
87 |
-
"example_image",
|
88 |
-
"image",
|
89 |
-
"mask_image",
|
90 |
-
"height",
|
91 |
-
"width",
|
92 |
-
"guidance_scale",
|
93 |
-
]
|
94 |
-
)
|
95 |
-
|
96 |
-
IMAGE_GUIDED_IMAGE_INPAINTING_BATCH_PARAMS = frozenset(["example_image", "image", "mask_image"])
|
97 |
-
|
98 |
-
CLASS_CONDITIONED_IMAGE_GENERATION_PARAMS = frozenset(["class_labels"])
|
99 |
-
|
100 |
-
CLASS_CONDITIONED_IMAGE_GENERATION_BATCH_PARAMS = frozenset(["class_labels"])
|
101 |
-
|
102 |
-
UNCONDITIONAL_IMAGE_GENERATION_PARAMS = frozenset(["batch_size"])
|
103 |
-
|
104 |
-
UNCONDITIONAL_IMAGE_GENERATION_BATCH_PARAMS = frozenset([])
|
105 |
-
|
106 |
-
UNCONDITIONAL_AUDIO_GENERATION_PARAMS = frozenset(["batch_size"])
|
107 |
-
|
108 |
-
UNCONDITIONAL_AUDIO_GENERATION_BATCH_PARAMS = frozenset([])
|
109 |
-
|
110 |
-
TEXT_TO_AUDIO_PARAMS = frozenset(
|
111 |
-
[
|
112 |
-
"prompt",
|
113 |
-
"audio_length_in_s",
|
114 |
-
"guidance_scale",
|
115 |
-
"negative_prompt",
|
116 |
-
"prompt_embeds",
|
117 |
-
"negative_prompt_embeds",
|
118 |
-
"cross_attention_kwargs",
|
119 |
-
]
|
120 |
-
)
|
121 |
-
|
122 |
-
TEXT_TO_AUDIO_BATCH_PARAMS = frozenset(["prompt", "negative_prompt"])
|
123 |
-
TOKENS_TO_AUDIO_GENERATION_PARAMS = frozenset(["input_tokens"])
|
124 |
-
|
125 |
-
TOKENS_TO_AUDIO_GENERATION_BATCH_PARAMS = frozenset(["input_tokens"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/pipelines/stable_diffusion/test_cycle_diffusion.py
DELETED
@@ -1,275 +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 gc
|
17 |
-
import random
|
18 |
-
import unittest
|
19 |
-
|
20 |
-
import numpy as np
|
21 |
-
import torch
|
22 |
-
from transformers import CLIPTextConfig, CLIPTextModel, CLIPTokenizer
|
23 |
-
|
24 |
-
from diffusers import AutoencoderKL, CycleDiffusionPipeline, DDIMScheduler, UNet2DConditionModel
|
25 |
-
from diffusers.utils import floats_tensor, load_image, load_numpy, slow, torch_device
|
26 |
-
from diffusers.utils.testing_utils import enable_full_determinism, require_torch_gpu, skip_mps
|
27 |
-
|
28 |
-
from ..pipeline_params import (
|
29 |
-
IMAGE_TO_IMAGE_IMAGE_PARAMS,
|
30 |
-
TEXT_GUIDED_IMAGE_VARIATION_BATCH_PARAMS,
|
31 |
-
TEXT_GUIDED_IMAGE_VARIATION_PARAMS,
|
32 |
-
)
|
33 |
-
from ..test_pipelines_common import PipelineLatentTesterMixin, PipelineTesterMixin
|
34 |
-
|
35 |
-
|
36 |
-
enable_full_determinism()
|
37 |
-
|
38 |
-
|
39 |
-
class CycleDiffusionPipelineFastTests(PipelineLatentTesterMixin, PipelineTesterMixin, unittest.TestCase):
|
40 |
-
pipeline_class = CycleDiffusionPipeline
|
41 |
-
params = TEXT_GUIDED_IMAGE_VARIATION_PARAMS - {
|
42 |
-
"negative_prompt",
|
43 |
-
"height",
|
44 |
-
"width",
|
45 |
-
"negative_prompt_embeds",
|
46 |
-
}
|
47 |
-
required_optional_params = PipelineTesterMixin.required_optional_params - {"latents"}
|
48 |
-
batch_params = TEXT_GUIDED_IMAGE_VARIATION_BATCH_PARAMS.union({"source_prompt"})
|
49 |
-
image_params = IMAGE_TO_IMAGE_IMAGE_PARAMS
|
50 |
-
image_latents_params = IMAGE_TO_IMAGE_IMAGE_PARAMS
|
51 |
-
|
52 |
-
def get_dummy_components(self):
|
53 |
-
torch.manual_seed(0)
|
54 |
-
unet = UNet2DConditionModel(
|
55 |
-
block_out_channels=(32, 64),
|
56 |
-
layers_per_block=2,
|
57 |
-
sample_size=32,
|
58 |
-
in_channels=4,
|
59 |
-
out_channels=4,
|
60 |
-
down_block_types=("DownBlock2D", "CrossAttnDownBlock2D"),
|
61 |
-
up_block_types=("CrossAttnUpBlock2D", "UpBlock2D"),
|
62 |
-
cross_attention_dim=32,
|
63 |
-
)
|
64 |
-
scheduler = DDIMScheduler(
|
65 |
-
beta_start=0.00085,
|
66 |
-
beta_end=0.012,
|
67 |
-
beta_schedule="scaled_linear",
|
68 |
-
num_train_timesteps=1000,
|
69 |
-
clip_sample=False,
|
70 |
-
set_alpha_to_one=False,
|
71 |
-
)
|
72 |
-
torch.manual_seed(0)
|
73 |
-
vae = AutoencoderKL(
|
74 |
-
block_out_channels=[32, 64],
|
75 |
-
in_channels=3,
|
76 |
-
out_channels=3,
|
77 |
-
down_block_types=["DownEncoderBlock2D", "DownEncoderBlock2D"],
|
78 |
-
up_block_types=["UpDecoderBlock2D", "UpDecoderBlock2D"],
|
79 |
-
latent_channels=4,
|
80 |
-
)
|
81 |
-
torch.manual_seed(0)
|
82 |
-
text_encoder_config = CLIPTextConfig(
|
83 |
-
bos_token_id=0,
|
84 |
-
eos_token_id=2,
|
85 |
-
hidden_size=32,
|
86 |
-
intermediate_size=37,
|
87 |
-
layer_norm_eps=1e-05,
|
88 |
-
num_attention_heads=4,
|
89 |
-
num_hidden_layers=5,
|
90 |
-
pad_token_id=1,
|
91 |
-
vocab_size=1000,
|
92 |
-
)
|
93 |
-
text_encoder = CLIPTextModel(text_encoder_config)
|
94 |
-
tokenizer = CLIPTokenizer.from_pretrained("hf-internal-testing/tiny-random-clip")
|
95 |
-
|
96 |
-
components = {
|
97 |
-
"unet": unet,
|
98 |
-
"scheduler": scheduler,
|
99 |
-
"vae": vae,
|
100 |
-
"text_encoder": text_encoder,
|
101 |
-
"tokenizer": tokenizer,
|
102 |
-
"safety_checker": None,
|
103 |
-
"feature_extractor": None,
|
104 |
-
}
|
105 |
-
return components
|
106 |
-
|
107 |
-
def get_dummy_inputs(self, device, seed=0):
|
108 |
-
image = floats_tensor((1, 3, 32, 32), rng=random.Random(seed)).to(device)
|
109 |
-
image = image / 2 + 0.5
|
110 |
-
if str(device).startswith("mps"):
|
111 |
-
generator = torch.manual_seed(seed)
|
112 |
-
else:
|
113 |
-
generator = torch.Generator(device=device).manual_seed(seed)
|
114 |
-
inputs = {
|
115 |
-
"prompt": "An astronaut riding an elephant",
|
116 |
-
"source_prompt": "An astronaut riding a horse",
|
117 |
-
"image": image,
|
118 |
-
"generator": generator,
|
119 |
-
"num_inference_steps": 2,
|
120 |
-
"eta": 0.1,
|
121 |
-
"strength": 0.8,
|
122 |
-
"guidance_scale": 3,
|
123 |
-
"source_guidance_scale": 1,
|
124 |
-
"output_type": "numpy",
|
125 |
-
}
|
126 |
-
return inputs
|
127 |
-
|
128 |
-
def test_stable_diffusion_cycle(self):
|
129 |
-
device = "cpu" # ensure determinism for the device-dependent torch.Generator
|
130 |
-
|
131 |
-
components = self.get_dummy_components()
|
132 |
-
pipe = CycleDiffusionPipeline(**components)
|
133 |
-
pipe = pipe.to(device)
|
134 |
-
pipe.set_progress_bar_config(disable=None)
|
135 |
-
|
136 |
-
inputs = self.get_dummy_inputs(device)
|
137 |
-
output = pipe(**inputs)
|
138 |
-
images = output.images
|
139 |
-
|
140 |
-
image_slice = images[0, -3:, -3:, -1]
|
141 |
-
|
142 |
-
assert images.shape == (1, 32, 32, 3)
|
143 |
-
expected_slice = np.array([0.4459, 0.4943, 0.4544, 0.6643, 0.5474, 0.4327, 0.5701, 0.5959, 0.5179])
|
144 |
-
|
145 |
-
assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2
|
146 |
-
|
147 |
-
@unittest.skipIf(torch_device != "cuda", "This test requires a GPU")
|
148 |
-
def test_stable_diffusion_cycle_fp16(self):
|
149 |
-
components = self.get_dummy_components()
|
150 |
-
for name, module in components.items():
|
151 |
-
if hasattr(module, "half"):
|
152 |
-
components[name] = module.half()
|
153 |
-
pipe = CycleDiffusionPipeline(**components)
|
154 |
-
pipe = pipe.to(torch_device)
|
155 |
-
pipe.set_progress_bar_config(disable=None)
|
156 |
-
|
157 |
-
inputs = self.get_dummy_inputs(torch_device)
|
158 |
-
output = pipe(**inputs)
|
159 |
-
images = output.images
|
160 |
-
|
161 |
-
image_slice = images[0, -3:, -3:, -1]
|
162 |
-
|
163 |
-
assert images.shape == (1, 32, 32, 3)
|
164 |
-
expected_slice = np.array([0.3506, 0.4543, 0.446, 0.4575, 0.5195, 0.4155, 0.5273, 0.518, 0.4116])
|
165 |
-
|
166 |
-
assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2
|
167 |
-
|
168 |
-
@skip_mps
|
169 |
-
def test_save_load_local(self):
|
170 |
-
return super().test_save_load_local()
|
171 |
-
|
172 |
-
@unittest.skip("non-deterministic pipeline")
|
173 |
-
def test_inference_batch_single_identical(self):
|
174 |
-
return super().test_inference_batch_single_identical()
|
175 |
-
|
176 |
-
@skip_mps
|
177 |
-
def test_dict_tuple_outputs_equivalent(self):
|
178 |
-
return super().test_dict_tuple_outputs_equivalent()
|
179 |
-
|
180 |
-
@skip_mps
|
181 |
-
def test_save_load_optional_components(self):
|
182 |
-
return super().test_save_load_optional_components()
|
183 |
-
|
184 |
-
@skip_mps
|
185 |
-
def test_attention_slicing_forward_pass(self):
|
186 |
-
return super().test_attention_slicing_forward_pass()
|
187 |
-
|
188 |
-
|
189 |
-
@slow
|
190 |
-
@require_torch_gpu
|
191 |
-
class CycleDiffusionPipelineIntegrationTests(unittest.TestCase):
|
192 |
-
def tearDown(self):
|
193 |
-
# clean up the VRAM after each test
|
194 |
-
super().tearDown()
|
195 |
-
gc.collect()
|
196 |
-
torch.cuda.empty_cache()
|
197 |
-
|
198 |
-
def test_cycle_diffusion_pipeline_fp16(self):
|
199 |
-
init_image = load_image(
|
200 |
-
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main"
|
201 |
-
"/cycle-diffusion/black_colored_car.png"
|
202 |
-
)
|
203 |
-
expected_image = load_numpy(
|
204 |
-
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/cycle-diffusion/blue_colored_car_fp16.npy"
|
205 |
-
)
|
206 |
-
init_image = init_image.resize((512, 512))
|
207 |
-
|
208 |
-
model_id = "CompVis/stable-diffusion-v1-4"
|
209 |
-
scheduler = DDIMScheduler.from_pretrained(model_id, subfolder="scheduler")
|
210 |
-
pipe = CycleDiffusionPipeline.from_pretrained(
|
211 |
-
model_id, scheduler=scheduler, safety_checker=None, torch_dtype=torch.float16, revision="fp16"
|
212 |
-
)
|
213 |
-
|
214 |
-
pipe.to(torch_device)
|
215 |
-
pipe.set_progress_bar_config(disable=None)
|
216 |
-
pipe.enable_attention_slicing()
|
217 |
-
|
218 |
-
source_prompt = "A black colored car"
|
219 |
-
prompt = "A blue colored car"
|
220 |
-
|
221 |
-
generator = torch.manual_seed(0)
|
222 |
-
output = pipe(
|
223 |
-
prompt=prompt,
|
224 |
-
source_prompt=source_prompt,
|
225 |
-
image=init_image,
|
226 |
-
num_inference_steps=100,
|
227 |
-
eta=0.1,
|
228 |
-
strength=0.85,
|
229 |
-
guidance_scale=3,
|
230 |
-
source_guidance_scale=1,
|
231 |
-
generator=generator,
|
232 |
-
output_type="np",
|
233 |
-
)
|
234 |
-
image = output.images
|
235 |
-
|
236 |
-
# the values aren't exactly equal, but the images look the same visually
|
237 |
-
assert np.abs(image - expected_image).max() < 5e-1
|
238 |
-
|
239 |
-
def test_cycle_diffusion_pipeline(self):
|
240 |
-
init_image = load_image(
|
241 |
-
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main"
|
242 |
-
"/cycle-diffusion/black_colored_car.png"
|
243 |
-
)
|
244 |
-
expected_image = load_numpy(
|
245 |
-
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/cycle-diffusion/blue_colored_car.npy"
|
246 |
-
)
|
247 |
-
init_image = init_image.resize((512, 512))
|
248 |
-
|
249 |
-
model_id = "CompVis/stable-diffusion-v1-4"
|
250 |
-
scheduler = DDIMScheduler.from_pretrained(model_id, subfolder="scheduler")
|
251 |
-
pipe = CycleDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler, safety_checker=None)
|
252 |
-
|
253 |
-
pipe.to(torch_device)
|
254 |
-
pipe.set_progress_bar_config(disable=None)
|
255 |
-
pipe.enable_attention_slicing()
|
256 |
-
|
257 |
-
source_prompt = "A black colored car"
|
258 |
-
prompt = "A blue colored car"
|
259 |
-
|
260 |
-
generator = torch.manual_seed(0)
|
261 |
-
output = pipe(
|
262 |
-
prompt=prompt,
|
263 |
-
source_prompt=source_prompt,
|
264 |
-
image=init_image,
|
265 |
-
num_inference_steps=100,
|
266 |
-
eta=0.1,
|
267 |
-
strength=0.85,
|
268 |
-
guidance_scale=3,
|
269 |
-
source_guidance_scale=1,
|
270 |
-
generator=generator,
|
271 |
-
output_type="np",
|
272 |
-
)
|
273 |
-
image = output.images
|
274 |
-
|
275 |
-
assert np.abs(image - expected_image).max() < 2e-2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_segmentation/configs/ann/ann_r50-d8_512x1024_80k_cityscapes.py
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
_base_ = [
|
2 |
-
'../_base_/models/ann_r50-d8.py', '../_base_/datasets/cityscapes.py',
|
3 |
-
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'
|
4 |
-
]
|
|
|
|
|
|
|
|
|
|
spaces/AnishKumbhar/ChatBot/text-generation-webui-main/modules/loaders.py
DELETED
@@ -1,493 +0,0 @@
|
|
1 |
-
import functools
|
2 |
-
from collections import OrderedDict
|
3 |
-
|
4 |
-
import gradio as gr
|
5 |
-
|
6 |
-
from modules import shared
|
7 |
-
|
8 |
-
loaders_and_params = OrderedDict({
|
9 |
-
'Transformers': [
|
10 |
-
'cpu_memory',
|
11 |
-
'gpu_memory',
|
12 |
-
'trust_remote_code',
|
13 |
-
'load_in_8bit',
|
14 |
-
'bf16',
|
15 |
-
'cpu',
|
16 |
-
'disk',
|
17 |
-
'auto_devices',
|
18 |
-
'load_in_4bit',
|
19 |
-
'use_double_quant',
|
20 |
-
'quant_type',
|
21 |
-
'compute_dtype',
|
22 |
-
'trust_remote_code',
|
23 |
-
'use_fast',
|
24 |
-
'alpha_value',
|
25 |
-
'rope_freq_base',
|
26 |
-
'compress_pos_emb',
|
27 |
-
'disable_exllama',
|
28 |
-
'transformers_info'
|
29 |
-
],
|
30 |
-
'ExLlama_HF': [
|
31 |
-
'gpu_split',
|
32 |
-
'max_seq_len',
|
33 |
-
'alpha_value',
|
34 |
-
'rope_freq_base',
|
35 |
-
'compress_pos_emb',
|
36 |
-
'cfg_cache',
|
37 |
-
'use_fast',
|
38 |
-
'exllama_HF_info',
|
39 |
-
],
|
40 |
-
'ExLlamav2_HF': [
|
41 |
-
'gpu_split',
|
42 |
-
'max_seq_len',
|
43 |
-
'cfg_cache',
|
44 |
-
'alpha_value',
|
45 |
-
'compress_pos_emb',
|
46 |
-
'use_fast',
|
47 |
-
],
|
48 |
-
'ExLlama': [
|
49 |
-
'gpu_split',
|
50 |
-
'max_seq_len',
|
51 |
-
'alpha_value',
|
52 |
-
'rope_freq_base',
|
53 |
-
'compress_pos_emb',
|
54 |
-
'exllama_info',
|
55 |
-
],
|
56 |
-
'ExLlamav2': [
|
57 |
-
'gpu_split',
|
58 |
-
'max_seq_len',
|
59 |
-
'alpha_value',
|
60 |
-
'compress_pos_emb',
|
61 |
-
],
|
62 |
-
'AutoGPTQ': [
|
63 |
-
'triton',
|
64 |
-
'no_inject_fused_attention',
|
65 |
-
'no_inject_fused_mlp',
|
66 |
-
'no_use_cuda_fp16',
|
67 |
-
'wbits',
|
68 |
-
'groupsize',
|
69 |
-
'desc_act',
|
70 |
-
'disable_exllama',
|
71 |
-
'gpu_memory',
|
72 |
-
'cpu_memory',
|
73 |
-
'cpu',
|
74 |
-
'disk',
|
75 |
-
'auto_devices',
|
76 |
-
'trust_remote_code',
|
77 |
-
'use_fast',
|
78 |
-
'autogptq_info',
|
79 |
-
],
|
80 |
-
'GPTQ-for-LLaMa': [
|
81 |
-
'wbits',
|
82 |
-
'groupsize',
|
83 |
-
'model_type',
|
84 |
-
'pre_layer',
|
85 |
-
'use_fast',
|
86 |
-
'gptq_for_llama_info',
|
87 |
-
],
|
88 |
-
'llama.cpp': [
|
89 |
-
'n_ctx',
|
90 |
-
'n_gpu_layers',
|
91 |
-
'tensor_split',
|
92 |
-
'n_batch',
|
93 |
-
'threads',
|
94 |
-
'threads_batch',
|
95 |
-
'no_mmap',
|
96 |
-
'mlock',
|
97 |
-
'mul_mat_q',
|
98 |
-
'llama_cpp_seed',
|
99 |
-
'alpha_value',
|
100 |
-
'rope_freq_base',
|
101 |
-
'compress_pos_emb',
|
102 |
-
'cpu',
|
103 |
-
'numa',
|
104 |
-
],
|
105 |
-
'llamacpp_HF': [
|
106 |
-
'n_ctx',
|
107 |
-
'n_gpu_layers',
|
108 |
-
'tensor_split',
|
109 |
-
'n_batch',
|
110 |
-
'threads',
|
111 |
-
'threads_batch',
|
112 |
-
'no_mmap',
|
113 |
-
'mlock',
|
114 |
-
'mul_mat_q',
|
115 |
-
'alpha_value',
|
116 |
-
'rope_freq_base',
|
117 |
-
'compress_pos_emb',
|
118 |
-
'cpu',
|
119 |
-
'numa',
|
120 |
-
'cfg_cache',
|
121 |
-
'use_fast',
|
122 |
-
'llamacpp_HF_info',
|
123 |
-
],
|
124 |
-
'ctransformers': [
|
125 |
-
'n_ctx',
|
126 |
-
'n_gpu_layers',
|
127 |
-
'n_batch',
|
128 |
-
'threads',
|
129 |
-
'model_type',
|
130 |
-
'no_mmap',
|
131 |
-
'mlock'
|
132 |
-
],
|
133 |
-
'AutoAWQ': [
|
134 |
-
'cpu_memory',
|
135 |
-
'gpu_memory',
|
136 |
-
'auto_devices',
|
137 |
-
'max_seq_len',
|
138 |
-
'n_batch',
|
139 |
-
'no_inject_fused_attention',
|
140 |
-
'trust_remote_code',
|
141 |
-
'use_fast',
|
142 |
-
]
|
143 |
-
})
|
144 |
-
|
145 |
-
loaders_samplers = {
|
146 |
-
'Transformers': {
|
147 |
-
'temperature',
|
148 |
-
'top_p',
|
149 |
-
'top_k',
|
150 |
-
'typical_p',
|
151 |
-
'epsilon_cutoff',
|
152 |
-
'eta_cutoff',
|
153 |
-
'tfs',
|
154 |
-
'top_a',
|
155 |
-
'repetition_penalty',
|
156 |
-
'repetition_penalty_range',
|
157 |
-
'encoder_repetition_penalty',
|
158 |
-
'no_repeat_ngram_size',
|
159 |
-
'min_length',
|
160 |
-
'seed',
|
161 |
-
'do_sample',
|
162 |
-
'penalty_alpha',
|
163 |
-
'num_beams',
|
164 |
-
'length_penalty',
|
165 |
-
'early_stopping',
|
166 |
-
'mirostat_mode',
|
167 |
-
'mirostat_tau',
|
168 |
-
'mirostat_eta',
|
169 |
-
'grammar_file_row',
|
170 |
-
'grammar_string',
|
171 |
-
'guidance_scale',
|
172 |
-
'negative_prompt',
|
173 |
-
'ban_eos_token',
|
174 |
-
'custom_token_bans',
|
175 |
-
'add_bos_token',
|
176 |
-
'skip_special_tokens',
|
177 |
-
'auto_max_new_tokens',
|
178 |
-
},
|
179 |
-
'ExLlama_HF': {
|
180 |
-
'temperature',
|
181 |
-
'top_p',
|
182 |
-
'top_k',
|
183 |
-
'typical_p',
|
184 |
-
'epsilon_cutoff',
|
185 |
-
'eta_cutoff',
|
186 |
-
'tfs',
|
187 |
-
'top_a',
|
188 |
-
'repetition_penalty',
|
189 |
-
'repetition_penalty_range',
|
190 |
-
'encoder_repetition_penalty',
|
191 |
-
'no_repeat_ngram_size',
|
192 |
-
'min_length',
|
193 |
-
'seed',
|
194 |
-
'do_sample',
|
195 |
-
'mirostat_mode',
|
196 |
-
'mirostat_tau',
|
197 |
-
'mirostat_eta',
|
198 |
-
'grammar_file_row',
|
199 |
-
'grammar_string',
|
200 |
-
'guidance_scale',
|
201 |
-
'negative_prompt',
|
202 |
-
'ban_eos_token',
|
203 |
-
'custom_token_bans',
|
204 |
-
'add_bos_token',
|
205 |
-
'skip_special_tokens',
|
206 |
-
'auto_max_new_tokens',
|
207 |
-
},
|
208 |
-
'ExLlama': {
|
209 |
-
'temperature',
|
210 |
-
'top_p',
|
211 |
-
'top_k',
|
212 |
-
'typical_p',
|
213 |
-
'repetition_penalty',
|
214 |
-
'repetition_penalty_range',
|
215 |
-
'seed',
|
216 |
-
'guidance_scale',
|
217 |
-
'negative_prompt',
|
218 |
-
'ban_eos_token',
|
219 |
-
'add_bos_token',
|
220 |
-
'custom_token_bans',
|
221 |
-
'auto_max_new_tokens',
|
222 |
-
},
|
223 |
-
'ExLlamav2': {
|
224 |
-
'temperature',
|
225 |
-
'top_p',
|
226 |
-
'top_k',
|
227 |
-
'typical_p',
|
228 |
-
'repetition_penalty',
|
229 |
-
'repetition_penalty_range',
|
230 |
-
'seed',
|
231 |
-
'ban_eos_token',
|
232 |
-
'add_bos_token',
|
233 |
-
'custom_token_bans',
|
234 |
-
'auto_max_new_tokens',
|
235 |
-
},
|
236 |
-
'ExLlamav2_HF': {
|
237 |
-
'temperature',
|
238 |
-
'top_p',
|
239 |
-
'top_k',
|
240 |
-
'typical_p',
|
241 |
-
'epsilon_cutoff',
|
242 |
-
'eta_cutoff',
|
243 |
-
'tfs',
|
244 |
-
'top_a',
|
245 |
-
'repetition_penalty',
|
246 |
-
'repetition_penalty_range',
|
247 |
-
'encoder_repetition_penalty',
|
248 |
-
'no_repeat_ngram_size',
|
249 |
-
'min_length',
|
250 |
-
'seed',
|
251 |
-
'do_sample',
|
252 |
-
'mirostat_mode',
|
253 |
-
'mirostat_tau',
|
254 |
-
'mirostat_eta',
|
255 |
-
'grammar_file_row',
|
256 |
-
'grammar_string',
|
257 |
-
'guidance_scale',
|
258 |
-
'negative_prompt',
|
259 |
-
'ban_eos_token',
|
260 |
-
'custom_token_bans',
|
261 |
-
'add_bos_token',
|
262 |
-
'skip_special_tokens',
|
263 |
-
'auto_max_new_tokens',
|
264 |
-
},
|
265 |
-
'AutoGPTQ': {
|
266 |
-
'temperature',
|
267 |
-
'top_p',
|
268 |
-
'top_k',
|
269 |
-
'typical_p',
|
270 |
-
'epsilon_cutoff',
|
271 |
-
'eta_cutoff',
|
272 |
-
'tfs',
|
273 |
-
'top_a',
|
274 |
-
'repetition_penalty',
|
275 |
-
'repetition_penalty_range',
|
276 |
-
'encoder_repetition_penalty',
|
277 |
-
'no_repeat_ngram_size',
|
278 |
-
'min_length',
|
279 |
-
'seed',
|
280 |
-
'do_sample',
|
281 |
-
'penalty_alpha',
|
282 |
-
'num_beams',
|
283 |
-
'length_penalty',
|
284 |
-
'early_stopping',
|
285 |
-
'mirostat_mode',
|
286 |
-
'mirostat_tau',
|
287 |
-
'mirostat_eta',
|
288 |
-
'grammar_file_row',
|
289 |
-
'grammar_string',
|
290 |
-
'guidance_scale',
|
291 |
-
'negative_prompt',
|
292 |
-
'ban_eos_token',
|
293 |
-
'custom_token_bans',
|
294 |
-
'add_bos_token',
|
295 |
-
'skip_special_tokens',
|
296 |
-
'auto_max_new_tokens',
|
297 |
-
},
|
298 |
-
'GPTQ-for-LLaMa': {
|
299 |
-
'temperature',
|
300 |
-
'top_p',
|
301 |
-
'top_k',
|
302 |
-
'typical_p',
|
303 |
-
'epsilon_cutoff',
|
304 |
-
'eta_cutoff',
|
305 |
-
'tfs',
|
306 |
-
'top_a',
|
307 |
-
'repetition_penalty',
|
308 |
-
'repetition_penalty_range',
|
309 |
-
'encoder_repetition_penalty',
|
310 |
-
'no_repeat_ngram_size',
|
311 |
-
'min_length',
|
312 |
-
'seed',
|
313 |
-
'do_sample',
|
314 |
-
'penalty_alpha',
|
315 |
-
'num_beams',
|
316 |
-
'length_penalty',
|
317 |
-
'early_stopping',
|
318 |
-
'mirostat_mode',
|
319 |
-
'mirostat_tau',
|
320 |
-
'mirostat_eta',
|
321 |
-
'grammar_file_row',
|
322 |
-
'grammar_string',
|
323 |
-
'guidance_scale',
|
324 |
-
'negative_prompt',
|
325 |
-
'ban_eos_token',
|
326 |
-
'custom_token_bans',
|
327 |
-
'add_bos_token',
|
328 |
-
'skip_special_tokens',
|
329 |
-
'auto_max_new_tokens',
|
330 |
-
},
|
331 |
-
'llama.cpp': {
|
332 |
-
'temperature',
|
333 |
-
'top_p',
|
334 |
-
'top_k',
|
335 |
-
'tfs',
|
336 |
-
'repetition_penalty',
|
337 |
-
'mirostat_mode',
|
338 |
-
'mirostat_tau',
|
339 |
-
'mirostat_eta',
|
340 |
-
'grammar_file_row',
|
341 |
-
'grammar_string',
|
342 |
-
'ban_eos_token',
|
343 |
-
'custom_token_bans',
|
344 |
-
},
|
345 |
-
'llamacpp_HF': {
|
346 |
-
'temperature',
|
347 |
-
'top_p',
|
348 |
-
'top_k',
|
349 |
-
'typical_p',
|
350 |
-
'epsilon_cutoff',
|
351 |
-
'eta_cutoff',
|
352 |
-
'tfs',
|
353 |
-
'top_a',
|
354 |
-
'repetition_penalty',
|
355 |
-
'repetition_penalty_range',
|
356 |
-
'encoder_repetition_penalty',
|
357 |
-
'no_repeat_ngram_size',
|
358 |
-
'min_length',
|
359 |
-
'seed',
|
360 |
-
'do_sample',
|
361 |
-
'mirostat_mode',
|
362 |
-
'mirostat_tau',
|
363 |
-
'mirostat_eta',
|
364 |
-
'grammar_file_row',
|
365 |
-
'grammar_string',
|
366 |
-
'guidance_scale',
|
367 |
-
'negative_prompt',
|
368 |
-
'ban_eos_token',
|
369 |
-
'custom_token_bans',
|
370 |
-
'add_bos_token',
|
371 |
-
'skip_special_tokens',
|
372 |
-
'auto_max_new_tokens',
|
373 |
-
},
|
374 |
-
'ctransformers': {
|
375 |
-
'temperature',
|
376 |
-
'top_p',
|
377 |
-
'top_k',
|
378 |
-
'repetition_penalty',
|
379 |
-
'repetition_penalty_range',
|
380 |
-
},
|
381 |
-
'AutoAWQ': {
|
382 |
-
'temperature',
|
383 |
-
'top_p',
|
384 |
-
'top_k',
|
385 |
-
'typical_p',
|
386 |
-
'epsilon_cutoff',
|
387 |
-
'eta_cutoff',
|
388 |
-
'tfs',
|
389 |
-
'top_a',
|
390 |
-
'repetition_penalty',
|
391 |
-
'repetition_penalty_range',
|
392 |
-
'encoder_repetition_penalty',
|
393 |
-
'no_repeat_ngram_size',
|
394 |
-
'min_length',
|
395 |
-
'seed',
|
396 |
-
'do_sample',
|
397 |
-
'penalty_alpha',
|
398 |
-
'num_beams',
|
399 |
-
'length_penalty',
|
400 |
-
'early_stopping',
|
401 |
-
'mirostat_mode',
|
402 |
-
'mirostat_tau',
|
403 |
-
'mirostat_eta',
|
404 |
-
'grammar_file_row',
|
405 |
-
'grammar_string',
|
406 |
-
'guidance_scale',
|
407 |
-
'negative_prompt',
|
408 |
-
'ban_eos_token',
|
409 |
-
'custom_token_bans',
|
410 |
-
'add_bos_token',
|
411 |
-
'skip_special_tokens',
|
412 |
-
'auto_max_new_tokens',
|
413 |
-
},
|
414 |
-
}
|
415 |
-
|
416 |
-
loaders_model_types = {
|
417 |
-
'GPTQ-for-LLaMa': [
|
418 |
-
"None",
|
419 |
-
"llama",
|
420 |
-
"opt",
|
421 |
-
"gptj"
|
422 |
-
],
|
423 |
-
'ctransformers': [
|
424 |
-
"None",
|
425 |
-
"gpt2",
|
426 |
-
"gptj",
|
427 |
-
"gptneox",
|
428 |
-
"llama",
|
429 |
-
"mpt",
|
430 |
-
"dollyv2",
|
431 |
-
"replit",
|
432 |
-
"starcoder",
|
433 |
-
"gptbigcode",
|
434 |
-
"falcon"
|
435 |
-
],
|
436 |
-
}
|
437 |
-
|
438 |
-
|
439 |
-
@functools.cache
|
440 |
-
def list_all_samplers():
|
441 |
-
all_samplers = set()
|
442 |
-
for k in loaders_samplers:
|
443 |
-
for sampler in loaders_samplers[k]:
|
444 |
-
all_samplers.add(sampler)
|
445 |
-
|
446 |
-
return sorted(all_samplers)
|
447 |
-
|
448 |
-
|
449 |
-
def blacklist_samplers(loader):
|
450 |
-
all_samplers = list_all_samplers()
|
451 |
-
if loader == 'All':
|
452 |
-
return [gr.update(visible=True) for sampler in all_samplers]
|
453 |
-
else:
|
454 |
-
return [gr.update(visible=True) if sampler in loaders_samplers[loader] else gr.update(visible=False) for sampler in all_samplers]
|
455 |
-
|
456 |
-
|
457 |
-
def get_model_types(loader):
|
458 |
-
if loader in loaders_model_types:
|
459 |
-
return loaders_model_types[loader]
|
460 |
-
|
461 |
-
return ["None"]
|
462 |
-
|
463 |
-
|
464 |
-
def get_gpu_memory_keys():
|
465 |
-
return [k for k in shared.gradio if k.startswith('gpu_memory')]
|
466 |
-
|
467 |
-
|
468 |
-
@functools.cache
|
469 |
-
def get_all_params():
|
470 |
-
all_params = set()
|
471 |
-
for k in loaders_and_params:
|
472 |
-
for el in loaders_and_params[k]:
|
473 |
-
all_params.add(el)
|
474 |
-
|
475 |
-
if 'gpu_memory' in all_params:
|
476 |
-
all_params.remove('gpu_memory')
|
477 |
-
for k in get_gpu_memory_keys():
|
478 |
-
all_params.add(k)
|
479 |
-
|
480 |
-
return sorted(all_params)
|
481 |
-
|
482 |
-
|
483 |
-
def make_loader_params_visible(loader):
|
484 |
-
params = []
|
485 |
-
all_params = get_all_params()
|
486 |
-
if loader in loaders_and_params:
|
487 |
-
params = loaders_and_params[loader]
|
488 |
-
|
489 |
-
if 'gpu_memory' in params:
|
490 |
-
params.remove('gpu_memory')
|
491 |
-
params += get_gpu_memory_keys()
|
492 |
-
|
493 |
-
return [gr.update(visible=True) if k in params else gr.update(visible=False) for k in all_params]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Anonymous-sub/Rerender/ControlNet/ldm/modules/image_degradation/bsrgan.py
DELETED
@@ -1,730 +0,0 @@
|
|
1 |
-
# -*- coding: utf-8 -*-
|
2 |
-
"""
|
3 |
-
# --------------------------------------------
|
4 |
-
# Super-Resolution
|
5 |
-
# --------------------------------------------
|
6 |
-
#
|
7 |
-
# Kai Zhang ([email protected])
|
8 |
-
# https://github.com/cszn
|
9 |
-
# From 2019/03--2021/08
|
10 |
-
# --------------------------------------------
|
11 |
-
"""
|
12 |
-
|
13 |
-
import numpy as np
|
14 |
-
import cv2
|
15 |
-
import torch
|
16 |
-
|
17 |
-
from functools import partial
|
18 |
-
import random
|
19 |
-
from scipy import ndimage
|
20 |
-
import scipy
|
21 |
-
import scipy.stats as ss
|
22 |
-
from scipy.interpolate import interp2d
|
23 |
-
from scipy.linalg import orth
|
24 |
-
import albumentations
|
25 |
-
|
26 |
-
import ldm.modules.image_degradation.utils_image as util
|
27 |
-
|
28 |
-
|
29 |
-
def modcrop_np(img, sf):
|
30 |
-
'''
|
31 |
-
Args:
|
32 |
-
img: numpy image, WxH or WxHxC
|
33 |
-
sf: scale factor
|
34 |
-
Return:
|
35 |
-
cropped image
|
36 |
-
'''
|
37 |
-
w, h = img.shape[:2]
|
38 |
-
im = np.copy(img)
|
39 |
-
return im[:w - w % sf, :h - h % sf, ...]
|
40 |
-
|
41 |
-
|
42 |
-
"""
|
43 |
-
# --------------------------------------------
|
44 |
-
# anisotropic Gaussian kernels
|
45 |
-
# --------------------------------------------
|
46 |
-
"""
|
47 |
-
|
48 |
-
|
49 |
-
def analytic_kernel(k):
|
50 |
-
"""Calculate the X4 kernel from the X2 kernel (for proof see appendix in paper)"""
|
51 |
-
k_size = k.shape[0]
|
52 |
-
# Calculate the big kernels size
|
53 |
-
big_k = np.zeros((3 * k_size - 2, 3 * k_size - 2))
|
54 |
-
# Loop over the small kernel to fill the big one
|
55 |
-
for r in range(k_size):
|
56 |
-
for c in range(k_size):
|
57 |
-
big_k[2 * r:2 * r + k_size, 2 * c:2 * c + k_size] += k[r, c] * k
|
58 |
-
# Crop the edges of the big kernel to ignore very small values and increase run time of SR
|
59 |
-
crop = k_size // 2
|
60 |
-
cropped_big_k = big_k[crop:-crop, crop:-crop]
|
61 |
-
# Normalize to 1
|
62 |
-
return cropped_big_k / cropped_big_k.sum()
|
63 |
-
|
64 |
-
|
65 |
-
def anisotropic_Gaussian(ksize=15, theta=np.pi, l1=6, l2=6):
|
66 |
-
""" generate an anisotropic Gaussian kernel
|
67 |
-
Args:
|
68 |
-
ksize : e.g., 15, kernel size
|
69 |
-
theta : [0, pi], rotation angle range
|
70 |
-
l1 : [0.1,50], scaling of eigenvalues
|
71 |
-
l2 : [0.1,l1], scaling of eigenvalues
|
72 |
-
If l1 = l2, will get an isotropic Gaussian kernel.
|
73 |
-
Returns:
|
74 |
-
k : kernel
|
75 |
-
"""
|
76 |
-
|
77 |
-
v = np.dot(np.array([[np.cos(theta), -np.sin(theta)], [np.sin(theta), np.cos(theta)]]), np.array([1., 0.]))
|
78 |
-
V = np.array([[v[0], v[1]], [v[1], -v[0]]])
|
79 |
-
D = np.array([[l1, 0], [0, l2]])
|
80 |
-
Sigma = np.dot(np.dot(V, D), np.linalg.inv(V))
|
81 |
-
k = gm_blur_kernel(mean=[0, 0], cov=Sigma, size=ksize)
|
82 |
-
|
83 |
-
return k
|
84 |
-
|
85 |
-
|
86 |
-
def gm_blur_kernel(mean, cov, size=15):
|
87 |
-
center = size / 2.0 + 0.5
|
88 |
-
k = np.zeros([size, size])
|
89 |
-
for y in range(size):
|
90 |
-
for x in range(size):
|
91 |
-
cy = y - center + 1
|
92 |
-
cx = x - center + 1
|
93 |
-
k[y, x] = ss.multivariate_normal.pdf([cx, cy], mean=mean, cov=cov)
|
94 |
-
|
95 |
-
k = k / np.sum(k)
|
96 |
-
return k
|
97 |
-
|
98 |
-
|
99 |
-
def shift_pixel(x, sf, upper_left=True):
|
100 |
-
"""shift pixel for super-resolution with different scale factors
|
101 |
-
Args:
|
102 |
-
x: WxHxC or WxH
|
103 |
-
sf: scale factor
|
104 |
-
upper_left: shift direction
|
105 |
-
"""
|
106 |
-
h, w = x.shape[:2]
|
107 |
-
shift = (sf - 1) * 0.5
|
108 |
-
xv, yv = np.arange(0, w, 1.0), np.arange(0, h, 1.0)
|
109 |
-
if upper_left:
|
110 |
-
x1 = xv + shift
|
111 |
-
y1 = yv + shift
|
112 |
-
else:
|
113 |
-
x1 = xv - shift
|
114 |
-
y1 = yv - shift
|
115 |
-
|
116 |
-
x1 = np.clip(x1, 0, w - 1)
|
117 |
-
y1 = np.clip(y1, 0, h - 1)
|
118 |
-
|
119 |
-
if x.ndim == 2:
|
120 |
-
x = interp2d(xv, yv, x)(x1, y1)
|
121 |
-
if x.ndim == 3:
|
122 |
-
for i in range(x.shape[-1]):
|
123 |
-
x[:, :, i] = interp2d(xv, yv, x[:, :, i])(x1, y1)
|
124 |
-
|
125 |
-
return x
|
126 |
-
|
127 |
-
|
128 |
-
def blur(x, k):
|
129 |
-
'''
|
130 |
-
x: image, NxcxHxW
|
131 |
-
k: kernel, Nx1xhxw
|
132 |
-
'''
|
133 |
-
n, c = x.shape[:2]
|
134 |
-
p1, p2 = (k.shape[-2] - 1) // 2, (k.shape[-1] - 1) // 2
|
135 |
-
x = torch.nn.functional.pad(x, pad=(p1, p2, p1, p2), mode='replicate')
|
136 |
-
k = k.repeat(1, c, 1, 1)
|
137 |
-
k = k.view(-1, 1, k.shape[2], k.shape[3])
|
138 |
-
x = x.view(1, -1, x.shape[2], x.shape[3])
|
139 |
-
x = torch.nn.functional.conv2d(x, k, bias=None, stride=1, padding=0, groups=n * c)
|
140 |
-
x = x.view(n, c, x.shape[2], x.shape[3])
|
141 |
-
|
142 |
-
return x
|
143 |
-
|
144 |
-
|
145 |
-
def gen_kernel(k_size=np.array([15, 15]), scale_factor=np.array([4, 4]), min_var=0.6, max_var=10., noise_level=0):
|
146 |
-
""""
|
147 |
-
# modified version of https://github.com/assafshocher/BlindSR_dataset_generator
|
148 |
-
# Kai Zhang
|
149 |
-
# min_var = 0.175 * sf # variance of the gaussian kernel will be sampled between min_var and max_var
|
150 |
-
# max_var = 2.5 * sf
|
151 |
-
"""
|
152 |
-
# Set random eigen-vals (lambdas) and angle (theta) for COV matrix
|
153 |
-
lambda_1 = min_var + np.random.rand() * (max_var - min_var)
|
154 |
-
lambda_2 = min_var + np.random.rand() * (max_var - min_var)
|
155 |
-
theta = np.random.rand() * np.pi # random theta
|
156 |
-
noise = -noise_level + np.random.rand(*k_size) * noise_level * 2
|
157 |
-
|
158 |
-
# Set COV matrix using Lambdas and Theta
|
159 |
-
LAMBDA = np.diag([lambda_1, lambda_2])
|
160 |
-
Q = np.array([[np.cos(theta), -np.sin(theta)],
|
161 |
-
[np.sin(theta), np.cos(theta)]])
|
162 |
-
SIGMA = Q @ LAMBDA @ Q.T
|
163 |
-
INV_SIGMA = np.linalg.inv(SIGMA)[None, None, :, :]
|
164 |
-
|
165 |
-
# Set expectation position (shifting kernel for aligned image)
|
166 |
-
MU = k_size // 2 - 0.5 * (scale_factor - 1) # - 0.5 * (scale_factor - k_size % 2)
|
167 |
-
MU = MU[None, None, :, None]
|
168 |
-
|
169 |
-
# Create meshgrid for Gaussian
|
170 |
-
[X, Y] = np.meshgrid(range(k_size[0]), range(k_size[1]))
|
171 |
-
Z = np.stack([X, Y], 2)[:, :, :, None]
|
172 |
-
|
173 |
-
# Calcualte Gaussian for every pixel of the kernel
|
174 |
-
ZZ = Z - MU
|
175 |
-
ZZ_t = ZZ.transpose(0, 1, 3, 2)
|
176 |
-
raw_kernel = np.exp(-0.5 * np.squeeze(ZZ_t @ INV_SIGMA @ ZZ)) * (1 + noise)
|
177 |
-
|
178 |
-
# shift the kernel so it will be centered
|
179 |
-
# raw_kernel_centered = kernel_shift(raw_kernel, scale_factor)
|
180 |
-
|
181 |
-
# Normalize the kernel and return
|
182 |
-
# kernel = raw_kernel_centered / np.sum(raw_kernel_centered)
|
183 |
-
kernel = raw_kernel / np.sum(raw_kernel)
|
184 |
-
return kernel
|
185 |
-
|
186 |
-
|
187 |
-
def fspecial_gaussian(hsize, sigma):
|
188 |
-
hsize = [hsize, hsize]
|
189 |
-
siz = [(hsize[0] - 1.0) / 2.0, (hsize[1] - 1.0) / 2.0]
|
190 |
-
std = sigma
|
191 |
-
[x, y] = np.meshgrid(np.arange(-siz[1], siz[1] + 1), np.arange(-siz[0], siz[0] + 1))
|
192 |
-
arg = -(x * x + y * y) / (2 * std * std)
|
193 |
-
h = np.exp(arg)
|
194 |
-
h[h < scipy.finfo(float).eps * h.max()] = 0
|
195 |
-
sumh = h.sum()
|
196 |
-
if sumh != 0:
|
197 |
-
h = h / sumh
|
198 |
-
return h
|
199 |
-
|
200 |
-
|
201 |
-
def fspecial_laplacian(alpha):
|
202 |
-
alpha = max([0, min([alpha, 1])])
|
203 |
-
h1 = alpha / (alpha + 1)
|
204 |
-
h2 = (1 - alpha) / (alpha + 1)
|
205 |
-
h = [[h1, h2, h1], [h2, -4 / (alpha + 1), h2], [h1, h2, h1]]
|
206 |
-
h = np.array(h)
|
207 |
-
return h
|
208 |
-
|
209 |
-
|
210 |
-
def fspecial(filter_type, *args, **kwargs):
|
211 |
-
'''
|
212 |
-
python code from:
|
213 |
-
https://github.com/ronaldosena/imagens-medicas-2/blob/40171a6c259edec7827a6693a93955de2bd39e76/Aulas/aula_2_-_uniform_filter/matlab_fspecial.py
|
214 |
-
'''
|
215 |
-
if filter_type == 'gaussian':
|
216 |
-
return fspecial_gaussian(*args, **kwargs)
|
217 |
-
if filter_type == 'laplacian':
|
218 |
-
return fspecial_laplacian(*args, **kwargs)
|
219 |
-
|
220 |
-
|
221 |
-
"""
|
222 |
-
# --------------------------------------------
|
223 |
-
# degradation models
|
224 |
-
# --------------------------------------------
|
225 |
-
"""
|
226 |
-
|
227 |
-
|
228 |
-
def bicubic_degradation(x, sf=3):
|
229 |
-
'''
|
230 |
-
Args:
|
231 |
-
x: HxWxC image, [0, 1]
|
232 |
-
sf: down-scale factor
|
233 |
-
Return:
|
234 |
-
bicubicly downsampled LR image
|
235 |
-
'''
|
236 |
-
x = util.imresize_np(x, scale=1 / sf)
|
237 |
-
return x
|
238 |
-
|
239 |
-
|
240 |
-
def srmd_degradation(x, k, sf=3):
|
241 |
-
''' blur + bicubic downsampling
|
242 |
-
Args:
|
243 |
-
x: HxWxC image, [0, 1]
|
244 |
-
k: hxw, double
|
245 |
-
sf: down-scale factor
|
246 |
-
Return:
|
247 |
-
downsampled LR image
|
248 |
-
Reference:
|
249 |
-
@inproceedings{zhang2018learning,
|
250 |
-
title={Learning a single convolutional super-resolution network for multiple degradations},
|
251 |
-
author={Zhang, Kai and Zuo, Wangmeng and Zhang, Lei},
|
252 |
-
booktitle={IEEE Conference on Computer Vision and Pattern Recognition},
|
253 |
-
pages={3262--3271},
|
254 |
-
year={2018}
|
255 |
-
}
|
256 |
-
'''
|
257 |
-
x = ndimage.filters.convolve(x, np.expand_dims(k, axis=2), mode='wrap') # 'nearest' | 'mirror'
|
258 |
-
x = bicubic_degradation(x, sf=sf)
|
259 |
-
return x
|
260 |
-
|
261 |
-
|
262 |
-
def dpsr_degradation(x, k, sf=3):
|
263 |
-
''' bicubic downsampling + blur
|
264 |
-
Args:
|
265 |
-
x: HxWxC image, [0, 1]
|
266 |
-
k: hxw, double
|
267 |
-
sf: down-scale factor
|
268 |
-
Return:
|
269 |
-
downsampled LR image
|
270 |
-
Reference:
|
271 |
-
@inproceedings{zhang2019deep,
|
272 |
-
title={Deep Plug-and-Play Super-Resolution for Arbitrary Blur Kernels},
|
273 |
-
author={Zhang, Kai and Zuo, Wangmeng and Zhang, Lei},
|
274 |
-
booktitle={IEEE Conference on Computer Vision and Pattern Recognition},
|
275 |
-
pages={1671--1681},
|
276 |
-
year={2019}
|
277 |
-
}
|
278 |
-
'''
|
279 |
-
x = bicubic_degradation(x, sf=sf)
|
280 |
-
x = ndimage.filters.convolve(x, np.expand_dims(k, axis=2), mode='wrap')
|
281 |
-
return x
|
282 |
-
|
283 |
-
|
284 |
-
def classical_degradation(x, k, sf=3):
|
285 |
-
''' blur + downsampling
|
286 |
-
Args:
|
287 |
-
x: HxWxC image, [0, 1]/[0, 255]
|
288 |
-
k: hxw, double
|
289 |
-
sf: down-scale factor
|
290 |
-
Return:
|
291 |
-
downsampled LR image
|
292 |
-
'''
|
293 |
-
x = ndimage.filters.convolve(x, np.expand_dims(k, axis=2), mode='wrap')
|
294 |
-
# x = filters.correlate(x, np.expand_dims(np.flip(k), axis=2))
|
295 |
-
st = 0
|
296 |
-
return x[st::sf, st::sf, ...]
|
297 |
-
|
298 |
-
|
299 |
-
def add_sharpening(img, weight=0.5, radius=50, threshold=10):
|
300 |
-
"""USM sharpening. borrowed from real-ESRGAN
|
301 |
-
Input image: I; Blurry image: B.
|
302 |
-
1. K = I + weight * (I - B)
|
303 |
-
2. Mask = 1 if abs(I - B) > threshold, else: 0
|
304 |
-
3. Blur mask:
|
305 |
-
4. Out = Mask * K + (1 - Mask) * I
|
306 |
-
Args:
|
307 |
-
img (Numpy array): Input image, HWC, BGR; float32, [0, 1].
|
308 |
-
weight (float): Sharp weight. Default: 1.
|
309 |
-
radius (float): Kernel size of Gaussian blur. Default: 50.
|
310 |
-
threshold (int):
|
311 |
-
"""
|
312 |
-
if radius % 2 == 0:
|
313 |
-
radius += 1
|
314 |
-
blur = cv2.GaussianBlur(img, (radius, radius), 0)
|
315 |
-
residual = img - blur
|
316 |
-
mask = np.abs(residual) * 255 > threshold
|
317 |
-
mask = mask.astype('float32')
|
318 |
-
soft_mask = cv2.GaussianBlur(mask, (radius, radius), 0)
|
319 |
-
|
320 |
-
K = img + weight * residual
|
321 |
-
K = np.clip(K, 0, 1)
|
322 |
-
return soft_mask * K + (1 - soft_mask) * img
|
323 |
-
|
324 |
-
|
325 |
-
def add_blur(img, sf=4):
|
326 |
-
wd2 = 4.0 + sf
|
327 |
-
wd = 2.0 + 0.2 * sf
|
328 |
-
if random.random() < 0.5:
|
329 |
-
l1 = wd2 * random.random()
|
330 |
-
l2 = wd2 * random.random()
|
331 |
-
k = anisotropic_Gaussian(ksize=2 * random.randint(2, 11) + 3, theta=random.random() * np.pi, l1=l1, l2=l2)
|
332 |
-
else:
|
333 |
-
k = fspecial('gaussian', 2 * random.randint(2, 11) + 3, wd * random.random())
|
334 |
-
img = ndimage.filters.convolve(img, np.expand_dims(k, axis=2), mode='mirror')
|
335 |
-
|
336 |
-
return img
|
337 |
-
|
338 |
-
|
339 |
-
def add_resize(img, sf=4):
|
340 |
-
rnum = np.random.rand()
|
341 |
-
if rnum > 0.8: # up
|
342 |
-
sf1 = random.uniform(1, 2)
|
343 |
-
elif rnum < 0.7: # down
|
344 |
-
sf1 = random.uniform(0.5 / sf, 1)
|
345 |
-
else:
|
346 |
-
sf1 = 1.0
|
347 |
-
img = cv2.resize(img, (int(sf1 * img.shape[1]), int(sf1 * img.shape[0])), interpolation=random.choice([1, 2, 3]))
|
348 |
-
img = np.clip(img, 0.0, 1.0)
|
349 |
-
|
350 |
-
return img
|
351 |
-
|
352 |
-
|
353 |
-
# def add_Gaussian_noise(img, noise_level1=2, noise_level2=25):
|
354 |
-
# noise_level = random.randint(noise_level1, noise_level2)
|
355 |
-
# rnum = np.random.rand()
|
356 |
-
# if rnum > 0.6: # add color Gaussian noise
|
357 |
-
# img += np.random.normal(0, noise_level / 255.0, img.shape).astype(np.float32)
|
358 |
-
# elif rnum < 0.4: # add grayscale Gaussian noise
|
359 |
-
# img += np.random.normal(0, noise_level / 255.0, (*img.shape[:2], 1)).astype(np.float32)
|
360 |
-
# else: # add noise
|
361 |
-
# L = noise_level2 / 255.
|
362 |
-
# D = np.diag(np.random.rand(3))
|
363 |
-
# U = orth(np.random.rand(3, 3))
|
364 |
-
# conv = np.dot(np.dot(np.transpose(U), D), U)
|
365 |
-
# img += np.random.multivariate_normal([0, 0, 0], np.abs(L ** 2 * conv), img.shape[:2]).astype(np.float32)
|
366 |
-
# img = np.clip(img, 0.0, 1.0)
|
367 |
-
# return img
|
368 |
-
|
369 |
-
def add_Gaussian_noise(img, noise_level1=2, noise_level2=25):
|
370 |
-
noise_level = random.randint(noise_level1, noise_level2)
|
371 |
-
rnum = np.random.rand()
|
372 |
-
if rnum > 0.6: # add color Gaussian noise
|
373 |
-
img = img + np.random.normal(0, noise_level / 255.0, img.shape).astype(np.float32)
|
374 |
-
elif rnum < 0.4: # add grayscale Gaussian noise
|
375 |
-
img = img + np.random.normal(0, noise_level / 255.0, (*img.shape[:2], 1)).astype(np.float32)
|
376 |
-
else: # add noise
|
377 |
-
L = noise_level2 / 255.
|
378 |
-
D = np.diag(np.random.rand(3))
|
379 |
-
U = orth(np.random.rand(3, 3))
|
380 |
-
conv = np.dot(np.dot(np.transpose(U), D), U)
|
381 |
-
img = img + np.random.multivariate_normal([0, 0, 0], np.abs(L ** 2 * conv), img.shape[:2]).astype(np.float32)
|
382 |
-
img = np.clip(img, 0.0, 1.0)
|
383 |
-
return img
|
384 |
-
|
385 |
-
|
386 |
-
def add_speckle_noise(img, noise_level1=2, noise_level2=25):
|
387 |
-
noise_level = random.randint(noise_level1, noise_level2)
|
388 |
-
img = np.clip(img, 0.0, 1.0)
|
389 |
-
rnum = random.random()
|
390 |
-
if rnum > 0.6:
|
391 |
-
img += img * np.random.normal(0, noise_level / 255.0, img.shape).astype(np.float32)
|
392 |
-
elif rnum < 0.4:
|
393 |
-
img += img * np.random.normal(0, noise_level / 255.0, (*img.shape[:2], 1)).astype(np.float32)
|
394 |
-
else:
|
395 |
-
L = noise_level2 / 255.
|
396 |
-
D = np.diag(np.random.rand(3))
|
397 |
-
U = orth(np.random.rand(3, 3))
|
398 |
-
conv = np.dot(np.dot(np.transpose(U), D), U)
|
399 |
-
img += img * np.random.multivariate_normal([0, 0, 0], np.abs(L ** 2 * conv), img.shape[:2]).astype(np.float32)
|
400 |
-
img = np.clip(img, 0.0, 1.0)
|
401 |
-
return img
|
402 |
-
|
403 |
-
|
404 |
-
def add_Poisson_noise(img):
|
405 |
-
img = np.clip((img * 255.0).round(), 0, 255) / 255.
|
406 |
-
vals = 10 ** (2 * random.random() + 2.0) # [2, 4]
|
407 |
-
if random.random() < 0.5:
|
408 |
-
img = np.random.poisson(img * vals).astype(np.float32) / vals
|
409 |
-
else:
|
410 |
-
img_gray = np.dot(img[..., :3], [0.299, 0.587, 0.114])
|
411 |
-
img_gray = np.clip((img_gray * 255.0).round(), 0, 255) / 255.
|
412 |
-
noise_gray = np.random.poisson(img_gray * vals).astype(np.float32) / vals - img_gray
|
413 |
-
img += noise_gray[:, :, np.newaxis]
|
414 |
-
img = np.clip(img, 0.0, 1.0)
|
415 |
-
return img
|
416 |
-
|
417 |
-
|
418 |
-
def add_JPEG_noise(img):
|
419 |
-
quality_factor = random.randint(30, 95)
|
420 |
-
img = cv2.cvtColor(util.single2uint(img), cv2.COLOR_RGB2BGR)
|
421 |
-
result, encimg = cv2.imencode('.jpg', img, [int(cv2.IMWRITE_JPEG_QUALITY), quality_factor])
|
422 |
-
img = cv2.imdecode(encimg, 1)
|
423 |
-
img = cv2.cvtColor(util.uint2single(img), cv2.COLOR_BGR2RGB)
|
424 |
-
return img
|
425 |
-
|
426 |
-
|
427 |
-
def random_crop(lq, hq, sf=4, lq_patchsize=64):
|
428 |
-
h, w = lq.shape[:2]
|
429 |
-
rnd_h = random.randint(0, h - lq_patchsize)
|
430 |
-
rnd_w = random.randint(0, w - lq_patchsize)
|
431 |
-
lq = lq[rnd_h:rnd_h + lq_patchsize, rnd_w:rnd_w + lq_patchsize, :]
|
432 |
-
|
433 |
-
rnd_h_H, rnd_w_H = int(rnd_h * sf), int(rnd_w * sf)
|
434 |
-
hq = hq[rnd_h_H:rnd_h_H + lq_patchsize * sf, rnd_w_H:rnd_w_H + lq_patchsize * sf, :]
|
435 |
-
return lq, hq
|
436 |
-
|
437 |
-
|
438 |
-
def degradation_bsrgan(img, sf=4, lq_patchsize=72, isp_model=None):
|
439 |
-
"""
|
440 |
-
This is the degradation model of BSRGAN from the paper
|
441 |
-
"Designing a Practical Degradation Model for Deep Blind Image Super-Resolution"
|
442 |
-
----------
|
443 |
-
img: HXWXC, [0, 1], its size should be large than (lq_patchsizexsf)x(lq_patchsizexsf)
|
444 |
-
sf: scale factor
|
445 |
-
isp_model: camera ISP model
|
446 |
-
Returns
|
447 |
-
-------
|
448 |
-
img: low-quality patch, size: lq_patchsizeXlq_patchsizeXC, range: [0, 1]
|
449 |
-
hq: corresponding high-quality patch, size: (lq_patchsizexsf)X(lq_patchsizexsf)XC, range: [0, 1]
|
450 |
-
"""
|
451 |
-
isp_prob, jpeg_prob, scale2_prob = 0.25, 0.9, 0.25
|
452 |
-
sf_ori = sf
|
453 |
-
|
454 |
-
h1, w1 = img.shape[:2]
|
455 |
-
img = img.copy()[:w1 - w1 % sf, :h1 - h1 % sf, ...] # mod crop
|
456 |
-
h, w = img.shape[:2]
|
457 |
-
|
458 |
-
if h < lq_patchsize * sf or w < lq_patchsize * sf:
|
459 |
-
raise ValueError(f'img size ({h1}X{w1}) is too small!')
|
460 |
-
|
461 |
-
hq = img.copy()
|
462 |
-
|
463 |
-
if sf == 4 and random.random() < scale2_prob: # downsample1
|
464 |
-
if np.random.rand() < 0.5:
|
465 |
-
img = cv2.resize(img, (int(1 / 2 * img.shape[1]), int(1 / 2 * img.shape[0])),
|
466 |
-
interpolation=random.choice([1, 2, 3]))
|
467 |
-
else:
|
468 |
-
img = util.imresize_np(img, 1 / 2, True)
|
469 |
-
img = np.clip(img, 0.0, 1.0)
|
470 |
-
sf = 2
|
471 |
-
|
472 |
-
shuffle_order = random.sample(range(7), 7)
|
473 |
-
idx1, idx2 = shuffle_order.index(2), shuffle_order.index(3)
|
474 |
-
if idx1 > idx2: # keep downsample3 last
|
475 |
-
shuffle_order[idx1], shuffle_order[idx2] = shuffle_order[idx2], shuffle_order[idx1]
|
476 |
-
|
477 |
-
for i in shuffle_order:
|
478 |
-
|
479 |
-
if i == 0:
|
480 |
-
img = add_blur(img, sf=sf)
|
481 |
-
|
482 |
-
elif i == 1:
|
483 |
-
img = add_blur(img, sf=sf)
|
484 |
-
|
485 |
-
elif i == 2:
|
486 |
-
a, b = img.shape[1], img.shape[0]
|
487 |
-
# downsample2
|
488 |
-
if random.random() < 0.75:
|
489 |
-
sf1 = random.uniform(1, 2 * sf)
|
490 |
-
img = cv2.resize(img, (int(1 / sf1 * img.shape[1]), int(1 / sf1 * img.shape[0])),
|
491 |
-
interpolation=random.choice([1, 2, 3]))
|
492 |
-
else:
|
493 |
-
k = fspecial('gaussian', 25, random.uniform(0.1, 0.6 * sf))
|
494 |
-
k_shifted = shift_pixel(k, sf)
|
495 |
-
k_shifted = k_shifted / k_shifted.sum() # blur with shifted kernel
|
496 |
-
img = ndimage.filters.convolve(img, np.expand_dims(k_shifted, axis=2), mode='mirror')
|
497 |
-
img = img[0::sf, 0::sf, ...] # nearest downsampling
|
498 |
-
img = np.clip(img, 0.0, 1.0)
|
499 |
-
|
500 |
-
elif i == 3:
|
501 |
-
# downsample3
|
502 |
-
img = cv2.resize(img, (int(1 / sf * a), int(1 / sf * b)), interpolation=random.choice([1, 2, 3]))
|
503 |
-
img = np.clip(img, 0.0, 1.0)
|
504 |
-
|
505 |
-
elif i == 4:
|
506 |
-
# add Gaussian noise
|
507 |
-
img = add_Gaussian_noise(img, noise_level1=2, noise_level2=25)
|
508 |
-
|
509 |
-
elif i == 5:
|
510 |
-
# add JPEG noise
|
511 |
-
if random.random() < jpeg_prob:
|
512 |
-
img = add_JPEG_noise(img)
|
513 |
-
|
514 |
-
elif i == 6:
|
515 |
-
# add processed camera sensor noise
|
516 |
-
if random.random() < isp_prob and isp_model is not None:
|
517 |
-
with torch.no_grad():
|
518 |
-
img, hq = isp_model.forward(img.copy(), hq)
|
519 |
-
|
520 |
-
# add final JPEG compression noise
|
521 |
-
img = add_JPEG_noise(img)
|
522 |
-
|
523 |
-
# random crop
|
524 |
-
img, hq = random_crop(img, hq, sf_ori, lq_patchsize)
|
525 |
-
|
526 |
-
return img, hq
|
527 |
-
|
528 |
-
|
529 |
-
# todo no isp_model?
|
530 |
-
def degradation_bsrgan_variant(image, sf=4, isp_model=None):
|
531 |
-
"""
|
532 |
-
This is the degradation model of BSRGAN from the paper
|
533 |
-
"Designing a Practical Degradation Model for Deep Blind Image Super-Resolution"
|
534 |
-
----------
|
535 |
-
sf: scale factor
|
536 |
-
isp_model: camera ISP model
|
537 |
-
Returns
|
538 |
-
-------
|
539 |
-
img: low-quality patch, size: lq_patchsizeXlq_patchsizeXC, range: [0, 1]
|
540 |
-
hq: corresponding high-quality patch, size: (lq_patchsizexsf)X(lq_patchsizexsf)XC, range: [0, 1]
|
541 |
-
"""
|
542 |
-
image = util.uint2single(image)
|
543 |
-
isp_prob, jpeg_prob, scale2_prob = 0.25, 0.9, 0.25
|
544 |
-
sf_ori = sf
|
545 |
-
|
546 |
-
h1, w1 = image.shape[:2]
|
547 |
-
image = image.copy()[:w1 - w1 % sf, :h1 - h1 % sf, ...] # mod crop
|
548 |
-
h, w = image.shape[:2]
|
549 |
-
|
550 |
-
hq = image.copy()
|
551 |
-
|
552 |
-
if sf == 4 and random.random() < scale2_prob: # downsample1
|
553 |
-
if np.random.rand() < 0.5:
|
554 |
-
image = cv2.resize(image, (int(1 / 2 * image.shape[1]), int(1 / 2 * image.shape[0])),
|
555 |
-
interpolation=random.choice([1, 2, 3]))
|
556 |
-
else:
|
557 |
-
image = util.imresize_np(image, 1 / 2, True)
|
558 |
-
image = np.clip(image, 0.0, 1.0)
|
559 |
-
sf = 2
|
560 |
-
|
561 |
-
shuffle_order = random.sample(range(7), 7)
|
562 |
-
idx1, idx2 = shuffle_order.index(2), shuffle_order.index(3)
|
563 |
-
if idx1 > idx2: # keep downsample3 last
|
564 |
-
shuffle_order[idx1], shuffle_order[idx2] = shuffle_order[idx2], shuffle_order[idx1]
|
565 |
-
|
566 |
-
for i in shuffle_order:
|
567 |
-
|
568 |
-
if i == 0:
|
569 |
-
image = add_blur(image, sf=sf)
|
570 |
-
|
571 |
-
elif i == 1:
|
572 |
-
image = add_blur(image, sf=sf)
|
573 |
-
|
574 |
-
elif i == 2:
|
575 |
-
a, b = image.shape[1], image.shape[0]
|
576 |
-
# downsample2
|
577 |
-
if random.random() < 0.75:
|
578 |
-
sf1 = random.uniform(1, 2 * sf)
|
579 |
-
image = cv2.resize(image, (int(1 / sf1 * image.shape[1]), int(1 / sf1 * image.shape[0])),
|
580 |
-
interpolation=random.choice([1, 2, 3]))
|
581 |
-
else:
|
582 |
-
k = fspecial('gaussian', 25, random.uniform(0.1, 0.6 * sf))
|
583 |
-
k_shifted = shift_pixel(k, sf)
|
584 |
-
k_shifted = k_shifted / k_shifted.sum() # blur with shifted kernel
|
585 |
-
image = ndimage.filters.convolve(image, np.expand_dims(k_shifted, axis=2), mode='mirror')
|
586 |
-
image = image[0::sf, 0::sf, ...] # nearest downsampling
|
587 |
-
image = np.clip(image, 0.0, 1.0)
|
588 |
-
|
589 |
-
elif i == 3:
|
590 |
-
# downsample3
|
591 |
-
image = cv2.resize(image, (int(1 / sf * a), int(1 / sf * b)), interpolation=random.choice([1, 2, 3]))
|
592 |
-
image = np.clip(image, 0.0, 1.0)
|
593 |
-
|
594 |
-
elif i == 4:
|
595 |
-
# add Gaussian noise
|
596 |
-
image = add_Gaussian_noise(image, noise_level1=2, noise_level2=25)
|
597 |
-
|
598 |
-
elif i == 5:
|
599 |
-
# add JPEG noise
|
600 |
-
if random.random() < jpeg_prob:
|
601 |
-
image = add_JPEG_noise(image)
|
602 |
-
|
603 |
-
# elif i == 6:
|
604 |
-
# # add processed camera sensor noise
|
605 |
-
# if random.random() < isp_prob and isp_model is not None:
|
606 |
-
# with torch.no_grad():
|
607 |
-
# img, hq = isp_model.forward(img.copy(), hq)
|
608 |
-
|
609 |
-
# add final JPEG compression noise
|
610 |
-
image = add_JPEG_noise(image)
|
611 |
-
image = util.single2uint(image)
|
612 |
-
example = {"image":image}
|
613 |
-
return example
|
614 |
-
|
615 |
-
|
616 |
-
# TODO incase there is a pickle error one needs to replace a += x with a = a + x in add_speckle_noise etc...
|
617 |
-
def degradation_bsrgan_plus(img, sf=4, shuffle_prob=0.5, use_sharp=True, lq_patchsize=64, isp_model=None):
|
618 |
-
"""
|
619 |
-
This is an extended degradation model by combining
|
620 |
-
the degradation models of BSRGAN and Real-ESRGAN
|
621 |
-
----------
|
622 |
-
img: HXWXC, [0, 1], its size should be large than (lq_patchsizexsf)x(lq_patchsizexsf)
|
623 |
-
sf: scale factor
|
624 |
-
use_shuffle: the degradation shuffle
|
625 |
-
use_sharp: sharpening the img
|
626 |
-
Returns
|
627 |
-
-------
|
628 |
-
img: low-quality patch, size: lq_patchsizeXlq_patchsizeXC, range: [0, 1]
|
629 |
-
hq: corresponding high-quality patch, size: (lq_patchsizexsf)X(lq_patchsizexsf)XC, range: [0, 1]
|
630 |
-
"""
|
631 |
-
|
632 |
-
h1, w1 = img.shape[:2]
|
633 |
-
img = img.copy()[:w1 - w1 % sf, :h1 - h1 % sf, ...] # mod crop
|
634 |
-
h, w = img.shape[:2]
|
635 |
-
|
636 |
-
if h < lq_patchsize * sf or w < lq_patchsize * sf:
|
637 |
-
raise ValueError(f'img size ({h1}X{w1}) is too small!')
|
638 |
-
|
639 |
-
if use_sharp:
|
640 |
-
img = add_sharpening(img)
|
641 |
-
hq = img.copy()
|
642 |
-
|
643 |
-
if random.random() < shuffle_prob:
|
644 |
-
shuffle_order = random.sample(range(13), 13)
|
645 |
-
else:
|
646 |
-
shuffle_order = list(range(13))
|
647 |
-
# local shuffle for noise, JPEG is always the last one
|
648 |
-
shuffle_order[2:6] = random.sample(shuffle_order[2:6], len(range(2, 6)))
|
649 |
-
shuffle_order[9:13] = random.sample(shuffle_order[9:13], len(range(9, 13)))
|
650 |
-
|
651 |
-
poisson_prob, speckle_prob, isp_prob = 0.1, 0.1, 0.1
|
652 |
-
|
653 |
-
for i in shuffle_order:
|
654 |
-
if i == 0:
|
655 |
-
img = add_blur(img, sf=sf)
|
656 |
-
elif i == 1:
|
657 |
-
img = add_resize(img, sf=sf)
|
658 |
-
elif i == 2:
|
659 |
-
img = add_Gaussian_noise(img, noise_level1=2, noise_level2=25)
|
660 |
-
elif i == 3:
|
661 |
-
if random.random() < poisson_prob:
|
662 |
-
img = add_Poisson_noise(img)
|
663 |
-
elif i == 4:
|
664 |
-
if random.random() < speckle_prob:
|
665 |
-
img = add_speckle_noise(img)
|
666 |
-
elif i == 5:
|
667 |
-
if random.random() < isp_prob and isp_model is not None:
|
668 |
-
with torch.no_grad():
|
669 |
-
img, hq = isp_model.forward(img.copy(), hq)
|
670 |
-
elif i == 6:
|
671 |
-
img = add_JPEG_noise(img)
|
672 |
-
elif i == 7:
|
673 |
-
img = add_blur(img, sf=sf)
|
674 |
-
elif i == 8:
|
675 |
-
img = add_resize(img, sf=sf)
|
676 |
-
elif i == 9:
|
677 |
-
img = add_Gaussian_noise(img, noise_level1=2, noise_level2=25)
|
678 |
-
elif i == 10:
|
679 |
-
if random.random() < poisson_prob:
|
680 |
-
img = add_Poisson_noise(img)
|
681 |
-
elif i == 11:
|
682 |
-
if random.random() < speckle_prob:
|
683 |
-
img = add_speckle_noise(img)
|
684 |
-
elif i == 12:
|
685 |
-
if random.random() < isp_prob and isp_model is not None:
|
686 |
-
with torch.no_grad():
|
687 |
-
img, hq = isp_model.forward(img.copy(), hq)
|
688 |
-
else:
|
689 |
-
print('check the shuffle!')
|
690 |
-
|
691 |
-
# resize to desired size
|
692 |
-
img = cv2.resize(img, (int(1 / sf * hq.shape[1]), int(1 / sf * hq.shape[0])),
|
693 |
-
interpolation=random.choice([1, 2, 3]))
|
694 |
-
|
695 |
-
# add final JPEG compression noise
|
696 |
-
img = add_JPEG_noise(img)
|
697 |
-
|
698 |
-
# random crop
|
699 |
-
img, hq = random_crop(img, hq, sf, lq_patchsize)
|
700 |
-
|
701 |
-
return img, hq
|
702 |
-
|
703 |
-
|
704 |
-
if __name__ == '__main__':
|
705 |
-
print("hey")
|
706 |
-
img = util.imread_uint('utils/test.png', 3)
|
707 |
-
print(img)
|
708 |
-
img = util.uint2single(img)
|
709 |
-
print(img)
|
710 |
-
img = img[:448, :448]
|
711 |
-
h = img.shape[0] // 4
|
712 |
-
print("resizing to", h)
|
713 |
-
sf = 4
|
714 |
-
deg_fn = partial(degradation_bsrgan_variant, sf=sf)
|
715 |
-
for i in range(20):
|
716 |
-
print(i)
|
717 |
-
img_lq = deg_fn(img)
|
718 |
-
print(img_lq)
|
719 |
-
img_lq_bicubic = albumentations.SmallestMaxSize(max_size=h, interpolation=cv2.INTER_CUBIC)(image=img)["image"]
|
720 |
-
print(img_lq.shape)
|
721 |
-
print("bicubic", img_lq_bicubic.shape)
|
722 |
-
print(img_hq.shape)
|
723 |
-
lq_nearest = cv2.resize(util.single2uint(img_lq), (int(sf * img_lq.shape[1]), int(sf * img_lq.shape[0])),
|
724 |
-
interpolation=0)
|
725 |
-
lq_bicubic_nearest = cv2.resize(util.single2uint(img_lq_bicubic), (int(sf * img_lq.shape[1]), int(sf * img_lq.shape[0])),
|
726 |
-
interpolation=0)
|
727 |
-
img_concat = np.concatenate([lq_bicubic_nearest, lq_nearest, util.single2uint(img_hq)], axis=1)
|
728 |
-
util.imsave(img_concat, str(i) + '.png')
|
729 |
-
|
730 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AnonymousSub/Ayurveda4U/README.md
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Ayurveda4U
|
3 |
-
emoji: 🏆
|
4 |
-
colorFrom: gray
|
5 |
-
colorTo: yellow
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.44.2
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pkg_resources/_vendor/packaging/markers.py
DELETED
@@ -1,304 +0,0 @@
|
|
1 |
-
# This file is dual licensed under the terms of the Apache License, Version
|
2 |
-
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
3 |
-
# for complete details.
|
4 |
-
|
5 |
-
import operator
|
6 |
-
import os
|
7 |
-
import platform
|
8 |
-
import sys
|
9 |
-
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
10 |
-
|
11 |
-
from pkg_resources.extern.pyparsing import ( # noqa: N817
|
12 |
-
Forward,
|
13 |
-
Group,
|
14 |
-
Literal as L,
|
15 |
-
ParseException,
|
16 |
-
ParseResults,
|
17 |
-
QuotedString,
|
18 |
-
ZeroOrMore,
|
19 |
-
stringEnd,
|
20 |
-
stringStart,
|
21 |
-
)
|
22 |
-
|
23 |
-
from .specifiers import InvalidSpecifier, Specifier
|
24 |
-
|
25 |
-
__all__ = [
|
26 |
-
"InvalidMarker",
|
27 |
-
"UndefinedComparison",
|
28 |
-
"UndefinedEnvironmentName",
|
29 |
-
"Marker",
|
30 |
-
"default_environment",
|
31 |
-
]
|
32 |
-
|
33 |
-
Operator = Callable[[str, str], bool]
|
34 |
-
|
35 |
-
|
36 |
-
class InvalidMarker(ValueError):
|
37 |
-
"""
|
38 |
-
An invalid marker was found, users should refer to PEP 508.
|
39 |
-
"""
|
40 |
-
|
41 |
-
|
42 |
-
class UndefinedComparison(ValueError):
|
43 |
-
"""
|
44 |
-
An invalid operation was attempted on a value that doesn't support it.
|
45 |
-
"""
|
46 |
-
|
47 |
-
|
48 |
-
class UndefinedEnvironmentName(ValueError):
|
49 |
-
"""
|
50 |
-
A name was attempted to be used that does not exist inside of the
|
51 |
-
environment.
|
52 |
-
"""
|
53 |
-
|
54 |
-
|
55 |
-
class Node:
|
56 |
-
def __init__(self, value: Any) -> None:
|
57 |
-
self.value = value
|
58 |
-
|
59 |
-
def __str__(self) -> str:
|
60 |
-
return str(self.value)
|
61 |
-
|
62 |
-
def __repr__(self) -> str:
|
63 |
-
return f"<{self.__class__.__name__}('{self}')>"
|
64 |
-
|
65 |
-
def serialize(self) -> str:
|
66 |
-
raise NotImplementedError
|
67 |
-
|
68 |
-
|
69 |
-
class Variable(Node):
|
70 |
-
def serialize(self) -> str:
|
71 |
-
return str(self)
|
72 |
-
|
73 |
-
|
74 |
-
class Value(Node):
|
75 |
-
def serialize(self) -> str:
|
76 |
-
return f'"{self}"'
|
77 |
-
|
78 |
-
|
79 |
-
class Op(Node):
|
80 |
-
def serialize(self) -> str:
|
81 |
-
return str(self)
|
82 |
-
|
83 |
-
|
84 |
-
VARIABLE = (
|
85 |
-
L("implementation_version")
|
86 |
-
| L("platform_python_implementation")
|
87 |
-
| L("implementation_name")
|
88 |
-
| L("python_full_version")
|
89 |
-
| L("platform_release")
|
90 |
-
| L("platform_version")
|
91 |
-
| L("platform_machine")
|
92 |
-
| L("platform_system")
|
93 |
-
| L("python_version")
|
94 |
-
| L("sys_platform")
|
95 |
-
| L("os_name")
|
96 |
-
| L("os.name") # PEP-345
|
97 |
-
| L("sys.platform") # PEP-345
|
98 |
-
| L("platform.version") # PEP-345
|
99 |
-
| L("platform.machine") # PEP-345
|
100 |
-
| L("platform.python_implementation") # PEP-345
|
101 |
-
| L("python_implementation") # undocumented setuptools legacy
|
102 |
-
| L("extra") # PEP-508
|
103 |
-
)
|
104 |
-
ALIASES = {
|
105 |
-
"os.name": "os_name",
|
106 |
-
"sys.platform": "sys_platform",
|
107 |
-
"platform.version": "platform_version",
|
108 |
-
"platform.machine": "platform_machine",
|
109 |
-
"platform.python_implementation": "platform_python_implementation",
|
110 |
-
"python_implementation": "platform_python_implementation",
|
111 |
-
}
|
112 |
-
VARIABLE.setParseAction(lambda s, l, t: Variable(ALIASES.get(t[0], t[0])))
|
113 |
-
|
114 |
-
VERSION_CMP = (
|
115 |
-
L("===") | L("==") | L(">=") | L("<=") | L("!=") | L("~=") | L(">") | L("<")
|
116 |
-
)
|
117 |
-
|
118 |
-
MARKER_OP = VERSION_CMP | L("not in") | L("in")
|
119 |
-
MARKER_OP.setParseAction(lambda s, l, t: Op(t[0]))
|
120 |
-
|
121 |
-
MARKER_VALUE = QuotedString("'") | QuotedString('"')
|
122 |
-
MARKER_VALUE.setParseAction(lambda s, l, t: Value(t[0]))
|
123 |
-
|
124 |
-
BOOLOP = L("and") | L("or")
|
125 |
-
|
126 |
-
MARKER_VAR = VARIABLE | MARKER_VALUE
|
127 |
-
|
128 |
-
MARKER_ITEM = Group(MARKER_VAR + MARKER_OP + MARKER_VAR)
|
129 |
-
MARKER_ITEM.setParseAction(lambda s, l, t: tuple(t[0]))
|
130 |
-
|
131 |
-
LPAREN = L("(").suppress()
|
132 |
-
RPAREN = L(")").suppress()
|
133 |
-
|
134 |
-
MARKER_EXPR = Forward()
|
135 |
-
MARKER_ATOM = MARKER_ITEM | Group(LPAREN + MARKER_EXPR + RPAREN)
|
136 |
-
MARKER_EXPR << MARKER_ATOM + ZeroOrMore(BOOLOP + MARKER_EXPR)
|
137 |
-
|
138 |
-
MARKER = stringStart + MARKER_EXPR + stringEnd
|
139 |
-
|
140 |
-
|
141 |
-
def _coerce_parse_result(results: Union[ParseResults, List[Any]]) -> List[Any]:
|
142 |
-
if isinstance(results, ParseResults):
|
143 |
-
return [_coerce_parse_result(i) for i in results]
|
144 |
-
else:
|
145 |
-
return results
|
146 |
-
|
147 |
-
|
148 |
-
def _format_marker(
|
149 |
-
marker: Union[List[str], Tuple[Node, ...], str], first: Optional[bool] = True
|
150 |
-
) -> str:
|
151 |
-
|
152 |
-
assert isinstance(marker, (list, tuple, str))
|
153 |
-
|
154 |
-
# Sometimes we have a structure like [[...]] which is a single item list
|
155 |
-
# where the single item is itself it's own list. In that case we want skip
|
156 |
-
# the rest of this function so that we don't get extraneous () on the
|
157 |
-
# outside.
|
158 |
-
if (
|
159 |
-
isinstance(marker, list)
|
160 |
-
and len(marker) == 1
|
161 |
-
and isinstance(marker[0], (list, tuple))
|
162 |
-
):
|
163 |
-
return _format_marker(marker[0])
|
164 |
-
|
165 |
-
if isinstance(marker, list):
|
166 |
-
inner = (_format_marker(m, first=False) for m in marker)
|
167 |
-
if first:
|
168 |
-
return " ".join(inner)
|
169 |
-
else:
|
170 |
-
return "(" + " ".join(inner) + ")"
|
171 |
-
elif isinstance(marker, tuple):
|
172 |
-
return " ".join([m.serialize() for m in marker])
|
173 |
-
else:
|
174 |
-
return marker
|
175 |
-
|
176 |
-
|
177 |
-
_operators: Dict[str, Operator] = {
|
178 |
-
"in": lambda lhs, rhs: lhs in rhs,
|
179 |
-
"not in": lambda lhs, rhs: lhs not in rhs,
|
180 |
-
"<": operator.lt,
|
181 |
-
"<=": operator.le,
|
182 |
-
"==": operator.eq,
|
183 |
-
"!=": operator.ne,
|
184 |
-
">=": operator.ge,
|
185 |
-
">": operator.gt,
|
186 |
-
}
|
187 |
-
|
188 |
-
|
189 |
-
def _eval_op(lhs: str, op: Op, rhs: str) -> bool:
|
190 |
-
try:
|
191 |
-
spec = Specifier("".join([op.serialize(), rhs]))
|
192 |
-
except InvalidSpecifier:
|
193 |
-
pass
|
194 |
-
else:
|
195 |
-
return spec.contains(lhs)
|
196 |
-
|
197 |
-
oper: Optional[Operator] = _operators.get(op.serialize())
|
198 |
-
if oper is None:
|
199 |
-
raise UndefinedComparison(f"Undefined {op!r} on {lhs!r} and {rhs!r}.")
|
200 |
-
|
201 |
-
return oper(lhs, rhs)
|
202 |
-
|
203 |
-
|
204 |
-
class Undefined:
|
205 |
-
pass
|
206 |
-
|
207 |
-
|
208 |
-
_undefined = Undefined()
|
209 |
-
|
210 |
-
|
211 |
-
def _get_env(environment: Dict[str, str], name: str) -> str:
|
212 |
-
value: Union[str, Undefined] = environment.get(name, _undefined)
|
213 |
-
|
214 |
-
if isinstance(value, Undefined):
|
215 |
-
raise UndefinedEnvironmentName(
|
216 |
-
f"{name!r} does not exist in evaluation environment."
|
217 |
-
)
|
218 |
-
|
219 |
-
return value
|
220 |
-
|
221 |
-
|
222 |
-
def _evaluate_markers(markers: List[Any], environment: Dict[str, str]) -> bool:
|
223 |
-
groups: List[List[bool]] = [[]]
|
224 |
-
|
225 |
-
for marker in markers:
|
226 |
-
assert isinstance(marker, (list, tuple, str))
|
227 |
-
|
228 |
-
if isinstance(marker, list):
|
229 |
-
groups[-1].append(_evaluate_markers(marker, environment))
|
230 |
-
elif isinstance(marker, tuple):
|
231 |
-
lhs, op, rhs = marker
|
232 |
-
|
233 |
-
if isinstance(lhs, Variable):
|
234 |
-
lhs_value = _get_env(environment, lhs.value)
|
235 |
-
rhs_value = rhs.value
|
236 |
-
else:
|
237 |
-
lhs_value = lhs.value
|
238 |
-
rhs_value = _get_env(environment, rhs.value)
|
239 |
-
|
240 |
-
groups[-1].append(_eval_op(lhs_value, op, rhs_value))
|
241 |
-
else:
|
242 |
-
assert marker in ["and", "or"]
|
243 |
-
if marker == "or":
|
244 |
-
groups.append([])
|
245 |
-
|
246 |
-
return any(all(item) for item in groups)
|
247 |
-
|
248 |
-
|
249 |
-
def format_full_version(info: "sys._version_info") -> str:
|
250 |
-
version = "{0.major}.{0.minor}.{0.micro}".format(info)
|
251 |
-
kind = info.releaselevel
|
252 |
-
if kind != "final":
|
253 |
-
version += kind[0] + str(info.serial)
|
254 |
-
return version
|
255 |
-
|
256 |
-
|
257 |
-
def default_environment() -> Dict[str, str]:
|
258 |
-
iver = format_full_version(sys.implementation.version)
|
259 |
-
implementation_name = sys.implementation.name
|
260 |
-
return {
|
261 |
-
"implementation_name": implementation_name,
|
262 |
-
"implementation_version": iver,
|
263 |
-
"os_name": os.name,
|
264 |
-
"platform_machine": platform.machine(),
|
265 |
-
"platform_release": platform.release(),
|
266 |
-
"platform_system": platform.system(),
|
267 |
-
"platform_version": platform.version(),
|
268 |
-
"python_full_version": platform.python_version(),
|
269 |
-
"platform_python_implementation": platform.python_implementation(),
|
270 |
-
"python_version": ".".join(platform.python_version_tuple()[:2]),
|
271 |
-
"sys_platform": sys.platform,
|
272 |
-
}
|
273 |
-
|
274 |
-
|
275 |
-
class Marker:
|
276 |
-
def __init__(self, marker: str) -> None:
|
277 |
-
try:
|
278 |
-
self._markers = _coerce_parse_result(MARKER.parseString(marker))
|
279 |
-
except ParseException as e:
|
280 |
-
raise InvalidMarker(
|
281 |
-
f"Invalid marker: {marker!r}, parse error at "
|
282 |
-
f"{marker[e.loc : e.loc + 8]!r}"
|
283 |
-
)
|
284 |
-
|
285 |
-
def __str__(self) -> str:
|
286 |
-
return _format_marker(self._markers)
|
287 |
-
|
288 |
-
def __repr__(self) -> str:
|
289 |
-
return f"<Marker('{self}')>"
|
290 |
-
|
291 |
-
def evaluate(self, environment: Optional[Dict[str, str]] = None) -> bool:
|
292 |
-
"""Evaluate a marker.
|
293 |
-
|
294 |
-
Return the boolean from evaluating the given marker against the
|
295 |
-
environment. environment is an optional argument to override all or
|
296 |
-
part of the determined environment.
|
297 |
-
|
298 |
-
The environment is determined from the current Python process.
|
299 |
-
"""
|
300 |
-
current_environment = default_environment()
|
301 |
-
if environment is not None:
|
302 |
-
current_environment.update(environment)
|
303 |
-
|
304 |
-
return _evaluate_markers(self._markers, current_environment)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/setuptools/_distutils/core.py
DELETED
@@ -1,291 +0,0 @@
|
|
1 |
-
"""distutils.core
|
2 |
-
|
3 |
-
The only module that needs to be imported to use the Distutils; provides
|
4 |
-
the 'setup' function (which is to be called from the setup script). Also
|
5 |
-
indirectly provides the Distribution and Command classes, although they are
|
6 |
-
really defined in distutils.dist and distutils.cmd.
|
7 |
-
"""
|
8 |
-
|
9 |
-
import os
|
10 |
-
import sys
|
11 |
-
import tokenize
|
12 |
-
|
13 |
-
from distutils.debug import DEBUG
|
14 |
-
from distutils.errors import (
|
15 |
-
DistutilsSetupError,
|
16 |
-
DistutilsError,
|
17 |
-
CCompilerError,
|
18 |
-
DistutilsArgError,
|
19 |
-
)
|
20 |
-
|
21 |
-
# Mainly import these so setup scripts can "from distutils.core import" them.
|
22 |
-
from distutils.dist import Distribution
|
23 |
-
from distutils.cmd import Command
|
24 |
-
from distutils.config import PyPIRCCommand
|
25 |
-
from distutils.extension import Extension
|
26 |
-
|
27 |
-
|
28 |
-
__all__ = ['Distribution', 'Command', 'PyPIRCCommand', 'Extension', 'setup']
|
29 |
-
|
30 |
-
# This is a barebones help message generated displayed when the user
|
31 |
-
# runs the setup script with no arguments at all. More useful help
|
32 |
-
# is generated with various --help options: global help, list commands,
|
33 |
-
# and per-command help.
|
34 |
-
USAGE = """\
|
35 |
-
usage: %(script)s [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
|
36 |
-
or: %(script)s --help [cmd1 cmd2 ...]
|
37 |
-
or: %(script)s --help-commands
|
38 |
-
or: %(script)s cmd --help
|
39 |
-
"""
|
40 |
-
|
41 |
-
|
42 |
-
def gen_usage(script_name):
|
43 |
-
script = os.path.basename(script_name)
|
44 |
-
return USAGE % locals()
|
45 |
-
|
46 |
-
|
47 |
-
# Some mild magic to control the behaviour of 'setup()' from 'run_setup()'.
|
48 |
-
_setup_stop_after = None
|
49 |
-
_setup_distribution = None
|
50 |
-
|
51 |
-
# Legal keyword arguments for the setup() function
|
52 |
-
setup_keywords = (
|
53 |
-
'distclass',
|
54 |
-
'script_name',
|
55 |
-
'script_args',
|
56 |
-
'options',
|
57 |
-
'name',
|
58 |
-
'version',
|
59 |
-
'author',
|
60 |
-
'author_email',
|
61 |
-
'maintainer',
|
62 |
-
'maintainer_email',
|
63 |
-
'url',
|
64 |
-
'license',
|
65 |
-
'description',
|
66 |
-
'long_description',
|
67 |
-
'keywords',
|
68 |
-
'platforms',
|
69 |
-
'classifiers',
|
70 |
-
'download_url',
|
71 |
-
'requires',
|
72 |
-
'provides',
|
73 |
-
'obsoletes',
|
74 |
-
)
|
75 |
-
|
76 |
-
# Legal keyword arguments for the Extension constructor
|
77 |
-
extension_keywords = (
|
78 |
-
'name',
|
79 |
-
'sources',
|
80 |
-
'include_dirs',
|
81 |
-
'define_macros',
|
82 |
-
'undef_macros',
|
83 |
-
'library_dirs',
|
84 |
-
'libraries',
|
85 |
-
'runtime_library_dirs',
|
86 |
-
'extra_objects',
|
87 |
-
'extra_compile_args',
|
88 |
-
'extra_link_args',
|
89 |
-
'swig_opts',
|
90 |
-
'export_symbols',
|
91 |
-
'depends',
|
92 |
-
'language',
|
93 |
-
)
|
94 |
-
|
95 |
-
|
96 |
-
def setup(**attrs): # noqa: C901
|
97 |
-
"""The gateway to the Distutils: do everything your setup script needs
|
98 |
-
to do, in a highly flexible and user-driven way. Briefly: create a
|
99 |
-
Distribution instance; find and parse config files; parse the command
|
100 |
-
line; run each Distutils command found there, customized by the options
|
101 |
-
supplied to 'setup()' (as keyword arguments), in config files, and on
|
102 |
-
the command line.
|
103 |
-
|
104 |
-
The Distribution instance might be an instance of a class supplied via
|
105 |
-
the 'distclass' keyword argument to 'setup'; if no such class is
|
106 |
-
supplied, then the Distribution class (in dist.py) is instantiated.
|
107 |
-
All other arguments to 'setup' (except for 'cmdclass') are used to set
|
108 |
-
attributes of the Distribution instance.
|
109 |
-
|
110 |
-
The 'cmdclass' argument, if supplied, is a dictionary mapping command
|
111 |
-
names to command classes. Each command encountered on the command line
|
112 |
-
will be turned into a command class, which is in turn instantiated; any
|
113 |
-
class found in 'cmdclass' is used in place of the default, which is
|
114 |
-
(for command 'foo_bar') class 'foo_bar' in module
|
115 |
-
'distutils.command.foo_bar'. The command class must provide a
|
116 |
-
'user_options' attribute which is a list of option specifiers for
|
117 |
-
'distutils.fancy_getopt'. Any command-line options between the current
|
118 |
-
and the next command are used to set attributes of the current command
|
119 |
-
object.
|
120 |
-
|
121 |
-
When the entire command-line has been successfully parsed, calls the
|
122 |
-
'run()' method on each command object in turn. This method will be
|
123 |
-
driven entirely by the Distribution object (which each command object
|
124 |
-
has a reference to, thanks to its constructor), and the
|
125 |
-
command-specific options that became attributes of each command
|
126 |
-
object.
|
127 |
-
"""
|
128 |
-
|
129 |
-
global _setup_stop_after, _setup_distribution
|
130 |
-
|
131 |
-
# Determine the distribution class -- either caller-supplied or
|
132 |
-
# our Distribution (see below).
|
133 |
-
klass = attrs.get('distclass')
|
134 |
-
if klass:
|
135 |
-
del attrs['distclass']
|
136 |
-
else:
|
137 |
-
klass = Distribution
|
138 |
-
|
139 |
-
if 'script_name' not in attrs:
|
140 |
-
attrs['script_name'] = os.path.basename(sys.argv[0])
|
141 |
-
if 'script_args' not in attrs:
|
142 |
-
attrs['script_args'] = sys.argv[1:]
|
143 |
-
|
144 |
-
# Create the Distribution instance, using the remaining arguments
|
145 |
-
# (ie. everything except distclass) to initialize it
|
146 |
-
try:
|
147 |
-
_setup_distribution = dist = klass(attrs)
|
148 |
-
except DistutilsSetupError as msg:
|
149 |
-
if 'name' not in attrs:
|
150 |
-
raise SystemExit("error in setup command: %s" % msg)
|
151 |
-
else:
|
152 |
-
raise SystemExit("error in {} setup command: {}".format(attrs['name'], msg))
|
153 |
-
|
154 |
-
if _setup_stop_after == "init":
|
155 |
-
return dist
|
156 |
-
|
157 |
-
# Find and parse the config file(s): they will override options from
|
158 |
-
# the setup script, but be overridden by the command line.
|
159 |
-
dist.parse_config_files()
|
160 |
-
|
161 |
-
if DEBUG:
|
162 |
-
print("options (after parsing config files):")
|
163 |
-
dist.dump_option_dicts()
|
164 |
-
|
165 |
-
if _setup_stop_after == "config":
|
166 |
-
return dist
|
167 |
-
|
168 |
-
# Parse the command line and override config files; any
|
169 |
-
# command-line errors are the end user's fault, so turn them into
|
170 |
-
# SystemExit to suppress tracebacks.
|
171 |
-
try:
|
172 |
-
ok = dist.parse_command_line()
|
173 |
-
except DistutilsArgError as msg:
|
174 |
-
raise SystemExit(gen_usage(dist.script_name) + "\nerror: %s" % msg)
|
175 |
-
|
176 |
-
if DEBUG:
|
177 |
-
print("options (after parsing command line):")
|
178 |
-
dist.dump_option_dicts()
|
179 |
-
|
180 |
-
if _setup_stop_after == "commandline":
|
181 |
-
return dist
|
182 |
-
|
183 |
-
# And finally, run all the commands found on the command line.
|
184 |
-
if ok:
|
185 |
-
return run_commands(dist)
|
186 |
-
|
187 |
-
return dist
|
188 |
-
|
189 |
-
|
190 |
-
# setup ()
|
191 |
-
|
192 |
-
|
193 |
-
def run_commands(dist):
|
194 |
-
"""Given a Distribution object run all the commands,
|
195 |
-
raising ``SystemExit`` errors in the case of failure.
|
196 |
-
|
197 |
-
This function assumes that either ``sys.argv`` or ``dist.script_args``
|
198 |
-
is already set accordingly.
|
199 |
-
"""
|
200 |
-
try:
|
201 |
-
dist.run_commands()
|
202 |
-
except KeyboardInterrupt:
|
203 |
-
raise SystemExit("interrupted")
|
204 |
-
except OSError as exc:
|
205 |
-
if DEBUG:
|
206 |
-
sys.stderr.write("error: {}\n".format(exc))
|
207 |
-
raise
|
208 |
-
else:
|
209 |
-
raise SystemExit("error: {}".format(exc))
|
210 |
-
|
211 |
-
except (DistutilsError, CCompilerError) as msg:
|
212 |
-
if DEBUG:
|
213 |
-
raise
|
214 |
-
else:
|
215 |
-
raise SystemExit("error: " + str(msg))
|
216 |
-
|
217 |
-
return dist
|
218 |
-
|
219 |
-
|
220 |
-
def run_setup(script_name, script_args=None, stop_after="run"):
|
221 |
-
"""Run a setup script in a somewhat controlled environment, and
|
222 |
-
return the Distribution instance that drives things. This is useful
|
223 |
-
if you need to find out the distribution meta-data (passed as
|
224 |
-
keyword args from 'script' to 'setup()', or the contents of the
|
225 |
-
config files or command-line.
|
226 |
-
|
227 |
-
'script_name' is a file that will be read and run with 'exec()';
|
228 |
-
'sys.argv[0]' will be replaced with 'script' for the duration of the
|
229 |
-
call. 'script_args' is a list of strings; if supplied,
|
230 |
-
'sys.argv[1:]' will be replaced by 'script_args' for the duration of
|
231 |
-
the call.
|
232 |
-
|
233 |
-
'stop_after' tells 'setup()' when to stop processing; possible
|
234 |
-
values:
|
235 |
-
init
|
236 |
-
stop after the Distribution instance has been created and
|
237 |
-
populated with the keyword arguments to 'setup()'
|
238 |
-
config
|
239 |
-
stop after config files have been parsed (and their data
|
240 |
-
stored in the Distribution instance)
|
241 |
-
commandline
|
242 |
-
stop after the command-line ('sys.argv[1:]' or 'script_args')
|
243 |
-
have been parsed (and the data stored in the Distribution)
|
244 |
-
run [default]
|
245 |
-
stop after all commands have been run (the same as if 'setup()'
|
246 |
-
had been called in the usual way
|
247 |
-
|
248 |
-
Returns the Distribution instance, which provides all information
|
249 |
-
used to drive the Distutils.
|
250 |
-
"""
|
251 |
-
if stop_after not in ('init', 'config', 'commandline', 'run'):
|
252 |
-
raise ValueError("invalid value for 'stop_after': {!r}".format(stop_after))
|
253 |
-
|
254 |
-
global _setup_stop_after, _setup_distribution
|
255 |
-
_setup_stop_after = stop_after
|
256 |
-
|
257 |
-
save_argv = sys.argv.copy()
|
258 |
-
g = {'__file__': script_name, '__name__': '__main__'}
|
259 |
-
try:
|
260 |
-
try:
|
261 |
-
sys.argv[0] = script_name
|
262 |
-
if script_args is not None:
|
263 |
-
sys.argv[1:] = script_args
|
264 |
-
# tokenize.open supports automatic encoding detection
|
265 |
-
with tokenize.open(script_name) as f:
|
266 |
-
code = f.read().replace(r'\r\n', r'\n')
|
267 |
-
exec(code, g)
|
268 |
-
finally:
|
269 |
-
sys.argv = save_argv
|
270 |
-
_setup_stop_after = None
|
271 |
-
except SystemExit:
|
272 |
-
# Hmm, should we do something if exiting with a non-zero code
|
273 |
-
# (ie. error)?
|
274 |
-
pass
|
275 |
-
|
276 |
-
if _setup_distribution is None:
|
277 |
-
raise RuntimeError(
|
278 |
-
(
|
279 |
-
"'distutils.core.setup()' was never called -- "
|
280 |
-
"perhaps '%s' is not a Distutils setup script?"
|
281 |
-
)
|
282 |
-
% script_name
|
283 |
-
)
|
284 |
-
|
285 |
-
# I wonder if the setup script's namespace -- g and l -- would be of
|
286 |
-
# any interest to callers?
|
287 |
-
# print "_setup_distribution:", _setup_distribution
|
288 |
-
return _setup_distribution
|
289 |
-
|
290 |
-
|
291 |
-
# run_setup ()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/solver/__init__.py
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
# Copyright (c) Facebook, Inc. and its affiliates.
|
2 |
-
from .build import build_lr_scheduler, build_optimizer, get_default_optimizer_params
|
3 |
-
from .lr_scheduler import WarmupCosineLR, WarmupMultiStepLR, LRMultiplier, WarmupParamScheduler
|
4 |
-
|
5 |
-
__all__ = [k for k in globals().keys() if not k.startswith("_")]
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Aymene/FakeNewsDetector/README.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: FakeNewsDetector
|
3 |
-
emoji: 🔥
|
4 |
-
colorFrom: pink
|
5 |
-
colorTo: blue
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 2.9.1
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
license: apache-2.0
|
11 |
-
---
|
12 |
-
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_internal/utils/compatibility_tags.py
DELETED
@@ -1,165 +0,0 @@
|
|
1 |
-
"""Generate and work with PEP 425 Compatibility Tags.
|
2 |
-
"""
|
3 |
-
|
4 |
-
import re
|
5 |
-
from typing import List, Optional, Tuple
|
6 |
-
|
7 |
-
from pip._vendor.packaging.tags import (
|
8 |
-
PythonVersion,
|
9 |
-
Tag,
|
10 |
-
compatible_tags,
|
11 |
-
cpython_tags,
|
12 |
-
generic_tags,
|
13 |
-
interpreter_name,
|
14 |
-
interpreter_version,
|
15 |
-
mac_platforms,
|
16 |
-
)
|
17 |
-
|
18 |
-
_osx_arch_pat = re.compile(r"(.+)_(\d+)_(\d+)_(.+)")
|
19 |
-
|
20 |
-
|
21 |
-
def version_info_to_nodot(version_info: Tuple[int, ...]) -> str:
|
22 |
-
# Only use up to the first two numbers.
|
23 |
-
return "".join(map(str, version_info[:2]))
|
24 |
-
|
25 |
-
|
26 |
-
def _mac_platforms(arch: str) -> List[str]:
|
27 |
-
match = _osx_arch_pat.match(arch)
|
28 |
-
if match:
|
29 |
-
name, major, minor, actual_arch = match.groups()
|
30 |
-
mac_version = (int(major), int(minor))
|
31 |
-
arches = [
|
32 |
-
# Since we have always only checked that the platform starts
|
33 |
-
# with "macosx", for backwards-compatibility we extract the
|
34 |
-
# actual prefix provided by the user in case they provided
|
35 |
-
# something like "macosxcustom_". It may be good to remove
|
36 |
-
# this as undocumented or deprecate it in the future.
|
37 |
-
"{}_{}".format(name, arch[len("macosx_") :])
|
38 |
-
for arch in mac_platforms(mac_version, actual_arch)
|
39 |
-
]
|
40 |
-
else:
|
41 |
-
# arch pattern didn't match (?!)
|
42 |
-
arches = [arch]
|
43 |
-
return arches
|
44 |
-
|
45 |
-
|
46 |
-
def _custom_manylinux_platforms(arch: str) -> List[str]:
|
47 |
-
arches = [arch]
|
48 |
-
arch_prefix, arch_sep, arch_suffix = arch.partition("_")
|
49 |
-
if arch_prefix == "manylinux2014":
|
50 |
-
# manylinux1/manylinux2010 wheels run on most manylinux2014 systems
|
51 |
-
# with the exception of wheels depending on ncurses. PEP 599 states
|
52 |
-
# manylinux1/manylinux2010 wheels should be considered
|
53 |
-
# manylinux2014 wheels:
|
54 |
-
# https://www.python.org/dev/peps/pep-0599/#backwards-compatibility-with-manylinux2010-wheels
|
55 |
-
if arch_suffix in {"i686", "x86_64"}:
|
56 |
-
arches.append("manylinux2010" + arch_sep + arch_suffix)
|
57 |
-
arches.append("manylinux1" + arch_sep + arch_suffix)
|
58 |
-
elif arch_prefix == "manylinux2010":
|
59 |
-
# manylinux1 wheels run on most manylinux2010 systems with the
|
60 |
-
# exception of wheels depending on ncurses. PEP 571 states
|
61 |
-
# manylinux1 wheels should be considered manylinux2010 wheels:
|
62 |
-
# https://www.python.org/dev/peps/pep-0571/#backwards-compatibility-with-manylinux1-wheels
|
63 |
-
arches.append("manylinux1" + arch_sep + arch_suffix)
|
64 |
-
return arches
|
65 |
-
|
66 |
-
|
67 |
-
def _get_custom_platforms(arch: str) -> List[str]:
|
68 |
-
arch_prefix, arch_sep, arch_suffix = arch.partition("_")
|
69 |
-
if arch.startswith("macosx"):
|
70 |
-
arches = _mac_platforms(arch)
|
71 |
-
elif arch_prefix in ["manylinux2014", "manylinux2010"]:
|
72 |
-
arches = _custom_manylinux_platforms(arch)
|
73 |
-
else:
|
74 |
-
arches = [arch]
|
75 |
-
return arches
|
76 |
-
|
77 |
-
|
78 |
-
def _expand_allowed_platforms(platforms: Optional[List[str]]) -> Optional[List[str]]:
|
79 |
-
if not platforms:
|
80 |
-
return None
|
81 |
-
|
82 |
-
seen = set()
|
83 |
-
result = []
|
84 |
-
|
85 |
-
for p in platforms:
|
86 |
-
if p in seen:
|
87 |
-
continue
|
88 |
-
additions = [c for c in _get_custom_platforms(p) if c not in seen]
|
89 |
-
seen.update(additions)
|
90 |
-
result.extend(additions)
|
91 |
-
|
92 |
-
return result
|
93 |
-
|
94 |
-
|
95 |
-
def _get_python_version(version: str) -> PythonVersion:
|
96 |
-
if len(version) > 1:
|
97 |
-
return int(version[0]), int(version[1:])
|
98 |
-
else:
|
99 |
-
return (int(version[0]),)
|
100 |
-
|
101 |
-
|
102 |
-
def _get_custom_interpreter(
|
103 |
-
implementation: Optional[str] = None, version: Optional[str] = None
|
104 |
-
) -> str:
|
105 |
-
if implementation is None:
|
106 |
-
implementation = interpreter_name()
|
107 |
-
if version is None:
|
108 |
-
version = interpreter_version()
|
109 |
-
return f"{implementation}{version}"
|
110 |
-
|
111 |
-
|
112 |
-
def get_supported(
|
113 |
-
version: Optional[str] = None,
|
114 |
-
platforms: Optional[List[str]] = None,
|
115 |
-
impl: Optional[str] = None,
|
116 |
-
abis: Optional[List[str]] = None,
|
117 |
-
) -> List[Tag]:
|
118 |
-
"""Return a list of supported tags for each version specified in
|
119 |
-
`versions`.
|
120 |
-
|
121 |
-
:param version: a string version, of the form "33" or "32",
|
122 |
-
or None. The version will be assumed to support our ABI.
|
123 |
-
:param platform: specify a list of platforms you want valid
|
124 |
-
tags for, or None. If None, use the local system platform.
|
125 |
-
:param impl: specify the exact implementation you want valid
|
126 |
-
tags for, or None. If None, use the local interpreter impl.
|
127 |
-
:param abis: specify a list of abis you want valid
|
128 |
-
tags for, or None. If None, use the local interpreter abi.
|
129 |
-
"""
|
130 |
-
supported: List[Tag] = []
|
131 |
-
|
132 |
-
python_version: Optional[PythonVersion] = None
|
133 |
-
if version is not None:
|
134 |
-
python_version = _get_python_version(version)
|
135 |
-
|
136 |
-
interpreter = _get_custom_interpreter(impl, version)
|
137 |
-
|
138 |
-
platforms = _expand_allowed_platforms(platforms)
|
139 |
-
|
140 |
-
is_cpython = (impl or interpreter_name()) == "cp"
|
141 |
-
if is_cpython:
|
142 |
-
supported.extend(
|
143 |
-
cpython_tags(
|
144 |
-
python_version=python_version,
|
145 |
-
abis=abis,
|
146 |
-
platforms=platforms,
|
147 |
-
)
|
148 |
-
)
|
149 |
-
else:
|
150 |
-
supported.extend(
|
151 |
-
generic_tags(
|
152 |
-
interpreter=interpreter,
|
153 |
-
abis=abis,
|
154 |
-
platforms=platforms,
|
155 |
-
)
|
156 |
-
)
|
157 |
-
supported.extend(
|
158 |
-
compatible_tags(
|
159 |
-
python_version=python_version,
|
160 |
-
interpreter=interpreter,
|
161 |
-
platforms=platforms,
|
162 |
-
)
|
163 |
-
)
|
164 |
-
|
165 |
-
return supported
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/pygments/lexers/python.py
DELETED
@@ -1,1204 +0,0 @@
|
|
1 |
-
"""
|
2 |
-
pygments.lexers.python
|
3 |
-
~~~~~~~~~~~~~~~~~~~~~~
|
4 |
-
|
5 |
-
Lexers for Python and related languages.
|
6 |
-
|
7 |
-
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
|
8 |
-
:license: BSD, see LICENSE for details.
|
9 |
-
"""
|
10 |
-
|
11 |
-
import re
|
12 |
-
import keyword
|
13 |
-
|
14 |
-
from pip._vendor.pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \
|
15 |
-
default, words, combined, do_insertions, this, line_re
|
16 |
-
from pip._vendor.pygments.util import get_bool_opt, shebang_matches
|
17 |
-
from pip._vendor.pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
18 |
-
Number, Punctuation, Generic, Other, Error, Whitespace
|
19 |
-
from pip._vendor.pygments import unistring as uni
|
20 |
-
|
21 |
-
__all__ = ['PythonLexer', 'PythonConsoleLexer', 'PythonTracebackLexer',
|
22 |
-
'Python2Lexer', 'Python2TracebackLexer',
|
23 |
-
'CythonLexer', 'DgLexer', 'NumPyLexer']
|
24 |
-
|
25 |
-
|
26 |
-
class PythonLexer(RegexLexer):
|
27 |
-
"""
|
28 |
-
For Python source code (version 3.x).
|
29 |
-
|
30 |
-
.. versionadded:: 0.10
|
31 |
-
|
32 |
-
.. versionchanged:: 2.5
|
33 |
-
This is now the default ``PythonLexer``. It is still available as the
|
34 |
-
alias ``Python3Lexer``.
|
35 |
-
"""
|
36 |
-
|
37 |
-
name = 'Python'
|
38 |
-
url = 'http://www.python.org'
|
39 |
-
aliases = ['python', 'py', 'sage', 'python3', 'py3']
|
40 |
-
filenames = [
|
41 |
-
'*.py',
|
42 |
-
'*.pyw',
|
43 |
-
# Type stubs
|
44 |
-
'*.pyi',
|
45 |
-
# Jython
|
46 |
-
'*.jy',
|
47 |
-
# Sage
|
48 |
-
'*.sage',
|
49 |
-
# SCons
|
50 |
-
'*.sc',
|
51 |
-
'SConstruct',
|
52 |
-
'SConscript',
|
53 |
-
# Skylark/Starlark (used by Bazel, Buck, and Pants)
|
54 |
-
'*.bzl',
|
55 |
-
'BUCK',
|
56 |
-
'BUILD',
|
57 |
-
'BUILD.bazel',
|
58 |
-
'WORKSPACE',
|
59 |
-
# Twisted Application infrastructure
|
60 |
-
'*.tac',
|
61 |
-
]
|
62 |
-
mimetypes = ['text/x-python', 'application/x-python',
|
63 |
-
'text/x-python3', 'application/x-python3']
|
64 |
-
|
65 |
-
uni_name = "[%s][%s]*" % (uni.xid_start, uni.xid_continue)
|
66 |
-
|
67 |
-
def innerstring_rules(ttype):
|
68 |
-
return [
|
69 |
-
# the old style '%s' % (...) string formatting (still valid in Py3)
|
70 |
-
(r'%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
|
71 |
-
'[hlL]?[E-GXc-giorsaux%]', String.Interpol),
|
72 |
-
# the new style '{}'.format(...) string formatting
|
73 |
-
(r'\{'
|
74 |
-
r'((\w+)((\.\w+)|(\[[^\]]+\]))*)?' # field name
|
75 |
-
r'(\![sra])?' # conversion
|
76 |
-
r'(\:(.?[<>=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?'
|
77 |
-
r'\}', String.Interpol),
|
78 |
-
|
79 |
-
# backslashes, quotes and formatting signs must be parsed one at a time
|
80 |
-
(r'[^\\\'"%{\n]+', ttype),
|
81 |
-
(r'[\'"\\]', ttype),
|
82 |
-
# unhandled string formatting sign
|
83 |
-
(r'%|(\{{1,2})', ttype)
|
84 |
-
# newlines are an error (use "nl" state)
|
85 |
-
]
|
86 |
-
|
87 |
-
def fstring_rules(ttype):
|
88 |
-
return [
|
89 |
-
# Assuming that a '}' is the closing brace after format specifier.
|
90 |
-
# Sadly, this means that we won't detect syntax error. But it's
|
91 |
-
# more important to parse correct syntax correctly, than to
|
92 |
-
# highlight invalid syntax.
|
93 |
-
(r'\}', String.Interpol),
|
94 |
-
(r'\{', String.Interpol, 'expr-inside-fstring'),
|
95 |
-
# backslashes, quotes and formatting signs must be parsed one at a time
|
96 |
-
(r'[^\\\'"{}\n]+', ttype),
|
97 |
-
(r'[\'"\\]', ttype),
|
98 |
-
# newlines are an error (use "nl" state)
|
99 |
-
]
|
100 |
-
|
101 |
-
tokens = {
|
102 |
-
'root': [
|
103 |
-
(r'\n', Whitespace),
|
104 |
-
(r'^(\s*)([rRuUbB]{,2})("""(?:.|\n)*?""")',
|
105 |
-
bygroups(Whitespace, String.Affix, String.Doc)),
|
106 |
-
(r"^(\s*)([rRuUbB]{,2})('''(?:.|\n)*?''')",
|
107 |
-
bygroups(Whitespace, String.Affix, String.Doc)),
|
108 |
-
(r'\A#!.+$', Comment.Hashbang),
|
109 |
-
(r'#.*$', Comment.Single),
|
110 |
-
(r'\\\n', Text),
|
111 |
-
(r'\\', Text),
|
112 |
-
include('keywords'),
|
113 |
-
include('soft-keywords'),
|
114 |
-
(r'(def)((?:\s|\\\s)+)', bygroups(Keyword, Text), 'funcname'),
|
115 |
-
(r'(class)((?:\s|\\\s)+)', bygroups(Keyword, Text), 'classname'),
|
116 |
-
(r'(from)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Text),
|
117 |
-
'fromimport'),
|
118 |
-
(r'(import)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Text),
|
119 |
-
'import'),
|
120 |
-
include('expr'),
|
121 |
-
],
|
122 |
-
'expr': [
|
123 |
-
# raw f-strings
|
124 |
-
('(?i)(rf|fr)(""")',
|
125 |
-
bygroups(String.Affix, String.Double),
|
126 |
-
combined('rfstringescape', 'tdqf')),
|
127 |
-
("(?i)(rf|fr)(''')",
|
128 |
-
bygroups(String.Affix, String.Single),
|
129 |
-
combined('rfstringescape', 'tsqf')),
|
130 |
-
('(?i)(rf|fr)(")',
|
131 |
-
bygroups(String.Affix, String.Double),
|
132 |
-
combined('rfstringescape', 'dqf')),
|
133 |
-
("(?i)(rf|fr)(')",
|
134 |
-
bygroups(String.Affix, String.Single),
|
135 |
-
combined('rfstringescape', 'sqf')),
|
136 |
-
# non-raw f-strings
|
137 |
-
('([fF])(""")', bygroups(String.Affix, String.Double),
|
138 |
-
combined('fstringescape', 'tdqf')),
|
139 |
-
("([fF])(''')", bygroups(String.Affix, String.Single),
|
140 |
-
combined('fstringescape', 'tsqf')),
|
141 |
-
('([fF])(")', bygroups(String.Affix, String.Double),
|
142 |
-
combined('fstringescape', 'dqf')),
|
143 |
-
("([fF])(')", bygroups(String.Affix, String.Single),
|
144 |
-
combined('fstringescape', 'sqf')),
|
145 |
-
# raw bytes and strings
|
146 |
-
('(?i)(rb|br|r)(""")',
|
147 |
-
bygroups(String.Affix, String.Double), 'tdqs'),
|
148 |
-
("(?i)(rb|br|r)(''')",
|
149 |
-
bygroups(String.Affix, String.Single), 'tsqs'),
|
150 |
-
('(?i)(rb|br|r)(")',
|
151 |
-
bygroups(String.Affix, String.Double), 'dqs'),
|
152 |
-
("(?i)(rb|br|r)(')",
|
153 |
-
bygroups(String.Affix, String.Single), 'sqs'),
|
154 |
-
# non-raw strings
|
155 |
-
('([uU]?)(""")', bygroups(String.Affix, String.Double),
|
156 |
-
combined('stringescape', 'tdqs')),
|
157 |
-
("([uU]?)(''')", bygroups(String.Affix, String.Single),
|
158 |
-
combined('stringescape', 'tsqs')),
|
159 |
-
('([uU]?)(")', bygroups(String.Affix, String.Double),
|
160 |
-
combined('stringescape', 'dqs')),
|
161 |
-
("([uU]?)(')", bygroups(String.Affix, String.Single),
|
162 |
-
combined('stringescape', 'sqs')),
|
163 |
-
# non-raw bytes
|
164 |
-
('([bB])(""")', bygroups(String.Affix, String.Double),
|
165 |
-
combined('bytesescape', 'tdqs')),
|
166 |
-
("([bB])(''')", bygroups(String.Affix, String.Single),
|
167 |
-
combined('bytesescape', 'tsqs')),
|
168 |
-
('([bB])(")', bygroups(String.Affix, String.Double),
|
169 |
-
combined('bytesescape', 'dqs')),
|
170 |
-
("([bB])(')", bygroups(String.Affix, String.Single),
|
171 |
-
combined('bytesescape', 'sqs')),
|
172 |
-
|
173 |
-
(r'[^\S\n]+', Text),
|
174 |
-
include('numbers'),
|
175 |
-
(r'!=|==|<<|>>|:=|[-~+/*%=<>&^|.]', Operator),
|
176 |
-
(r'[]{}:(),;[]', Punctuation),
|
177 |
-
(r'(in|is|and|or|not)\b', Operator.Word),
|
178 |
-
include('expr-keywords'),
|
179 |
-
include('builtins'),
|
180 |
-
include('magicfuncs'),
|
181 |
-
include('magicvars'),
|
182 |
-
include('name'),
|
183 |
-
],
|
184 |
-
'expr-inside-fstring': [
|
185 |
-
(r'[{([]', Punctuation, 'expr-inside-fstring-inner'),
|
186 |
-
# without format specifier
|
187 |
-
(r'(=\s*)?' # debug (https://bugs.python.org/issue36817)
|
188 |
-
r'(\![sraf])?' # conversion
|
189 |
-
r'\}', String.Interpol, '#pop'),
|
190 |
-
# with format specifier
|
191 |
-
# we'll catch the remaining '}' in the outer scope
|
192 |
-
(r'(=\s*)?' # debug (https://bugs.python.org/issue36817)
|
193 |
-
r'(\![sraf])?' # conversion
|
194 |
-
r':', String.Interpol, '#pop'),
|
195 |
-
(r'\s+', Whitespace), # allow new lines
|
196 |
-
include('expr'),
|
197 |
-
],
|
198 |
-
'expr-inside-fstring-inner': [
|
199 |
-
(r'[{([]', Punctuation, 'expr-inside-fstring-inner'),
|
200 |
-
(r'[])}]', Punctuation, '#pop'),
|
201 |
-
(r'\s+', Whitespace), # allow new lines
|
202 |
-
include('expr'),
|
203 |
-
],
|
204 |
-
'expr-keywords': [
|
205 |
-
# Based on https://docs.python.org/3/reference/expressions.html
|
206 |
-
(words((
|
207 |
-
'async for', 'await', 'else', 'for', 'if', 'lambda',
|
208 |
-
'yield', 'yield from'), suffix=r'\b'),
|
209 |
-
Keyword),
|
210 |
-
(words(('True', 'False', 'None'), suffix=r'\b'), Keyword.Constant),
|
211 |
-
],
|
212 |
-
'keywords': [
|
213 |
-
(words((
|
214 |
-
'assert', 'async', 'await', 'break', 'continue', 'del', 'elif',
|
215 |
-
'else', 'except', 'finally', 'for', 'global', 'if', 'lambda',
|
216 |
-
'pass', 'raise', 'nonlocal', 'return', 'try', 'while', 'yield',
|
217 |
-
'yield from', 'as', 'with'), suffix=r'\b'),
|
218 |
-
Keyword),
|
219 |
-
(words(('True', 'False', 'None'), suffix=r'\b'), Keyword.Constant),
|
220 |
-
],
|
221 |
-
'soft-keywords': [
|
222 |
-
# `match`, `case` and `_` soft keywords
|
223 |
-
(r'(^[ \t]*)' # at beginning of line + possible indentation
|
224 |
-
r'(match|case)\b' # a possible keyword
|
225 |
-
r'(?![ \t]*(?:' # not followed by...
|
226 |
-
r'[:,;=^&|@~)\]}]|(?:' + # characters and keywords that mean this isn't
|
227 |
-
r'|'.join(keyword.kwlist) + r')\b))', # pattern matching
|
228 |
-
bygroups(Text, Keyword), 'soft-keywords-inner'),
|
229 |
-
],
|
230 |
-
'soft-keywords-inner': [
|
231 |
-
# optional `_` keyword
|
232 |
-
(r'(\s+)([^\n_]*)(_\b)', bygroups(Whitespace, using(this), Keyword)),
|
233 |
-
default('#pop')
|
234 |
-
],
|
235 |
-
'builtins': [
|
236 |
-
(words((
|
237 |
-
'__import__', 'abs', 'all', 'any', 'bin', 'bool', 'bytearray',
|
238 |
-
'breakpoint', 'bytes', 'chr', 'classmethod', 'compile', 'complex',
|
239 |
-
'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'filter',
|
240 |
-
'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr',
|
241 |
-
'hash', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass',
|
242 |
-
'iter', 'len', 'list', 'locals', 'map', 'max', 'memoryview',
|
243 |
-
'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print',
|
244 |
-
'property', 'range', 'repr', 'reversed', 'round', 'set', 'setattr',
|
245 |
-
'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple',
|
246 |
-
'type', 'vars', 'zip'), prefix=r'(?<!\.)', suffix=r'\b'),
|
247 |
-
Name.Builtin),
|
248 |
-
(r'(?<!\.)(self|Ellipsis|NotImplemented|cls)\b', Name.Builtin.Pseudo),
|
249 |
-
(words((
|
250 |
-
'ArithmeticError', 'AssertionError', 'AttributeError',
|
251 |
-
'BaseException', 'BufferError', 'BytesWarning', 'DeprecationWarning',
|
252 |
-
'EOFError', 'EnvironmentError', 'Exception', 'FloatingPointError',
|
253 |
-
'FutureWarning', 'GeneratorExit', 'IOError', 'ImportError',
|
254 |
-
'ImportWarning', 'IndentationError', 'IndexError', 'KeyError',
|
255 |
-
'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError',
|
256 |
-
'NotImplementedError', 'OSError', 'OverflowError',
|
257 |
-
'PendingDeprecationWarning', 'ReferenceError', 'ResourceWarning',
|
258 |
-
'RuntimeError', 'RuntimeWarning', 'StopIteration',
|
259 |
-
'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit',
|
260 |
-
'TabError', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError',
|
261 |
-
'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError',
|
262 |
-
'UnicodeWarning', 'UserWarning', 'ValueError', 'VMSError',
|
263 |
-
'Warning', 'WindowsError', 'ZeroDivisionError',
|
264 |
-
# new builtin exceptions from PEP 3151
|
265 |
-
'BlockingIOError', 'ChildProcessError', 'ConnectionError',
|
266 |
-
'BrokenPipeError', 'ConnectionAbortedError', 'ConnectionRefusedError',
|
267 |
-
'ConnectionResetError', 'FileExistsError', 'FileNotFoundError',
|
268 |
-
'InterruptedError', 'IsADirectoryError', 'NotADirectoryError',
|
269 |
-
'PermissionError', 'ProcessLookupError', 'TimeoutError',
|
270 |
-
# others new in Python 3
|
271 |
-
'StopAsyncIteration', 'ModuleNotFoundError', 'RecursionError',
|
272 |
-
'EncodingWarning'),
|
273 |
-
prefix=r'(?<!\.)', suffix=r'\b'),
|
274 |
-
Name.Exception),
|
275 |
-
],
|
276 |
-
'magicfuncs': [
|
277 |
-
(words((
|
278 |
-
'__abs__', '__add__', '__aenter__', '__aexit__', '__aiter__',
|
279 |
-
'__and__', '__anext__', '__await__', '__bool__', '__bytes__',
|
280 |
-
'__call__', '__complex__', '__contains__', '__del__', '__delattr__',
|
281 |
-
'__delete__', '__delitem__', '__dir__', '__divmod__', '__enter__',
|
282 |
-
'__eq__', '__exit__', '__float__', '__floordiv__', '__format__',
|
283 |
-
'__ge__', '__get__', '__getattr__', '__getattribute__',
|
284 |
-
'__getitem__', '__gt__', '__hash__', '__iadd__', '__iand__',
|
285 |
-
'__ifloordiv__', '__ilshift__', '__imatmul__', '__imod__',
|
286 |
-
'__imul__', '__index__', '__init__', '__instancecheck__',
|
287 |
-
'__int__', '__invert__', '__ior__', '__ipow__', '__irshift__',
|
288 |
-
'__isub__', '__iter__', '__itruediv__', '__ixor__', '__le__',
|
289 |
-
'__len__', '__length_hint__', '__lshift__', '__lt__', '__matmul__',
|
290 |
-
'__missing__', '__mod__', '__mul__', '__ne__', '__neg__',
|
291 |
-
'__new__', '__next__', '__or__', '__pos__', '__pow__',
|
292 |
-
'__prepare__', '__radd__', '__rand__', '__rdivmod__', '__repr__',
|
293 |
-
'__reversed__', '__rfloordiv__', '__rlshift__', '__rmatmul__',
|
294 |
-
'__rmod__', '__rmul__', '__ror__', '__round__', '__rpow__',
|
295 |
-
'__rrshift__', '__rshift__', '__rsub__', '__rtruediv__',
|
296 |
-
'__rxor__', '__set__', '__setattr__', '__setitem__', '__str__',
|
297 |
-
'__sub__', '__subclasscheck__', '__truediv__',
|
298 |
-
'__xor__'), suffix=r'\b'),
|
299 |
-
Name.Function.Magic),
|
300 |
-
],
|
301 |
-
'magicvars': [
|
302 |
-
(words((
|
303 |
-
'__annotations__', '__bases__', '__class__', '__closure__',
|
304 |
-
'__code__', '__defaults__', '__dict__', '__doc__', '__file__',
|
305 |
-
'__func__', '__globals__', '__kwdefaults__', '__module__',
|
306 |
-
'__mro__', '__name__', '__objclass__', '__qualname__',
|
307 |
-
'__self__', '__slots__', '__weakref__'), suffix=r'\b'),
|
308 |
-
Name.Variable.Magic),
|
309 |
-
],
|
310 |
-
'numbers': [
|
311 |
-
(r'(\d(?:_?\d)*\.(?:\d(?:_?\d)*)?|(?:\d(?:_?\d)*)?\.\d(?:_?\d)*)'
|
312 |
-
r'([eE][+-]?\d(?:_?\d)*)?', Number.Float),
|
313 |
-
(r'\d(?:_?\d)*[eE][+-]?\d(?:_?\d)*j?', Number.Float),
|
314 |
-
(r'0[oO](?:_?[0-7])+', Number.Oct),
|
315 |
-
(r'0[bB](?:_?[01])+', Number.Bin),
|
316 |
-
(r'0[xX](?:_?[a-fA-F0-9])+', Number.Hex),
|
317 |
-
(r'\d(?:_?\d)*', Number.Integer),
|
318 |
-
],
|
319 |
-
'name': [
|
320 |
-
(r'@' + uni_name, Name.Decorator),
|
321 |
-
(r'@', Operator), # new matrix multiplication operator
|
322 |
-
(uni_name, Name),
|
323 |
-
],
|
324 |
-
'funcname': [
|
325 |
-
include('magicfuncs'),
|
326 |
-
(uni_name, Name.Function, '#pop'),
|
327 |
-
default('#pop'),
|
328 |
-
],
|
329 |
-
'classname': [
|
330 |
-
(uni_name, Name.Class, '#pop'),
|
331 |
-
],
|
332 |
-
'import': [
|
333 |
-
(r'(\s+)(as)(\s+)', bygroups(Text, Keyword, Text)),
|
334 |
-
(r'\.', Name.Namespace),
|
335 |
-
(uni_name, Name.Namespace),
|
336 |
-
(r'(\s*)(,)(\s*)', bygroups(Text, Operator, Text)),
|
337 |
-
default('#pop') # all else: go back
|
338 |
-
],
|
339 |
-
'fromimport': [
|
340 |
-
(r'(\s+)(import)\b', bygroups(Text, Keyword.Namespace), '#pop'),
|
341 |
-
(r'\.', Name.Namespace),
|
342 |
-
# if None occurs here, it's "raise x from None", since None can
|
343 |
-
# never be a module name
|
344 |
-
(r'None\b', Name.Builtin.Pseudo, '#pop'),
|
345 |
-
(uni_name, Name.Namespace),
|
346 |
-
default('#pop'),
|
347 |
-
],
|
348 |
-
'rfstringescape': [
|
349 |
-
(r'\{\{', String.Escape),
|
350 |
-
(r'\}\}', String.Escape),
|
351 |
-
],
|
352 |
-
'fstringescape': [
|
353 |
-
include('rfstringescape'),
|
354 |
-
include('stringescape'),
|
355 |
-
],
|
356 |
-
'bytesescape': [
|
357 |
-
(r'\\([\\abfnrtv"\']|\n|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
|
358 |
-
],
|
359 |
-
'stringescape': [
|
360 |
-
(r'\\(N\{.*?\}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8})', String.Escape),
|
361 |
-
include('bytesescape')
|
362 |
-
],
|
363 |
-
'fstrings-single': fstring_rules(String.Single),
|
364 |
-
'fstrings-double': fstring_rules(String.Double),
|
365 |
-
'strings-single': innerstring_rules(String.Single),
|
366 |
-
'strings-double': innerstring_rules(String.Double),
|
367 |
-
'dqf': [
|
368 |
-
(r'"', String.Double, '#pop'),
|
369 |
-
(r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
|
370 |
-
include('fstrings-double')
|
371 |
-
],
|
372 |
-
'sqf': [
|
373 |
-
(r"'", String.Single, '#pop'),
|
374 |
-
(r"\\\\|\\'|\\\n", String.Escape), # included here for raw strings
|
375 |
-
include('fstrings-single')
|
376 |
-
],
|
377 |
-
'dqs': [
|
378 |
-
(r'"', String.Double, '#pop'),
|
379 |
-
(r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
|
380 |
-
include('strings-double')
|
381 |
-
],
|
382 |
-
'sqs': [
|
383 |
-
(r"'", String.Single, '#pop'),
|
384 |
-
(r"\\\\|\\'|\\\n", String.Escape), # included here for raw strings
|
385 |
-
include('strings-single')
|
386 |
-
],
|
387 |
-
'tdqf': [
|
388 |
-
(r'"""', String.Double, '#pop'),
|
389 |
-
include('fstrings-double'),
|
390 |
-
(r'\n', String.Double)
|
391 |
-
],
|
392 |
-
'tsqf': [
|
393 |
-
(r"'''", String.Single, '#pop'),
|
394 |
-
include('fstrings-single'),
|
395 |
-
(r'\n', String.Single)
|
396 |
-
],
|
397 |
-
'tdqs': [
|
398 |
-
(r'"""', String.Double, '#pop'),
|
399 |
-
include('strings-double'),
|
400 |
-
(r'\n', String.Double)
|
401 |
-
],
|
402 |
-
'tsqs': [
|
403 |
-
(r"'''", String.Single, '#pop'),
|
404 |
-
include('strings-single'),
|
405 |
-
(r'\n', String.Single)
|
406 |
-
],
|
407 |
-
}
|
408 |
-
|
409 |
-
def analyse_text(text):
|
410 |
-
return shebang_matches(text, r'pythonw?(3(\.\d)?)?') or \
|
411 |
-
'import ' in text[:1000]
|
412 |
-
|
413 |
-
|
414 |
-
Python3Lexer = PythonLexer
|
415 |
-
|
416 |
-
|
417 |
-
class Python2Lexer(RegexLexer):
|
418 |
-
"""
|
419 |
-
For Python 2.x source code.
|
420 |
-
|
421 |
-
.. versionchanged:: 2.5
|
422 |
-
This class has been renamed from ``PythonLexer``. ``PythonLexer`` now
|
423 |
-
refers to the Python 3 variant. File name patterns like ``*.py`` have
|
424 |
-
been moved to Python 3 as well.
|
425 |
-
"""
|
426 |
-
|
427 |
-
name = 'Python 2.x'
|
428 |
-
url = 'http://www.python.org'
|
429 |
-
aliases = ['python2', 'py2']
|
430 |
-
filenames = [] # now taken over by PythonLexer (3.x)
|
431 |
-
mimetypes = ['text/x-python2', 'application/x-python2']
|
432 |
-
|
433 |
-
def innerstring_rules(ttype):
|
434 |
-
return [
|
435 |
-
# the old style '%s' % (...) string formatting
|
436 |
-
(r'%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
|
437 |
-
'[hlL]?[E-GXc-giorsux%]', String.Interpol),
|
438 |
-
# backslashes, quotes and formatting signs must be parsed one at a time
|
439 |
-
(r'[^\\\'"%\n]+', ttype),
|
440 |
-
(r'[\'"\\]', ttype),
|
441 |
-
# unhandled string formatting sign
|
442 |
-
(r'%', ttype),
|
443 |
-
# newlines are an error (use "nl" state)
|
444 |
-
]
|
445 |
-
|
446 |
-
tokens = {
|
447 |
-
'root': [
|
448 |
-
(r'\n', Whitespace),
|
449 |
-
(r'^(\s*)([rRuUbB]{,2})("""(?:.|\n)*?""")',
|
450 |
-
bygroups(Whitespace, String.Affix, String.Doc)),
|
451 |
-
(r"^(\s*)([rRuUbB]{,2})('''(?:.|\n)*?''')",
|
452 |
-
bygroups(Whitespace, String.Affix, String.Doc)),
|
453 |
-
(r'[^\S\n]+', Text),
|
454 |
-
(r'\A#!.+$', Comment.Hashbang),
|
455 |
-
(r'#.*$', Comment.Single),
|
456 |
-
(r'[]{}:(),;[]', Punctuation),
|
457 |
-
(r'\\\n', Text),
|
458 |
-
(r'\\', Text),
|
459 |
-
(r'(in|is|and|or|not)\b', Operator.Word),
|
460 |
-
(r'!=|==|<<|>>|[-~+/*%=<>&^|.]', Operator),
|
461 |
-
include('keywords'),
|
462 |
-
(r'(def)((?:\s|\\\s)+)', bygroups(Keyword, Text), 'funcname'),
|
463 |
-
(r'(class)((?:\s|\\\s)+)', bygroups(Keyword, Text), 'classname'),
|
464 |
-
(r'(from)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Text),
|
465 |
-
'fromimport'),
|
466 |
-
(r'(import)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Text),
|
467 |
-
'import'),
|
468 |
-
include('builtins'),
|
469 |
-
include('magicfuncs'),
|
470 |
-
include('magicvars'),
|
471 |
-
include('backtick'),
|
472 |
-
('([rR]|[uUbB][rR]|[rR][uUbB])(""")',
|
473 |
-
bygroups(String.Affix, String.Double), 'tdqs'),
|
474 |
-
("([rR]|[uUbB][rR]|[rR][uUbB])(''')",
|
475 |
-
bygroups(String.Affix, String.Single), 'tsqs'),
|
476 |
-
('([rR]|[uUbB][rR]|[rR][uUbB])(")',
|
477 |
-
bygroups(String.Affix, String.Double), 'dqs'),
|
478 |
-
("([rR]|[uUbB][rR]|[rR][uUbB])(')",
|
479 |
-
bygroups(String.Affix, String.Single), 'sqs'),
|
480 |
-
('([uUbB]?)(""")', bygroups(String.Affix, String.Double),
|
481 |
-
combined('stringescape', 'tdqs')),
|
482 |
-
("([uUbB]?)(''')", bygroups(String.Affix, String.Single),
|
483 |
-
combined('stringescape', 'tsqs')),
|
484 |
-
('([uUbB]?)(")', bygroups(String.Affix, String.Double),
|
485 |
-
combined('stringescape', 'dqs')),
|
486 |
-
("([uUbB]?)(')", bygroups(String.Affix, String.Single),
|
487 |
-
combined('stringescape', 'sqs')),
|
488 |
-
include('name'),
|
489 |
-
include('numbers'),
|
490 |
-
],
|
491 |
-
'keywords': [
|
492 |
-
(words((
|
493 |
-
'assert', 'break', 'continue', 'del', 'elif', 'else', 'except',
|
494 |
-
'exec', 'finally', 'for', 'global', 'if', 'lambda', 'pass',
|
495 |
-
'print', 'raise', 'return', 'try', 'while', 'yield',
|
496 |
-
'yield from', 'as', 'with'), suffix=r'\b'),
|
497 |
-
Keyword),
|
498 |
-
],
|
499 |
-
'builtins': [
|
500 |
-
(words((
|
501 |
-
'__import__', 'abs', 'all', 'any', 'apply', 'basestring', 'bin',
|
502 |
-
'bool', 'buffer', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod',
|
503 |
-
'cmp', 'coerce', 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod',
|
504 |
-
'enumerate', 'eval', 'execfile', 'exit', 'file', 'filter', 'float',
|
505 |
-
'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'hex', 'id',
|
506 |
-
'input', 'int', 'intern', 'isinstance', 'issubclass', 'iter', 'len',
|
507 |
-
'list', 'locals', 'long', 'map', 'max', 'min', 'next', 'object',
|
508 |
-
'oct', 'open', 'ord', 'pow', 'property', 'range', 'raw_input', 'reduce',
|
509 |
-
'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice',
|
510 |
-
'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type',
|
511 |
-
'unichr', 'unicode', 'vars', 'xrange', 'zip'),
|
512 |
-
prefix=r'(?<!\.)', suffix=r'\b'),
|
513 |
-
Name.Builtin),
|
514 |
-
(r'(?<!\.)(self|None|Ellipsis|NotImplemented|False|True|cls'
|
515 |
-
r')\b', Name.Builtin.Pseudo),
|
516 |
-
(words((
|
517 |
-
'ArithmeticError', 'AssertionError', 'AttributeError',
|
518 |
-
'BaseException', 'DeprecationWarning', 'EOFError', 'EnvironmentError',
|
519 |
-
'Exception', 'FloatingPointError', 'FutureWarning', 'GeneratorExit',
|
520 |
-
'IOError', 'ImportError', 'ImportWarning', 'IndentationError',
|
521 |
-
'IndexError', 'KeyError', 'KeyboardInterrupt', 'LookupError',
|
522 |
-
'MemoryError', 'NameError',
|
523 |
-
'NotImplementedError', 'OSError', 'OverflowError', 'OverflowWarning',
|
524 |
-
'PendingDeprecationWarning', 'ReferenceError',
|
525 |
-
'RuntimeError', 'RuntimeWarning', 'StandardError', 'StopIteration',
|
526 |
-
'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit',
|
527 |
-
'TabError', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError',
|
528 |
-
'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError',
|
529 |
-
'UnicodeWarning', 'UserWarning', 'ValueError', 'VMSError', 'Warning',
|
530 |
-
'WindowsError', 'ZeroDivisionError'), prefix=r'(?<!\.)', suffix=r'\b'),
|
531 |
-
Name.Exception),
|
532 |
-
],
|
533 |
-
'magicfuncs': [
|
534 |
-
(words((
|
535 |
-
'__abs__', '__add__', '__and__', '__call__', '__cmp__', '__coerce__',
|
536 |
-
'__complex__', '__contains__', '__del__', '__delattr__', '__delete__',
|
537 |
-
'__delitem__', '__delslice__', '__div__', '__divmod__', '__enter__',
|
538 |
-
'__eq__', '__exit__', '__float__', '__floordiv__', '__ge__', '__get__',
|
539 |
-
'__getattr__', '__getattribute__', '__getitem__', '__getslice__', '__gt__',
|
540 |
-
'__hash__', '__hex__', '__iadd__', '__iand__', '__idiv__', '__ifloordiv__',
|
541 |
-
'__ilshift__', '__imod__', '__imul__', '__index__', '__init__',
|
542 |
-
'__instancecheck__', '__int__', '__invert__', '__iop__', '__ior__',
|
543 |
-
'__ipow__', '__irshift__', '__isub__', '__iter__', '__itruediv__',
|
544 |
-
'__ixor__', '__le__', '__len__', '__long__', '__lshift__', '__lt__',
|
545 |
-
'__missing__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__',
|
546 |
-
'__nonzero__', '__oct__', '__op__', '__or__', '__pos__', '__pow__',
|
547 |
-
'__radd__', '__rand__', '__rcmp__', '__rdiv__', '__rdivmod__', '__repr__',
|
548 |
-
'__reversed__', '__rfloordiv__', '__rlshift__', '__rmod__', '__rmul__',
|
549 |
-
'__rop__', '__ror__', '__rpow__', '__rrshift__', '__rshift__', '__rsub__',
|
550 |
-
'__rtruediv__', '__rxor__', '__set__', '__setattr__', '__setitem__',
|
551 |
-
'__setslice__', '__str__', '__sub__', '__subclasscheck__', '__truediv__',
|
552 |
-
'__unicode__', '__xor__'), suffix=r'\b'),
|
553 |
-
Name.Function.Magic),
|
554 |
-
],
|
555 |
-
'magicvars': [
|
556 |
-
(words((
|
557 |
-
'__bases__', '__class__', '__closure__', '__code__', '__defaults__',
|
558 |
-
'__dict__', '__doc__', '__file__', '__func__', '__globals__',
|
559 |
-
'__metaclass__', '__module__', '__mro__', '__name__', '__self__',
|
560 |
-
'__slots__', '__weakref__'),
|
561 |
-
suffix=r'\b'),
|
562 |
-
Name.Variable.Magic),
|
563 |
-
],
|
564 |
-
'numbers': [
|
565 |
-
(r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?', Number.Float),
|
566 |
-
(r'\d+[eE][+-]?[0-9]+j?', Number.Float),
|
567 |
-
(r'0[0-7]+j?', Number.Oct),
|
568 |
-
(r'0[bB][01]+', Number.Bin),
|
569 |
-
(r'0[xX][a-fA-F0-9]+', Number.Hex),
|
570 |
-
(r'\d+L', Number.Integer.Long),
|
571 |
-
(r'\d+j?', Number.Integer)
|
572 |
-
],
|
573 |
-
'backtick': [
|
574 |
-
('`.*?`', String.Backtick),
|
575 |
-
],
|
576 |
-
'name': [
|
577 |
-
(r'@[\w.]+', Name.Decorator),
|
578 |
-
(r'[a-zA-Z_]\w*', Name),
|
579 |
-
],
|
580 |
-
'funcname': [
|
581 |
-
include('magicfuncs'),
|
582 |
-
(r'[a-zA-Z_]\w*', Name.Function, '#pop'),
|
583 |
-
default('#pop'),
|
584 |
-
],
|
585 |
-
'classname': [
|
586 |
-
(r'[a-zA-Z_]\w*', Name.Class, '#pop')
|
587 |
-
],
|
588 |
-
'import': [
|
589 |
-
(r'(?:[ \t]|\\\n)+', Text),
|
590 |
-
(r'as\b', Keyword.Namespace),
|
591 |
-
(r',', Operator),
|
592 |
-
(r'[a-zA-Z_][\w.]*', Name.Namespace),
|
593 |
-
default('#pop') # all else: go back
|
594 |
-
],
|
595 |
-
'fromimport': [
|
596 |
-
(r'(?:[ \t]|\\\n)+', Text),
|
597 |
-
(r'import\b', Keyword.Namespace, '#pop'),
|
598 |
-
# if None occurs here, it's "raise x from None", since None can
|
599 |
-
# never be a module name
|
600 |
-
(r'None\b', Name.Builtin.Pseudo, '#pop'),
|
601 |
-
# sadly, in "raise x from y" y will be highlighted as namespace too
|
602 |
-
(r'[a-zA-Z_.][\w.]*', Name.Namespace),
|
603 |
-
# anything else here also means "raise x from y" and is therefore
|
604 |
-
# not an error
|
605 |
-
default('#pop'),
|
606 |
-
],
|
607 |
-
'stringescape': [
|
608 |
-
(r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|'
|
609 |
-
r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
|
610 |
-
],
|
611 |
-
'strings-single': innerstring_rules(String.Single),
|
612 |
-
'strings-double': innerstring_rules(String.Double),
|
613 |
-
'dqs': [
|
614 |
-
(r'"', String.Double, '#pop'),
|
615 |
-
(r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
|
616 |
-
include('strings-double')
|
617 |
-
],
|
618 |
-
'sqs': [
|
619 |
-
(r"'", String.Single, '#pop'),
|
620 |
-
(r"\\\\|\\'|\\\n", String.Escape), # included here for raw strings
|
621 |
-
include('strings-single')
|
622 |
-
],
|
623 |
-
'tdqs': [
|
624 |
-
(r'"""', String.Double, '#pop'),
|
625 |
-
include('strings-double'),
|
626 |
-
(r'\n', String.Double)
|
627 |
-
],
|
628 |
-
'tsqs': [
|
629 |
-
(r"'''", String.Single, '#pop'),
|
630 |
-
include('strings-single'),
|
631 |
-
(r'\n', String.Single)
|
632 |
-
],
|
633 |
-
}
|
634 |
-
|
635 |
-
def analyse_text(text):
|
636 |
-
return shebang_matches(text, r'pythonw?2(\.\d)?')
|
637 |
-
|
638 |
-
|
639 |
-
class PythonConsoleLexer(Lexer):
|
640 |
-
"""
|
641 |
-
For Python console output or doctests, such as:
|
642 |
-
|
643 |
-
.. sourcecode:: pycon
|
644 |
-
|
645 |
-
>>> a = 'foo'
|
646 |
-
>>> print a
|
647 |
-
foo
|
648 |
-
>>> 1 / 0
|
649 |
-
Traceback (most recent call last):
|
650 |
-
File "<stdin>", line 1, in <module>
|
651 |
-
ZeroDivisionError: integer division or modulo by zero
|
652 |
-
|
653 |
-
Additional options:
|
654 |
-
|
655 |
-
`python3`
|
656 |
-
Use Python 3 lexer for code. Default is ``True``.
|
657 |
-
|
658 |
-
.. versionadded:: 1.0
|
659 |
-
.. versionchanged:: 2.5
|
660 |
-
Now defaults to ``True``.
|
661 |
-
"""
|
662 |
-
name = 'Python console session'
|
663 |
-
aliases = ['pycon']
|
664 |
-
mimetypes = ['text/x-python-doctest']
|
665 |
-
|
666 |
-
def __init__(self, **options):
|
667 |
-
self.python3 = get_bool_opt(options, 'python3', True)
|
668 |
-
Lexer.__init__(self, **options)
|
669 |
-
|
670 |
-
def get_tokens_unprocessed(self, text):
|
671 |
-
if self.python3:
|
672 |
-
pylexer = PythonLexer(**self.options)
|
673 |
-
tblexer = PythonTracebackLexer(**self.options)
|
674 |
-
else:
|
675 |
-
pylexer = Python2Lexer(**self.options)
|
676 |
-
tblexer = Python2TracebackLexer(**self.options)
|
677 |
-
|
678 |
-
curcode = ''
|
679 |
-
insertions = []
|
680 |
-
curtb = ''
|
681 |
-
tbindex = 0
|
682 |
-
tb = 0
|
683 |
-
for match in line_re.finditer(text):
|
684 |
-
line = match.group()
|
685 |
-
if line.startswith('>>> ') or line.startswith('... '):
|
686 |
-
tb = 0
|
687 |
-
insertions.append((len(curcode),
|
688 |
-
[(0, Generic.Prompt, line[:4])]))
|
689 |
-
curcode += line[4:]
|
690 |
-
elif line.rstrip() == '...' and not tb:
|
691 |
-
# only a new >>> prompt can end an exception block
|
692 |
-
# otherwise an ellipsis in place of the traceback frames
|
693 |
-
# will be mishandled
|
694 |
-
insertions.append((len(curcode),
|
695 |
-
[(0, Generic.Prompt, '...')]))
|
696 |
-
curcode += line[3:]
|
697 |
-
else:
|
698 |
-
if curcode:
|
699 |
-
yield from do_insertions(
|
700 |
-
insertions, pylexer.get_tokens_unprocessed(curcode))
|
701 |
-
curcode = ''
|
702 |
-
insertions = []
|
703 |
-
if (line.startswith('Traceback (most recent call last):') or
|
704 |
-
re.match(' File "[^"]+", line \\d+\\n$', line)):
|
705 |
-
tb = 1
|
706 |
-
curtb = line
|
707 |
-
tbindex = match.start()
|
708 |
-
elif line == 'KeyboardInterrupt\n':
|
709 |
-
yield match.start(), Name.Class, line
|
710 |
-
elif tb:
|
711 |
-
curtb += line
|
712 |
-
if not (line.startswith(' ') or line.strip() == '...'):
|
713 |
-
tb = 0
|
714 |
-
for i, t, v in tblexer.get_tokens_unprocessed(curtb):
|
715 |
-
yield tbindex+i, t, v
|
716 |
-
curtb = ''
|
717 |
-
else:
|
718 |
-
yield match.start(), Generic.Output, line
|
719 |
-
if curcode:
|
720 |
-
yield from do_insertions(insertions,
|
721 |
-
pylexer.get_tokens_unprocessed(curcode))
|
722 |
-
if curtb:
|
723 |
-
for i, t, v in tblexer.get_tokens_unprocessed(curtb):
|
724 |
-
yield tbindex+i, t, v
|
725 |
-
|
726 |
-
|
727 |
-
class PythonTracebackLexer(RegexLexer):
|
728 |
-
"""
|
729 |
-
For Python 3.x tracebacks, with support for chained exceptions.
|
730 |
-
|
731 |
-
.. versionadded:: 1.0
|
732 |
-
|
733 |
-
.. versionchanged:: 2.5
|
734 |
-
This is now the default ``PythonTracebackLexer``. It is still available
|
735 |
-
as the alias ``Python3TracebackLexer``.
|
736 |
-
"""
|
737 |
-
|
738 |
-
name = 'Python Traceback'
|
739 |
-
aliases = ['pytb', 'py3tb']
|
740 |
-
filenames = ['*.pytb', '*.py3tb']
|
741 |
-
mimetypes = ['text/x-python-traceback', 'text/x-python3-traceback']
|
742 |
-
|
743 |
-
tokens = {
|
744 |
-
'root': [
|
745 |
-
(r'\n', Whitespace),
|
746 |
-
(r'^Traceback \(most recent call last\):\n', Generic.Traceback, 'intb'),
|
747 |
-
(r'^During handling of the above exception, another '
|
748 |
-
r'exception occurred:\n\n', Generic.Traceback),
|
749 |
-
(r'^The above exception was the direct cause of the '
|
750 |
-
r'following exception:\n\n', Generic.Traceback),
|
751 |
-
(r'^(?= File "[^"]+", line \d+)', Generic.Traceback, 'intb'),
|
752 |
-
(r'^.*\n', Other),
|
753 |
-
],
|
754 |
-
'intb': [
|
755 |
-
(r'^( File )("[^"]+")(, line )(\d+)(, in )(.+)(\n)',
|
756 |
-
bygroups(Text, Name.Builtin, Text, Number, Text, Name, Whitespace)),
|
757 |
-
(r'^( File )("[^"]+")(, line )(\d+)(\n)',
|
758 |
-
bygroups(Text, Name.Builtin, Text, Number, Whitespace)),
|
759 |
-
(r'^( )(.+)(\n)',
|
760 |
-
bygroups(Whitespace, using(PythonLexer), Whitespace), 'markers'),
|
761 |
-
(r'^([ \t]*)(\.\.\.)(\n)',
|
762 |
-
bygroups(Whitespace, Comment, Whitespace)), # for doctests...
|
763 |
-
(r'^([^:]+)(: )(.+)(\n)',
|
764 |
-
bygroups(Generic.Error, Text, Name, Whitespace), '#pop'),
|
765 |
-
(r'^([a-zA-Z_][\w.]*)(:?\n)',
|
766 |
-
bygroups(Generic.Error, Whitespace), '#pop')
|
767 |
-
],
|
768 |
-
'markers': [
|
769 |
-
# Either `PEP 657 <https://www.python.org/dev/peps/pep-0657/>`
|
770 |
-
# error locations in Python 3.11+, or single-caret markers
|
771 |
-
# for syntax errors before that.
|
772 |
-
(r'^( {4,})([~^]+)(\n)',
|
773 |
-
bygroups(Whitespace, Punctuation.Marker, Whitespace),
|
774 |
-
'#pop'),
|
775 |
-
default('#pop'),
|
776 |
-
],
|
777 |
-
}
|
778 |
-
|
779 |
-
|
780 |
-
Python3TracebackLexer = PythonTracebackLexer
|
781 |
-
|
782 |
-
|
783 |
-
class Python2TracebackLexer(RegexLexer):
|
784 |
-
"""
|
785 |
-
For Python tracebacks.
|
786 |
-
|
787 |
-
.. versionadded:: 0.7
|
788 |
-
|
789 |
-
.. versionchanged:: 2.5
|
790 |
-
This class has been renamed from ``PythonTracebackLexer``.
|
791 |
-
``PythonTracebackLexer`` now refers to the Python 3 variant.
|
792 |
-
"""
|
793 |
-
|
794 |
-
name = 'Python 2.x Traceback'
|
795 |
-
aliases = ['py2tb']
|
796 |
-
filenames = ['*.py2tb']
|
797 |
-
mimetypes = ['text/x-python2-traceback']
|
798 |
-
|
799 |
-
tokens = {
|
800 |
-
'root': [
|
801 |
-
# Cover both (most recent call last) and (innermost last)
|
802 |
-
# The optional ^C allows us to catch keyboard interrupt signals.
|
803 |
-
(r'^(\^C)?(Traceback.*\n)',
|
804 |
-
bygroups(Text, Generic.Traceback), 'intb'),
|
805 |
-
# SyntaxError starts with this.
|
806 |
-
(r'^(?= File "[^"]+", line \d+)', Generic.Traceback, 'intb'),
|
807 |
-
(r'^.*\n', Other),
|
808 |
-
],
|
809 |
-
'intb': [
|
810 |
-
(r'^( File )("[^"]+")(, line )(\d+)(, in )(.+)(\n)',
|
811 |
-
bygroups(Text, Name.Builtin, Text, Number, Text, Name, Whitespace)),
|
812 |
-
(r'^( File )("[^"]+")(, line )(\d+)(\n)',
|
813 |
-
bygroups(Text, Name.Builtin, Text, Number, Whitespace)),
|
814 |
-
(r'^( )(.+)(\n)',
|
815 |
-
bygroups(Text, using(Python2Lexer), Whitespace), 'marker'),
|
816 |
-
(r'^([ \t]*)(\.\.\.)(\n)',
|
817 |
-
bygroups(Text, Comment, Whitespace)), # for doctests...
|
818 |
-
(r'^([^:]+)(: )(.+)(\n)',
|
819 |
-
bygroups(Generic.Error, Text, Name, Whitespace), '#pop'),
|
820 |
-
(r'^([a-zA-Z_]\w*)(:?\n)',
|
821 |
-
bygroups(Generic.Error, Whitespace), '#pop')
|
822 |
-
],
|
823 |
-
'marker': [
|
824 |
-
# For syntax errors.
|
825 |
-
(r'( {4,})(\^)', bygroups(Text, Punctuation.Marker), '#pop'),
|
826 |
-
default('#pop'),
|
827 |
-
],
|
828 |
-
}
|
829 |
-
|
830 |
-
|
831 |
-
class CythonLexer(RegexLexer):
|
832 |
-
"""
|
833 |
-
For Pyrex and Cython source code.
|
834 |
-
|
835 |
-
.. versionadded:: 1.1
|
836 |
-
"""
|
837 |
-
|
838 |
-
name = 'Cython'
|
839 |
-
url = 'http://cython.org'
|
840 |
-
aliases = ['cython', 'pyx', 'pyrex']
|
841 |
-
filenames = ['*.pyx', '*.pxd', '*.pxi']
|
842 |
-
mimetypes = ['text/x-cython', 'application/x-cython']
|
843 |
-
|
844 |
-
tokens = {
|
845 |
-
'root': [
|
846 |
-
(r'\n', Whitespace),
|
847 |
-
(r'^(\s*)("""(?:.|\n)*?""")', bygroups(Whitespace, String.Doc)),
|
848 |
-
(r"^(\s*)('''(?:.|\n)*?''')", bygroups(Whitespace, String.Doc)),
|
849 |
-
(r'[^\S\n]+', Text),
|
850 |
-
(r'#.*$', Comment),
|
851 |
-
(r'[]{}:(),;[]', Punctuation),
|
852 |
-
(r'\\\n', Whitespace),
|
853 |
-
(r'\\', Text),
|
854 |
-
(r'(in|is|and|or|not)\b', Operator.Word),
|
855 |
-
(r'(<)([a-zA-Z0-9.?]+)(>)',
|
856 |
-
bygroups(Punctuation, Keyword.Type, Punctuation)),
|
857 |
-
(r'!=|==|<<|>>|[-~+/*%=<>&^|.?]', Operator),
|
858 |
-
(r'(from)(\d+)(<=)(\s+)(<)(\d+)(:)',
|
859 |
-
bygroups(Keyword, Number.Integer, Operator, Name, Operator,
|
860 |
-
Name, Punctuation)),
|
861 |
-
include('keywords'),
|
862 |
-
(r'(def|property)(\s+)', bygroups(Keyword, Text), 'funcname'),
|
863 |
-
(r'(cp?def)(\s+)', bygroups(Keyword, Text), 'cdef'),
|
864 |
-
# (should actually start a block with only cdefs)
|
865 |
-
(r'(cdef)(:)', bygroups(Keyword, Punctuation)),
|
866 |
-
(r'(class|struct)(\s+)', bygroups(Keyword, Text), 'classname'),
|
867 |
-
(r'(from)(\s+)', bygroups(Keyword, Text), 'fromimport'),
|
868 |
-
(r'(c?import)(\s+)', bygroups(Keyword, Text), 'import'),
|
869 |
-
include('builtins'),
|
870 |
-
include('backtick'),
|
871 |
-
('(?:[rR]|[uU][rR]|[rR][uU])"""', String, 'tdqs'),
|
872 |
-
("(?:[rR]|[uU][rR]|[rR][uU])'''", String, 'tsqs'),
|
873 |
-
('(?:[rR]|[uU][rR]|[rR][uU])"', String, 'dqs'),
|
874 |
-
("(?:[rR]|[uU][rR]|[rR][uU])'", String, 'sqs'),
|
875 |
-
('[uU]?"""', String, combined('stringescape', 'tdqs')),
|
876 |
-
("[uU]?'''", String, combined('stringescape', 'tsqs')),
|
877 |
-
('[uU]?"', String, combined('stringescape', 'dqs')),
|
878 |
-
("[uU]?'", String, combined('stringescape', 'sqs')),
|
879 |
-
include('name'),
|
880 |
-
include('numbers'),
|
881 |
-
],
|
882 |
-
'keywords': [
|
883 |
-
(words((
|
884 |
-
'assert', 'async', 'await', 'break', 'by', 'continue', 'ctypedef', 'del', 'elif',
|
885 |
-
'else', 'except', 'except?', 'exec', 'finally', 'for', 'fused', 'gil',
|
886 |
-
'global', 'if', 'include', 'lambda', 'nogil', 'pass', 'print',
|
887 |
-
'raise', 'return', 'try', 'while', 'yield', 'as', 'with'), suffix=r'\b'),
|
888 |
-
Keyword),
|
889 |
-
(r'(DEF|IF|ELIF|ELSE)\b', Comment.Preproc),
|
890 |
-
],
|
891 |
-
'builtins': [
|
892 |
-
(words((
|
893 |
-
'__import__', 'abs', 'all', 'any', 'apply', 'basestring', 'bin', 'bint',
|
894 |
-
'bool', 'buffer', 'bytearray', 'bytes', 'callable', 'chr',
|
895 |
-
'classmethod', 'cmp', 'coerce', 'compile', 'complex', 'delattr',
|
896 |
-
'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile', 'exit',
|
897 |
-
'file', 'filter', 'float', 'frozenset', 'getattr', 'globals',
|
898 |
-
'hasattr', 'hash', 'hex', 'id', 'input', 'int', 'intern', 'isinstance',
|
899 |
-
'issubclass', 'iter', 'len', 'list', 'locals', 'long', 'map', 'max',
|
900 |
-
'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'property', 'Py_ssize_t',
|
901 |
-
'range', 'raw_input', 'reduce', 'reload', 'repr', 'reversed',
|
902 |
-
'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod',
|
903 |
-
'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode', 'unsigned',
|
904 |
-
'vars', 'xrange', 'zip'), prefix=r'(?<!\.)', suffix=r'\b'),
|
905 |
-
Name.Builtin),
|
906 |
-
(r'(?<!\.)(self|None|Ellipsis|NotImplemented|False|True|NULL'
|
907 |
-
r')\b', Name.Builtin.Pseudo),
|
908 |
-
(words((
|
909 |
-
'ArithmeticError', 'AssertionError', 'AttributeError',
|
910 |
-
'BaseException', 'DeprecationWarning', 'EOFError', 'EnvironmentError',
|
911 |
-
'Exception', 'FloatingPointError', 'FutureWarning', 'GeneratorExit',
|
912 |
-
'IOError', 'ImportError', 'ImportWarning', 'IndentationError',
|
913 |
-
'IndexError', 'KeyError', 'KeyboardInterrupt', 'LookupError',
|
914 |
-
'MemoryError', 'NameError', 'NotImplemented', 'NotImplementedError',
|
915 |
-
'OSError', 'OverflowError', 'OverflowWarning',
|
916 |
-
'PendingDeprecationWarning', 'ReferenceError', 'RuntimeError',
|
917 |
-
'RuntimeWarning', 'StandardError', 'StopIteration', 'SyntaxError',
|
918 |
-
'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError',
|
919 |
-
'TypeError', 'UnboundLocalError', 'UnicodeDecodeError',
|
920 |
-
'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError',
|
921 |
-
'UnicodeWarning', 'UserWarning', 'ValueError', 'Warning',
|
922 |
-
'ZeroDivisionError'), prefix=r'(?<!\.)', suffix=r'\b'),
|
923 |
-
Name.Exception),
|
924 |
-
],
|
925 |
-
'numbers': [
|
926 |
-
(r'(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
|
927 |
-
(r'0\d+', Number.Oct),
|
928 |
-
(r'0[xX][a-fA-F0-9]+', Number.Hex),
|
929 |
-
(r'\d+L', Number.Integer.Long),
|
930 |
-
(r'\d+', Number.Integer)
|
931 |
-
],
|
932 |
-
'backtick': [
|
933 |
-
('`.*?`', String.Backtick),
|
934 |
-
],
|
935 |
-
'name': [
|
936 |
-
(r'@\w+', Name.Decorator),
|
937 |
-
(r'[a-zA-Z_]\w*', Name),
|
938 |
-
],
|
939 |
-
'funcname': [
|
940 |
-
(r'[a-zA-Z_]\w*', Name.Function, '#pop')
|
941 |
-
],
|
942 |
-
'cdef': [
|
943 |
-
(r'(public|readonly|extern|api|inline)\b', Keyword.Reserved),
|
944 |
-
(r'(struct|enum|union|class)\b', Keyword),
|
945 |
-
(r'([a-zA-Z_]\w*)(\s*)(?=[(:#=]|$)',
|
946 |
-
bygroups(Name.Function, Text), '#pop'),
|
947 |
-
(r'([a-zA-Z_]\w*)(\s*)(,)',
|
948 |
-
bygroups(Name.Function, Text, Punctuation)),
|
949 |
-
(r'from\b', Keyword, '#pop'),
|
950 |
-
(r'as\b', Keyword),
|
951 |
-
(r':', Punctuation, '#pop'),
|
952 |
-
(r'(?=["\'])', Text, '#pop'),
|
953 |
-
(r'[a-zA-Z_]\w*', Keyword.Type),
|
954 |
-
(r'.', Text),
|
955 |
-
],
|
956 |
-
'classname': [
|
957 |
-
(r'[a-zA-Z_]\w*', Name.Class, '#pop')
|
958 |
-
],
|
959 |
-
'import': [
|
960 |
-
(r'(\s+)(as)(\s+)', bygroups(Text, Keyword, Text)),
|
961 |
-
(r'[a-zA-Z_][\w.]*', Name.Namespace),
|
962 |
-
(r'(\s*)(,)(\s*)', bygroups(Text, Operator, Text)),
|
963 |
-
default('#pop') # all else: go back
|
964 |
-
],
|
965 |
-
'fromimport': [
|
966 |
-
(r'(\s+)(c?import)\b', bygroups(Text, Keyword), '#pop'),
|
967 |
-
(r'[a-zA-Z_.][\w.]*', Name.Namespace),
|
968 |
-
# ``cdef foo from "header"``, or ``for foo from 0 < i < 10``
|
969 |
-
default('#pop'),
|
970 |
-
],
|
971 |
-
'stringescape': [
|
972 |
-
(r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|'
|
973 |
-
r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
|
974 |
-
],
|
975 |
-
'strings': [
|
976 |
-
(r'%(\([a-zA-Z0-9]+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
|
977 |
-
'[hlL]?[E-GXc-giorsux%]', String.Interpol),
|
978 |
-
(r'[^\\\'"%\n]+', String),
|
979 |
-
# quotes, percents and backslashes must be parsed one at a time
|
980 |
-
(r'[\'"\\]', String),
|
981 |
-
# unhandled string formatting sign
|
982 |
-
(r'%', String)
|
983 |
-
# newlines are an error (use "nl" state)
|
984 |
-
],
|
985 |
-
'nl': [
|
986 |
-
(r'\n', String)
|
987 |
-
],
|
988 |
-
'dqs': [
|
989 |
-
(r'"', String, '#pop'),
|
990 |
-
(r'\\\\|\\"|\\\n', String.Escape), # included here again for raw strings
|
991 |
-
include('strings')
|
992 |
-
],
|
993 |
-
'sqs': [
|
994 |
-
(r"'", String, '#pop'),
|
995 |
-
(r"\\\\|\\'|\\\n", String.Escape), # included here again for raw strings
|
996 |
-
include('strings')
|
997 |
-
],
|
998 |
-
'tdqs': [
|
999 |
-
(r'"""', String, '#pop'),
|
1000 |
-
include('strings'),
|
1001 |
-
include('nl')
|
1002 |
-
],
|
1003 |
-
'tsqs': [
|
1004 |
-
(r"'''", String, '#pop'),
|
1005 |
-
include('strings'),
|
1006 |
-
include('nl')
|
1007 |
-
],
|
1008 |
-
}
|
1009 |
-
|
1010 |
-
|
1011 |
-
class DgLexer(RegexLexer):
|
1012 |
-
"""
|
1013 |
-
Lexer for dg,
|
1014 |
-
a functional and object-oriented programming language
|
1015 |
-
running on the CPython 3 VM.
|
1016 |
-
|
1017 |
-
.. versionadded:: 1.6
|
1018 |
-
"""
|
1019 |
-
name = 'dg'
|
1020 |
-
aliases = ['dg']
|
1021 |
-
filenames = ['*.dg']
|
1022 |
-
mimetypes = ['text/x-dg']
|
1023 |
-
|
1024 |
-
tokens = {
|
1025 |
-
'root': [
|
1026 |
-
(r'\s+', Text),
|
1027 |
-
(r'#.*?$', Comment.Single),
|
1028 |
-
|
1029 |
-
(r'(?i)0b[01]+', Number.Bin),
|
1030 |
-
(r'(?i)0o[0-7]+', Number.Oct),
|
1031 |
-
(r'(?i)0x[0-9a-f]+', Number.Hex),
|
1032 |
-
(r'(?i)[+-]?[0-9]+\.[0-9]+(e[+-]?[0-9]+)?j?', Number.Float),
|
1033 |
-
(r'(?i)[+-]?[0-9]+e[+-]?\d+j?', Number.Float),
|
1034 |
-
(r'(?i)[+-]?[0-9]+j?', Number.Integer),
|
1035 |
-
|
1036 |
-
(r"(?i)(br|r?b?)'''", String, combined('stringescape', 'tsqs', 'string')),
|
1037 |
-
(r'(?i)(br|r?b?)"""', String, combined('stringescape', 'tdqs', 'string')),
|
1038 |
-
(r"(?i)(br|r?b?)'", String, combined('stringescape', 'sqs', 'string')),
|
1039 |
-
(r'(?i)(br|r?b?)"', String, combined('stringescape', 'dqs', 'string')),
|
1040 |
-
|
1041 |
-
(r"`\w+'*`", Operator),
|
1042 |
-
(r'\b(and|in|is|or|where)\b', Operator.Word),
|
1043 |
-
(r'[!$%&*+\-./:<-@\\^|~;,]+', Operator),
|
1044 |
-
|
1045 |
-
(words((
|
1046 |
-
'bool', 'bytearray', 'bytes', 'classmethod', 'complex', 'dict', 'dict\'',
|
1047 |
-
'float', 'frozenset', 'int', 'list', 'list\'', 'memoryview', 'object',
|
1048 |
-
'property', 'range', 'set', 'set\'', 'slice', 'staticmethod', 'str',
|
1049 |
-
'super', 'tuple', 'tuple\'', 'type'),
|
1050 |
-
prefix=r'(?<!\.)', suffix=r'(?![\'\w])'),
|
1051 |
-
Name.Builtin),
|
1052 |
-
(words((
|
1053 |
-
'__import__', 'abs', 'all', 'any', 'bin', 'bind', 'chr', 'cmp', 'compile',
|
1054 |
-
'complex', 'delattr', 'dir', 'divmod', 'drop', 'dropwhile', 'enumerate',
|
1055 |
-
'eval', 'exhaust', 'filter', 'flip', 'foldl1?', 'format', 'fst',
|
1056 |
-
'getattr', 'globals', 'hasattr', 'hash', 'head', 'hex', 'id', 'init',
|
1057 |
-
'input', 'isinstance', 'issubclass', 'iter', 'iterate', 'last', 'len',
|
1058 |
-
'locals', 'map', 'max', 'min', 'next', 'oct', 'open', 'ord', 'pow',
|
1059 |
-
'print', 'repr', 'reversed', 'round', 'setattr', 'scanl1?', 'snd',
|
1060 |
-
'sorted', 'sum', 'tail', 'take', 'takewhile', 'vars', 'zip'),
|
1061 |
-
prefix=r'(?<!\.)', suffix=r'(?![\'\w])'),
|
1062 |
-
Name.Builtin),
|
1063 |
-
(r"(?<!\.)(self|Ellipsis|NotImplemented|None|True|False)(?!['\w])",
|
1064 |
-
Name.Builtin.Pseudo),
|
1065 |
-
|
1066 |
-
(r"(?<!\.)[A-Z]\w*(Error|Exception|Warning)'*(?!['\w])",
|
1067 |
-
Name.Exception),
|
1068 |
-
(r"(?<!\.)(Exception|GeneratorExit|KeyboardInterrupt|StopIteration|"
|
1069 |
-
r"SystemExit)(?!['\w])", Name.Exception),
|
1070 |
-
|
1071 |
-
(r"(?<![\w.])(except|finally|for|if|import|not|otherwise|raise|"
|
1072 |
-
r"subclass|while|with|yield)(?!['\w])", Keyword.Reserved),
|
1073 |
-
|
1074 |
-
(r"[A-Z_]+'*(?!['\w])", Name),
|
1075 |
-
(r"[A-Z]\w+'*(?!['\w])", Keyword.Type),
|
1076 |
-
(r"\w+'*", Name),
|
1077 |
-
|
1078 |
-
(r'[()]', Punctuation),
|
1079 |
-
(r'.', Error),
|
1080 |
-
],
|
1081 |
-
'stringescape': [
|
1082 |
-
(r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|'
|
1083 |
-
r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
|
1084 |
-
],
|
1085 |
-
'string': [
|
1086 |
-
(r'%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
|
1087 |
-
'[hlL]?[E-GXc-giorsux%]', String.Interpol),
|
1088 |
-
(r'[^\\\'"%\n]+', String),
|
1089 |
-
# quotes, percents and backslashes must be parsed one at a time
|
1090 |
-
(r'[\'"\\]', String),
|
1091 |
-
# unhandled string formatting sign
|
1092 |
-
(r'%', String),
|
1093 |
-
(r'\n', String)
|
1094 |
-
],
|
1095 |
-
'dqs': [
|
1096 |
-
(r'"', String, '#pop')
|
1097 |
-
],
|
1098 |
-
'sqs': [
|
1099 |
-
(r"'", String, '#pop')
|
1100 |
-
],
|
1101 |
-
'tdqs': [
|
1102 |
-
(r'"""', String, '#pop')
|
1103 |
-
],
|
1104 |
-
'tsqs': [
|
1105 |
-
(r"'''", String, '#pop')
|
1106 |
-
],
|
1107 |
-
}
|
1108 |
-
|
1109 |
-
|
1110 |
-
class NumPyLexer(PythonLexer):
|
1111 |
-
"""
|
1112 |
-
A Python lexer recognizing Numerical Python builtins.
|
1113 |
-
|
1114 |
-
.. versionadded:: 0.10
|
1115 |
-
"""
|
1116 |
-
|
1117 |
-
name = 'NumPy'
|
1118 |
-
url = 'https://numpy.org/'
|
1119 |
-
aliases = ['numpy']
|
1120 |
-
|
1121 |
-
# override the mimetypes to not inherit them from python
|
1122 |
-
mimetypes = []
|
1123 |
-
filenames = []
|
1124 |
-
|
1125 |
-
EXTRA_KEYWORDS = {
|
1126 |
-
'abs', 'absolute', 'accumulate', 'add', 'alen', 'all', 'allclose',
|
1127 |
-
'alltrue', 'alterdot', 'amax', 'amin', 'angle', 'any', 'append',
|
1128 |
-
'apply_along_axis', 'apply_over_axes', 'arange', 'arccos', 'arccosh',
|
1129 |
-
'arcsin', 'arcsinh', 'arctan', 'arctan2', 'arctanh', 'argmax', 'argmin',
|
1130 |
-
'argsort', 'argwhere', 'around', 'array', 'array2string', 'array_equal',
|
1131 |
-
'array_equiv', 'array_repr', 'array_split', 'array_str', 'arrayrange',
|
1132 |
-
'asanyarray', 'asarray', 'asarray_chkfinite', 'ascontiguousarray',
|
1133 |
-
'asfarray', 'asfortranarray', 'asmatrix', 'asscalar', 'astype',
|
1134 |
-
'atleast_1d', 'atleast_2d', 'atleast_3d', 'average', 'bartlett',
|
1135 |
-
'base_repr', 'beta', 'binary_repr', 'bincount', 'binomial',
|
1136 |
-
'bitwise_and', 'bitwise_not', 'bitwise_or', 'bitwise_xor', 'blackman',
|
1137 |
-
'bmat', 'broadcast', 'byte_bounds', 'bytes', 'byteswap', 'c_',
|
1138 |
-
'can_cast', 'ceil', 'choose', 'clip', 'column_stack', 'common_type',
|
1139 |
-
'compare_chararrays', 'compress', 'concatenate', 'conj', 'conjugate',
|
1140 |
-
'convolve', 'copy', 'corrcoef', 'correlate', 'cos', 'cosh', 'cov',
|
1141 |
-
'cross', 'cumprod', 'cumproduct', 'cumsum', 'delete', 'deprecate',
|
1142 |
-
'diag', 'diagflat', 'diagonal', 'diff', 'digitize', 'disp', 'divide',
|
1143 |
-
'dot', 'dsplit', 'dstack', 'dtype', 'dump', 'dumps', 'ediff1d', 'empty',
|
1144 |
-
'empty_like', 'equal', 'exp', 'expand_dims', 'expm1', 'extract', 'eye',
|
1145 |
-
'fabs', 'fastCopyAndTranspose', 'fft', 'fftfreq', 'fftshift', 'fill',
|
1146 |
-
'finfo', 'fix', 'flat', 'flatnonzero', 'flatten', 'fliplr', 'flipud',
|
1147 |
-
'floor', 'floor_divide', 'fmod', 'frexp', 'fromarrays', 'frombuffer',
|
1148 |
-
'fromfile', 'fromfunction', 'fromiter', 'frompyfunc', 'fromstring',
|
1149 |
-
'generic', 'get_array_wrap', 'get_include', 'get_numarray_include',
|
1150 |
-
'get_numpy_include', 'get_printoptions', 'getbuffer', 'getbufsize',
|
1151 |
-
'geterr', 'geterrcall', 'geterrobj', 'getfield', 'gradient', 'greater',
|
1152 |
-
'greater_equal', 'gumbel', 'hamming', 'hanning', 'histogram',
|
1153 |
-
'histogram2d', 'histogramdd', 'hsplit', 'hstack', 'hypot', 'i0',
|
1154 |
-
'identity', 'ifft', 'imag', 'index_exp', 'indices', 'inf', 'info',
|
1155 |
-
'inner', 'insert', 'int_asbuffer', 'interp', 'intersect1d',
|
1156 |
-
'intersect1d_nu', 'inv', 'invert', 'iscomplex', 'iscomplexobj',
|
1157 |
-
'isfinite', 'isfortran', 'isinf', 'isnan', 'isneginf', 'isposinf',
|
1158 |
-
'isreal', 'isrealobj', 'isscalar', 'issctype', 'issubclass_',
|
1159 |
-
'issubdtype', 'issubsctype', 'item', 'itemset', 'iterable', 'ix_',
|
1160 |
-
'kaiser', 'kron', 'ldexp', 'left_shift', 'less', 'less_equal', 'lexsort',
|
1161 |
-
'linspace', 'load', 'loads', 'loadtxt', 'log', 'log10', 'log1p', 'log2',
|
1162 |
-
'logical_and', 'logical_not', 'logical_or', 'logical_xor', 'logspace',
|
1163 |
-
'lstsq', 'mat', 'matrix', 'max', 'maximum', 'maximum_sctype',
|
1164 |
-
'may_share_memory', 'mean', 'median', 'meshgrid', 'mgrid', 'min',
|
1165 |
-
'minimum', 'mintypecode', 'mod', 'modf', 'msort', 'multiply', 'nan',
|
1166 |
-
'nan_to_num', 'nanargmax', 'nanargmin', 'nanmax', 'nanmin', 'nansum',
|
1167 |
-
'ndenumerate', 'ndim', 'ndindex', 'negative', 'newaxis', 'newbuffer',
|
1168 |
-
'newbyteorder', 'nonzero', 'not_equal', 'obj2sctype', 'ogrid', 'ones',
|
1169 |
-
'ones_like', 'outer', 'permutation', 'piecewise', 'pinv', 'pkgload',
|
1170 |
-
'place', 'poisson', 'poly', 'poly1d', 'polyadd', 'polyder', 'polydiv',
|
1171 |
-
'polyfit', 'polyint', 'polymul', 'polysub', 'polyval', 'power', 'prod',
|
1172 |
-
'product', 'ptp', 'put', 'putmask', 'r_', 'randint', 'random_integers',
|
1173 |
-
'random_sample', 'ranf', 'rank', 'ravel', 'real', 'real_if_close',
|
1174 |
-
'recarray', 'reciprocal', 'reduce', 'remainder', 'repeat', 'require',
|
1175 |
-
'reshape', 'resize', 'restoredot', 'right_shift', 'rint', 'roll',
|
1176 |
-
'rollaxis', 'roots', 'rot90', 'round', 'round_', 'row_stack', 's_',
|
1177 |
-
'sample', 'savetxt', 'sctype2char', 'searchsorted', 'seed', 'select',
|
1178 |
-
'set_numeric_ops', 'set_printoptions', 'set_string_function',
|
1179 |
-
'setbufsize', 'setdiff1d', 'seterr', 'seterrcall', 'seterrobj',
|
1180 |
-
'setfield', 'setflags', 'setmember1d', 'setxor1d', 'shape',
|
1181 |
-
'show_config', 'shuffle', 'sign', 'signbit', 'sin', 'sinc', 'sinh',
|
1182 |
-
'size', 'slice', 'solve', 'sometrue', 'sort', 'sort_complex', 'source',
|
1183 |
-
'split', 'sqrt', 'square', 'squeeze', 'standard_normal', 'std',
|
1184 |
-
'subtract', 'sum', 'svd', 'swapaxes', 'take', 'tan', 'tanh', 'tensordot',
|
1185 |
-
'test', 'tile', 'tofile', 'tolist', 'tostring', 'trace', 'transpose',
|
1186 |
-
'trapz', 'tri', 'tril', 'trim_zeros', 'triu', 'true_divide', 'typeDict',
|
1187 |
-
'typename', 'uniform', 'union1d', 'unique', 'unique1d', 'unravel_index',
|
1188 |
-
'unwrap', 'vander', 'var', 'vdot', 'vectorize', 'view', 'vonmises',
|
1189 |
-
'vsplit', 'vstack', 'weibull', 'where', 'who', 'zeros', 'zeros_like'
|
1190 |
-
}
|
1191 |
-
|
1192 |
-
def get_tokens_unprocessed(self, text):
|
1193 |
-
for index, token, value in \
|
1194 |
-
PythonLexer.get_tokens_unprocessed(self, text):
|
1195 |
-
if token is Name and value in self.EXTRA_KEYWORDS:
|
1196 |
-
yield index, Keyword.Pseudo, value
|
1197 |
-
else:
|
1198 |
-
yield index, token, value
|
1199 |
-
|
1200 |
-
def analyse_text(text):
|
1201 |
-
ltext = text[:1000]
|
1202 |
-
return (shebang_matches(text, r'pythonw?(3(\.\d)?)?') or
|
1203 |
-
'import ' in ltext) \
|
1204 |
-
and ('import numpy' in ltext or 'from numpy import' in ltext)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/rich/color.py
DELETED
@@ -1,622 +0,0 @@
|
|
1 |
-
import platform
|
2 |
-
import re
|
3 |
-
from colorsys import rgb_to_hls
|
4 |
-
from enum import IntEnum
|
5 |
-
from functools import lru_cache
|
6 |
-
from typing import TYPE_CHECKING, NamedTuple, Optional, Tuple
|
7 |
-
|
8 |
-
from ._palettes import EIGHT_BIT_PALETTE, STANDARD_PALETTE, WINDOWS_PALETTE
|
9 |
-
from .color_triplet import ColorTriplet
|
10 |
-
from .repr import Result, rich_repr
|
11 |
-
from .terminal_theme import DEFAULT_TERMINAL_THEME
|
12 |
-
|
13 |
-
if TYPE_CHECKING: # pragma: no cover
|
14 |
-
from .terminal_theme import TerminalTheme
|
15 |
-
from .text import Text
|
16 |
-
|
17 |
-
|
18 |
-
WINDOWS = platform.system() == "Windows"
|
19 |
-
|
20 |
-
|
21 |
-
class ColorSystem(IntEnum):
|
22 |
-
"""One of the 3 color system supported by terminals."""
|
23 |
-
|
24 |
-
STANDARD = 1
|
25 |
-
EIGHT_BIT = 2
|
26 |
-
TRUECOLOR = 3
|
27 |
-
WINDOWS = 4
|
28 |
-
|
29 |
-
def __repr__(self) -> str:
|
30 |
-
return f"ColorSystem.{self.name}"
|
31 |
-
|
32 |
-
def __str__(self) -> str:
|
33 |
-
return repr(self)
|
34 |
-
|
35 |
-
|
36 |
-
class ColorType(IntEnum):
|
37 |
-
"""Type of color stored in Color class."""
|
38 |
-
|
39 |
-
DEFAULT = 0
|
40 |
-
STANDARD = 1
|
41 |
-
EIGHT_BIT = 2
|
42 |
-
TRUECOLOR = 3
|
43 |
-
WINDOWS = 4
|
44 |
-
|
45 |
-
def __repr__(self) -> str:
|
46 |
-
return f"ColorType.{self.name}"
|
47 |
-
|
48 |
-
|
49 |
-
ANSI_COLOR_NAMES = {
|
50 |
-
"black": 0,
|
51 |
-
"red": 1,
|
52 |
-
"green": 2,
|
53 |
-
"yellow": 3,
|
54 |
-
"blue": 4,
|
55 |
-
"magenta": 5,
|
56 |
-
"cyan": 6,
|
57 |
-
"white": 7,
|
58 |
-
"bright_black": 8,
|
59 |
-
"bright_red": 9,
|
60 |
-
"bright_green": 10,
|
61 |
-
"bright_yellow": 11,
|
62 |
-
"bright_blue": 12,
|
63 |
-
"bright_magenta": 13,
|
64 |
-
"bright_cyan": 14,
|
65 |
-
"bright_white": 15,
|
66 |
-
"grey0": 16,
|
67 |
-
"gray0": 16,
|
68 |
-
"navy_blue": 17,
|
69 |
-
"dark_blue": 18,
|
70 |
-
"blue3": 20,
|
71 |
-
"blue1": 21,
|
72 |
-
"dark_green": 22,
|
73 |
-
"deep_sky_blue4": 25,
|
74 |
-
"dodger_blue3": 26,
|
75 |
-
"dodger_blue2": 27,
|
76 |
-
"green4": 28,
|
77 |
-
"spring_green4": 29,
|
78 |
-
"turquoise4": 30,
|
79 |
-
"deep_sky_blue3": 32,
|
80 |
-
"dodger_blue1": 33,
|
81 |
-
"green3": 40,
|
82 |
-
"spring_green3": 41,
|
83 |
-
"dark_cyan": 36,
|
84 |
-
"light_sea_green": 37,
|
85 |
-
"deep_sky_blue2": 38,
|
86 |
-
"deep_sky_blue1": 39,
|
87 |
-
"spring_green2": 47,
|
88 |
-
"cyan3": 43,
|
89 |
-
"dark_turquoise": 44,
|
90 |
-
"turquoise2": 45,
|
91 |
-
"green1": 46,
|
92 |
-
"spring_green1": 48,
|
93 |
-
"medium_spring_green": 49,
|
94 |
-
"cyan2": 50,
|
95 |
-
"cyan1": 51,
|
96 |
-
"dark_red": 88,
|
97 |
-
"deep_pink4": 125,
|
98 |
-
"purple4": 55,
|
99 |
-
"purple3": 56,
|
100 |
-
"blue_violet": 57,
|
101 |
-
"orange4": 94,
|
102 |
-
"grey37": 59,
|
103 |
-
"gray37": 59,
|
104 |
-
"medium_purple4": 60,
|
105 |
-
"slate_blue3": 62,
|
106 |
-
"royal_blue1": 63,
|
107 |
-
"chartreuse4": 64,
|
108 |
-
"dark_sea_green4": 71,
|
109 |
-
"pale_turquoise4": 66,
|
110 |
-
"steel_blue": 67,
|
111 |
-
"steel_blue3": 68,
|
112 |
-
"cornflower_blue": 69,
|
113 |
-
"chartreuse3": 76,
|
114 |
-
"cadet_blue": 73,
|
115 |
-
"sky_blue3": 74,
|
116 |
-
"steel_blue1": 81,
|
117 |
-
"pale_green3": 114,
|
118 |
-
"sea_green3": 78,
|
119 |
-
"aquamarine3": 79,
|
120 |
-
"medium_turquoise": 80,
|
121 |
-
"chartreuse2": 112,
|
122 |
-
"sea_green2": 83,
|
123 |
-
"sea_green1": 85,
|
124 |
-
"aquamarine1": 122,
|
125 |
-
"dark_slate_gray2": 87,
|
126 |
-
"dark_magenta": 91,
|
127 |
-
"dark_violet": 128,
|
128 |
-
"purple": 129,
|
129 |
-
"light_pink4": 95,
|
130 |
-
"plum4": 96,
|
131 |
-
"medium_purple3": 98,
|
132 |
-
"slate_blue1": 99,
|
133 |
-
"yellow4": 106,
|
134 |
-
"wheat4": 101,
|
135 |
-
"grey53": 102,
|
136 |
-
"gray53": 102,
|
137 |
-
"light_slate_grey": 103,
|
138 |
-
"light_slate_gray": 103,
|
139 |
-
"medium_purple": 104,
|
140 |
-
"light_slate_blue": 105,
|
141 |
-
"dark_olive_green3": 149,
|
142 |
-
"dark_sea_green": 108,
|
143 |
-
"light_sky_blue3": 110,
|
144 |
-
"sky_blue2": 111,
|
145 |
-
"dark_sea_green3": 150,
|
146 |
-
"dark_slate_gray3": 116,
|
147 |
-
"sky_blue1": 117,
|
148 |
-
"chartreuse1": 118,
|
149 |
-
"light_green": 120,
|
150 |
-
"pale_green1": 156,
|
151 |
-
"dark_slate_gray1": 123,
|
152 |
-
"red3": 160,
|
153 |
-
"medium_violet_red": 126,
|
154 |
-
"magenta3": 164,
|
155 |
-
"dark_orange3": 166,
|
156 |
-
"indian_red": 167,
|
157 |
-
"hot_pink3": 168,
|
158 |
-
"medium_orchid3": 133,
|
159 |
-
"medium_orchid": 134,
|
160 |
-
"medium_purple2": 140,
|
161 |
-
"dark_goldenrod": 136,
|
162 |
-
"light_salmon3": 173,
|
163 |
-
"rosy_brown": 138,
|
164 |
-
"grey63": 139,
|
165 |
-
"gray63": 139,
|
166 |
-
"medium_purple1": 141,
|
167 |
-
"gold3": 178,
|
168 |
-
"dark_khaki": 143,
|
169 |
-
"navajo_white3": 144,
|
170 |
-
"grey69": 145,
|
171 |
-
"gray69": 145,
|
172 |
-
"light_steel_blue3": 146,
|
173 |
-
"light_steel_blue": 147,
|
174 |
-
"yellow3": 184,
|
175 |
-
"dark_sea_green2": 157,
|
176 |
-
"light_cyan3": 152,
|
177 |
-
"light_sky_blue1": 153,
|
178 |
-
"green_yellow": 154,
|
179 |
-
"dark_olive_green2": 155,
|
180 |
-
"dark_sea_green1": 193,
|
181 |
-
"pale_turquoise1": 159,
|
182 |
-
"deep_pink3": 162,
|
183 |
-
"magenta2": 200,
|
184 |
-
"hot_pink2": 169,
|
185 |
-
"orchid": 170,
|
186 |
-
"medium_orchid1": 207,
|
187 |
-
"orange3": 172,
|
188 |
-
"light_pink3": 174,
|
189 |
-
"pink3": 175,
|
190 |
-
"plum3": 176,
|
191 |
-
"violet": 177,
|
192 |
-
"light_goldenrod3": 179,
|
193 |
-
"tan": 180,
|
194 |
-
"misty_rose3": 181,
|
195 |
-
"thistle3": 182,
|
196 |
-
"plum2": 183,
|
197 |
-
"khaki3": 185,
|
198 |
-
"light_goldenrod2": 222,
|
199 |
-
"light_yellow3": 187,
|
200 |
-
"grey84": 188,
|
201 |
-
"gray84": 188,
|
202 |
-
"light_steel_blue1": 189,
|
203 |
-
"yellow2": 190,
|
204 |
-
"dark_olive_green1": 192,
|
205 |
-
"honeydew2": 194,
|
206 |
-
"light_cyan1": 195,
|
207 |
-
"red1": 196,
|
208 |
-
"deep_pink2": 197,
|
209 |
-
"deep_pink1": 199,
|
210 |
-
"magenta1": 201,
|
211 |
-
"orange_red1": 202,
|
212 |
-
"indian_red1": 204,
|
213 |
-
"hot_pink": 206,
|
214 |
-
"dark_orange": 208,
|
215 |
-
"salmon1": 209,
|
216 |
-
"light_coral": 210,
|
217 |
-
"pale_violet_red1": 211,
|
218 |
-
"orchid2": 212,
|
219 |
-
"orchid1": 213,
|
220 |
-
"orange1": 214,
|
221 |
-
"sandy_brown": 215,
|
222 |
-
"light_salmon1": 216,
|
223 |
-
"light_pink1": 217,
|
224 |
-
"pink1": 218,
|
225 |
-
"plum1": 219,
|
226 |
-
"gold1": 220,
|
227 |
-
"navajo_white1": 223,
|
228 |
-
"misty_rose1": 224,
|
229 |
-
"thistle1": 225,
|
230 |
-
"yellow1": 226,
|
231 |
-
"light_goldenrod1": 227,
|
232 |
-
"khaki1": 228,
|
233 |
-
"wheat1": 229,
|
234 |
-
"cornsilk1": 230,
|
235 |
-
"grey100": 231,
|
236 |
-
"gray100": 231,
|
237 |
-
"grey3": 232,
|
238 |
-
"gray3": 232,
|
239 |
-
"grey7": 233,
|
240 |
-
"gray7": 233,
|
241 |
-
"grey11": 234,
|
242 |
-
"gray11": 234,
|
243 |
-
"grey15": 235,
|
244 |
-
"gray15": 235,
|
245 |
-
"grey19": 236,
|
246 |
-
"gray19": 236,
|
247 |
-
"grey23": 237,
|
248 |
-
"gray23": 237,
|
249 |
-
"grey27": 238,
|
250 |
-
"gray27": 238,
|
251 |
-
"grey30": 239,
|
252 |
-
"gray30": 239,
|
253 |
-
"grey35": 240,
|
254 |
-
"gray35": 240,
|
255 |
-
"grey39": 241,
|
256 |
-
"gray39": 241,
|
257 |
-
"grey42": 242,
|
258 |
-
"gray42": 242,
|
259 |
-
"grey46": 243,
|
260 |
-
"gray46": 243,
|
261 |
-
"grey50": 244,
|
262 |
-
"gray50": 244,
|
263 |
-
"grey54": 245,
|
264 |
-
"gray54": 245,
|
265 |
-
"grey58": 246,
|
266 |
-
"gray58": 246,
|
267 |
-
"grey62": 247,
|
268 |
-
"gray62": 247,
|
269 |
-
"grey66": 248,
|
270 |
-
"gray66": 248,
|
271 |
-
"grey70": 249,
|
272 |
-
"gray70": 249,
|
273 |
-
"grey74": 250,
|
274 |
-
"gray74": 250,
|
275 |
-
"grey78": 251,
|
276 |
-
"gray78": 251,
|
277 |
-
"grey82": 252,
|
278 |
-
"gray82": 252,
|
279 |
-
"grey85": 253,
|
280 |
-
"gray85": 253,
|
281 |
-
"grey89": 254,
|
282 |
-
"gray89": 254,
|
283 |
-
"grey93": 255,
|
284 |
-
"gray93": 255,
|
285 |
-
}
|
286 |
-
|
287 |
-
|
288 |
-
class ColorParseError(Exception):
|
289 |
-
"""The color could not be parsed."""
|
290 |
-
|
291 |
-
|
292 |
-
RE_COLOR = re.compile(
|
293 |
-
r"""^
|
294 |
-
\#([0-9a-f]{6})$|
|
295 |
-
color\(([0-9]{1,3})\)$|
|
296 |
-
rgb\(([\d\s,]+)\)$
|
297 |
-
""",
|
298 |
-
re.VERBOSE,
|
299 |
-
)
|
300 |
-
|
301 |
-
|
302 |
-
@rich_repr
|
303 |
-
class Color(NamedTuple):
|
304 |
-
"""Terminal color definition."""
|
305 |
-
|
306 |
-
name: str
|
307 |
-
"""The name of the color (typically the input to Color.parse)."""
|
308 |
-
type: ColorType
|
309 |
-
"""The type of the color."""
|
310 |
-
number: Optional[int] = None
|
311 |
-
"""The color number, if a standard color, or None."""
|
312 |
-
triplet: Optional[ColorTriplet] = None
|
313 |
-
"""A triplet of color components, if an RGB color."""
|
314 |
-
|
315 |
-
def __rich__(self) -> "Text":
|
316 |
-
"""Displays the actual color if Rich printed."""
|
317 |
-
from .style import Style
|
318 |
-
from .text import Text
|
319 |
-
|
320 |
-
return Text.assemble(
|
321 |
-
f"<color {self.name!r} ({self.type.name.lower()})",
|
322 |
-
("⬤", Style(color=self)),
|
323 |
-
" >",
|
324 |
-
)
|
325 |
-
|
326 |
-
def __rich_repr__(self) -> Result:
|
327 |
-
yield self.name
|
328 |
-
yield self.type
|
329 |
-
yield "number", self.number, None
|
330 |
-
yield "triplet", self.triplet, None
|
331 |
-
|
332 |
-
@property
|
333 |
-
def system(self) -> ColorSystem:
|
334 |
-
"""Get the native color system for this color."""
|
335 |
-
if self.type == ColorType.DEFAULT:
|
336 |
-
return ColorSystem.STANDARD
|
337 |
-
return ColorSystem(int(self.type))
|
338 |
-
|
339 |
-
@property
|
340 |
-
def is_system_defined(self) -> bool:
|
341 |
-
"""Check if the color is ultimately defined by the system."""
|
342 |
-
return self.system not in (ColorSystem.EIGHT_BIT, ColorSystem.TRUECOLOR)
|
343 |
-
|
344 |
-
@property
|
345 |
-
def is_default(self) -> bool:
|
346 |
-
"""Check if the color is a default color."""
|
347 |
-
return self.type == ColorType.DEFAULT
|
348 |
-
|
349 |
-
def get_truecolor(
|
350 |
-
self, theme: Optional["TerminalTheme"] = None, foreground: bool = True
|
351 |
-
) -> ColorTriplet:
|
352 |
-
"""Get an equivalent color triplet for this color.
|
353 |
-
|
354 |
-
Args:
|
355 |
-
theme (TerminalTheme, optional): Optional terminal theme, or None to use default. Defaults to None.
|
356 |
-
foreground (bool, optional): True for a foreground color, or False for background. Defaults to True.
|
357 |
-
|
358 |
-
Returns:
|
359 |
-
ColorTriplet: A color triplet containing RGB components.
|
360 |
-
"""
|
361 |
-
|
362 |
-
if theme is None:
|
363 |
-
theme = DEFAULT_TERMINAL_THEME
|
364 |
-
if self.type == ColorType.TRUECOLOR:
|
365 |
-
assert self.triplet is not None
|
366 |
-
return self.triplet
|
367 |
-
elif self.type == ColorType.EIGHT_BIT:
|
368 |
-
assert self.number is not None
|
369 |
-
return EIGHT_BIT_PALETTE[self.number]
|
370 |
-
elif self.type == ColorType.STANDARD:
|
371 |
-
assert self.number is not None
|
372 |
-
return theme.ansi_colors[self.number]
|
373 |
-
elif self.type == ColorType.WINDOWS:
|
374 |
-
assert self.number is not None
|
375 |
-
return WINDOWS_PALETTE[self.number]
|
376 |
-
else: # self.type == ColorType.DEFAULT:
|
377 |
-
assert self.number is None
|
378 |
-
return theme.foreground_color if foreground else theme.background_color
|
379 |
-
|
380 |
-
@classmethod
|
381 |
-
def from_ansi(cls, number: int) -> "Color":
|
382 |
-
"""Create a Color number from it's 8-bit ansi number.
|
383 |
-
|
384 |
-
Args:
|
385 |
-
number (int): A number between 0-255 inclusive.
|
386 |
-
|
387 |
-
Returns:
|
388 |
-
Color: A new Color instance.
|
389 |
-
"""
|
390 |
-
return cls(
|
391 |
-
name=f"color({number})",
|
392 |
-
type=(ColorType.STANDARD if number < 16 else ColorType.EIGHT_BIT),
|
393 |
-
number=number,
|
394 |
-
)
|
395 |
-
|
396 |
-
@classmethod
|
397 |
-
def from_triplet(cls, triplet: "ColorTriplet") -> "Color":
|
398 |
-
"""Create a truecolor RGB color from a triplet of values.
|
399 |
-
|
400 |
-
Args:
|
401 |
-
triplet (ColorTriplet): A color triplet containing red, green and blue components.
|
402 |
-
|
403 |
-
Returns:
|
404 |
-
Color: A new color object.
|
405 |
-
"""
|
406 |
-
return cls(name=triplet.hex, type=ColorType.TRUECOLOR, triplet=triplet)
|
407 |
-
|
408 |
-
@classmethod
|
409 |
-
def from_rgb(cls, red: float, green: float, blue: float) -> "Color":
|
410 |
-
"""Create a truecolor from three color components in the range(0->255).
|
411 |
-
|
412 |
-
Args:
|
413 |
-
red (float): Red component in range 0-255.
|
414 |
-
green (float): Green component in range 0-255.
|
415 |
-
blue (float): Blue component in range 0-255.
|
416 |
-
|
417 |
-
Returns:
|
418 |
-
Color: A new color object.
|
419 |
-
"""
|
420 |
-
return cls.from_triplet(ColorTriplet(int(red), int(green), int(blue)))
|
421 |
-
|
422 |
-
@classmethod
|
423 |
-
def default(cls) -> "Color":
|
424 |
-
"""Get a Color instance representing the default color.
|
425 |
-
|
426 |
-
Returns:
|
427 |
-
Color: Default color.
|
428 |
-
"""
|
429 |
-
return cls(name="default", type=ColorType.DEFAULT)
|
430 |
-
|
431 |
-
@classmethod
|
432 |
-
@lru_cache(maxsize=1024)
|
433 |
-
def parse(cls, color: str) -> "Color":
|
434 |
-
"""Parse a color definition."""
|
435 |
-
original_color = color
|
436 |
-
color = color.lower().strip()
|
437 |
-
|
438 |
-
if color == "default":
|
439 |
-
return cls(color, type=ColorType.DEFAULT)
|
440 |
-
|
441 |
-
color_number = ANSI_COLOR_NAMES.get(color)
|
442 |
-
if color_number is not None:
|
443 |
-
return cls(
|
444 |
-
color,
|
445 |
-
type=(ColorType.STANDARD if color_number < 16 else ColorType.EIGHT_BIT),
|
446 |
-
number=color_number,
|
447 |
-
)
|
448 |
-
|
449 |
-
color_match = RE_COLOR.match(color)
|
450 |
-
if color_match is None:
|
451 |
-
raise ColorParseError(f"{original_color!r} is not a valid color")
|
452 |
-
|
453 |
-
color_24, color_8, color_rgb = color_match.groups()
|
454 |
-
if color_24:
|
455 |
-
triplet = ColorTriplet(
|
456 |
-
int(color_24[0:2], 16), int(color_24[2:4], 16), int(color_24[4:6], 16)
|
457 |
-
)
|
458 |
-
return cls(color, ColorType.TRUECOLOR, triplet=triplet)
|
459 |
-
|
460 |
-
elif color_8:
|
461 |
-
number = int(color_8)
|
462 |
-
if number > 255:
|
463 |
-
raise ColorParseError(f"color number must be <= 255 in {color!r}")
|
464 |
-
return cls(
|
465 |
-
color,
|
466 |
-
type=(ColorType.STANDARD if number < 16 else ColorType.EIGHT_BIT),
|
467 |
-
number=number,
|
468 |
-
)
|
469 |
-
|
470 |
-
else: # color_rgb:
|
471 |
-
components = color_rgb.split(",")
|
472 |
-
if len(components) != 3:
|
473 |
-
raise ColorParseError(
|
474 |
-
f"expected three components in {original_color!r}"
|
475 |
-
)
|
476 |
-
red, green, blue = components
|
477 |
-
triplet = ColorTriplet(int(red), int(green), int(blue))
|
478 |
-
if not all(component <= 255 for component in triplet):
|
479 |
-
raise ColorParseError(
|
480 |
-
f"color components must be <= 255 in {original_color!r}"
|
481 |
-
)
|
482 |
-
return cls(color, ColorType.TRUECOLOR, triplet=triplet)
|
483 |
-
|
484 |
-
@lru_cache(maxsize=1024)
|
485 |
-
def get_ansi_codes(self, foreground: bool = True) -> Tuple[str, ...]:
|
486 |
-
"""Get the ANSI escape codes for this color."""
|
487 |
-
_type = self.type
|
488 |
-
if _type == ColorType.DEFAULT:
|
489 |
-
return ("39" if foreground else "49",)
|
490 |
-
|
491 |
-
elif _type == ColorType.WINDOWS:
|
492 |
-
number = self.number
|
493 |
-
assert number is not None
|
494 |
-
fore, back = (30, 40) if number < 8 else (82, 92)
|
495 |
-
return (str(fore + number if foreground else back + number),)
|
496 |
-
|
497 |
-
elif _type == ColorType.STANDARD:
|
498 |
-
number = self.number
|
499 |
-
assert number is not None
|
500 |
-
fore, back = (30, 40) if number < 8 else (82, 92)
|
501 |
-
return (str(fore + number if foreground else back + number),)
|
502 |
-
|
503 |
-
elif _type == ColorType.EIGHT_BIT:
|
504 |
-
assert self.number is not None
|
505 |
-
return ("38" if foreground else "48", "5", str(self.number))
|
506 |
-
|
507 |
-
else: # self.standard == ColorStandard.TRUECOLOR:
|
508 |
-
assert self.triplet is not None
|
509 |
-
red, green, blue = self.triplet
|
510 |
-
return ("38" if foreground else "48", "2", str(red), str(green), str(blue))
|
511 |
-
|
512 |
-
@lru_cache(maxsize=1024)
|
513 |
-
def downgrade(self, system: ColorSystem) -> "Color":
|
514 |
-
"""Downgrade a color system to a system with fewer colors."""
|
515 |
-
|
516 |
-
if self.type in (ColorType.DEFAULT, system):
|
517 |
-
return self
|
518 |
-
# Convert to 8-bit color from truecolor color
|
519 |
-
if system == ColorSystem.EIGHT_BIT and self.system == ColorSystem.TRUECOLOR:
|
520 |
-
assert self.triplet is not None
|
521 |
-
_h, l, s = rgb_to_hls(*self.triplet.normalized)
|
522 |
-
# If saturation is under 15% assume it is grayscale
|
523 |
-
if s < 0.15:
|
524 |
-
gray = round(l * 25.0)
|
525 |
-
if gray == 0:
|
526 |
-
color_number = 16
|
527 |
-
elif gray == 25:
|
528 |
-
color_number = 231
|
529 |
-
else:
|
530 |
-
color_number = 231 + gray
|
531 |
-
return Color(self.name, ColorType.EIGHT_BIT, number=color_number)
|
532 |
-
|
533 |
-
red, green, blue = self.triplet
|
534 |
-
six_red = red / 95 if red < 95 else 1 + (red - 95) / 40
|
535 |
-
six_green = green / 95 if green < 95 else 1 + (green - 95) / 40
|
536 |
-
six_blue = blue / 95 if blue < 95 else 1 + (blue - 95) / 40
|
537 |
-
|
538 |
-
color_number = (
|
539 |
-
16 + 36 * round(six_red) + 6 * round(six_green) + round(six_blue)
|
540 |
-
)
|
541 |
-
return Color(self.name, ColorType.EIGHT_BIT, number=color_number)
|
542 |
-
|
543 |
-
# Convert to standard from truecolor or 8-bit
|
544 |
-
elif system == ColorSystem.STANDARD:
|
545 |
-
if self.system == ColorSystem.TRUECOLOR:
|
546 |
-
assert self.triplet is not None
|
547 |
-
triplet = self.triplet
|
548 |
-
else: # self.system == ColorSystem.EIGHT_BIT
|
549 |
-
assert self.number is not None
|
550 |
-
triplet = ColorTriplet(*EIGHT_BIT_PALETTE[self.number])
|
551 |
-
|
552 |
-
color_number = STANDARD_PALETTE.match(triplet)
|
553 |
-
return Color(self.name, ColorType.STANDARD, number=color_number)
|
554 |
-
|
555 |
-
elif system == ColorSystem.WINDOWS:
|
556 |
-
if self.system == ColorSystem.TRUECOLOR:
|
557 |
-
assert self.triplet is not None
|
558 |
-
triplet = self.triplet
|
559 |
-
else: # self.system == ColorSystem.EIGHT_BIT
|
560 |
-
assert self.number is not None
|
561 |
-
if self.number < 16:
|
562 |
-
return Color(self.name, ColorType.WINDOWS, number=self.number)
|
563 |
-
triplet = ColorTriplet(*EIGHT_BIT_PALETTE[self.number])
|
564 |
-
|
565 |
-
color_number = WINDOWS_PALETTE.match(triplet)
|
566 |
-
return Color(self.name, ColorType.WINDOWS, number=color_number)
|
567 |
-
|
568 |
-
return self
|
569 |
-
|
570 |
-
|
571 |
-
def parse_rgb_hex(hex_color: str) -> ColorTriplet:
|
572 |
-
"""Parse six hex characters in to RGB triplet."""
|
573 |
-
assert len(hex_color) == 6, "must be 6 characters"
|
574 |
-
color = ColorTriplet(
|
575 |
-
int(hex_color[0:2], 16), int(hex_color[2:4], 16), int(hex_color[4:6], 16)
|
576 |
-
)
|
577 |
-
return color
|
578 |
-
|
579 |
-
|
580 |
-
def blend_rgb(
|
581 |
-
color1: ColorTriplet, color2: ColorTriplet, cross_fade: float = 0.5
|
582 |
-
) -> ColorTriplet:
|
583 |
-
"""Blend one RGB color in to another."""
|
584 |
-
r1, g1, b1 = color1
|
585 |
-
r2, g2, b2 = color2
|
586 |
-
new_color = ColorTriplet(
|
587 |
-
int(r1 + (r2 - r1) * cross_fade),
|
588 |
-
int(g1 + (g2 - g1) * cross_fade),
|
589 |
-
int(b1 + (b2 - b1) * cross_fade),
|
590 |
-
)
|
591 |
-
return new_color
|
592 |
-
|
593 |
-
|
594 |
-
if __name__ == "__main__": # pragma: no cover
|
595 |
-
|
596 |
-
from .console import Console
|
597 |
-
from .table import Table
|
598 |
-
from .text import Text
|
599 |
-
|
600 |
-
console = Console()
|
601 |
-
|
602 |
-
table = Table(show_footer=False, show_edge=True)
|
603 |
-
table.add_column("Color", width=10, overflow="ellipsis")
|
604 |
-
table.add_column("Number", justify="right", style="yellow")
|
605 |
-
table.add_column("Name", style="green")
|
606 |
-
table.add_column("Hex", style="blue")
|
607 |
-
table.add_column("RGB", style="magenta")
|
608 |
-
|
609 |
-
colors = sorted((v, k) for k, v in ANSI_COLOR_NAMES.items())
|
610 |
-
for color_number, name in colors:
|
611 |
-
if "grey" in name:
|
612 |
-
continue
|
613 |
-
color_cell = Text(" " * 10, style=f"on {name}")
|
614 |
-
if color_number < 16:
|
615 |
-
table.add_row(color_cell, f"{color_number}", Text(f'"{name}"'))
|
616 |
-
else:
|
617 |
-
color = EIGHT_BIT_PALETTE[color_number] # type: ignore[has-type]
|
618 |
-
table.add_row(
|
619 |
-
color_cell, str(color_number), Text(f'"{name}"'), color.hex, color.rgb
|
620 |
-
)
|
621 |
-
|
622 |
-
console.print(table)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/pybind11/tools/clang/__init__.py
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
#===- __init__.py - Clang Python Bindings --------------------*- python -*--===#
|
2 |
-
#
|
3 |
-
# The LLVM Compiler Infrastructure
|
4 |
-
#
|
5 |
-
# This file is distributed under the University of Illinois Open Source
|
6 |
-
# License. See LICENSE.TXT for details.
|
7 |
-
#
|
8 |
-
#===------------------------------------------------------------------------===#
|
9 |
-
|
10 |
-
r"""
|
11 |
-
Clang Library Bindings
|
12 |
-
======================
|
13 |
-
|
14 |
-
This package provides access to the Clang compiler and libraries.
|
15 |
-
|
16 |
-
The available modules are:
|
17 |
-
|
18 |
-
cindex
|
19 |
-
|
20 |
-
Bindings for the Clang indexing library.
|
21 |
-
"""
|
22 |
-
|
23 |
-
__all__ = ['cindex']
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/system/tbb/execution_policy.h
DELETED
@@ -1,156 +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 |
-
/*! \file thrust/system/tbb/execution_policy.h
|
20 |
-
* \brief Execution policies for Thrust's TBB system.
|
21 |
-
*/
|
22 |
-
|
23 |
-
#include <thrust/detail/config.h>
|
24 |
-
|
25 |
-
// get the execution policies definitions first
|
26 |
-
#include <thrust/system/tbb/detail/execution_policy.h>
|
27 |
-
|
28 |
-
// get the definition of par
|
29 |
-
#include <thrust/system/tbb/detail/par.h>
|
30 |
-
|
31 |
-
// now get all the algorithm definitions
|
32 |
-
|
33 |
-
#include <thrust/system/tbb/detail/adjacent_difference.h>
|
34 |
-
#include <thrust/system/tbb/detail/assign_value.h>
|
35 |
-
#include <thrust/system/tbb/detail/binary_search.h>
|
36 |
-
#include <thrust/system/tbb/detail/copy.h>
|
37 |
-
#include <thrust/system/tbb/detail/copy_if.h>
|
38 |
-
#include <thrust/system/tbb/detail/count.h>
|
39 |
-
#include <thrust/system/tbb/detail/equal.h>
|
40 |
-
#include <thrust/system/tbb/detail/extrema.h>
|
41 |
-
#include <thrust/system/tbb/detail/fill.h>
|
42 |
-
#include <thrust/system/tbb/detail/find.h>
|
43 |
-
#include <thrust/system/tbb/detail/for_each.h>
|
44 |
-
#include <thrust/system/tbb/detail/gather.h>
|
45 |
-
#include <thrust/system/tbb/detail/generate.h>
|
46 |
-
#include <thrust/system/tbb/detail/get_value.h>
|
47 |
-
#include <thrust/system/tbb/detail/inner_product.h>
|
48 |
-
#include <thrust/system/tbb/detail/iter_swap.h>
|
49 |
-
#include <thrust/system/tbb/detail/logical.h>
|
50 |
-
#include <thrust/system/tbb/detail/malloc_and_free.h>
|
51 |
-
#include <thrust/system/tbb/detail/merge.h>
|
52 |
-
#include <thrust/system/tbb/detail/mismatch.h>
|
53 |
-
#include <thrust/system/tbb/detail/partition.h>
|
54 |
-
#include <thrust/system/tbb/detail/reduce.h>
|
55 |
-
#include <thrust/system/tbb/detail/reduce_by_key.h>
|
56 |
-
#include <thrust/system/tbb/detail/remove.h>
|
57 |
-
#include <thrust/system/tbb/detail/replace.h>
|
58 |
-
#include <thrust/system/tbb/detail/reverse.h>
|
59 |
-
#include <thrust/system/tbb/detail/scan.h>
|
60 |
-
#include <thrust/system/tbb/detail/scan_by_key.h>
|
61 |
-
#include <thrust/system/tbb/detail/scatter.h>
|
62 |
-
#include <thrust/system/tbb/detail/sequence.h>
|
63 |
-
#include <thrust/system/tbb/detail/set_operations.h>
|
64 |
-
#include <thrust/system/tbb/detail/sort.h>
|
65 |
-
#include <thrust/system/tbb/detail/swap_ranges.h>
|
66 |
-
#include <thrust/system/tbb/detail/tabulate.h>
|
67 |
-
#include <thrust/system/tbb/detail/transform.h>
|
68 |
-
#include <thrust/system/tbb/detail/transform_reduce.h>
|
69 |
-
#include <thrust/system/tbb/detail/transform_scan.h>
|
70 |
-
#include <thrust/system/tbb/detail/uninitialized_copy.h>
|
71 |
-
#include <thrust/system/tbb/detail/uninitialized_fill.h>
|
72 |
-
#include <thrust/system/tbb/detail/unique.h>
|
73 |
-
#include <thrust/system/tbb/detail/unique_by_key.h>
|
74 |
-
|
75 |
-
|
76 |
-
// define these entities here for the purpose of Doxygenating them
|
77 |
-
// they are actually defined elsewhere
|
78 |
-
#if 0
|
79 |
-
namespace thrust
|
80 |
-
{
|
81 |
-
namespace system
|
82 |
-
{
|
83 |
-
namespace tbb
|
84 |
-
{
|
85 |
-
|
86 |
-
|
87 |
-
/*! \addtogroup execution_policies
|
88 |
-
* \{
|
89 |
-
*/
|
90 |
-
|
91 |
-
|
92 |
-
/*! \p thrust::tbb::execution_policy is the base class for all Thrust parallel execution
|
93 |
-
* policies which are derived from Thrust's TBB backend system.
|
94 |
-
*/
|
95 |
-
template<typename DerivedPolicy>
|
96 |
-
struct execution_policy : thrust::execution_policy<DerivedPolicy>
|
97 |
-
{};
|
98 |
-
|
99 |
-
|
100 |
-
/*! \p tbb::tag is a type representing Thrust's TBB backend system in C++'s type system.
|
101 |
-
* Iterators "tagged" with a type which is convertible to \p tbb::tag assert that they may be
|
102 |
-
* "dispatched" to algorithm implementations in the \p tbb system.
|
103 |
-
*/
|
104 |
-
struct tag : thrust::system::tbb::execution_policy<tag> { unspecified };
|
105 |
-
|
106 |
-
|
107 |
-
/*! \p thrust::tbb::par is the parallel execution policy associated with Thrust's TBB
|
108 |
-
* backend system.
|
109 |
-
*
|
110 |
-
* Instead of relying on implicit algorithm dispatch through iterator system tags, users may
|
111 |
-
* directly target Thrust's TBB backend system by providing \p thrust::tbb::par as an algorithm
|
112 |
-
* parameter.
|
113 |
-
*
|
114 |
-
* Explicit dispatch can be useful in avoiding the introduction of data copies into containers such
|
115 |
-
* as \p thrust::tbb::vector.
|
116 |
-
*
|
117 |
-
* The type of \p thrust::tbb::par is implementation-defined.
|
118 |
-
*
|
119 |
-
* The following code snippet demonstrates how to use \p thrust::tbb::par to explicitly dispatch an
|
120 |
-
* invocation of \p thrust::for_each to the TBB backend system:
|
121 |
-
*
|
122 |
-
* \code
|
123 |
-
* #include <thrust/for_each.h>
|
124 |
-
* #include <thrust/system/tbb/execution_policy.h>
|
125 |
-
* #include <cstdio>
|
126 |
-
*
|
127 |
-
* struct printf_functor
|
128 |
-
* {
|
129 |
-
* __host__ __device__
|
130 |
-
* void operator()(int x)
|
131 |
-
* {
|
132 |
-
* printf("%d\n", x);
|
133 |
-
* }
|
134 |
-
* };
|
135 |
-
* ...
|
136 |
-
* int vec[3];
|
137 |
-
* vec[0] = 0; vec[1] = 1; vec[2] = 2;
|
138 |
-
*
|
139 |
-
* thrust::for_each(thrust::tbb::par, vec.begin(), vec.end(), printf_functor());
|
140 |
-
*
|
141 |
-
* // 0 1 2 is printed to standard output in some unspecified order
|
142 |
-
* \endcode
|
143 |
-
*/
|
144 |
-
static const unspecified par;
|
145 |
-
|
146 |
-
|
147 |
-
/*! \}
|
148 |
-
*/
|
149 |
-
|
150 |
-
|
151 |
-
} // end tbb
|
152 |
-
} // end system
|
153 |
-
} // end thrust
|
154 |
-
#endif
|
155 |
-
|
156 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/drawings-to-human/frontend/src/app.d.ts
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
/// <reference types="@sveltejs/kit" />
|
2 |
-
|
3 |
-
// See https://kit.svelte.dev/docs/types#app
|
4 |
-
// for information about these interfaces
|
5 |
-
// and what to do when importing types
|
6 |
-
declare namespace App {
|
7 |
-
interface Locals {
|
8 |
-
userid: string;
|
9 |
-
}
|
10 |
-
|
11 |
-
// interface Platform {}
|
12 |
-
|
13 |
-
// interface Session {}
|
14 |
-
|
15 |
-
// interface Stuff {}
|
16 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/regionclip-demo/detectron2/modeling/proposal_generator/__init__.py
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
# Copyright (c) Facebook, Inc. and its affiliates.
|
2 |
-
from .build import PROPOSAL_GENERATOR_REGISTRY, build_proposal_generator
|
3 |
-
from .rpn import RPN_HEAD_REGISTRY, build_rpn_head, RPN, StandardRPNHead
|
4 |
-
|
5 |
-
__all__ = list(globals().keys())
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CjangCjengh/Sanskrit-TTS/modules.py
DELETED
@@ -1,387 +0,0 @@
|
|
1 |
-
import math
|
2 |
-
import torch
|
3 |
-
from torch import nn
|
4 |
-
from torch.nn import functional as F
|
5 |
-
|
6 |
-
from torch.nn import Conv1d
|
7 |
-
from torch.nn.utils import weight_norm, remove_weight_norm
|
8 |
-
|
9 |
-
import commons
|
10 |
-
from commons import init_weights, get_padding
|
11 |
-
from transforms import piecewise_rational_quadratic_transform
|
12 |
-
|
13 |
-
|
14 |
-
LRELU_SLOPE = 0.1
|
15 |
-
|
16 |
-
|
17 |
-
class LayerNorm(nn.Module):
|
18 |
-
def __init__(self, channels, eps=1e-5):
|
19 |
-
super().__init__()
|
20 |
-
self.channels = channels
|
21 |
-
self.eps = eps
|
22 |
-
|
23 |
-
self.gamma = nn.Parameter(torch.ones(channels))
|
24 |
-
self.beta = nn.Parameter(torch.zeros(channels))
|
25 |
-
|
26 |
-
def forward(self, x):
|
27 |
-
x = x.transpose(1, -1)
|
28 |
-
x = F.layer_norm(x, (self.channels,), self.gamma, self.beta, self.eps)
|
29 |
-
return x.transpose(1, -1)
|
30 |
-
|
31 |
-
|
32 |
-
class ConvReluNorm(nn.Module):
|
33 |
-
def __init__(self, in_channels, hidden_channels, out_channels, kernel_size, n_layers, p_dropout):
|
34 |
-
super().__init__()
|
35 |
-
self.in_channels = in_channels
|
36 |
-
self.hidden_channels = hidden_channels
|
37 |
-
self.out_channels = out_channels
|
38 |
-
self.kernel_size = kernel_size
|
39 |
-
self.n_layers = n_layers
|
40 |
-
self.p_dropout = p_dropout
|
41 |
-
assert n_layers > 1, "Number of layers should be larger than 0."
|
42 |
-
|
43 |
-
self.conv_layers = nn.ModuleList()
|
44 |
-
self.norm_layers = nn.ModuleList()
|
45 |
-
self.conv_layers.append(nn.Conv1d(in_channels, hidden_channels, kernel_size, padding=kernel_size//2))
|
46 |
-
self.norm_layers.append(LayerNorm(hidden_channels))
|
47 |
-
self.relu_drop = nn.Sequential(
|
48 |
-
nn.ReLU(),
|
49 |
-
nn.Dropout(p_dropout))
|
50 |
-
for _ in range(n_layers-1):
|
51 |
-
self.conv_layers.append(nn.Conv1d(hidden_channels, hidden_channels, kernel_size, padding=kernel_size//2))
|
52 |
-
self.norm_layers.append(LayerNorm(hidden_channels))
|
53 |
-
self.proj = nn.Conv1d(hidden_channels, out_channels, 1)
|
54 |
-
self.proj.weight.data.zero_()
|
55 |
-
self.proj.bias.data.zero_()
|
56 |
-
|
57 |
-
def forward(self, x, x_mask):
|
58 |
-
x_org = x
|
59 |
-
for i in range(self.n_layers):
|
60 |
-
x = self.conv_layers[i](x * x_mask)
|
61 |
-
x = self.norm_layers[i](x)
|
62 |
-
x = self.relu_drop(x)
|
63 |
-
x = x_org + self.proj(x)
|
64 |
-
return x * x_mask
|
65 |
-
|
66 |
-
|
67 |
-
class DDSConv(nn.Module):
|
68 |
-
"""
|
69 |
-
Dialted and Depth-Separable Convolution
|
70 |
-
"""
|
71 |
-
def __init__(self, channels, kernel_size, n_layers, p_dropout=0.):
|
72 |
-
super().__init__()
|
73 |
-
self.channels = channels
|
74 |
-
self.kernel_size = kernel_size
|
75 |
-
self.n_layers = n_layers
|
76 |
-
self.p_dropout = p_dropout
|
77 |
-
|
78 |
-
self.drop = nn.Dropout(p_dropout)
|
79 |
-
self.convs_sep = nn.ModuleList()
|
80 |
-
self.convs_1x1 = nn.ModuleList()
|
81 |
-
self.norms_1 = nn.ModuleList()
|
82 |
-
self.norms_2 = nn.ModuleList()
|
83 |
-
for i in range(n_layers):
|
84 |
-
dilation = kernel_size ** i
|
85 |
-
padding = (kernel_size * dilation - dilation) // 2
|
86 |
-
self.convs_sep.append(nn.Conv1d(channels, channels, kernel_size,
|
87 |
-
groups=channels, dilation=dilation, padding=padding
|
88 |
-
))
|
89 |
-
self.convs_1x1.append(nn.Conv1d(channels, channels, 1))
|
90 |
-
self.norms_1.append(LayerNorm(channels))
|
91 |
-
self.norms_2.append(LayerNorm(channels))
|
92 |
-
|
93 |
-
def forward(self, x, x_mask, g=None):
|
94 |
-
if g is not None:
|
95 |
-
x = x + g
|
96 |
-
for i in range(self.n_layers):
|
97 |
-
y = self.convs_sep[i](x * x_mask)
|
98 |
-
y = self.norms_1[i](y)
|
99 |
-
y = F.gelu(y)
|
100 |
-
y = self.convs_1x1[i](y)
|
101 |
-
y = self.norms_2[i](y)
|
102 |
-
y = F.gelu(y)
|
103 |
-
y = self.drop(y)
|
104 |
-
x = x + y
|
105 |
-
return x * x_mask
|
106 |
-
|
107 |
-
|
108 |
-
class WN(torch.nn.Module):
|
109 |
-
def __init__(self, hidden_channels, kernel_size, dilation_rate, n_layers, gin_channels=0, p_dropout=0):
|
110 |
-
super(WN, self).__init__()
|
111 |
-
assert(kernel_size % 2 == 1)
|
112 |
-
self.hidden_channels =hidden_channels
|
113 |
-
self.kernel_size = kernel_size,
|
114 |
-
self.dilation_rate = dilation_rate
|
115 |
-
self.n_layers = n_layers
|
116 |
-
self.gin_channels = gin_channels
|
117 |
-
self.p_dropout = p_dropout
|
118 |
-
|
119 |
-
self.in_layers = torch.nn.ModuleList()
|
120 |
-
self.res_skip_layers = torch.nn.ModuleList()
|
121 |
-
self.drop = nn.Dropout(p_dropout)
|
122 |
-
|
123 |
-
if gin_channels != 0:
|
124 |
-
cond_layer = torch.nn.Conv1d(gin_channels, 2*hidden_channels*n_layers, 1)
|
125 |
-
self.cond_layer = torch.nn.utils.weight_norm(cond_layer, name='weight')
|
126 |
-
|
127 |
-
for i in range(n_layers):
|
128 |
-
dilation = dilation_rate ** i
|
129 |
-
padding = int((kernel_size * dilation - dilation) / 2)
|
130 |
-
in_layer = torch.nn.Conv1d(hidden_channels, 2*hidden_channels, kernel_size,
|
131 |
-
dilation=dilation, padding=padding)
|
132 |
-
in_layer = torch.nn.utils.weight_norm(in_layer, name='weight')
|
133 |
-
self.in_layers.append(in_layer)
|
134 |
-
|
135 |
-
# last one is not necessary
|
136 |
-
if i < n_layers - 1:
|
137 |
-
res_skip_channels = 2 * hidden_channels
|
138 |
-
else:
|
139 |
-
res_skip_channels = hidden_channels
|
140 |
-
|
141 |
-
res_skip_layer = torch.nn.Conv1d(hidden_channels, res_skip_channels, 1)
|
142 |
-
res_skip_layer = torch.nn.utils.weight_norm(res_skip_layer, name='weight')
|
143 |
-
self.res_skip_layers.append(res_skip_layer)
|
144 |
-
|
145 |
-
def forward(self, x, x_mask, g=None, **kwargs):
|
146 |
-
output = torch.zeros_like(x)
|
147 |
-
n_channels_tensor = torch.IntTensor([self.hidden_channels])
|
148 |
-
|
149 |
-
if g is not None:
|
150 |
-
g = self.cond_layer(g)
|
151 |
-
|
152 |
-
for i in range(self.n_layers):
|
153 |
-
x_in = self.in_layers[i](x)
|
154 |
-
if g is not None:
|
155 |
-
cond_offset = i * 2 * self.hidden_channels
|
156 |
-
g_l = g[:,cond_offset:cond_offset+2*self.hidden_channels,:]
|
157 |
-
else:
|
158 |
-
g_l = torch.zeros_like(x_in)
|
159 |
-
|
160 |
-
acts = commons.fused_add_tanh_sigmoid_multiply(
|
161 |
-
x_in,
|
162 |
-
g_l,
|
163 |
-
n_channels_tensor)
|
164 |
-
acts = self.drop(acts)
|
165 |
-
|
166 |
-
res_skip_acts = self.res_skip_layers[i](acts)
|
167 |
-
if i < self.n_layers - 1:
|
168 |
-
res_acts = res_skip_acts[:,:self.hidden_channels,:]
|
169 |
-
x = (x + res_acts) * x_mask
|
170 |
-
output = output + res_skip_acts[:,self.hidden_channels:,:]
|
171 |
-
else:
|
172 |
-
output = output + res_skip_acts
|
173 |
-
return output * x_mask
|
174 |
-
|
175 |
-
def remove_weight_norm(self):
|
176 |
-
if self.gin_channels != 0:
|
177 |
-
torch.nn.utils.remove_weight_norm(self.cond_layer)
|
178 |
-
for l in self.in_layers:
|
179 |
-
torch.nn.utils.remove_weight_norm(l)
|
180 |
-
for l in self.res_skip_layers:
|
181 |
-
torch.nn.utils.remove_weight_norm(l)
|
182 |
-
|
183 |
-
|
184 |
-
class ResBlock1(torch.nn.Module):
|
185 |
-
def __init__(self, channels, kernel_size=3, dilation=(1, 3, 5)):
|
186 |
-
super(ResBlock1, self).__init__()
|
187 |
-
self.convs1 = nn.ModuleList([
|
188 |
-
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=dilation[0],
|
189 |
-
padding=get_padding(kernel_size, dilation[0]))),
|
190 |
-
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=dilation[1],
|
191 |
-
padding=get_padding(kernel_size, dilation[1]))),
|
192 |
-
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=dilation[2],
|
193 |
-
padding=get_padding(kernel_size, dilation[2])))
|
194 |
-
])
|
195 |
-
self.convs1.apply(init_weights)
|
196 |
-
|
197 |
-
self.convs2 = nn.ModuleList([
|
198 |
-
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=1,
|
199 |
-
padding=get_padding(kernel_size, 1))),
|
200 |
-
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=1,
|
201 |
-
padding=get_padding(kernel_size, 1))),
|
202 |
-
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=1,
|
203 |
-
padding=get_padding(kernel_size, 1)))
|
204 |
-
])
|
205 |
-
self.convs2.apply(init_weights)
|
206 |
-
|
207 |
-
def forward(self, x, x_mask=None):
|
208 |
-
for c1, c2 in zip(self.convs1, self.convs2):
|
209 |
-
xt = F.leaky_relu(x, LRELU_SLOPE)
|
210 |
-
if x_mask is not None:
|
211 |
-
xt = xt * x_mask
|
212 |
-
xt = c1(xt)
|
213 |
-
xt = F.leaky_relu(xt, LRELU_SLOPE)
|
214 |
-
if x_mask is not None:
|
215 |
-
xt = xt * x_mask
|
216 |
-
xt = c2(xt)
|
217 |
-
x = xt + x
|
218 |
-
if x_mask is not None:
|
219 |
-
x = x * x_mask
|
220 |
-
return x
|
221 |
-
|
222 |
-
def remove_weight_norm(self):
|
223 |
-
for l in self.convs1:
|
224 |
-
remove_weight_norm(l)
|
225 |
-
for l in self.convs2:
|
226 |
-
remove_weight_norm(l)
|
227 |
-
|
228 |
-
|
229 |
-
class ResBlock2(torch.nn.Module):
|
230 |
-
def __init__(self, channels, kernel_size=3, dilation=(1, 3)):
|
231 |
-
super(ResBlock2, self).__init__()
|
232 |
-
self.convs = nn.ModuleList([
|
233 |
-
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=dilation[0],
|
234 |
-
padding=get_padding(kernel_size, dilation[0]))),
|
235 |
-
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=dilation[1],
|
236 |
-
padding=get_padding(kernel_size, dilation[1])))
|
237 |
-
])
|
238 |
-
self.convs.apply(init_weights)
|
239 |
-
|
240 |
-
def forward(self, x, x_mask=None):
|
241 |
-
for c in self.convs:
|
242 |
-
xt = F.leaky_relu(x, LRELU_SLOPE)
|
243 |
-
if x_mask is not None:
|
244 |
-
xt = xt * x_mask
|
245 |
-
xt = c(xt)
|
246 |
-
x = xt + x
|
247 |
-
if x_mask is not None:
|
248 |
-
x = x * x_mask
|
249 |
-
return x
|
250 |
-
|
251 |
-
def remove_weight_norm(self):
|
252 |
-
for l in self.convs:
|
253 |
-
remove_weight_norm(l)
|
254 |
-
|
255 |
-
|
256 |
-
class Log(nn.Module):
|
257 |
-
def forward(self, x, x_mask, reverse=False, **kwargs):
|
258 |
-
if not reverse:
|
259 |
-
y = torch.log(torch.clamp_min(x, 1e-5)) * x_mask
|
260 |
-
logdet = torch.sum(-y, [1, 2])
|
261 |
-
return y, logdet
|
262 |
-
else:
|
263 |
-
x = torch.exp(x) * x_mask
|
264 |
-
return x
|
265 |
-
|
266 |
-
|
267 |
-
class Flip(nn.Module):
|
268 |
-
def forward(self, x, *args, reverse=False, **kwargs):
|
269 |
-
x = torch.flip(x, [1])
|
270 |
-
if not reverse:
|
271 |
-
logdet = torch.zeros(x.size(0)).to(dtype=x.dtype, device=x.device)
|
272 |
-
return x, logdet
|
273 |
-
else:
|
274 |
-
return x
|
275 |
-
|
276 |
-
|
277 |
-
class ElementwiseAffine(nn.Module):
|
278 |
-
def __init__(self, channels):
|
279 |
-
super().__init__()
|
280 |
-
self.channels = channels
|
281 |
-
self.m = nn.Parameter(torch.zeros(channels,1))
|
282 |
-
self.logs = nn.Parameter(torch.zeros(channels,1))
|
283 |
-
|
284 |
-
def forward(self, x, x_mask, reverse=False, **kwargs):
|
285 |
-
if not reverse:
|
286 |
-
y = self.m + torch.exp(self.logs) * x
|
287 |
-
y = y * x_mask
|
288 |
-
logdet = torch.sum(self.logs * x_mask, [1,2])
|
289 |
-
return y, logdet
|
290 |
-
else:
|
291 |
-
x = (x - self.m) * torch.exp(-self.logs) * x_mask
|
292 |
-
return x
|
293 |
-
|
294 |
-
|
295 |
-
class ResidualCouplingLayer(nn.Module):
|
296 |
-
def __init__(self,
|
297 |
-
channels,
|
298 |
-
hidden_channels,
|
299 |
-
kernel_size,
|
300 |
-
dilation_rate,
|
301 |
-
n_layers,
|
302 |
-
p_dropout=0,
|
303 |
-
gin_channels=0,
|
304 |
-
mean_only=False):
|
305 |
-
assert channels % 2 == 0, "channels should be divisible by 2"
|
306 |
-
super().__init__()
|
307 |
-
self.channels = channels
|
308 |
-
self.hidden_channels = hidden_channels
|
309 |
-
self.kernel_size = kernel_size
|
310 |
-
self.dilation_rate = dilation_rate
|
311 |
-
self.n_layers = n_layers
|
312 |
-
self.half_channels = channels // 2
|
313 |
-
self.mean_only = mean_only
|
314 |
-
|
315 |
-
self.pre = nn.Conv1d(self.half_channels, hidden_channels, 1)
|
316 |
-
self.enc = WN(hidden_channels, kernel_size, dilation_rate, n_layers, p_dropout=p_dropout, gin_channels=gin_channels)
|
317 |
-
self.post = nn.Conv1d(hidden_channels, self.half_channels * (2 - mean_only), 1)
|
318 |
-
self.post.weight.data.zero_()
|
319 |
-
self.post.bias.data.zero_()
|
320 |
-
|
321 |
-
def forward(self, x, x_mask, g=None, reverse=False):
|
322 |
-
x0, x1 = torch.split(x, [self.half_channels]*2, 1)
|
323 |
-
h = self.pre(x0) * x_mask
|
324 |
-
h = self.enc(h, x_mask, g=g)
|
325 |
-
stats = self.post(h) * x_mask
|
326 |
-
if not self.mean_only:
|
327 |
-
m, logs = torch.split(stats, [self.half_channels]*2, 1)
|
328 |
-
else:
|
329 |
-
m = stats
|
330 |
-
logs = torch.zeros_like(m)
|
331 |
-
|
332 |
-
if not reverse:
|
333 |
-
x1 = m + x1 * torch.exp(logs) * x_mask
|
334 |
-
x = torch.cat([x0, x1], 1)
|
335 |
-
logdet = torch.sum(logs, [1,2])
|
336 |
-
return x, logdet
|
337 |
-
else:
|
338 |
-
x1 = (x1 - m) * torch.exp(-logs) * x_mask
|
339 |
-
x = torch.cat([x0, x1], 1)
|
340 |
-
return x
|
341 |
-
|
342 |
-
|
343 |
-
class ConvFlow(nn.Module):
|
344 |
-
def __init__(self, in_channels, filter_channels, kernel_size, n_layers, num_bins=10, tail_bound=5.0):
|
345 |
-
super().__init__()
|
346 |
-
self.in_channels = in_channels
|
347 |
-
self.filter_channels = filter_channels
|
348 |
-
self.kernel_size = kernel_size
|
349 |
-
self.n_layers = n_layers
|
350 |
-
self.num_bins = num_bins
|
351 |
-
self.tail_bound = tail_bound
|
352 |
-
self.half_channels = in_channels // 2
|
353 |
-
|
354 |
-
self.pre = nn.Conv1d(self.half_channels, filter_channels, 1)
|
355 |
-
self.convs = DDSConv(filter_channels, kernel_size, n_layers, p_dropout=0.)
|
356 |
-
self.proj = nn.Conv1d(filter_channels, self.half_channels * (num_bins * 3 - 1), 1)
|
357 |
-
self.proj.weight.data.zero_()
|
358 |
-
self.proj.bias.data.zero_()
|
359 |
-
|
360 |
-
def forward(self, x, x_mask, g=None, reverse=False):
|
361 |
-
x0, x1 = torch.split(x, [self.half_channels]*2, 1)
|
362 |
-
h = self.pre(x0)
|
363 |
-
h = self.convs(h, x_mask, g=g)
|
364 |
-
h = self.proj(h) * x_mask
|
365 |
-
|
366 |
-
b, c, t = x0.shape
|
367 |
-
h = h.reshape(b, c, -1, t).permute(0, 1, 3, 2) # [b, cx?, t] -> [b, c, t, ?]
|
368 |
-
|
369 |
-
unnormalized_widths = h[..., :self.num_bins] / math.sqrt(self.filter_channels)
|
370 |
-
unnormalized_heights = h[..., self.num_bins:2*self.num_bins] / math.sqrt(self.filter_channels)
|
371 |
-
unnormalized_derivatives = h[..., 2 * self.num_bins:]
|
372 |
-
|
373 |
-
x1, logabsdet = piecewise_rational_quadratic_transform(x1,
|
374 |
-
unnormalized_widths,
|
375 |
-
unnormalized_heights,
|
376 |
-
unnormalized_derivatives,
|
377 |
-
inverse=reverse,
|
378 |
-
tails='linear',
|
379 |
-
tail_bound=self.tail_bound
|
380 |
-
)
|
381 |
-
|
382 |
-
x = torch.cat([x0, x1], 1) * x_mask
|
383 |
-
logdet = torch.sum(logabsdet * x_mask, [1,2])
|
384 |
-
if not reverse:
|
385 |
-
return x, logdet
|
386 |
-
else:
|
387 |
-
return x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CofAI/chat/client/js/change-language.js
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
document.addEventListener('DOMContentLoaded', fetchLanguages);
|
2 |
-
|
3 |
-
async function fetchLanguages() {
|
4 |
-
try {
|
5 |
-
const [languagesResponse, currentLanguageResponse] = await Promise.all([
|
6 |
-
fetch(`${url_prefix}/get-languages`),
|
7 |
-
fetch(`${url_prefix}/get-locale`)
|
8 |
-
]);
|
9 |
-
|
10 |
-
const languages = await languagesResponse.json();
|
11 |
-
const currentLanguage = await currentLanguageResponse.text();
|
12 |
-
|
13 |
-
const languageSelect = document.getElementById('language');
|
14 |
-
languages.forEach(lang => {
|
15 |
-
const option = document.createElement('option');
|
16 |
-
option.value = lang;
|
17 |
-
option.textContent = lang;
|
18 |
-
languageSelect.appendChild(option);
|
19 |
-
});
|
20 |
-
|
21 |
-
const savedLanguage = localStorage.getItem("language") || currentLanguage;
|
22 |
-
setLanguageOnPageLoad(savedLanguage);
|
23 |
-
} catch (error) {
|
24 |
-
console.error("Failed to fetch languages or current language");
|
25 |
-
}
|
26 |
-
}
|
27 |
-
|
28 |
-
function setLanguageOnPageLoad(language) {
|
29 |
-
document.getElementById("language").value = language;
|
30 |
-
}
|
31 |
-
|
32 |
-
function changeLanguage(lang) {
|
33 |
-
fetch(`${url_prefix}/change-language`, {
|
34 |
-
method: "POST",
|
35 |
-
headers: {
|
36 |
-
"Content-Type": "application/json",
|
37 |
-
},
|
38 |
-
body: JSON.stringify({ language: lang }),
|
39 |
-
}).then((response) => {
|
40 |
-
if (response.ok) {
|
41 |
-
localStorage.setItem("language", lang);
|
42 |
-
location.reload();
|
43 |
-
} else {
|
44 |
-
console.error("Failed to change language");
|
45 |
-
}
|
46 |
-
});
|
47 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Cran-May/ygVI/README.md
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: 玉刚六号改-Chat
|
3 |
-
emoji: 🌍
|
4 |
-
colorFrom: indigo
|
5 |
-
colorTo: blue
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.38.0
|
8 |
-
app_file: app.py
|
9 |
-
pinned: true
|
10 |
-
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|