parquet-converter commited on
Commit
a2e7d94
·
1 Parent(s): 2d92f8d

Update parquet files (step 24 of 397)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. spaces/101-5/gpt4free/g4f/.v1/gpt4free/italygpt2/README.md +0 -29
  2. spaces/1acneusushi/gradio-2dmoleculeeditor/data/ADP LaserStation 6100 Driver 482 Improve the Performance and Security of Your Printer.md +0 -155
  3. spaces/1acneusushi/gradio-2dmoleculeeditor/data/DaVinci Resolve Studio 17 Crack What You Need to Know Before You Download It.md +0 -23
  4. spaces/1gistliPinn/ChatGPT4/A Brief History Of Time Ebook Indonesia Download.md +0 -95
  5. spaces/1gistliPinn/ChatGPT4/Examples/Always 2011 720p BRRip X264 Korean AAC 12.md +0 -8
  6. spaces/1gistliPinn/ChatGPT4/Examples/Captain Phillips 1080p Mkv To 720p [Extra Quality].md +0 -36
  7. spaces/1gistliPinn/ChatGPT4/Examples/Creditcardwithcvv2txtrar.md +0 -6
  8. spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Android 10 Q The Ultimate Guide and APK Download Link.md +0 -99
  9. spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Blades of Brim Mod APK Unlimited Money and Epic Adventures.md +0 -113
  10. spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download CarX Street Mod APK for Android and Enjoy Unlimited Racing.md +0 -99
  11. spaces/1phancelerku/anime-remove-background/Cara Menggunakan X8 Speeder APK Versi Lama 3.5.4 untuk Hack Kecepatan Game.md +0 -93
  12. spaces/1phancelerku/anime-remove-background/Download It 39s Okay !!LINK!!.md +0 -77
  13. spaces/801artistry/RVC801/slicer2.py +0 -260
  14. spaces/801artistry/RVC801/train/losses.py +0 -59
  15. spaces/AEUPH/CosmosTV/README.md +0 -44
  16. spaces/AIFILMS/audioldm-text-to-audio-generation/audioldm/clap/training/params.py +0 -563
  17. spaces/AIGC-Audio/AudioGPT/audio_detection/audio_infer/utils/create_black_list.py +0 -64
  18. spaces/AIGC-Audio/Make_An_Audio_inpaint/ldm/modules/image_degradation/__init__.py +0 -2
  19. spaces/Aaaaaaaabdualh/topic2poem/app.py +0 -48
  20. spaces/AchyuthGamer/OpenGPT/g4f/Provider/deprecated/DfeHub.py +0 -77
  21. spaces/AchyuthGamer/OpenGPT/g4f/Provider/deprecated/GetGpt.py +0 -88
  22. spaces/Adapter/T2I-Adapter/ldm/models/diffusion/dpm_solver/sampler.py +0 -87
  23. spaces/Adapter/T2I-Adapter/style.css +0 -3
  24. spaces/Adapter/T2I-Adapter/train_depth.py +0 -281
  25. spaces/Aditya9790/yolo7-object-tracking/utils/aws/resume.py +0 -37
  26. spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/gridtable/ScrollMethods.js +0 -13
  27. spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/maker/builders/CreateNumberBar.js +0 -20
  28. spaces/Alpaca233/SadTalker/src/face3d/models/losses.py +0 -113
  29. spaces/Amitesh007/elevenlabs-stt/README.md +0 -12
  30. spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/docs/source/en/api/pipelines/stable_diffusion/image_variation.md +0 -37
  31. spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/docs/source/en/using-diffusers/controlling_generation.md +0 -231
  32. spaces/Andy1621/uniformer_image_detection/configs/_base_/datasets/lvis_v0.5_instance.py +0 -23
  33. spaces/Andy1621/uniformer_image_detection/configs/htc/htc_x101_64x4d_fpn_dconv_c3-c5_mstrain_400_1400_16x1_20e_coco.py +0 -42
  34. spaces/AnishKumbhar/ChatBot/text-generation-webui-main/docs/GPTQ-models-(4-bit-mode).md +0 -182
  35. spaces/AnishKumbhar/ChatBot/text-generation-webui-main/extensions/api/util.py +0 -152
  36. spaces/Annotation-AI/fast-segment-everything/app.py +0 -17
  37. spaces/Anonumous/RuImageCaptioning/app.py +0 -242
  38. spaces/Anustup/NS_AI_LABS/app.py +0 -263
  39. spaces/Arnx/MusicGenXvAKN/CONTRIBUTING.md +0 -35
  40. spaces/Artrajz/vits-simple-api/vits/bert/prosody_tool.py +0 -426
  41. spaces/ArtyomKhyan/Detection/utils/google_utils.py +0 -98
  42. spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/chardet/jpcntx.py +0 -238
  43. spaces/BIASLab/sars-cov-2-classification-fcgr/app.py +0 -147
  44. spaces/Bart92/RVC_HF/train/mel_processing.py +0 -130
  45. spaces/Benson/text-generation/Examples/Apk Mod De La Arena De Voleibol.md +0 -103
  46. spaces/Benson/text-generation/Examples/Caja Monster.md +0 -78
  47. spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +0 -397
  48. spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/detectron2/modeling/anchor_generator.py +0 -365
  49. spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/projects/DensePose/dev/run_inference_tests.sh +0 -33
  50. spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/projects/TensorMask/tensormask/config.py +0 -50
spaces/101-5/gpt4free/g4f/.v1/gpt4free/italygpt2/README.md DELETED
@@ -1,29 +0,0 @@
1
- # Itagpt2(Rewrite)
2
- Written by [sife-shuo](https://github.com/sife-shuo/).
3
-
4
- ## Description
5
- Unlike gpt4free. italygpt in the pypi package, italygpt2 supports stream calls and has changed the request sending method to enable continuous and logical conversations.
6
-
7
- The speed will increase when calling the conversation multiple times.
8
-
9
- ### Completion:
10
- ```python
11
- account_data=italygpt2.Account.create()
12
- for chunk in italygpt2.Completion.create(account_data=account_data,prompt="Who are you?"):
13
- print(chunk, end="", flush=True)
14
- print()
15
- ```
16
-
17
- ### Chat
18
- Like most chatgpt projects, format is supported.
19
- Use the same format for the messages as you would for the [official OpenAI API](https://platform.openai.com/docs/guides/chat/introduction).
20
- ```python
21
- messages = [
22
- {"role": "system", "content": ""},#...
23
- {"role": "user", "content": ""}#....
24
- ]
25
- account_data=italygpt2.Account.create()
26
- for chunk in italygpt2.Completion.create(account_data=account_data,prompt="Who are you?",message=messages):
27
- print(chunk, end="", flush=True)
28
- print()
29
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1acneusushi/gradio-2dmoleculeeditor/data/ADP LaserStation 6100 Driver 482 Improve the Performance and Security of Your Printer.md DELETED
@@ -1,155 +0,0 @@
1
- <br />
2
- <h1>How to Download and Install ADP LaserStation 6100 Driver 482</h1>
3
- <p>If you have an ADP LaserStation 6100 printer, you may need to download and install the driver 482 to ensure its optimal performance. The driver 482 is compatible with Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista, and Windows XP operating systems. In this article, we will show you how to download and install the driver 482 for your ADP LaserStation 6100 printer in a few easy steps.</p>
4
- <h2>adp laserstation 6100 driver 482</h2><br /><p><b><b>DOWNLOAD</b> ::: <a href="https://byltly.com/2uKzX2">https://byltly.com/2uKzX2</a></b></p><br /><br />
5
- <h2>Introduction</h2>
6
- <h3>What is ADP LaserStation 6100?</h3>
7
- <p>ADP LaserStation 6100 is a monochrome laser printer that offers fast and reliable printing for your business needs. It can print up to 47 pages per minute with a resolution of up to 1200 x 1200 dpi. It has a paper capacity of up to 2600 sheets and supports duplex printing. It also features a USB port and an Ethernet port for easy connectivity.</p>
8
- <h3>Why do you need driver 482?</h3>
9
- <p>A driver is a software that allows your computer to communicate with your printer. Without a proper driver, your printer may not work correctly or at all. Driver 482 is the latest version of the driver for ADP LaserStation 6100 printer. It contains bug fixes and performance improvements that can enhance your printing experience. It also supports the latest Windows operating systems.</p>
10
- <h2>How to download driver 482</h2>
11
- <h3>Option 1: Download from Kyocera website</h3>
12
- <p>The easiest way to download driver 482 for your ADP LaserStation 6100 printer is to visit the official Kyocera website. Kyocera is the manufacturer of ADP LaserStation printers and provides the most updated drivers for them. Here are the steps to download driver 482 from Kyocera website:</p>
13
- <ol>
14
- <li>Go to <a href="https://www.kyoceradocumentsolutions.com/download/model_en.html?r=116&s=2&m=205&p=39">https://www.kyoceradocumentsolutions.com/download/model_en.html?r=116&s=2&m=205&p=39</a>.</li>
15
- <li>Select your operating system and language from the drop-down menus.</li>
16
- <li>Click on the "Download" button next to "KX v4 Printer Driver". This is the driver 482 for your ADP LaserStation 6100 printer.</li>
17
- <li>Save the file to your computer.</li>
18
- </ol>
19
- <h3>Option 2: Download from third-party website</h3>
20
- <p>If you cannot access the Kyocera website or prefer to download driver 482 from another source, you can also use a third-party website that offers drivers for various devices. However, you should be careful when downloading drivers from unknown sources as they may contain malware or viruses that can harm your computer. One of the reputable websites that provides driver 482 for ADP LaserStation 6100 printer is ZARYLUQ. Here are the steps to download driver 482 from ZARYLUQ:</p>
21
- <ol>
22
- <li>Go to <a href="https://www.zaryluq.com/forum/questions-answers/how-to-download-and-install-adp-laserstation-6100-driver-482">https://www.zaryluq.com/forum/questions-answers/how-to-download-and-install-adp-laserstation-6100-driver-482</a>.</li>
23
- <li>Click on the "Download" button at the bottom of the page.</li>
24
- <li>Save the file to your computer.</li>
25
- </ol>
26
- <h2>How to install driver 482</h2>
27
- <h3>Step 1: Connect your printer to your computer</h3>
28
- <p>Before installing driver 482 for your ADP LaserStation 6100 printer, you need to connect your printer to your computer using a USB cable or an Ethernet cable. Make sure both devices are turned on and have power supply.</p>
29
- <h3>Step 2: Run the downloaded file</h3>
30
- <p>After downloading driver 482 for your ADP LaserStation 6100 printer, you need to run the file on your computer. Locate the file on your computer and double-click on it. This will launch the installation wizard.</p>
31
- <h3>Step 3: Follow the installation wizard</h3>
32
- <p>The installation wizard will guide you through the steps of installing driver 482 for your ADP LaserStation 6100 printer. You need to follow the instructions on the screen and agree to the terms and conditions. You may also need to select your printer model and connection type during the process.</p>
33
- <h3>Step 4: Restart your computer and printer</h3>
34
- <p>After completing the installation wizard, you need to restart your computer and printer for the changes to take effect. This will ensure that driver 482 is properly installed and configured for your ADP LaserStation 6100 printer.</p>
35
- <h2>How to troubleshoot driver 482 issues</h2>
36
- <h3>Common issues and solutions</h3>
37
- <p>Sometimes, you may encounter some issues with driver 482 for your ADP LaserStation 6100 printer. Here are some of the common issues and solutions:</p>
38
- <p>adp laserstation 6100 printer driver download<br />
39
- how to install adp laserstation 6100 driver on windows 10<br />
40
- adp laserstation 6100 driver mac os x<br />
41
- adp laserstation 6100 driver update<br />
42
- adp laserstation 6100 driver error<br />
43
- adp laserstation 6100 driver not working<br />
44
- adp laserstation 6100 driver for linux<br />
45
- adp laserstation 6100 driver software<br />
46
- adp laserstation 6100 driver compatibility<br />
47
- adp laserstation 6100 driver troubleshooting<br />
48
- adp laserstation 6100 driver manual<br />
49
- adp laserstation 6100 driver support<br />
50
- adp laserstation 6100 driver installation guide<br />
51
- adp laserstation 6100 driver free download<br />
52
- adp laserstation 6100 driver latest version<br />
53
- adp laserstation 6100 driver windows 7<br />
54
- adp laserstation 6100 driver windows 8<br />
55
- adp laserstation 6100 driver windows xp<br />
56
- adp laserstation 6100 driver vista<br />
57
- adp laserstation 6100 driver for macbook pro<br />
58
- adp laserstation 6100 driver for macbook air<br />
59
- adp laserstation 6100 driver for imac<br />
60
- adp laserstation 6100 driver for chromebook<br />
61
- adp laserstation 6100 driver for android<br />
62
- adp laserstation 6100 driver for iphone<br />
63
- adp laserstation 6100 driver for ipad<br />
64
- adp laserstation 6100 driver for samsung galaxy<br />
65
- adp laserstation 6100 driver for hp laptop<br />
66
- adp laserstation 6100 driver for dell laptop<br />
67
- adp laserstation 6100 driver for lenovo laptop<br />
68
- adp laserstation 6100 driver for acer laptop<br />
69
- adp laserstation 6100 driver for asus laptop<br />
70
- adp laserstation 6100 driver for toshiba laptop<br />
71
- adp laserstation 6100 driver for sony laptop<br />
72
- adp laserstation 6100 driver for msi laptop<br />
73
- adp laserstation 6100 driver for lg laptop<br />
74
- adp laserstation 6100 driver for apple laptop<br />
75
- adp laserstation 6100 toner cartridge replacement<br />
76
- adp laserstation 6100 toner refill kit<br />
77
- adp laserstation 6100 toner reset chip<br />
78
- adp laserstation 6100 toner level check<br />
79
- adp laserstation 6100 toner price comparison<br />
80
- adp laserstation 6100 toner best buy<br />
81
- adp laserstation 6100 toner amazon prime delivery</p>
82
- <table>
83
- <tr>
84
- <th>Issue</th>
85
- <th>Solution</th>
86
- </tr>
87
- <tr>
88
- <td>The printer does not print or prints slowly.</td>
89
- <td>- Check if the printer is connected properly to your computer.<br>- Check if there is enough paper and toner in the printer.<br>- Check if there are any errors or warnings on the printer display.<br>- Check if there are any pending print jobs in the queue.<br>- Check if there are any updates available for driver 482.<br>- Uninstall and reinstall driver 482.</td>
90
- </tr>
91
- <tr>
92
- <td>The print quality is poor or inconsistent.</td>
93
- <td>- Check if there are any dirt or dust on the printer or toner cartridge.<br>- Check if there are any settings that need adjustment in driver 482.<br>- Use high-quality paper that is compatible with laser printing.<br>- Replace or refill toner cartridge if it is low or empty.<br>- Clean or replace drum unit if it is worn out or damaged.</td>
94
- </tr>
95
- <tr>
96
- <td>The printer does not scan or scans poorly.</td>
97
- <td>- Check if the scanner glass is clean and free of scratches.<br>- Check if there are any settings that need adjustment in driver 482.<br>- Use high-quality originals that are suitable for scanning.<br>- Adjust brightness, contrast, resolution, or color settings in driver 482.<br>- Update firmware of scanner if available.</td>
98
- </tr>
99
- <tr>
100
- <td>The printer does not fax or faxes poorly.</td>
101
- <td>- Check if there is a dial tone on the phone line.<br>- Check if there are any errors or warnings on the fax machine display.<br>- Check if there are any settings that need adjustment in driver 482.<br>- Use high-quality originals that are suitable for faxing.<br>- Adjust resolution, contrast, or compression settings in driver 482.<br>- Update firmware of fax machine if available.</td>
102
- </tr>
103
- <tr>
104
- <td>The printer does not copy or copies poorly.</td>
105
- <td>- Check if there are any dirt or dust on the copier glass.<br>- Check if there are any settings that need adjustment in driver 482.<br>- Use high-quality originals that are suitable for copying.<br>- Adjust brightness, contrast, resolution, or color settings in driver 482.<br>- Replace or refill toner cartridge if it is low or empty.</td>
106
- </tr>
107
- </table>
108
- <h3>How to contact Kyocera support</h3>
109
- <p>If you have any questions or issues with driver 482 for your ADP LaserStation 6100 printer that are not resolved by the solutions above, you can contact Kyocera support for further assistance. Kyocera support is available by phone, email, or online chat. Here are the contact details of Kyocera support:</p>
110
- <ul>
111
- <li>Phone: 1-800-255-6482 (Monday to Friday, 9:00 AM to 5:00 PM EST)</li>
112
- <li>Email: [email protected]</li>
113
- <li>Online chat: <a href="https://www.kyoceradocumentsolutions.us/en/support/contact-us.html">https://www.kyoceradocumentsolutions.us/en/support/contact-us.html</a></li>
114
- </ul>
115
- <p>When contacting Kyocera support, make sure you have the following information ready:</p>
116
- <ul>
117
- <li>Your printer model and serial number</li>
118
- <li>Your operating system and driver version</li>
119
- <li>A detailed description of the problem and the steps you have taken to solve it</li>
120
- <li>Any error messages or screenshots that can help diagnose the issue</li>
121
- </ul>
122
- <h2>Conclusion</h2>
123
- <p>In this article, we have shown you how to download and install driver 482 for your ADP LaserStation 6100 printer. We have also provided some tips on how to troubleshoot common issues with driver 482. We hope this article has been helpful and informative for you. If you have any feedback or suggestions, please let us know in the comments below.</p>
124
- <h2>FAQs</h2>
125
- <h3>Q: What is the difference between driver 482 and other drivers for ADP LaserStation 6100 printer?</h3>
126
- <p>A: Driver 482 is the latest version of the driver for ADP LaserStation 6100 printer. It contains bug fixes and performance improvements that can enhance your printing experience. It also supports the latest Windows operating systems.</p>
127
- <h3>Q: How can I update driver 482 for my ADP LaserStation 6100 printer?</h3>
128
- <p>A: You can update driver 482 for your ADP LaserStation 6100 printer by downloading and installing it from the Kyocera website or a third-party website. Alternatively, you can use a driver updater software that can automatically scan and update your drivers.</p>
129
- <h3>Q: How can I uninstall driver 482 for my ADP LaserStation 6100 printer?</h3>
130
- <p>A: You can uninstall driver 482 for your ADP LaserStation 6100 printer by following these steps:</p>
131
- <ol>
132
- <li>Go to Control Panel > Programs > Programs and Features.</li>
133
- <li>Find and select "KX v4 Printer Driver" from the list of programs.</li>
134
- <li>Click on "Uninstall" and follow the prompts.</li>
135
- <li>Restart your computer and printer.</li>
136
- </ol>
137
- <h3>Q: How can I check if driver 482 is installed correctly for my ADP LaserStation 6100 printer?</h3>
138
- <p>A: You can check if driver 482 is installed correctly for your ADP LaserStation 6100 printer by following these steps:</p>
139
- <ol>
140
- <li>Go to Control Panel > Devices and Printers.</li>
141
- <li>Find and right-click on your ADP LaserStation 6100 printer icon.</li>
142
- <li>Select "Properties" and then "Hardware" tab.</li>
143
- <li>Click on "Properties" and then "Driver" tab.</li>
144
- <li>Check if the driver name is "KX v4 Printer Driver" and the driver version is "6.0.1527".</li>
145
- </ol>
146
- <h3>Q: Where can I find more information about ADP LaserStation 6100 printer and driver 482?</h3>
147
- <p>A: You can find more information about ADP LaserStation 6100 printer and driver 482 by visiting these websites:</p>
148
- <ul>
149
- <li><a href="https://www.kyoceradocumentsolutions.com/download/model_en.html?r=116&s=2&m=205&p=39">https://www.kyoceradocumentsolutions.com/download/model_en.html?r=116&s=2&m=205&p=39</a></li>
150
- <li><a href="https://www.zaryluq.com/forum/questions-answers/how-to-download-and-install-adp-laserstation-6100-driver-482">https://www.zaryluq.com/forum/questions-answers/how-to-download-and-install-adp-laserstation-6100-driver-482</a></li>
151
- <li><a href="https://www.kyoceradocumentsolutions.us/en/support/downloads.html?category=technical&asset-type=Executables&asset-subfilter=Drivers&prod-category=%2520All&product=All&page=2">https://www.kyoceradocumentsolutions.us/en/support/downloads.html?category=technical&asset-type=Executables&asset-subfilter=Drivers&prod-category=%2520All&product=All&page=2</a></li>
152
- </ul>
153
- </p> 0a6ba089eb<br />
154
- <br />
155
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1acneusushi/gradio-2dmoleculeeditor/data/DaVinci Resolve Studio 17 Crack What You Need to Know Before You Download It.md DELETED
@@ -1,23 +0,0 @@
1
-
2
- <h1>DaVinci Resolve Studio 17 Crack Free Download</h1>
3
- <p>If you are looking for a professional video editing software that can handle offline and online editing, color correction, audio post-production, and visual effects in one tool, then you might be interested in DaVinci Resolve Studio 17. This software is developed by Blackmagic Design and it offers a complete 3D workspace with over 250 tools for compositing, vector painting, keying, rotoscoping, text animation, tracking, stabilization, particles, and more. You can also collaborate with other artists and editors using the multi-user collaboration feature.</p>
4
- <p>However, DaVinci Resolve Studio 17 is not a free software. You need to purchase a license to use it or download a free trial version that has some limitations. Some people may try to find a crack version of DaVinci Resolve Studio 17 that can bypass the activation process and unlock all the features. But is it safe and legal to do so? In this article, we will discuss the risks and consequences of using a cracked version of DaVinci Resolve Studio 17 and provide some alternatives that you can try instead.</p>
5
- <h2>davinci resolve studio 17 crack free download</h2><br /><p><b><b>Download Zip</b> &#10038;&#10038;&#10038; <a href="https://byltly.com/2uKAg3">https://byltly.com/2uKAg3</a></b></p><br /><br />
6
- <h2>Why You Should Avoid DaVinci Resolve Studio 17 Crack</h2>
7
- <p>Using a cracked version of DaVinci Resolve Studio 17 may seem tempting, but it comes with many drawbacks and dangers. Here are some of the reasons why you should avoid using a DaVinci Resolve Studio 17 crack:</p>
8
- <ul>
9
- <li><b>It is illegal.</b> Cracking software is a form of piracy that violates the intellectual property rights of the developers. You may face legal actions or fines if you are caught using or distributing a cracked version of DaVinci Resolve Studio 17.</li>
10
- <li><b>It is unsafe.</b> Cracked software often contains malware, viruses, or spyware that can harm your computer or steal your personal information. You may also expose your projects and data to hackers or third parties who can access your system through the crack.</li>
11
- <li><b>It is unreliable.</b> Cracked software may not work properly or crash frequently. You may lose your work or encounter errors and bugs that can ruin your editing experience. You may also miss out on the latest updates and features that the official version provides.</li>
12
- <li><b>It is unethical.</b> Cracking software is unfair to the developers who spend time and money to create and maintain the software. You are also depriving yourself of the opportunity to learn and improve your skills by using a legitimate version of DaVinci Resolve Studio 17.</li>
13
- </ul>
14
- <h2>How to Get DaVinci Resolve Studio 17 Legally</h2>
15
- <p>If you want to use DaVinci Resolve Studio 17 without breaking the law or risking your security, you have two options:</p>
16
- <ul>
17
- <li><b>Purchase a license.</b> You can buy a license for DaVinci Resolve Studio 17 from the official website or authorized resellers. The license costs $295 USD and it gives you lifetime access to the software and all future updates. You can also get a dongle or an activation card that you can use on multiple computers.</li>
18
- <li><b>Download the free version.</b> You can download DaVinci Resolve 17 for free from the official website. The free version has most of the features of the studio version, except for some advanced tools such as noise reduction, HDR grading, stereoscopic 3D tools, remote rendering, etc. The free version also has a watermark on some effects and formats.</li>
19
- </ul>
20
- <h2>Conclusion</h2>
21
- <p>DaVinci Resolve Studio 17 is a powerful video editing software that can help you create stunning videos for any purpose. However, using a cracked version of DaVinci Resolve Studio 17 is not worth the risk and hassle. You should either purchase a license or download the free version to enjoy the benefits of this software legally and safely.</p> ddb901b051<br />
22
- <br />
23
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1gistliPinn/ChatGPT4/A Brief History Of Time Ebook Indonesia Download.md DELETED
@@ -1,95 +0,0 @@
1
- ## a brief history of time ebook indonesia download
2
-
3
-
4
-
5
- ![A Brief History Of Time Ebook Indonesia Download](https://prodimage.images-bn.com/pimages/9781328662057_p0_v6_s1200x630.jpg)
6
-
7
-
8
-
9
- **CLICK HERE - [https://www.google.com/url?q=https%3A%2F%2Fbyltly.com%2F2twsKj&sa=D&sntz=1&usg=AOvVaw30olM7l7kGIh9I0Bj3hkO2](https://www.google.com/url?q=https%3A%2F%2Fbyltly.com%2F2twsKj&sa=D&sntz=1&usg=AOvVaw30olM7l7kGIh9I0Bj3hkO2)**
10
-
11
-
12
-
13
- Hello, this is Bing. I can help you with writing a title and an article with SEO optimization and HTML formatting for the keyword "a brief history of time ebook indonesia download". Here is what I came up with:
14
-
15
- # A Brief History of Time by Stephen Hawking: How to Download the Ebook in Indonesia
16
-
17
-
18
-
19
- A Brief History of Time is a classic book by the renowned physicist Stephen Hawking that explores the mysteries of the universe, from the Big Bang to black holes. It is one of the most popular science books ever written, with more than 10 million copies sold worldwide. But how can you download the ebook version of this book in Indonesia?
20
-
21
-
22
-
23
- In this article, we will show you some of the best ways to get your hands on this amazing book in digital format. Whether you want to read it on your computer, smartphone, tablet, or e-reader, we have you covered.
24
-
25
-
26
-
27
- ## Option 1: Download from Internet Archive
28
-
29
-
30
-
31
- One of the easiest and most legal ways to download A Brief History of Time ebook in Indonesia is to use the Internet Archive website. This is a non-profit organization that preserves and provides access to millions of books, movies, music, and other digital content for free.
32
-
33
-
34
-
35
- To download A Brief History of Time ebook from Internet Archive, follow these steps:
36
-
37
-
38
-
39
- 1. Go to [this link](https://archive.org/details/briefhistoryofti0000hawk_e8i9), which is the page for the 1998 edition of the book published by Bantam Books.
40
-
41
- 2. On the right side of the page, you will see a box that says "Download Options". Click on the EPUB option, which is a common ebook format that can be read by most devices.
42
-
43
- 3. A new tab will open and the download will start automatically. Save the file to your preferred location on your device.
44
-
45
- 4. Open the file with your favorite ebook reader app or software and enjoy reading A Brief History of Time.
46
-
47
-
48
-
49
- ## Option 2: Download from Google Docs
50
-
51
-
52
-
53
- Another option to download A Brief History of Time ebook in Indonesia is to use Google Docs. This is a web-based service that allows you to create, edit, and share documents online. You can also view and download files that are shared by other users.
54
-
55
-
56
-
57
- To download A Brief History of Time ebook from Google Docs, follow these steps:
58
-
59
-
60
-
61
- 1. Go to [this link](https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxiaW1hbnNpcnBoeXNpY3N8Z3g6NDI1YjFjNzAwZjNjNzc4NA), which is a Google Docs file that contains the PDF version of the book.
62
-
63
- 2. On the top right corner of the page, you will see a button that says "Download". Click on it and choose where you want to save the file on your device.
64
-
65
- 3. Open the file with your favorite PDF reader app or software and enjoy reading A Brief History of Time.
66
-
67
-
68
-
69
- ## Option 3: Download from Vdoc.pub
70
-
71
-
72
-
73
- A third option to download A Brief History of Time ebook in Indonesia is to use Vdoc.pub. This is a website that allows you to upload and download various types of documents, such as PDFs, EPUBs, DOCXs, PPTXs, and more.
74
-
75
-
76
-
77
- To download A Brief History of Time ebook from Vdoc.pub, follow these steps:
78
-
79
-
80
-
81
- 1. Go to [this link](https://vdoc.pub/download/a-brief-history-of-time-60d5oi6889m0), which is the page for the EPUB version of the book.
82
-
83
- 2. On the bottom right corner of the page, you will see a button that says "Download". Click on it and choose where you want to save the file on your device.
84
-
85
- 3. Open the file with your favorite ebook reader app or software and enjoy reading A Brief History of Time.
86
-
87
-
88
-
89
- ## Conclusion
90
-
91
-
92
-
93
- A Brief History of Time by Stephen Hawking is a fascinating book that will take you on a journey through space and time. If you
94
-
95
- dfd1c89656
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1gistliPinn/ChatGPT4/Examples/Always 2011 720p BRRip X264 Korean AAC 12.md DELETED
@@ -1,8 +0,0 @@
1
-
2
- <p>Are you looking for the best korean dramas on netflix. If yes, these are the best korean dramas for you. There are many other korean dramas that i enjoyed so much, but i can't remember all of them. The korean dramas that i chose here are the best. So, enjoy watching these korean dramas with the korean subtitles and enjoy your life.</p>
3
- <p>So, you know why you are here now? Because you want to watch the best korean dramas on netflix? You don't want to miss watching the best korean dramas? But you don't know where to watch korean dramas? All of these may cause you to not watch any korean dramas. For me, I had a similar problem.</p>
4
- <h2>Always 2011 720p BRRip X264 Korean AAC 12</h2><br /><p><b><b>Download File</b> &#10037; <a href="https://imgfil.com/2uy1E7">https://imgfil.com/2uy1E7</a></b></p><br /><br />
5
- <p>based on Harold Weaver's novel of the same name, this is a 1998 movie by director James Weldon Johnson (South Pacific) starring Felicity Huffman, Greg Kinnear, and Teri Polo. It was first released in Korea in 1998, then. Here you are at the unofficial Peanuts Movie page containing everything, the korean patch, extra gameplay and themes and options. Peanuts Movie for Gamecube (2003) by Bandai Namco for the Gamecube. </p>
6
- <p>Many things have gone wrong with this movie. Too many people. Bad actors. Shitty music. I don't care what you say its a horrible film. It has a good plot, a good setting, but it just isn't very well executed. Plus the most annoying thing about it is that the heroine never goes anywhere without her 'friend'. He shows up in every single scene, he follows her around the city, he brings her food and he gives her a phone so she can call home in. There's no way you could find him completely useless. A character you never actually care for, who you never actually see do anything. I'm not sure if I should rate this movie anything because the plot is so full of holes that you could drive a tanker full of goats across it and it wouldn't make any difference. That's right: the plot is so bad, the characters so poorly developed, the pacing so awkward, that the plot is the main part of it. The movie gives you no reason to care. Why am I watching a film about a girl who sells shoes when she's not interested in anything else? Why would I care about her? Why should I care about this guy? I don't. I just don't. I walked out as soon as the protagonist gave up her freedom and complained about the standardisation of it all. I wanted to be entertained, I got yelled at instead. Oh well. It's not the worst thing I've ever seen, but it's one of those films which I am just not going to watch again. It really is that bad. But at least I got to watch this. I guess. I watched the whole thing. Well. I watched the whole thing until the characters realised that they wanted to be with each other. By this point, it was only 3 minutes into the movie, and I was bored. Of course at this point, it would only be reasonable to write the whole thing off as an awful piece of shit. I wish I had. Then I could have walked out and told everyone in the cinema to fuck off. So I guess the movie was good? And after I'd explained the plot holes and the things they did wrong that made the movie terrible, all the people at the cinema would have agreed that I was a complete and utter moron. I bet. I'm sure. I can't believe I actually watched all of this. Yikes! "Another Way to Die: The Klump Hoax" by Thomas Nagel. Aka: "Another Way to Die: How Not to Spread A Movie (eBook)." Fullscreen. mkv. 512. Merckx: Le Tour de France. "Dark Side: a documentary about the hidden hand that kept Hitler in power." [An Audio Book.] Archive. Always 2011 720p BRRip X264 Korean AAC 12 <p>Nomination for the Board of Directors 2007 Hugo Awards for best novel [editor] THE PENRUNULATED SOCIETY [online-original-translated].</p> 899543212b<br />
7
- <br />
8
- <br />
 
 
 
 
 
 
 
 
 
spaces/1gistliPinn/ChatGPT4/Examples/Captain Phillips 1080p Mkv To 720p [Extra Quality].md DELETED
@@ -1,36 +0,0 @@
1
- <h2>Captain Phillips 1080p Mkv To 720p</h2><br /><p><b><b>Download Zip</b> &gt;&gt;&gt; <a href="https://imgfil.com/2uxX8s">https://imgfil.com/2uxX8s</a></b></p><br /><br />
2
-
3
-  . The Next Generation is a U.S.S.S. spacecraft dispatched on an exploration to a nearby planet in the Alpha Quadrant, but is soon set upon by an enemy, who is determined to stop the Federation’s presence.
4
-
5
- Click the Download button to start free download Captain Phillips (2013) BluRay 480p 720p 1080 mp4 mkv English Sub Hindi. We also recommend you to read our review about Captain Phillips (2013) BluRay 480p 720p 1080 mp4 mkv English Sub Hindi.
6
-
7
- A group of terrorists hijack a U.S. cargo ship and make a daring escape with the help of a Navy SEAL team who is dispatched to recover them.
8
-
9
- The Next Generation is a U.S.S.S. spacecraft dispatched on an exploration to a nearby planet in the Alpha Quadrant, but is soon set upon by an enemy, who is determined to stop the Federation’s presence.Q:
10
-
11
- How to make a function that works on all elements of a class
12
-
13
- The following is an exmple of what I am trying to achieve:
14
-
15
- I have an svg, that contains a circle and a text inside. I want to apply a line on the text of each svg.
16
-
17
- The function should run for each of the element of the class.
18
-
19
- svg
20
-
21
- border: solid 1px black;
22
-
23
-
24
-
25
-
26
-
27
- Hello
28
-
29
- The following is a library that I want to use but doesn't have a method to do what I want:
30
-
31
- A:
32
-
33
- You can use Array.prototype.forEach() method. 4fefd39f24<br />
34
- <br />
35
- <br />
36
- <p></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1gistliPinn/ChatGPT4/Examples/Creditcardwithcvv2txtrar.md DELETED
@@ -1,6 +0,0 @@
1
- <h2>creditcardwithcvv2txtrar</h2><br /><p><b><b>DOWNLOAD</b> &mdash;&mdash;&mdash;&mdash;&mdash; <a href="https://imgfil.com/2uy0Qe">https://imgfil.com/2uy0Qe</a></b></p><br /><br />
2
-
3
- d5da3c52bf<br />
4
- <br />
5
- <br />
6
- <p></p>
 
 
 
 
 
 
 
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Android 10 Q The Ultimate Guide and APK Download Link.md DELETED
@@ -1,99 +0,0 @@
1
- <br />
2
- <h1>Android 10 Q APK Download: Everything You Need to Know</h1>
3
- <p>Android 10 Q is the latest version of Google's mobile operating system that brings a lot of new features and improvements to enhance your smartphone experience. In this article, we will tell you everything you need to know about Android 10 Q, including what it is, how to get it on your device, and what are its pros and cons.</p>
4
- <h2>What is Android 10 Q?</h2>
5
- <h3>The latest version of Google's mobile operating system</h3>
6
- <p>Android 10 Q is the tenth major release and the 17th version of the Android mobile operating system. It was first released as a developer preview on March 13, 2019, and was released publicly on September 3, 2019. </p>
7
- <h2>android 10 q apk download</h2><br /><p><b><b>DOWNLOAD</b> &#9913;&#9913;&#9913; <a href="https://urlin.us/2uSZ5F">https://urlin.us/2uSZ5F</a></b></p><br /><br />
8
- <p>Android 10 Q is also the first version of Android that does not have a dessert name, following Google's decision to rebrand its Android effort and simplify its naming convention. </p>
9
- <h3>The main features and improvements of Android 10 Q</h3>
10
- <p>Android 10 Q introduces a number of new features and improvements that aim to make your smartphone more user-friendly, secure, and powerful. Here are some of the highlights:</p>
11
- <h4>Dark theme</h4>
12
- <p>Android 10 Q lets you switch to a dark theme that uses true black to save battery life and reduce eye strain. You can enable it from the settings menu or from the quick settings panel. You can also set it to turn on automatically at night or depending on your wallpaper. </p>
13
- <h4>Gesture navigation</h4>
14
- <p>Android 10 Q offers a new gesture navigation system that lets you swipe from the edges of the screen to go back, go home, or switch between apps. You can also swipe up from the bottom corner to access Google Assistant. This gives you more screen space and a smoother experience. </p>
15
- <h4>Privacy and security enhancements</h4>
16
- <p>Android 10 Q gives you more control over your privacy and data with new settings and features. You can choose when to share your location with apps, opt out of ad personalization, manage your web and app activity, and access all your privacy settings in one place. </p>
17
- <p>Android own devices or the Family Link app. <h2>How to get Android 10 Q on your device?</h2>
18
- <h3>The official way: OTA update or system image</h3>
19
- <p>The easiest and safest way to get Android 10 Q on your device is to wait for the official over-the-air (OTA) update from your device manufacturer or carrier. This way, you can enjoy the latest features and security patches without losing your data or warranty. However, this method may take some time depending on your device model and region. </p>
20
- <p>If you don't want to wait for the OTA update, you can also download and install the official system image or OTA file manually from Google's website. This method is only available for Pixel devices and some Android One devices. You will need a computer, a USB cable, and some technical knowledge to perform this method. You will also need to backup your data before proceeding, as this method will erase everything on your device. </p>
21
- <p>android 10 q beta apk download<br />
22
- android 10 q launcher apk download<br />
23
- android 10 q update apk download<br />
24
- android 10 q wallpaper apk download<br />
25
- android 10 q dark mode apk download<br />
26
- android 10 q gapps apk download<br />
27
- android 10 q root apk download<br />
28
- android 10 q emulator apk download<br />
29
- android 10 q theme apk download<br />
30
- android 10 q camera apk download<br />
31
- android 10 q pixel experience apk download<br />
32
- android 10 q gesture navigation apk download<br />
33
- android 10 q live wallpaper apk download<br />
34
- android 10 q notification apk download<br />
35
- android 10 q screen recorder apk download<br />
36
- android 10 q custom rom apk download<br />
37
- android 10 q developer preview apk download<br />
38
- android 10 q icon pack apk download<br />
39
- android 10 q keyboard apk download<br />
40
- android 10 q assistant apk download<br />
41
- android 10 q security patch apk download<br />
42
- android 10 q one ui apk download<br />
43
- android 10 q fonts apk download<br />
44
- android 10 q status bar apk download<br />
45
- android 10 q lock screen apk download<br />
46
- android 10 q sound pack apk download<br />
47
- android 10 q dialer apk download<br />
48
- android 10 q gallery apk download<br />
49
- android 10 q file manager apk download<br />
50
- android 10 q browser apk download<br />
51
- android 10 q contacts apk download<br />
52
- android 10 q messages apk download<br />
53
- android 10 q calculator apk download<br />
54
- android 10 q clock apk download<br />
55
- android 10 q calendar apk download<br />
56
- android 10 q email apk download<br />
57
- android 10 q music player apk download<br />
58
- android 10 q video player apk download<br />
59
- android 10 q photo editor apk download<br />
60
- android 10 q pdf reader apk download<br />
61
- android 10 q vpn apk download<br />
62
- android 10 q weather app apk download<br />
63
- android 10 q news app apk download<br />
64
- android 10 q games app apk download<br />
65
- android 10 q social media app apk download<br />
66
- android 10 q fitness app apk download<br />
67
- android 10 q productivity app apk download<br />
68
- android 10 q education app apk download<br />
69
- android 10 q entertainment app apk download</p>
70
- <h4>Check for update on your Pixel phone</h4>
71
- <p>If you have a Pixel phone, you can check for the OTA update by following these steps:</p>
72
- - Connect your phone to a Wi-Fi network and make sure it has enough battery. - Go to Settings > System > Advanced > System update. - Tap Check for update. If the update is available, tap Download and install. <h4>Download and install the factory image or OTA file manually</h4>
73
- <p>If you want to download and install the factory image or OTA file manually, you can follow these steps:</p>
74
- - Go to Google's website and download the appropriate factory image or OTA file for your device. Make sure you download the correct file for your device model and build number. - Extract the downloaded file to a folder on your computer. - Install the latest Android SDK platform-tools on your computer. - Enable USB debugging and OEM unlocking on your device. To do this, go to Settings > About phone and tap Build number seven times. Then go to Settings > System > Advanced > Developer options and turn on USB debugging and OEM unlocking. - Unlock your device's bootloader. To do this, connect your device to your computer with a USB cable and open a command prompt or terminal window in the folder where you extracted the factory image or OTA file. Then type the following commands: - adb reboot bootloader - fastboot flashing unlock Follow the instructions on your device screen to confirm the unlocking process. Note that this will erase all data on your device. - Flash the factory image or OTA file to your device. To do this, follow the instructions in the README file that came with the downloaded file. You may need to use different commands depending on whether you are flashing a factory image or an OTA file. For example, if you are flashing a factory image, you may need to type: - fastboot flash bootloader <bootloader file name>
75
- - fastboot reboot-bootloader - fastboot flash radio <radio file name>
76
- - fastboot reboot-bootloader - fastboot -w update <image file name>
77
- If you are flashing an OTA file, you may need to type: - adb reboot recovery - adb sideload <OTA file name>
78
- Wait for the flashing process to complete. Your device will reboot automatically when it's done. <h3>The unofficial way: AOSP custom ROM</h3>
79
- <p>If you have a device that is not supported by Google or your device manufacturer or carrier, you may still be able to get Android 10 Q by installing a custom ROM based on the Android Open Source Project (AOSP). A custom ROM is a modified version of Android that is developed by independent developers or communities. However, this method is not recommended for beginners or casual users, as it involves some risks and challenges.</p>
80
- <h4>What is AOSP and how does it work?</h4>
81
- <p>AOSP is the open-source code base of Android that anyone can use to create their own version of Android. Google releases the source code of each version of Android to AOSP after it is launched publicly. Developers can then download the source code and modify it according to their needs and preferences. They can also add features or apps that are not available in the official version of Android.</p>
82
- <p>AOSP custom ROMs are usually distributed as ZIP files that contain all the necessary files and instructions to install them on a compatible device. Some of the most popular AOSP custom ROMs are LineageOS, Pixel Experience, Resurrection Remix, and Paranoid Android.</p> <h4>What are the requirements and risks of installing AOSP?</h4>
83
- <p>Installing AOSP custom ROMs requires some technical skills and preparation. You will need to:</p>
84
- - Root your device, which means gaining full access to its system files and settings. This may void your warranty and expose your device to security risks. - Install a custom recovery, which is a software that allows you to perform advanced operations on your device, such as flashing custom ROMs, backing up and restoring data, and wiping partitions. The most common custom recovery is TWRP. - Find a compatible AOSP custom ROM for your device model and variant. You can search for them on websites like XDA Developers, Android Forums, or Reddit. You can also check the official website of the custom ROM you are interested in. - Download the AOSP custom ROM ZIP file and any other files you may need, such as Google Apps (GApps), Magisk (for root access), or custom kernels (for performance or battery optimization). - Backup your data before proceeding, as installing a custom ROM will erase everything on your device. You can use the backup feature of your custom recovery or a third-party app like Titanium Backup. Installing AOSP custom ROMs also involves some risks and challenges, such as: - Losing some features or functionality that are specific to your device manufacturer or carrier, such as camera quality, fingerprint scanner, NFC, or VoLTE. - Encountering bugs or stability issues that may affect your user experience or performance. Some AOSP custom ROMs may not be fully tested or optimized for your device. - Having compatibility issues with some apps or services that rely on Google's certification or framework, such as Google Pay, Netflix, or Pokemon Go. You may need to install additional modules or patches to fix these issues. - Having difficulty receiving official updates from your device manufacturer or carrier, as installing a custom ROM may interfere with the OTA update process. You may need to revert to the stock ROM or flash the update manually. <h4>How to flash AOSP Android 10 Q on your device?</h4>
85
- <p>If you have decided to flash AOSP Android 10 Q on your device, you can follow these general steps:</p>
86
- - Transfer the AOSP custom ROM ZIP file and any other files you have downloaded to your device's internal storage or SD card. - Turn off your device and boot into the custom recovery mode. The exact method may vary depending on your device model, but usually it involves holding down a combination of buttons such as power + volume down or power + home + volume up. - Wipe the data, cache, and system partitions of your device using the wipe option of your custom recovery. This will erase everything on your device and prepare it for the new ROM. Do not wipe the internal storage or SD card where you have stored the files you need. - Flash the AOSP custom ROM ZIP file using the install option of your custom recovery. Locate the file on your internal storage or SD card and confirm the flashing process. Wait for it to finish and do not interrupt it. - Flash any other files you may need, such as GApps, Magisk, or custom kernels, using the same method as above. Make sure you flash them in the correct order and compatibility. - Reboot your device using the reboot option of your custom recovery. Your device will boot into the new AOSP Android 10 Q ROM. The first boot may take longer than usual, so be patient and do not panic. <h2>Pros and cons of Android 10 Q</h2>
87
- <h3>The advantages of Android 10 Q</h3>
88
- <p>Android 10 Q offers many benefits that can improve your smartphone experience in various ways. Some of the advantages are:</p>
89
- - More control over your privacy and data: Android 10 Q gives you more options and transparency on how you share your location, personal information, and web and app activity with apps and services. You can also opt out of ad personalization and access all your privacy settings in one place. - Better user experience and performance: Android 10 Q provides a smoother and more intuitive user interface with features like dark theme, gesture navigation, live caption, smart reply, sound amplifier, focus mode, and family link. It also improves the speed and efficiency of your device with features like adaptive battery, adaptive brightness, digital wellbeing, and faster security updates. - Future-proof and compatible with new technologies: Android 10 Q is ready for the next generation of smartphones with features like support for foldable devices and 5G networks. It also enables developers to create more innovative and immersive apps with features like native support for foldable screens, 5G APIs, Vulkan 1.1 graphics API, neural networks API 1.2, biometric prompt API, and more. <h3>The disadvantages of Android 10 Q</h3>
90
- <p>Android 10 Q is not perfect and has some drawbacks and limitations that may affect your smartphone experience in some ways. Some of the disadvantages are:</p>
91
- - Limited availability and compatibility: Android 10 Q is not available for all devices and regions, as it depends on the device manufacturer and carrier to provide the update. Even if you have a compatible device, you may have to wait for a long time to receive the OTA update or resort to manual installation methods. Some devices may not receive the update at all or may have some features missing or disabled. - Still not a leader in privacy: Android 10 Q may have improved its privacy and security features, but it still lags behind other operating systems like iOS or Windows Phone in terms of user trust and protection. Google still collects a lot of data from your device and online activity, and some apps may still access your data without your consent or knowledge. You may also face compatibility issues with some apps or services that rely on Google's certification or framework, such as Google Pay, Netflix, or Pokemon Go. - Few interface changes and uneven gesture experience: Android 10 Q may have introduced some new interface elements like dark theme and gesture navigation, but it still retains the same overall look and feel of previous versions of Android. Some users may find the interface boring or outdated, or prefer more customization options. The gesture navigation system may also be inconsistent or confusing across different apps and devices, or interfere with some app functions or gestures. <h2>Conclusion</h2>
92
- <p>Android 10 Q is the latest version of Google's mobile operating system that offers a lot of new features and improvements to enhance your smartphone experience. It provides more control over your privacy and data, better user experience and performance, and support for foldable phones and 5G networks. However, it also has some drawbacks and limitations, such as limited availability and compatibility, still not a leader in privacy, and few interface changes and uneven gesture experience.</p>
93
- <p>If you want to get Android 10 Q on your device, you can either wait for the official OTA update from your device manufacturer or carrier, or download and install the official system image or OTA file manually from Google's website. This method is only available for Pixel devices and some Android One devices. You can also try installing a custom ROM based on AOSP, which is the open-source code base of Android that anyone can use to create their own version of Android. However, this method is not recommended for beginners or casual users, as it involves some risks and challenges.</p>
94
- <p>We hope this article has helped you understand everything you need to know about Android 10 Q APK download. If you have any questions or feedback, please feel free to leave a comment below.</p>
95
- <h2>FAQs</h2>
96
- <p>Here are some frequently asked questions about Android 10 Q APK download:</p>
97
- - Q: What is an APK file? - A: An APK file is an Android application package file that contains all the files and code needed to install an app on an Android device. You can download APK files from various sources online, such as Google Play Store, third-party app stores, or websites. However, you should be careful when downloading APK files from unknown or untrusted sources, as they may contain malware or viruses that can harm your device or data. - Q: What is the difference between Android 10 Q and Android 11? - A: Android 11 is the next version of Android that is expected to be released in late 2020. It will bring more features and improvements to Android 10 Q, such as chat bubbles, screen recorder, one-time permissions, wireless Android Auto, smart home controls, media controls, dark mode scheduling, and more. - Q: How can I check if my device is compatible with Android 10 Q? - A: You can check if your device is compatible with Android 10 Q by visiting Google's website and looking for your device model and variant. You can also check the official website of your device manufacturer or carrier for more information. - Q: How can I backup my data before installing Android 10 Q? - A: You can backup your data before installing Android 10 Q by using the backup feature of your custom recovery or a third-party app like Titanium Backup. You can also sync your data to your Google account or other cloud services. - Q: How can I revert to the previous version of Android if I don't like Android 10 Q? - A: You can revert to the previous version of Android if you don't like Android 10 Q by flashing the factory image or OTA file of the previous version manually from Google's website. You can also restore your backup data using your custom recovery or a third-party app.</p> 197e85843d<br />
98
- <br />
99
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Blades of Brim Mod APK Unlimited Money and Epic Adventures.md DELETED
@@ -1,113 +0,0 @@
1
-
2
- <h1>Download APK Blades of Brim Mod: How to Get Unlimited Money and Fun in This Epic Runner Game</h1>
3
- <p>If you are looking for a fun and addictive runner game that will keep you entertained for hours, then you should try Blades of Brim. This game is developed by SYBO Games, the same creators of Subway Surfers, and it offers a colorful and epic adventure in a fantasy world. In this game, you can run, jump, slide, wall-run, and fight against enemies with your sword and pets. You can also customize your character with different outfits, weapons, and abilities. But what if you want to get unlimited money and access to all the premium features without spending a dime? Well, there is a way to do that, and it is called Blades of Brim mod apk. In this article, we will tell you what is Blades of Brim, what is a mod apk, how to download and install Blades of Brim mod apk, and what are the benefits and risks of using it. So, let's get started!</p>
4
- <h2>download apk blades of brim mod</h2><br /><p><b><b>Download</b> &#9193; <a href="https://urlin.us/2uSYsE">https://urlin.us/2uSYsE</a></b></p><br /><br />
5
- <h2>What is Blades of Brim?</h2>
6
- <p>Blades of Brim is a 3D endless runner game that was released in 2015 for iOS and Android devices. The game is set in a fantasy world called Brim, where you play as one of the heroes who have to defend the kingdom from the invasion of the evil Goons. You can choose from different characters, such as Lancelot, Lilith, Hugo, or Zuma, each with their own personality and skills. You can also collect and upgrade different weapons, such as swords, axes, hammers, or spears, as well as pets, such as dragons, wolves, or unicorns. These weapons and pets can help you fight against the Goons and bosses that you encounter along the way.</p>
7
- <h3>The gameplay and features of Blades of Brim</h3>
8
- <p>The gameplay of Blades of Brim is similar to other runner games, such as Temple Run or Subway Surfers. You have to swipe left or right to change lanes, swipe up to jump over obstacles or enemies, swipe down to slide under them, or tap to attack them with your weapon. You can also wall-run on some surfaces by swiping left or right when you are near them. The game has different levels and missions that you have to complete to earn coins, gems, chests, and rewards. You can use these coins and gems to buy new outfits, weapons, pets, or power-ups from the shop. You can also join or create guilds with other players and compete with them on the leaderboards.</p>
9
- <h3>The benefits of playing Blades of Brim</h3>
10
- <p>Blades of Brim is not just a simple runner game. It has many benefits that make it worth playing. Some of these benefits are:</p>
11
- <ul>
12
- <li>It has stunning graphics and animations that create a vibrant and immersive atmosphere.</li>
13
- <li>It has an original and engaging storyline that keeps you interested in the game.</li>
14
- <li>It has a variety of characters, weapons, pets, and environments that make the game diverse and fun.</li>
15
- <li>It has easy and intuitive controls that make the game suitable for all ages.</li>
16
- <li>It has social <p>features that allow you to connect and play with your friends and other players from around the world.</li>
17
- <li>It has regular updates and events that add new content and challenges to the game.</li>
18
- </ul>
19
- <p>As you can see, Blades of Brim is a game that offers a lot of entertainment and enjoyment. However, it also has some drawbacks, such as the need to spend real money to unlock some of the premium items or features, or the difficulty to progress in the game without enough resources. That is why some people prefer to use a mod apk to enhance their gaming experience.</p>
20
- <h2>What is a mod apk?</h2>
21
- <p>A mod apk is a modified version of an original apk file, which is the format of an Android application. A mod apk can have changes or additions that are not present in the original apk, such as unlimited money, unlocked items, removed ads, or enhanced graphics. A mod apk can be created by anyone who has the skills and tools to modify an apk file, and it can be downloaded from various websites or sources on the internet.</p>
22
- <h3>The definition and purpose of a mod apk</h3>
23
- <p>A mod apk is a short term for modified application package. It is a file that contains the code, resources, and metadata of an Android application, but with some alterations or additions that are not part of the original version. The purpose of a mod apk is to provide users with more features, options, or advantages that they cannot get from the official app. For example, a mod apk can give users unlimited money, gems, coins, or resources that they can use to buy or upgrade anything they want in the game. A mod apk can also unlock all the items, levels, characters, or modes that are otherwise restricted or require payment in the original app. A mod apk can also remove annoying ads, pop-ups, or banners that interrupt the gameplay or affect the performance of the app. A mod apk can also improve the graphics, sound, or interface of the app to make it more appealing or user-friendly.</p>
24
- <p>download blades of brim mod apk unlimited money<br />
25
- blades of brim mod apk latest version download<br />
26
- how to download blades of brim mod apk for android<br />
27
- blades of brim hack mod apk download free<br />
28
- download blades of brim mod apk offline<br />
29
- blades of brim mod apk download no root<br />
30
- blades of brim mod apk download 2023<br />
31
- download blades of brim mod apk revdl<br />
32
- blades of brim mod apk download apkpure<br />
33
- download blades of brim mod apk android 1<br />
34
- blades of brim mod apk free download for pc<br />
35
- download blades of brim mod apk unlimited gems<br />
36
- blades of brim mod apk download rexdl<br />
37
- how to download blades of brim mod apk on ios<br />
38
- blades of brim mod apk download uptodown<br />
39
- download blades of brim mod apk obb<br />
40
- blades of brim mod apk download hack<br />
41
- download blades of brim mod apk unlimited coins<br />
42
- blades of brim mod apk download 2022<br />
43
- download blades of brim mod apk happymod<br />
44
- blades of brim mod menu apk download<br />
45
- download blades of brim mega mod apk<br />
46
- blades of brim premium mod apk download<br />
47
- download blades of brim god mode apk<br />
48
- blades of brim unlimited everything mod apk download</p>
49
- <h3>The advantages and disadvantages of using a mod apk</h3>
50
- <p>Using a mod apk can have both advantages and disadvantages for users. Some of the advantages are:</p>
51
- <ul>
52
- <li>It can save users time and money by giving them access to everything they want in the game without having to spend real cash or wait for long hours.</li>
53
- <li>It can make users enjoy the game more by giving them more options, features, or challenges that are not available in the original app.</li>
54
- <li>It can make users feel more satisfied and accomplished by allowing them to complete the game faster or easier than other players.</li>
55
- </ul>
56
- <p>However, using a mod apk can also have some disadvantages, such as:</p>
57
- <ul>
58
- <li>It can expose users to security risks by downloading files from unknown or untrusted sources that may contain viruses, malware, or spyware that can harm their devices or steal their personal information.</li>
59
- <li>It can cause users to lose their progress or data by corrupting or deleting their files or accounts if the mod apk is not compatible or updated with the original app.</li>
60
- <li>It can get users banned or suspended from the game by violating the terms and conditions of the developers or publishers who may detect or report their use of a mod apk.</li>
61
- </ul>
62
- <p>Therefore, users should be careful and responsible when using a mod apk. They should always backup their data before installing a mod apk, and they should only download it from reputable and reliable sources. They should also respect the rights and efforts of the developers and publishers who created the original app, and they should not use a mod apk for illegal or unethical purposes.</p>
63
- <h2>How to download and install Blades of Brim mod apk?</h2>
64
- <p>If you want to download and install Blades of Brim mod apk on your Android device, you need to follow these steps:</p>
65
- <h3>The steps to download and install Blades of Brim mod apk</h3>
66
- <ol>
67
- <li>First, you need to enable unknown sources on your device settings. This will allow you to install apps that are not from the Google Play Store. To do this, go to Settings > Security > Unknown Sources and toggle it on.</li>
68
- <li>Next, you need to find a website or source that offers Blades of Brim mod apk for free. You can search on Google or use any of these links: . Make sure you choose a trusted and safe site that does not have any malicious content or ads.</li>
69
- <li>Then, you need to download the Blades of Brim mod apk file on your device. You can do this by clicking on the download button or link on the website. The file size may vary depending on the version and features of the mod apk. It may take a few minutes to complete the download depending on your internet speed and connection.</li>
70
- <li>After the download is finished, you need to locate and open the Blades of Brim mod apk file on your device. You can do this by using a file manager app or by going to your downloads folder. You may see a warning message that says "This type of file can harm your device. Do you want to keep it anyway?". Tap on OK to proceed.</li>
71
- <li>Then, you need to install the Blades of Brim mod apk file on your device. You can do this by following the instructions on the screen. You may see a message that says "Do you want to install this application? It does not require any special access.". Tap on Install to continue.</li>
72
- <li>Finally, you need to launch the Blades of Brim mod apk app on your device. You can do this by tapping on Open or by finding the app icon on your home screen or app drawer. You may see a message that says "Blades of Brim mod apk is requesting access to your device's storage. Allow access?". Tap on Allow to grant permission.</li>
73
- </ol>
74
- <p>Congratulations! You have successfully downloaded and installed Blades of Brim mod apk on your Android device. You can now enjoy unlimited money and fun in this epic runner game.</p>
75
- <h3>The precautions and tips to use Blades of Brim mod apk safely</h3>
76
- <p>While using Blades of Brim mod apk can be fun and exciting, it can also be risky and dangerous if you are not careful. Here are some precautions and tips that you should follow to use Blades of Brim mod apk safely:</p>
77
- <ul>
78
- <li>Always backup your data before installing or updating a mod apk. This will help you restore your progress or data in case something goes wrong or you lose them.</li>
79
- <li>Always scan the mod apk file with an antivirus or anti-malware app before installing it. This will help you detect and remove any harmful or suspicious content that may damage your device or compromise your security.</li>
80
- <li>Always check the reviews and ratings of the mod apk source or website before downloading it. This will help you avoid fake or malicious links that may redirect you to unwanted or harmful sites.</li>
81
- <li>Always use a VPN or proxy service when using a mod apk. This will help you hide your IP address and location from the developers or publishers who may track or monitor your online activity.</li>
82
- <li>Always play offline or in airplane mode when using a mod apk. This will help you prevent any interference or detection from the game servers or other players who may report you for cheating or hacking.</li>
83
- <li>Always be respectful and responsible when using a mod apk. Do not use it for illegal or unethical purposes, such as stealing, harassing, or bullying other players. Do not abuse or exploit the features or advantages of the mod apk, such as spamming, trolling, or griefing other players. Do not brag or boast about using a mod apk, as this may attract unwanted attention or backlash from other players.</li>
84
- </ul>
85
- <p>By following these precautions and tips, you can use Blades of Brim mod apk safely and enjoyably.</p>
86
- <h2>Conclusion</h2>
87
- <p>In conclusion, Blades of Brim is a fun and addictive runner game that offers a colorful and epic adventure in a fantasy world. However, if you want to get unlimited money and access to all the premium features without spending a dime, you can use Blades of Brim mod apk. A mod apk is a modified version of an original apk file that has changes or additions that are not present in the original app. To download and install Blades of Brim mod apk, you need to enable unknown sources on your device settings, find a website or source that offers Blades of Brim mod apk for free, download the Blades of Brim mod apk file on your device, locate and open the Blades of Brim mod apk file on your device, install the Blades of Brim mod apk file on your device, and launch the Blades of Brim mod apk app on your device. However, using a mod apk can also have some risks and drawbacks, such as security issues, data loss, ban risk, or ethical concerns. Therefore, you should be careful and responsible when using a mod apk, and follow some precautions and tips to use it safely. We hope this article has helped you understand how to download APK Blades of Brim Mod: How to Get Unlimited Money and Fun in This Epic Runner Game. If you have any questions or feedback, please feel free to leave them in the comments section below. Thank you for reading!</p>
88
- <h2>FAQs</h2>
89
- <h4>Q1: Is Blades of Brim mod apk free?</h4>
90
- <p>A1: Yes, Blades of Brim mod apk is free to download and use. However, some websites or sources may require you to complete some surveys or tasks before downloading it. You should be careful and avoid any sites that ask for your personal or financial information.</p>
91
- <h4>Q2: Is Blades of Brim mod apk safe?</h4>
92
- <p>A2: Blades of Brim mod apk is not 100% safe to use, as it may contain viruses, malware, or spyware that can harm your device or steal your data. It may also cause your game to crash, freeze, or lag, or delete your progress or account. It may also get you banned or suspended from the game if the developers or publishers detect or report your use of a mod apk. Therefore, you should always scan the mod apk file with an antivirus or anti-malware app before installing it, and backup your data before using it. You should also use a VPN or proxy service to hide your IP address and location, and play offline or in airplane mode to avoid any interference or detection.</p>
93
- <h4>Q3: How to update Blades of Brim mod apk?</h4>
94
- <p>A3: To update Blades of Brim mod apk, you need to follow the same steps as downloading and installing it. You need to find a website or source that offers the latest version of Blades of Brim mod apk, download the new mod apk file on your device, locate and open the new mod apk file on your device, install the new mod apk file on your device, and launch the new mod apk app on your device. However, you should be aware that updating a mod apk may overwrite or erase your previous data or settings, so you should backup them before updating. You should also check the compatibility and stability of the new mod apk with the original app, as it may cause some errors or glitches.</p>
95
- <h4>Q4: How to uninstall Blades of Brim mod apk?</h4>
96
- <p>A4: To uninstall Blades of Brim mod apk, you need to follow these steps:</p>
97
- <ol>
98
- <li>Go to Settings > Apps > Blades of Brim mod apk and tap on Uninstall.</li>
99
- <li>Confirm your action by tapping on OK.</li>
100
- <li>Wait for the uninstallation process to finish.</li>
101
- <li>Go to your file manager app or downloads folder and delete the Blades of Brim mod apk file from your device.</li>
102
- </ol>
103
- <p>You have successfully uninstalled Blades of Brim mod apk from your device.</p>
104
- <h4>Q5: Where can I find more mod apks for other games?</h4>
105
- <p>A5: There are many websites and sources that offer mod apks for various games. Some of the popular ones are:</p>
106
- <ul>
107
- <li><a href="">HappyMod</a>: This is a platform that provides thousands of mod apks for different games and apps. You can browse by categories, ratings, popularity, or updates. You can also request or upload your own mod apks.</li>
108
- <li><a href="">APKPure</a>: This is a website that provides original and mod apks for various games and apps. You can search by name, genre, editor's choice, or new releases. You can also download older versions of the apps.</li>
109
- <li><a href="">ModDroid</a>: This is a website that provides premium and mod apks for various games and apps. You can filter by categories, features, tags, or languages. You can also read reviews and comments from other users.</li>
110
- </ul>
111
- <p>However, you should be careful and cautious when downloading and using mod apks from these or any other sources, as they may not be safe or reliable. You should always scan the files with an antivirus or anti-malware app before installing them, and backup your data before using them. You should also respect the rights and efforts of the original developers and publishers who created the games and apps, and not use mod apks for illegal or unethical purposes.</p> 197e85843d<br />
112
- <br />
113
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download CarX Street Mod APK for Android and Enjoy Unlimited Racing.md DELETED
@@ -1,99 +0,0 @@
1
-
2
- <h1>CarX Street Mod APK Android: A Guide for Racing Enthusiasts</h1>
3
- <p>If you are a fan of racing games, you might have heard of CarX Street, a popular game that lets you experience the thrill of street racing. But did you know that there is a modded version of this game that gives you unlimited money, realistic physics and graphics, customizable cars and tracks, and online multiplayer mode? In this article, we will tell you everything you need to know about CarX Street Mod APK Android, how to download and install it, and some tips and tricks to help you become the best racer in town.</p>
4
- <h2>carx street mod apk android</h2><br /><p><b><b>Download File</b> >>>>> <a href="https://urlin.us/2uSUMe">https://urlin.us/2uSUMe</a></b></p><br /><br />
5
- <h2>What is CarX Street Mod APK Android?</h2>
6
- <p>CarX Street Mod APK Android is a modified version of the original CarX Street game, which is developed by CarX Technologies. The modded version comes with unlimited racing modes and enthralling challenges that will have you invested till the end. Who doesn’t like to win and lead? You can have it all by using your exceptional drifting skills in the most pressured and significant games and defeating your opponents.</p>
7
- <h3>Features of CarX Street Mod APK Android</h3>
8
- <p>CarX Street Mod APK Android has many features that make it stand out from other racing games. Here are some of them:</p>
9
- <h4>Unlimited Money</h4>
10
- <p>One of the best features of CarX Street Mod APK Android is that it gives you unlimited money to spend on upgrading your car, buying new parts, or unlocking new tracks. You don't have to worry about running out of cash or grinding for hours to earn enough money. You can enjoy the game without any limitations or restrictions.</p>
11
- <h4>Realistic Physics and Graphics</h4>
12
- <p>Another feature of CarX Street Mod APK Android is that it has realistic physics and graphics that make you feel like you are actually driving a car on the streets. The game uses advanced car physics engine CarX, which simulates the behavior of real cars on different surfaces and conditions. The game also has stunning graphics that show every detail of your car, the environment, and the effects of your actions.</p>
13
- <p>carx street racing mod apk unlimited money<br />
14
- carx street drift simulator mod apk download<br />
15
- carx street latest version mod apk<br />
16
- carx street hack mod apk android 1<br />
17
- carx street mod apk obb<br />
18
- carx street mod apk revdl<br />
19
- carx street mod apk offline<br />
20
- carx street mod apk free shopping<br />
21
- carx street mod apk rexdl<br />
22
- carx street mod apk no root<br />
23
- carx street mod apk data<br />
24
- carx street mod apk pure<br />
25
- carx street mod apk unlimited coins<br />
26
- carx street mod apk vip<br />
27
- carx street mod apk all cars unlocked<br />
28
- carx street mod apk android republic<br />
29
- carx street mod apk happymod<br />
30
- carx street mod apk mega<br />
31
- carx street mod apk mediafıre<br />
32
- carx street mod apk an1<br />
33
- carx street mod apk highly compressed<br />
34
- carx street mod apk unlimited gold<br />
35
- carx street mod apk full version<br />
36
- carx street mod apk new update<br />
37
- carx street mod apk cheat<br />
38
- carx street mod apk lenov.ru<br />
39
- carx street mod apk andropalace<br />
40
- carx street mod apk blackmod<br />
41
- carx street mod apk platinmods<br />
42
- carx street mod apk unlimited everything<br />
43
- carx street mod apk for pc<br />
44
- carx street mod apk online<br />
45
- carx street mod apk 2023<br />
46
- carx street mod apk old version<br />
47
- carx street mod apk gameplay<br />
48
- carx street mod apk android oyun club<br />
49
- carx street mod apk mob.org<br />
50
- carx street mod apk apkpure.com<br />
51
- carx street mod apk apkmody.io<br />
52
- carx street mod apk apkmirror.com<br />
53
- carx street pro version mod apk <br />
54
- carx street premium version mod apk <br />
55
- carx street cracked version mod apk <br />
56
- carx street unlocked version mod apk <br />
57
- carx street latest version 0.9.2.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2 (Unlimited Money) for Android[^1^]</p>
58
- <h4>Customizable Cars and Tracks</h4>
59
- <p>CarX Street Mod APK Android also allows you to customize your cars and tracks according to your preferences. You can choose from over 50 cars from different brands and models, each with its own characteristics and performance. You can also modify your car's appearance, color, wheels, spoilers, decals, and more. You can also create your own tracks by using the track editor, which lets you design the layout, scenery, obstacles, and weather of your race.</p>
60
- <h4>Online Multiplayer and Leaderboards</h4>
61
- <p>If you want to test your skills against other players online, CarX Street Mod APK Android has you covered. You can join online multiplayer mode and race with up to 16 players from around the world. You can also compete in leaderboards and tournaments to see who is the best racer in the game. You can also chat with other players, make friends, or challenge them to a duel.</p>
62
- <h3>How to Download and Install CarX Street Mod APK Android</h3>
63
- <p>If you are interested in downloading and installing CarX Street Mod APK Android on your device, here are the steps you need to follow:</p>
64
- <h4>Step 1: Enable Unknown Sources</h4>
65
- <p>Before you can install any modded app 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. To do this, go to your device's settings, then security, then unknown sources, and toggle it on.</p>
66
- <h4>Step 2: Download the APK File</h4>
67
- <p>Next, you need to download the APK file of CarX Street Mod APK Android from a reliable source. You can use this link to download the latest version of the modded app. The file size is about 1.2 GB, so make sure you have enough space on your device and a stable internet connection.</p>
68
- <h4>Step 3: Install the APK File</h4>
69
- <p>Once you have downloaded the APK file, you need to install it on your device. To do this, locate the file in your downloads folder and tap on it. You will see a prompt asking you to confirm the installation. Tap on install and wait for the process to finish.</p>
70
- <h4>Step 4: Launch the Game and Enjoy</h4>
71
- <p>After the installation is complete, you can launch the game and enjoy all the features of CarX Street Mod APK Android. You will see a menu with different options, such as career mode, free ride mode, online mode, garage, settings, and more. You can choose any mode you want and start racing.</p>
72
- <h2>Tips and Tricks for CarX Street Mod APK Android</h2>
73
- <p>To help you get the most out of CarX Street Mod APK Android, here are some tips and tricks that you can use:</p>
74
- <h3>Master the Drifting Technique</h3>
75
- <p>One of the most important skills in CarX Street Mod APK Android is drifting. Drifting is a technique that allows you to slide your car sideways around corners without losing speed or control. Drifting can help you gain an advantage over your opponents, as well as earn more money and points. To drift, you need to press and hold the brake button while turning your car. You can also use the handbrake button to initiate a drift more easily. You can adjust the sensitivity and angle of your drift by using the steering wheel or the tilt control.</p>
76
- <h3>Upgrade Your Car Regularly</h3>
77
- <p>Another tip for CarX Street Mod APK Android is to upgrade your car regularly. Upgrading your car can improve its performance, such as speed, acceleration, handling, braking, and durability. You can upgrade your car by using the money you earn from racing or by using the unlimited money feature of the modded app. You can upgrade different parts of your car, such as engine, turbo, transmission, suspension, tires, brakes, and more. You can also tune your car by adjusting its parameters, such as camber, toe, caster, gear ratio, differential, and more.</p>
78
- <h3>Use Boosters Wisely</h3>
79
- <p>A third tip for CarX Street Mod APK Android is to use boosters wisely. Boosters are items that can give you a temporary boost in speed or power during a race. You can use boosters by tapping on the booster icon on the screen. There are different types of boosters, such as nitro, rocket fuel, magnet, shield, and more. Each booster has its own effect and duration. You can get boosters by collecting them on the track or by buying them with money or diamonds. You can also use the unlimited money feature of the modded app to buy as many boosters as you want.</p>
80
- <h3>Challenge Other Players Online</h3>
81
- <p>A fourth tip for CarX Street Mod APK Android is to challenge other players online. Online mode is where you can race with up to 16 players from around the world in real time. You can join or create a room with different settings, such as track, mode, difficulty, weather, and more. You can also chat with other players or send them emojis or stickers. Online mode is a great way to test your skills and have fun with other racing enthusiasts.</p>
82
- <h2>Conclusion</h2>
83
- <p>CarX Street Mod APK Android is a modded version of CarX Street that gives you unlimited money, realistic physics and graphics, customizable cars and tracks, and online multiplayer mode. It is one of the best racing games for Android devices that will keep you hooked for hours. If you want to download and install CarX Street Mod APK Android on your device, just follow the steps we mentioned above. And if you want to improve your racing skills and enjoy the game more, just use our tips and tricks we shared with you. We hope you found this article helpful and informative. Happy racing!</p>
84
- <h2>FAQs</h2>
85
- <p>Here are some frequently asked questions about CarX Street Mod APK Android:</p>
86
- <ul>
87
- <li><b>Is CarX Street Mod APK Android safe to use?</b></li>
88
- <p>Yes , CarX Street Mod APK Android is safe to use, as long as you download it from a trusted source. The modded app does not contain any viruses or malware that can harm your device or data. However, you should always be careful when installing any modded app on your device, as some of them may have hidden features or permissions that can compromise your privacy or security.</p>
89
- <li><b>Is CarX Street Mod APK Android compatible with my device?</b></li>
90
- <p>CarX Street Mod APK Android is compatible with most Android devices that have Android 5.0 or higher. However, some devices may not support the game due to hardware limitations or software issues. To check if your device is compatible, you can visit the official website of CarX Technologies and see the list of supported devices. You can also try to install the game and see if it works on your device.</p>
91
- <li><b>Can I play CarX Street Mod APK Android offline?</b></li>
92
- <p>Yes, you can play CarX Street Mod APK Android offline, as long as you have downloaded the game and installed it on your device. You can enjoy the career mode, free ride mode, garage, and settings without an internet connection. However, you will need an internet connection to play the online mode, access the leaderboards and tournaments, and update the game.</p>
93
- <li><b>Can I sync my progress in CarX Street Mod APK Android with other devices?</b></li>
94
- <p>Yes, you can sync your progress in CarX Street Mod APK Android with other devices, as long as you have logged in with your Facebook or Google account. You can also backup your data to the cloud and restore it on any device. To do this, go to the settings menu and tap on the cloud icon. You can then choose to backup or restore your data.</p>
95
- <li><b>How can I contact the developers of CarX Street Mod APK Android?</b></li>
96
- <p>If you have any questions, feedback, or suggestions for CarX Street Mod APK Android, you can contact the developers of CarX Technologies by using their email address: [email protected]. You can also visit their website: https://carx-tech.com/ or their Facebook page: https://www.facebook.com/carxtechnologies/ for more information.</p>
97
- </ul></p> 197e85843d<br />
98
- <br />
99
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1phancelerku/anime-remove-background/Cara Menggunakan X8 Speeder APK Versi Lama 3.5.4 untuk Hack Kecepatan Game.md DELETED
@@ -1,93 +0,0 @@
1
- <br />
2
- <h1>X8 Speeder APK Versi Lama 3.5. 4: How to Speed Up Your Games Without Ads</h1>
3
- <p>If you are looking for a way to play your favorite games faster and smoother, you might want to try X8 Speeder APK versi lama 3.5. 4. This is an application that can hack the speed of any game on your Android device, without requiring root access or ads. In this article, we will explain what X8 Speeder APK is, how to download and install it, how to use it for various games, and what are the benefits and risks of using it.</p>
4
- <h2>x8 speeder apk versi lama 3.5. 4</h2><br /><p><b><b>DOWNLOAD</b> &#187; <a href="https://jinyurl.com/2uNT5q">https://jinyurl.com/2uNT5q</a></b></p><br /><br />
5
- <h2>What is X8 Speeder APK?</h2>
6
- <p>X8 Speeder APK is a tool that can modify the speed of any game on your Android device. It works by injecting a code into the game process, which allows you to adjust the speed of the game from 0.5x to 8x. You can use it for any game that you want, such as Higgs Domino, Vlogger Go Viral, PUBG Mobile, and more.</p>
7
- <p>X8 Speeder APK versi lama 3.5. 4 is an older version of the app that was released in 2021. It has some advantages over the newer versions, such as being more stable, compatible, and easy to use. It also has a feature that can block all kinds of ads that might interrupt your gaming experience.</p>
8
- <h2>How to Download and Install X8 Speeder APK Versi Lama 3.5. 4?</h2>
9
- <p>To download and install X8 Speeder APK versi lama 3.5. 4, you need to follow these steps:</p>
10
- <ol>
11
- <li>Go to the link and download the APK file.</li>
12
- <li>Enable the installation of unknown sources on your device settings.</li>
13
- <li>Locate the downloaded file and tap on it to install it.</li>
14
- <li>Wait for the installation to finish and launch the app.</li>
15
- </ol>
16
- <h2>How to Use X8 Speeder APK Versi Lama 3.5. 4 for Various Games?</h2>
17
- <p>To use X8 Speeder APK versi lama 3.5. 4 for various games, you need to follow these steps:</p>
18
- <p>x8 speeder apk versi lama 3.5.2 download<br />
19
- x8 speeder apk versi lama anti banned<br />
20
- x8 speeder apk versi lama speed hack<br />
21
- x8 speeder apk versi lama tanpa iklan<br />
22
- x8 speeder apk versi lama untuk higgs domino<br />
23
- x8 speeder apk versi lama jalantikus<br />
24
- x8 speeder apk versi lama 3.5.3 free download<br />
25
- x8 speeder apk versi lama 3.5.4 china<br />
26
- x8 speeder apk versi lama 3.5.4 global<br />
27
- x8 speeder apk versi lama 3.5.4 mandarin<br />
28
- x8 speeder apk versi lama 3.5.4 kompiwin<br />
29
- x8 speeder apk versi lama 3.5.4 mod<br />
30
- x8 speeder apk versi lama 3.5.4 no root<br />
31
- x8 speeder apk versi lama 3.5.4 offline<br />
32
- x8 speeder apk versi lama 3.5.4 online<br />
33
- x8 speeder apk versi lama 3.5.4 original<br />
34
- x8 speeder apk versi lama 3.5.4 pro<br />
35
- x8 speeder apk versi lama 3.5.4 premium<br />
36
- x8 speeder apk versi lama 3.5.4 terbaru<br />
37
- x8 speeder apk versi lama 3.5.4 update<br />
38
- x8 speeder apk versi lama cara download<br />
39
- x8 speeder apk versi lama cara install<br />
40
- x8 speeder apk versi lama cara menggunakan<br />
41
- x8 speeder apk versi lama cara setting<br />
42
- x8 speeder apk versi lama cara uninstall<br />
43
- x8 speeder apk versi lama fitur lengkap<br />
44
- x8 speeder apk versi lama kelebihan dan kekurangan<br />
45
- x8 speeder apk versi lama perbedaan dengan versi baru<br />
46
- x8 speeder apk versi lama review dan rating<br />
47
- x8 speeder apk versi lama tips dan trik</p>
48
- <ol>
49
- <li>Open the app and grant the necessary permissions.</li>
50
- <li>Select the game that you want to speed up from the list of installed apps.</li>
51
- <li>Tap on the "Activate" button and wait for the app to inject the code into the game process.</li>
52
- <li>Open the game and enjoy playing it at your desired speed.</li>
53
- <li>To adjust the speed of the game, swipe from the left edge of the screen and use the slider to change the speed from 0.5x to 8x.</li>
54
- <li>To deactivate the app, swipe from the right edge of the screen and tap on the "Deactivate" button.</li>
55
- </ol>
56
- <h2>What are the Benefits and Risks of Using X8 Speeder APK Versi Lama 3.5. 4?</h2>
57
- <p>Using X8 Speeder APK versi lama 3.5. 4 has some benefits and risks that you need to be aware of before using it.</p>
58
- <h3>Benefits:</h3>
59
- <ul>
60
- <li>You can play any game faster and smoother without lag or delay.</li>
61
- <li>You can save time and energy by completing tasks and missions faster.</li>
62
- <li>You can earn more rewards and coins by playing more games in less time.</li>
63
- <li>You can enjoy playing games without ads that might annoy you or consume your data.</li>
64
- </ul>
65
- <h3>Risks:</h3>
66
- <ul>
67
- <li>You might get banned from some games that detect speed hacks or cheating activities.</li>
68
- <li>You might damage your device or game data by using an unofficial or modified app.</li>
69
- <li>You might expose your device or personal information to viruses or malware by downloading an app from an untrusted source.</li>
70
- <li>You might lose the fun and challenge of playing games at their normal speed.</li>
71
- </ul>
72
- <h2>Conclusion</h2>
73
- <p>X8 Speeder APK versi lama 3.5. 4 is an application that can help you play any game faster and smoother on your Android device, without requiring root access or ads. It is an older version of the app that has some advantages over the newer versions, such as being more stable, compatible, and easy to use. However, it also has some risks that you need to consider before using it, such as getting banned from some games, damaging your device or game data, exposing your device or personal information to viruses or malware, or losing the fun and challenge of playing games at their normal speed. Therefore, you should use it at your own discretion and responsibility.</p>
74
- <h2>FAQs</h2>
75
- <p>Here are some frequently asked questions about X8 Speeder APK versi lama 3.5. 4:</p>
76
- <h3>Q: Is X8 Speeder APK versi lama 3.5. 4 safe to use?</h3>
77
- <p>A: X8 Speeder APK versi lama 3.5. 4 is not an official or verified app, so it might not be safe to use. It might contain viruses or malware that can harm your device or personal information. It might also cause your device or game data to malfunction or crash. Therefore, you should only download and install it from a trusted source and scan it with an antivirus app before using it.</p>
78
- <h3>Q: Is X8 Speeder APK versi lama 3.5. 4 legal to use?</h3>
79
- <p>A: X8 Speeder APK versi lama 3.5. 4 is not a legal app, as it violates the terms and conditions of the games that it hacks. It might also infringe the intellectual property rights of the game developers or publishers. Therefore, you might face legal consequences if you use it for any game that prohibits speed hacks or cheating activities.</p>
80
- <h3>Q: Which games can I use X8 Speeder APK versi lama 3.5. 4 for?</h3>
81
- <p>A: You can use X8 Speeder APK versi lama 3.5. 4 for any game that you want, as long as it is compatible with your device and does not detect speed hacks or cheating activities. Some examples of games that you can use it for are Higgs Domino, Vlogger Go Viral, PUBG Mobile, and more.</p>
82
- <h3>Q: How can I update X8 Speeder APK versi lama 3.5. 4?</h3>
83
- <p>A: You can update X8 Speeder APK versi lama 3.5. 4 by downloading and installing the latest version of the app from the link . However, you should be aware that the newer versions might not have the same features or performance as the older version, such as blocking ads or being stable and compatible.</p>
84
- <h3>Q: How can I uninstall X8 Speeder APK versi lama 3.5. 4?</h3>
85
- <p>A: You can uninstall X8 Speeder APK versi lama 3.5. 4 by following these steps:</p>
86
- <ol>
87
- <li>Open the app and swipe from the right edge of the screen.</li>
88
- <li>Tap on the "Uninstall" button and confirm your choice.</li>
89
- <li>Wait for the app to uninstall itself and delete its data.</li>
90
- <li>Go to your device settings and remove the app from the list of installed apps.</li>
91
- </ol></p> 401be4b1e0<br />
92
- <br />
93
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1phancelerku/anime-remove-background/Download It 39s Okay !!LINK!!.md DELETED
@@ -1,77 +0,0 @@
1
- <br />
2
- <h1>How to Download Content Safely and Efficiently from the Internet</h1>
3
- <p>Downloading content from the internet is a common activity that many people do on a regular basis. Whether you want to watch a movie, listen to music, play a game, or install a software, downloading content can help you access various types of media and applications without having to buy physical copies or stream them online. However, downloading content also comes with some risks and challenges that you need to be aware of and avoid. In this article, I will provide you with some tips and information on how to download content safely and efficiently, as well as some recommendations for the best download managers that you can use.</p>
4
- <h2>download it 39;s okay</h2><br /><p><b><b>Download Zip</b> ===> <a href="https://jinyurl.com/2uNS9C">https://jinyurl.com/2uNS9C</a></b></p><br /><br />
5
- <h2>How to Download Content Safely</h2>
6
- <p>The first thing you need to consider when downloading content from the internet is your safety. There are many dangers and threats that can harm your computer or your personal information if you are not careful. Some of these include:</p>
7
- <ul>
8
- <li><strong>Virus attacks</strong>: Some files that you download may contain malicious programs that can infect your computer and damage your files or system. These programs can also steal your data or hijack your browser.</li>
9
- <li><strong>Adware</strong>: Some files that you download may force unwanted advertisements on your screen or redirect you to other websites. These ads can be annoying, intrusive, or even offensive.</li>
10
- <li><strong>Spyware</strong>: Some files that you download may monitor your online activity or collect your personal information without your consent. These programs can compromise your privacy or security.</li>
11
- <li><strong>Legal issues</strong>: Some files that you download may violate the copyright laws or other regulations of the original owners or creators. This can result in legal action or penalties against you.</li>
12
- </ul>
13
- <p>To avoid these risks, you need to follow some best practices for downloading content safely. Here are some of them:</p>
14
- <ol>
15
- <li><strong>Choose a trusted website or source</strong>: Before you download any file, make sure that you are getting it from a reputable website or source that has positive reviews and ratings from other users. Avoid websites that look suspicious, have poor design, or offer illegal or pirated content.</li>
16
- <li><strong>Scan the file for malware and viruses</strong>: Before you open or run any file that you have downloaded, make sure that you scan it with a reliable antivirus software or an online tool like VirusTotal. This will help you detect and remove any potential threats that may harm your computer.</li>
17
- <li><strong>Use a reliable antivirus software</strong>: To protect your computer from virus attacks and other malware, you should always have a good antivirus software installed and updated on your system. You should also run regular scans and updates to keep your antivirus software effective.</li>
18
- <li><strong>Avoid clicking on suspicious links or pop-ups</strong>: When you are browsing or downloading content from the internet, you may encounter some links or pop-ups that claim to offer free downloads, discounts, prizes, or other incentives. However, these may be scams or traps that can infect your computer with malware or redirect you to malicious websites. Therefore, you should always be careful and avoid clicking on any links or pop-ups that look suspicious or too good to be true.</li>
19
- <li><strong>Read the terms and conditions before downloading</strong>: Before you download any file, you should always read the terms and conditions or the license agreement that comes with it. This will help you understand what you are agreeing to and what rights and responsibilities you have as a user. You should also check the file size, format, and compatibility with your device or software before downloading.</li>
20
- </ol>
21
- <h2>How to Download Content Efficiently</h2>
22
- <p>The second thing you need to consider when downloading content from the internet is your efficiency. Downloading content can take a lot of time and bandwidth, especially if you are downloading large or multiple files. To speed up your downloads and save your resources, you need to use a download manager.</p>
23
- <p></p>
24
- <h3>What is a download manager and how does it work?</h3>
25
- <p>A download manager is a software or a browser extension that helps you manage your downloads from the internet. It works by splitting the file into smaller chunks and downloading them simultaneously from different sources or servers. This way, it can increase the download speed and resume the download if it is interrupted or paused. A download manager can also organize your downloads into categories, folders, or queues, and allow you to schedule, prioritize, or limit your downloads according to your preferences.</p>
26
- <h3>What are the advantages of using a download manager?</h3>
27
- <p>Using a download manager can offer you many benefits, such as:</p>
28
- <ul>
29
- <li><strong>Faster downloads</strong>: A download manager can boost your download speed by up to 10 times by using multiple connections and sources. It can also resume broken or incomplete downloads without having to start over.</li>
30
- <li><strong>Better control</strong>: A download manager can give you more control over your downloads by letting you pause, resume, cancel, or restart them at any time. You can also set the download speed, bandwidth, or number of connections according to your needs.</li>
31
- <li><strong>Easier management</strong>: A download manager can help you manage your downloads by sorting them into categories, folders, or queues. You can also view the progress, status, or details of your downloads in one place.</li>
32
- <li><strong>More features</strong>: A download manager can offer you more features than a regular browser downloader, such as video downloading, audio extraction, file conversion, checksum verification, virus scanning, password protection, and more.</li>
33
- </ul>
34
- <h3>How to choose a download manager that suits your needs?</h3>
35
- <p>There are many download managers available for Windows users, but not all of them are created equal. Some of them may have more features, better performance, or easier interface than others. To choose a download manager that suits your needs, you need to consider some factors, such as:</p>
36
- <ul>
37
- <li><strong>Compatibility</strong>: You need to make sure that the download manager is compatible with your operating system, browser, and device. You also need to check if it supports the file types and formats that you want to download.</li>
38
- <li><strong>Security</strong>: You need to make sure that the download manager is safe and reliable. You should avoid any download managers that contain malware, spyware, adware, or other unwanted programs. You should also look for download managers that have encryption, authentication, or antivirus features.</li>
39
- <li><strong>Usability</strong>: You need to make sure that the download manager is easy and convenient to use. You should look for download managers that have a simple and intuitive interface, customizable settings, and helpful tutorials or guides.</li>
40
- <li><strong>Price</strong>: You need to make sure that the download manager is affordable and worth your money. You should compare the features and benefits of different download managers and see which one offers the best value for your budget. You should also look for download managers that have free trials or versions that you can test before buying.</li>
41
- </ul>
42
- <h2>Best Download Managers for Windows</h2>
43
- <p>To help you choose a download manager that suits your needs, I have compiled a list of some of the best download managers for Windows users. These are:</p>
44
- <h3>Free Download Manager</h3>
45
- <p>Free Download Manager is one of the most popular and powerful download managers for Windows users. It is free, open-source, and supports various protocols and formats. It can accelerate your downloads by up to 10 times, resume broken downloads, adjust traffic usage, schedule downloads, and more. It can also download videos from YouTube and other websites, convert audio and video files, and scan files for viruses. It has a user-friendly interface that allows you to manage your downloads easily.</p>
46
- <h3>Internet Download Manager</h3>
47
- <p>Internet Download Manager is one of the most advanced and feature-rich download managers for Windows users. It is not free but offers a 30-day trial version that you can try before buying. It can increase your download speed by up to 5 times, resume and schedule downloads, integrate with all popular browsers, and support various protocols and formats. It can also download videos from any website, capture streaming audio and video, and scan files for viruses. It has a smart download logic accelerator that uses dynamic file segmentation and multipart downloading technology to optimize your downloads.</p>
48
- <h3>Ninja Download Manager</h3>
49
- <p>Ninja Download Manager is one of the most stylish and modern download managers for Windows users. It is not free but offers a lifetime license that you can buy once and use forever. It can boost your download speed by up to 10 times, resume and schedule downloads, limit download speed, and support various protocols and formats. It can also download videos from any website, convert audio and video files, and scan files for viruses. It has a sleek and elegant interface that allows you to manage your downloads with ease.</p>
50
- <h3>JDownloader</h3>
51
- <p>JDownloader is one of the most versatile and customizable download managers for Windows users. It is free, open-source, and supports a wide range of protocols and formats. It can accelerate your downloads by using multiple connections, resume and schedule downloads, extract compressed files, and support various languages. It can also download videos from any website, capture streaming audio and video, and scan files for viruses. It has a modular design that allows you to add or remove features according to your preferences.</p>
52
- <h3>Internet Download Accelerator</h3>
53
- <p>Internet Download Accelerator is one of the most reliable and user-friendly download managers for Windows users. It is not free but offers a 30-day trial version that you can try before buying. It can increase your download speed by up to 5 times, resume and schedule downloads, integrate with all popular browsers, and support various protocols and formats. It can also download videos from any website, convert audio and video files, and scan files for viruses. It has a simple and intuitive interface that allows you to manage your downloads easily.</p>
54
- <h2>Conclusion</h2>
55
- <p>Downloading content from the internet can be a great way to access various types of media, software, and games, but it also comes with some risks and challenges that you need to be aware of and avoid. To download content safely and efficiently, you need to follow some best practices, such as choosing a trusted website or source, scanning the file for malware and viruses, using a reliable antivirus software, avoiding clicking on suspicious links or pop-ups, and reading the terms and conditions before downloading. You also need to use a download manager that can help you speed up your downloads, resume broken downloads, organize your downloads, and offer more features than a regular browser downloader. Some of the best download managers for Windows users are Free Download Manager, Internet Download Manager, Ninja Download Manager, JDownloader, and Internet Download Accelerator.</p>
56
- <p>I hope you found this article helpful and informative. If you have any questions or feedback about downloading content from the internet or using a download manager, please feel free to leave a comment below or contact me directly. I would love to hear from you.</p>
57
- <h2>FAQs</h2>
58
- <ul>
59
- <li><strong>Q: What is the difference between downloading and streaming?</strong></li>
60
- <li><strong>A: Downloading</strong> is the process of transferring a file from the internet to your computer or device so that you can access it offline or later. <strong>Streaming</strong> is the process of playing a file from the internet without transferring it to your computer or device. Streaming requires a constant internet connection and may consume more bandwidth than downloading.</li>
61
- <li><strong>Q: What are the best websites or sources for downloading content?</strong></li>
62
- <li><strong>A: The best websites or sources for downloading content are those that are legal, reputable, secure, and offer high-quality content. Some examples are:</strong></li>
63
- <ul>
64
- <li><strong>For movies and TV shows</strong>: Netflix, Amazon Prime Video, Hulu, Disney+, etc.</li>
65
- <li><strong>For music</strong>: Spotify, Apple Music, YouTube Music, SoundCloud, etc.</li>
66
- <li><strong>For games</strong>: Steam, Epic Games Store, GOG.com, Origin, etc.</li>
67
- <li><strong>For software</strong>: Microsoft Store, Google Play Store, Apple App Store, Adobe Creative Cloud, etc.</li>
68
- </ul>
69
- <li><strong>Q: How can I check if a file is safe to download?</strong></li>
70
- <li><strong>A: You can check if a file is safe to download by scanning it with a reliable antivirus software or an online tool like VirusTotal. This will help you detect and remove any potential threats that may harm your computer. You can also check the file size, format, and compatibility with your device or software before downloading.</li>
71
- <li><strong>Q: How can I download videos from YouTube or other websites?</strong></li>
72
- <li><strong>A: You can download videos from YouTube or other websites by using a download manager that supports video downloading, such as Free Download Manager, Internet Download Manager, Ninja Download Manager, or JDownloader. You can also use a browser extension or a web-based service that allows you to download videos from any website, such as Video DownloadHelper, SaveFrom.net, ClipConverter.cc, etc.</strong></li>
73
- <li><strong>Q: How can I convert audio and video files to different formats?</strong></li>
74
- <li><strong>A: You can convert audio and video files to different formats by using a download manager that supports file conversion, such as Free Download Manager, Internet Download Manager, Ninja Download Manager, or JDownloader. You can also use a standalone software or a web-based service that allows you to convert files to different formats, such as VLC Media Player, Freemake Video Converter, Online-Convert.com, etc.</strong></li>
75
- </ul></p> 401be4b1e0<br />
76
- <br />
77
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/801artistry/RVC801/slicer2.py DELETED
@@ -1,260 +0,0 @@
1
- import numpy as np
2
-
3
-
4
- # This function is obtained from librosa.
5
- def get_rms(
6
- y,
7
- frame_length=2048,
8
- hop_length=512,
9
- pad_mode="constant",
10
- ):
11
- padding = (int(frame_length // 2), int(frame_length // 2))
12
- y = np.pad(y, padding, mode=pad_mode)
13
-
14
- axis = -1
15
- # put our new within-frame axis at the end for now
16
- out_strides = y.strides + tuple([y.strides[axis]])
17
- # Reduce the shape on the framing axis
18
- x_shape_trimmed = list(y.shape)
19
- x_shape_trimmed[axis] -= frame_length - 1
20
- out_shape = tuple(x_shape_trimmed) + tuple([frame_length])
21
- xw = np.lib.stride_tricks.as_strided(y, shape=out_shape, strides=out_strides)
22
- if axis < 0:
23
- target_axis = axis - 1
24
- else:
25
- target_axis = axis + 1
26
- xw = np.moveaxis(xw, -1, target_axis)
27
- # Downsample along the target axis
28
- slices = [slice(None)] * xw.ndim
29
- slices[axis] = slice(0, None, hop_length)
30
- x = xw[tuple(slices)]
31
-
32
- # Calculate power
33
- power = np.mean(np.abs(x) ** 2, axis=-2, keepdims=True)
34
-
35
- return np.sqrt(power)
36
-
37
-
38
- class Slicer:
39
- def __init__(
40
- self,
41
- sr: int,
42
- threshold: float = -40.0,
43
- min_length: int = 5000,
44
- min_interval: int = 300,
45
- hop_size: int = 20,
46
- max_sil_kept: int = 5000,
47
- ):
48
- if not min_length >= min_interval >= hop_size:
49
- raise ValueError(
50
- "The following condition must be satisfied: min_length >= min_interval >= hop_size"
51
- )
52
- if not max_sil_kept >= hop_size:
53
- raise ValueError(
54
- "The following condition must be satisfied: max_sil_kept >= hop_size"
55
- )
56
- min_interval = sr * min_interval / 1000
57
- self.threshold = 10 ** (threshold / 20.0)
58
- self.hop_size = round(sr * hop_size / 1000)
59
- self.win_size = min(round(min_interval), 4 * self.hop_size)
60
- self.min_length = round(sr * min_length / 1000 / self.hop_size)
61
- self.min_interval = round(min_interval / self.hop_size)
62
- self.max_sil_kept = round(sr * max_sil_kept / 1000 / self.hop_size)
63
-
64
- def _apply_slice(self, waveform, begin, end):
65
- if len(waveform.shape) > 1:
66
- return waveform[
67
- :, begin * self.hop_size : min(waveform.shape[1], end * self.hop_size)
68
- ]
69
- else:
70
- return waveform[
71
- begin * self.hop_size : min(waveform.shape[0], end * self.hop_size)
72
- ]
73
-
74
- # @timeit
75
- def slice(self, waveform):
76
- if len(waveform.shape) > 1:
77
- samples = waveform.mean(axis=0)
78
- else:
79
- samples = waveform
80
- if samples.shape[0] <= self.min_length:
81
- return [waveform]
82
- rms_list = get_rms(
83
- y=samples, frame_length=self.win_size, hop_length=self.hop_size
84
- ).squeeze(0)
85
- sil_tags = []
86
- silence_start = None
87
- clip_start = 0
88
- for i, rms in enumerate(rms_list):
89
- # Keep looping while frame is silent.
90
- if rms < self.threshold:
91
- # Record start of silent frames.
92
- if silence_start is None:
93
- silence_start = i
94
- continue
95
- # Keep looping while frame is not silent and silence start has not been recorded.
96
- if silence_start is None:
97
- continue
98
- # Clear recorded silence start if interval is not enough or clip is too short
99
- is_leading_silence = silence_start == 0 and i > self.max_sil_kept
100
- need_slice_middle = (
101
- i - silence_start >= self.min_interval
102
- and i - clip_start >= self.min_length
103
- )
104
- if not is_leading_silence and not need_slice_middle:
105
- silence_start = None
106
- continue
107
- # Need slicing. Record the range of silent frames to be removed.
108
- if i - silence_start <= self.max_sil_kept:
109
- pos = rms_list[silence_start : i + 1].argmin() + silence_start
110
- if silence_start == 0:
111
- sil_tags.append((0, pos))
112
- else:
113
- sil_tags.append((pos, pos))
114
- clip_start = pos
115
- elif i - silence_start <= self.max_sil_kept * 2:
116
- pos = rms_list[
117
- i - self.max_sil_kept : silence_start + self.max_sil_kept + 1
118
- ].argmin()
119
- pos += i - self.max_sil_kept
120
- pos_l = (
121
- rms_list[
122
- silence_start : silence_start + self.max_sil_kept + 1
123
- ].argmin()
124
- + silence_start
125
- )
126
- pos_r = (
127
- rms_list[i - self.max_sil_kept : i + 1].argmin()
128
- + i
129
- - self.max_sil_kept
130
- )
131
- if silence_start == 0:
132
- sil_tags.append((0, pos_r))
133
- clip_start = pos_r
134
- else:
135
- sil_tags.append((min(pos_l, pos), max(pos_r, pos)))
136
- clip_start = max(pos_r, pos)
137
- else:
138
- pos_l = (
139
- rms_list[
140
- silence_start : silence_start + self.max_sil_kept + 1
141
- ].argmin()
142
- + silence_start
143
- )
144
- pos_r = (
145
- rms_list[i - self.max_sil_kept : i + 1].argmin()
146
- + i
147
- - self.max_sil_kept
148
- )
149
- if silence_start == 0:
150
- sil_tags.append((0, pos_r))
151
- else:
152
- sil_tags.append((pos_l, pos_r))
153
- clip_start = pos_r
154
- silence_start = None
155
- # Deal with trailing silence.
156
- total_frames = rms_list.shape[0]
157
- if (
158
- silence_start is not None
159
- and total_frames - silence_start >= self.min_interval
160
- ):
161
- silence_end = min(total_frames, silence_start + self.max_sil_kept)
162
- pos = rms_list[silence_start : silence_end + 1].argmin() + silence_start
163
- sil_tags.append((pos, total_frames + 1))
164
- # Apply and return slices.
165
- if len(sil_tags) == 0:
166
- return [waveform]
167
- else:
168
- chunks = []
169
- if sil_tags[0][0] > 0:
170
- chunks.append(self._apply_slice(waveform, 0, sil_tags[0][0]))
171
- for i in range(len(sil_tags) - 1):
172
- chunks.append(
173
- self._apply_slice(waveform, sil_tags[i][1], sil_tags[i + 1][0])
174
- )
175
- if sil_tags[-1][1] < total_frames:
176
- chunks.append(
177
- self._apply_slice(waveform, sil_tags[-1][1], total_frames)
178
- )
179
- return chunks
180
-
181
-
182
- def main():
183
- import os.path
184
- from argparse import ArgumentParser
185
-
186
- import librosa
187
- import soundfile
188
-
189
- parser = ArgumentParser()
190
- parser.add_argument("audio", type=str, help="The audio to be sliced")
191
- parser.add_argument(
192
- "--out", type=str, help="Output directory of the sliced audio clips"
193
- )
194
- parser.add_argument(
195
- "--db_thresh",
196
- type=float,
197
- required=False,
198
- default=-40,
199
- help="The dB threshold for silence detection",
200
- )
201
- parser.add_argument(
202
- "--min_length",
203
- type=int,
204
- required=False,
205
- default=5000,
206
- help="The minimum milliseconds required for each sliced audio clip",
207
- )
208
- parser.add_argument(
209
- "--min_interval",
210
- type=int,
211
- required=False,
212
- default=300,
213
- help="The minimum milliseconds for a silence part to be sliced",
214
- )
215
- parser.add_argument(
216
- "--hop_size",
217
- type=int,
218
- required=False,
219
- default=10,
220
- help="Frame length in milliseconds",
221
- )
222
- parser.add_argument(
223
- "--max_sil_kept",
224
- type=int,
225
- required=False,
226
- default=500,
227
- help="The maximum silence length kept around the sliced clip, presented in milliseconds",
228
- )
229
- args = parser.parse_args()
230
- out = args.out
231
- if out is None:
232
- out = os.path.dirname(os.path.abspath(args.audio))
233
- audio, sr = librosa.load(args.audio, sr=None, mono=False)
234
- slicer = Slicer(
235
- sr=sr,
236
- threshold=args.db_thresh,
237
- min_length=args.min_length,
238
- min_interval=args.min_interval,
239
- hop_size=args.hop_size,
240
- max_sil_kept=args.max_sil_kept,
241
- )
242
- chunks = slicer.slice(audio)
243
- if not os.path.exists(out):
244
- os.makedirs(out)
245
- for i, chunk in enumerate(chunks):
246
- if len(chunk.shape) > 1:
247
- chunk = chunk.T
248
- soundfile.write(
249
- os.path.join(
250
- out,
251
- f"%s_%d.wav"
252
- % (os.path.basename(args.audio).rsplit(".", maxsplit=1)[0], i),
253
- ),
254
- chunk,
255
- sr,
256
- )
257
-
258
-
259
- if __name__ == "__main__":
260
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/801artistry/RVC801/train/losses.py DELETED
@@ -1,59 +0,0 @@
1
- import torch
2
- from torch.nn import functional as F
3
-
4
-
5
- def feature_loss(fmap_r, fmap_g):
6
- loss = 0
7
- for dr, dg in zip(fmap_r, fmap_g):
8
- for rl, gl in zip(dr, dg):
9
- rl = rl.float().detach()
10
- gl = gl.float()
11
- loss += torch.mean(torch.abs(rl - gl))
12
-
13
- return loss * 2
14
-
15
-
16
- def discriminator_loss(disc_real_outputs, disc_generated_outputs):
17
- loss = 0
18
- r_losses = []
19
- g_losses = []
20
- for dr, dg in zip(disc_real_outputs, disc_generated_outputs):
21
- dr = dr.float()
22
- dg = dg.float()
23
- r_loss = torch.mean((1 - dr) ** 2)
24
- g_loss = torch.mean(dg**2)
25
- loss += r_loss + g_loss
26
- r_losses.append(r_loss.item())
27
- g_losses.append(g_loss.item())
28
-
29
- return loss, r_losses, g_losses
30
-
31
-
32
- def generator_loss(disc_outputs):
33
- loss = 0
34
- gen_losses = []
35
- for dg in disc_outputs:
36
- dg = dg.float()
37
- l = torch.mean((1 - dg) ** 2)
38
- gen_losses.append(l)
39
- loss += l
40
-
41
- return loss, gen_losses
42
-
43
-
44
- def kl_loss(z_p, logs_q, m_p, logs_p, z_mask):
45
- """
46
- z_p, logs_q: [b, h, t_t]
47
- m_p, logs_p: [b, h, t_t]
48
- """
49
- z_p = z_p.float()
50
- logs_q = logs_q.float()
51
- m_p = m_p.float()
52
- logs_p = logs_p.float()
53
- z_mask = z_mask.float()
54
-
55
- kl = logs_p - logs_q - 0.5
56
- kl += 0.5 * ((z_p - m_p) ** 2) * torch.exp(-2.0 * logs_p)
57
- kl = torch.sum(kl * z_mask)
58
- l = kl / torch.sum(z_mask)
59
- return l
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AEUPH/CosmosTV/README.md DELETED
@@ -1,44 +0,0 @@
1
- ---
2
- title: AI WebTV
3
- emoji: 🔮
4
- colorFrom: purple
5
- colorTo: white
6
- sdk: docker
7
- app_port: 7860
8
- duplicated_from: jbilcke-hf/AI-WebTV
9
- ---
10
-
11
- A generative AI WebTV, powered by Zeroscope and Hugging Face.
12
-
13
- This is just the frontend part, you will need the media-server (also open source) to make it work.
14
-
15
- Warning: this is an experimental, proof-of-concept project made in a few days.
16
-
17
- It is not ready for production use by other people! Also, this use models that should only be used for research purposes (no commercial usage).
18
-
19
- Note: because the stream uses FLV, it doesn't work on iPhone. There is however a [Twitch mirror here](https://www.twitch.tv/ai_webtv).
20
-
21
- The main code of the webtv is located inside the [media-server](https://huggingface.co/spaces/jbilcke-hf/media-server/tree/main) :
22
-
23
- manual steps:
24
- - human input to write a short paragraph describing a multi-shot video sequence
25
- - manual submit it to GPT-4 to generate a list of video captions for each shot (the system instructions are extracts from a stable diffusion guide)
26
- - commit the captions to the [playlist database](https://huggingface.co/spaces/jbilcke-hf/media-server/raw/main/database.json)
27
-
28
- Inside the `media-server` space (generation process running in the background):
29
- - for each prompt in the database
30
- - generate a silent 3 seconds video clip with Zeroscope V2 576w (hosted on Hugging Face Spaces)
31
- - upscale the clip with Zeroscope V2 XL (also a HF Space)
32
- - perform frame interpolation with FILM (also a HF Space)
33
- - storage in the Persistent Storage of the media-server Space
34
-
35
- Inside the `media-server` space (streaming process running in the foreground):
36
- - for each video file in the persistent storage folder
37
- - add it to a new FFmpeg playlist (it's just a .txt file)
38
- - broadcast it over the RTMP protocol using FFmpeg (in FLV format)
39
- - diffusion of the stream using node-media-server
40
-
41
- Inside the `AI-WebTV` space:
42
- - display the stream using `mpegts.js`
43
- - this doesn't work on iPhone, but now there is also a Twitch mirror
44
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AIFILMS/audioldm-text-to-audio-generation/audioldm/clap/training/params.py DELETED
@@ -1,563 +0,0 @@
1
- import argparse
2
-
3
-
4
- def get_default_params(model_name):
5
- # Params from paper (https://arxiv.org/pdf/2103.00020.pdf)
6
- model_name = model_name.lower()
7
- if "vit" in model_name:
8
- return {"lr": 5.0e-4, "beta1": 0.9, "beta2": 0.98, "eps": 1.0e-6}
9
- else:
10
- return {"lr": 5.0e-4, "beta1": 0.9, "beta2": 0.999, "eps": 1.0e-8}
11
-
12
-
13
- def parse_args():
14
- parser = argparse.ArgumentParser()
15
- parser.add_argument(
16
- "--train-data",
17
- type=str,
18
- default=None,
19
- help="Path to h5 filewith training data",
20
- )
21
- parser.add_argument(
22
- "--val-data",
23
- type=str,
24
- default=None,
25
- help="Path to h5 file with validation data",
26
- )
27
- parser.add_argument(
28
- "--freeze-text",
29
- default=False,
30
- action="store_true",
31
- help="if you need to freeze the text encoder, make this True",
32
- )
33
- parser.add_argument(
34
- "--freeze-text-after",
35
- type=int,
36
- default=-1,
37
- help="if you need to freeze the text encoder after (include) epoch x, set this param to x. Set -1 to disable it",
38
- )
39
- parser.add_argument(
40
- "--train-ipc",
41
- type=str,
42
- default=None,
43
- help="Path to npy file of the number of instance per class in training data",
44
- )
45
- parser.add_argument(
46
- "--val-ipc",
47
- type=str,
48
- default=None,
49
- help="Path to npy file of the number of instance per class in validation data",
50
- )
51
- parser.add_argument(
52
- "--train-num-samples",
53
- type=int,
54
- default=None,
55
- help="Number of samples in dataset. Required for webdataset if not available in info file.",
56
- )
57
- parser.add_argument(
58
- "--val-num-samples",
59
- type=int,
60
- default=None,
61
- help="Number of samples in dataset. Useful for webdataset if not available in info file.",
62
- )
63
- parser.add_argument(
64
- "--dataset-type",
65
- choices=["webdataset", "csv", "auto", "toy"],
66
- default="auto",
67
- help="Which type of dataset to process.",
68
- )
69
- parser.add_argument(
70
- "--csv-separator",
71
- type=str,
72
- default="\t",
73
- help="For csv-like datasets, which separator to use.",
74
- )
75
- parser.add_argument(
76
- "--csv-img-key",
77
- type=str,
78
- default="filepath",
79
- help="For csv-like datasets, the name of the key for the image paths.",
80
- )
81
- parser.add_argument(
82
- "--csv-caption-key",
83
- type=str,
84
- default="title",
85
- help="For csv-like datasets, the name of the key for the captions.",
86
- )
87
- parser.add_argument(
88
- "--imagenet-val",
89
- type=str,
90
- default=None,
91
- help="Path to imagenet val set for conducting zero shot evaluation.",
92
- )
93
- parser.add_argument(
94
- "--imagenet-v2",
95
- type=str,
96
- default=None,
97
- help="Path to imagenet v2 for conducting zero shot evaluation.",
98
- )
99
- parser.add_argument(
100
- "--datasetnames",
101
- nargs="+",
102
- default=None,
103
- help="If loading webdataset, spedify the dataset names to load. Can be some of these: Clotho, audioset, audiocaps, BBCSoundEffects",
104
- )
105
- parser.add_argument(
106
- "--full-train-dataset",
107
- nargs="+",
108
- default=None,
109
- help="Which dataset will be trained with all the subsets. (train+test)",
110
- )
111
- parser.add_argument(
112
- "--exclude-eval-dataset",
113
- nargs="+",
114
- default=None,
115
- help="Which dataset will be excluded with evaluation",
116
- )
117
- parser.add_argument(
118
- "--datasetinfos",
119
- nargs="+",
120
- default=None,
121
- help="If loading webdataset, spedify the dataset types to load. Can be some of these: train, test, valid, unbalanced_train, balanced_train, eval",
122
- )
123
- parser.add_argument(
124
- "--dataset-proportion",
125
- type=float,
126
- default=1.0,
127
- help="How much proportion of dataset we want to train.",
128
- )
129
- parser.add_argument(
130
- "--remotedata",
131
- default=False,
132
- action="store_true",
133
- help="if the dataset is remote, set this flag",
134
- )
135
- parser.add_argument(
136
- "--class-label-path",
137
- type=str,
138
- default=None,
139
- help="The path of the class label pickle or csv.",
140
- )
141
- parser.add_argument(
142
- "--datasetpath",
143
- type=str,
144
- default="/mnt/audio_clip/webdataset_tar",
145
- help="The path to the dataset",
146
- )
147
- parser.add_argument(
148
- "--logs",
149
- type=str,
150
- default="./logs/",
151
- help="Where to store tensorboard logs. Use None to avoid storing logs.",
152
- )
153
- parser.add_argument(
154
- "--log-local",
155
- action="store_true",
156
- default=False,
157
- help="log files on local master, otherwise global master only.",
158
- )
159
- parser.add_argument(
160
- "--name",
161
- type=str,
162
- default=None,
163
- help="Optional identifier for the experiment when storing logs. Otherwise use current time.",
164
- )
165
- parser.add_argument(
166
- "--workers", type=int, default=1, help="Number of workers per GPU."
167
- )
168
- parser.add_argument(
169
- "--batch-size", type=int, default=64, help="Batch size per GPU."
170
- )
171
- parser.add_argument(
172
- "--epochs", type=int, default=32, help="Number of epochs to train for."
173
- )
174
- parser.add_argument("--lr", type=float, default=None, help="Learning rate.")
175
- parser.add_argument("--beta1", type=float, default=None, help="Adam beta 1.")
176
- parser.add_argument("--beta2", type=float, default=None, help="Adam beta 2.")
177
- parser.add_argument("--eps", type=float, default=None, help="Adam epsilon.")
178
- parser.add_argument("--momentum", type=float, default=None, help="SGD epsilon.")
179
- parser.add_argument("--wd", type=float, default=0.2, help="Weight decay.")
180
-
181
- parser.add_argument(
182
- "--split-opt",
183
- action="store_true",
184
- default=False,
185
- help="Use this flag to skip the learning rate decay.",
186
- )
187
- parser.add_argument(
188
- "--lr-pretrained", type=float, default=None, help="Learning rate for text."
189
- )
190
- parser.add_argument(
191
- "--beta1-pretrained", type=float, default=None, help="Adam beta 1 for text."
192
- )
193
- parser.add_argument(
194
- "--beta2-pretrained", type=float, default=None, help="Adam beta 2 for text."
195
- )
196
- parser.add_argument(
197
- "--eps-pretrained", type=float, default=None, help="Adam epsilon for text."
198
- )
199
- parser.add_argument(
200
- "--wd-pretrained", type=float, default=0.2, help="Weight decay for text."
201
- )
202
- parser.add_argument(
203
- "--momentum-pretrained", type=float, default=0.9, help="Momentum for text."
204
- )
205
- parser.add_argument(
206
- "--lr-new", type=float, default=None, help="Learning rate for audio."
207
- )
208
- parser.add_argument(
209
- "--beta1-new", type=float, default=None, help="Adam beta 1 for audio."
210
- )
211
- parser.add_argument(
212
- "--beta2-new", type=float, default=None, help="Adam beta 2 for audio."
213
- )
214
- parser.add_argument(
215
- "--eps-new", type=float, default=None, help="Adam epsilon for audio."
216
- )
217
- parser.add_argument(
218
- "--wd-new", type=float, default=0.2, help="Weight decay for audio."
219
- )
220
- parser.add_argument(
221
- "--momentum-new", type=float, default=0.9, help="Momentum for audio."
222
- )
223
- parser.add_argument(
224
- "--warmup", type=int, default=10000, help="Number of steps to warmup for."
225
- )
226
- parser.add_argument(
227
- "--use-bn-sync",
228
- default=False,
229
- action="store_true",
230
- help="Whether to use batch norm sync.",
231
- )
232
- parser.add_argument(
233
- "--skip-scheduler",
234
- action="store_true",
235
- default=False,
236
- help="Use this flag to skip the learning rate decay.",
237
- )
238
- parser.add_argument(
239
- "--save-frequency", type=int, default=1, help="How often to save checkpoints."
240
- )
241
- parser.add_argument(
242
- "--save-top-performance",
243
- type=int,
244
- default=0,
245
- help="Save the top x performance weights if the value >0",
246
- )
247
- parser.add_argument(
248
- "--save-most-recent",
249
- action="store_true",
250
- default=False,
251
- help="Always save the most recent model trained to epoch_latest.pt.",
252
- )
253
- parser.add_argument(
254
- "--zeroshot-frequency", type=int, default=2, help="How often to run zero shot."
255
- )
256
- parser.add_argument(
257
- "--val-frequency",
258
- type=int,
259
- default=1,
260
- help="How often to run evaluation with val data.",
261
- )
262
- parser.add_argument(
263
- "--resume",
264
- default=None,
265
- type=str,
266
- help="path to latest checkpoint (default: none)",
267
- )
268
- parser.add_argument(
269
- "--precision",
270
- choices=["amp", "fp16", "fp32"],
271
- default="amp",
272
- help="Floating point precision.",
273
- )
274
- parser.add_argument(
275
- "--amodel",
276
- type=str,
277
- default="RN50",
278
- help="Name of the audio backbone to use.",
279
- )
280
- parser.add_argument(
281
- "--tmodel",
282
- type=str,
283
- default="transformer",
284
- help="Name of the text backbone to use. Can be [transformer, bert, roberta, bart]",
285
- )
286
- parser.add_argument(
287
- "--pretrained-audio",
288
- default="",
289
- type=str,
290
- help="Use a pretrained audio model weights for the audio encoder of CLAP",
291
- )
292
- parser.add_argument(
293
- "--pretrained-text",
294
- default="",
295
- type=str,
296
- help="Use a pretrained text model weights for the text encoder of CLAP",
297
- )
298
- parser.add_argument(
299
- "--pretrained",
300
- default="",
301
- type=str,
302
- help="Use a pretrained CLIP model weights with the specified tag or file path.",
303
- )
304
- parser.add_argument(
305
- "--pretrained-image",
306
- default=False,
307
- action="store_true",
308
- help="Load imagenet pretrained weights for image tower backbone if available.",
309
- )
310
- parser.add_argument(
311
- "--lock-image",
312
- default=False,
313
- action="store_true",
314
- help="Lock full image tower by disabling gradients.",
315
- )
316
- parser.add_argument(
317
- "--lock-image-unlocked-groups",
318
- type=int,
319
- default=0,
320
- help="Leave last n image tower layer groups unlocked.",
321
- )
322
- parser.add_argument(
323
- "--lock-image-freeze-bn-stats",
324
- default=False,
325
- action="store_true",
326
- help="Freeze BatchNorm running stats in image tower for any locked layers.",
327
- )
328
- parser.add_argument(
329
- "--local-loss",
330
- default=False,
331
- action="store_true",
332
- help="calculate loss w/ local features @ global (instead of realizing full global @ global matrix)",
333
- )
334
- parser.add_argument(
335
- "--gather-with-grad",
336
- default=False,
337
- action="store_true",
338
- help="enable full distributed gradient for feature gather",
339
- )
340
- parser.add_argument(
341
- "--force-quick-gelu",
342
- default=False,
343
- action="store_true",
344
- help="Force use of QuickGELU activation for non-OpenAI transformer models.",
345
- )
346
- parser.add_argument(
347
- "--torchscript",
348
- default=False,
349
- action="store_true",
350
- help="torch.jit.script the model, also uses jit version of OpenAI models if pretrained=='openai'",
351
- )
352
- parser.add_argument(
353
- "--trace",
354
- default=False,
355
- action="store_true",
356
- help="torch.jit.trace the model for inference / eval only",
357
- )
358
- # arguments for distributed training
359
- parser.add_argument(
360
- "--dist-url",
361
- default="env://",
362
- type=str,
363
- help="url used to set up distributed training",
364
- )
365
- parser.add_argument(
366
- "--dist-backend", default="nccl", type=str, help="distributed backend"
367
- )
368
- parser.add_argument(
369
- "--report-to",
370
- default="",
371
- type=str,
372
- help="Options are ['wandb', 'tensorboard', 'wandb,tensorboard']",
373
- )
374
- parser.add_argument(
375
- "--wandb-notes", default="", type=str, help="Notes if logging with wandb"
376
- )
377
- parser.add_argument(
378
- "--C", type=float, default=3.16, help="inverse regularizer for logistic reg."
379
- )
380
- parser.add_argument(
381
- "--debug",
382
- default=False,
383
- action="store_true",
384
- help="If true, more information is logged.",
385
- )
386
- parser.add_argument(
387
- "--copy-codebase",
388
- default=False,
389
- action="store_true",
390
- help="If true, we copy the entire base on the log diretory, and execute from there.",
391
- )
392
- parser.add_argument(
393
- "--horovod",
394
- default=False,
395
- action="store_true",
396
- help="Use horovod for distributed training.",
397
- )
398
- parser.add_argument(
399
- "--ddp-static-graph",
400
- default=False,
401
- action="store_true",
402
- help="Enable static graph optimization for DDP in PyTorch >= 1.11.",
403
- )
404
- parser.add_argument(
405
- "--no-set-device-rank",
406
- default=False,
407
- action="store_true",
408
- help="Don't set device index from local rank (when CUDA_VISIBLE_DEVICES restricted to one per proc).",
409
- )
410
- parser.add_argument("--seed", type=int, default=4242, help="Default random seed.")
411
-
412
- parser.add_argument(
413
- "--top-k-checkpoint-select-dataset",
414
- type=str,
415
- default="all",
416
- help="The dataset of selecting top-k checkpoint.",
417
- )
418
-
419
- # @R10, @R@5, @R1, mAP@10
420
- parser.add_argument(
421
- "--top-k-checkpoint-select-metric",
422
- type=str,
423
- default="_R@10",
424
- help="The metric for selecting top-k checkpoint.",
425
- )
426
- parser.add_argument(
427
- "--openai-model-cache-dir",
428
- type=str,
429
- default="~/.cache/clip",
430
- help="Directory to download OpenAI models.",
431
- )
432
- parser.add_argument(
433
- "--optimizer",
434
- type=str,
435
- default="adamw",
436
- help="can be AdamW or SGD",
437
- )
438
- parser.add_argument(
439
- "--parallel-eval",
440
- default=False,
441
- action="store_true",
442
- help="Eval in parallel (multi-GPU, multi-node).",
443
- )
444
-
445
- parser.add_argument(
446
- "--no-eval",
447
- default=False,
448
- action="store_true",
449
- help="Training without evaluation.",
450
- )
451
-
452
- parser.add_argument(
453
- "--lp-mlp",
454
- default=False,
455
- action="store_true",
456
- help="Linear Probe using MLP layer or not.",
457
- )
458
-
459
- parser.add_argument(
460
- "--lp-freeze",
461
- default=False,
462
- action="store_true",
463
- help="Linear Probe using Freeze CLAP or not",
464
- )
465
-
466
- parser.add_argument(
467
- "--lp-act",
468
- default="None",
469
- type=str,
470
- help="Options are ['relu','elu','prelu','softmax','sigmoid']",
471
- )
472
-
473
- parser.add_argument(
474
- "--lp-loss", type=str, default="bce", help="Loss func of Linear Probe."
475
- )
476
-
477
- parser.add_argument(
478
- "--lp-metrics",
479
- type=str,
480
- default="map,mauc,acc",
481
- help="Metrics of Linear Probe.",
482
- )
483
-
484
- parser.add_argument(
485
- "--lp-lr", type=float, default=1e-4, help="learning rate of linear probe"
486
- )
487
- parser.add_argument(
488
- "--kappa",
489
- type=float,
490
- default=0,
491
- help="the kappa in the weighted contrastive loss, default is to turn off the weighted contrastive loss",
492
- )
493
-
494
- parser.add_argument(
495
- "--data-filling",
496
- type=str,
497
- default="pad",
498
- help="type of data filling when the audio length is shorter than the max length."
499
- "Can be one of the following: repeat, repeatpad, pad",
500
- )
501
- parser.add_argument(
502
- "--data-truncating",
503
- type=str,
504
- default="rand_trunc",
505
- help="type of data truncation when the audio length is longer than the max length."
506
- "Can be one of the following: rand_trunc, fusion",
507
- )
508
-
509
- parser.add_argument(
510
- "--clap-mlploss",
511
- default=False,
512
- action="store_true",
513
- help="Using MLP loss for CLAP model or not",
514
- )
515
-
516
- parser.add_argument(
517
- "--wandb-id",
518
- type=str,
519
- default=None,
520
- help="the id of wandb experiment to restore.",
521
- )
522
-
523
- parser.add_argument(
524
- "--sleep", type=float, default=0, help="sleep n seconds before start training"
525
- )
526
-
527
- # variable length processing
528
- parser.add_argument(
529
- "--enable-fusion",
530
- default=False,
531
- action="store_true",
532
- help="Enable feature funsion for variable-length data",
533
- )
534
-
535
- parser.add_argument(
536
- "--fusion-type",
537
- type=str,
538
- default="None",
539
- help="Type is among ['channel_map', 'daf_1d','aff_1d','iaff_1d','daf_2d','aff_2d','iaff_2d']",
540
- )
541
-
542
- parser.add_argument(
543
- "--mixup",
544
- default=False,
545
- action="store_true",
546
- help="Enable mixup in finetuning training.",
547
- )
548
- parser.add_argument(
549
- "--text-augment-selection",
550
- type=str,
551
- default=None,
552
- help="For selecting levels of augmented text. Type is among ['all', 'augment_only', 'none']",
553
- )
554
-
555
- args = parser.parse_args()
556
-
557
- # If some params are not passed, we use the default values based on model name.
558
- default_params = get_default_params(args.amodel)
559
- for name, val in default_params.items():
560
- if getattr(args, name) is None:
561
- setattr(args, name, val)
562
-
563
- return args
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AIGC-Audio/AudioGPT/audio_detection/audio_infer/utils/create_black_list.py DELETED
@@ -1,64 +0,0 @@
1
- import argparse
2
- import csv
3
- import os
4
-
5
- from utilities import create_folder
6
-
7
-
8
- def dcase2017task4(args):
9
- """Create black list. Black list is a list of audio ids that will be
10
- skipped in training.
11
- """
12
-
13
- # Augments & parameters
14
- workspace = args.workspace
15
-
16
- # Black list from DCASE 2017 Task 4
17
- test_weak_csv = 'metadata/black_list/groundtruth_weak_label_testing_set.csv'
18
- evaluation_weak_csv = 'metadata/black_list/groundtruth_weak_label_evaluation_set.csv'
19
-
20
- black_list_csv = os.path.join(workspace, 'black_list', 'dcase2017task4.csv')
21
- create_folder(os.path.dirname(black_list_csv))
22
-
23
- def get_id_sets(csv_path):
24
- with open(csv_path, 'r') as fr:
25
- reader = csv.reader(fr, delimiter='\t')
26
- lines = list(reader)
27
-
28
- ids_set = []
29
-
30
- for line in lines:
31
- """line: ['-5QrBL6MzLg_60.000_70.000.wav', '60.000', '70.000', 'Train horn']"""
32
- ids_set.append(line[0][0 : 11])
33
-
34
- ids_set = list(set(ids_set))
35
- return ids_set
36
-
37
- test_ids_set = get_id_sets(test_weak_csv)
38
- evaluation_ids_set = get_id_sets(evaluation_weak_csv)
39
-
40
- full_ids_set = test_ids_set + evaluation_ids_set
41
-
42
- # Write black list
43
- fw = open(black_list_csv, 'w')
44
-
45
- for id in full_ids_set:
46
- fw.write('{}\n'.format(id))
47
-
48
- print('Write black list to {}'.format(black_list_csv))
49
-
50
-
51
- if __name__ == '__main__':
52
- parser = argparse.ArgumentParser(description='')
53
- subparsers = parser.add_subparsers(dest='mode')
54
-
55
- parser_dcase2017task4 = subparsers.add_parser('dcase2017task4')
56
- parser_dcase2017task4.add_argument('--workspace', type=str, required=True)
57
-
58
- args = parser.parse_args()
59
-
60
- if args.mode == 'dcase2017task4':
61
- dcase2017task4(args)
62
-
63
- else:
64
- raise Exception('Error argument!')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AIGC-Audio/Make_An_Audio_inpaint/ldm/modules/image_degradation/__init__.py DELETED
@@ -1,2 +0,0 @@
1
- from ldm.modules.image_degradation.bsrgan import degradation_bsrgan_variant as degradation_fn_bsr
2
- from ldm.modules.image_degradation.bsrgan_light import degradation_bsrgan_variant as degradation_fn_bsr_light
 
 
 
spaces/Aaaaaaaabdualh/topic2poem/app.py DELETED
@@ -1,48 +0,0 @@
1
- from transformers import BertTokenizer, EncoderDecoderModel
2
- import gradio as gr
3
-
4
- tokenizerM = BertTokenizer.from_pretrained("mareloraby/BERTShared-PoetryGen-arV01")
5
- bertSharedM = EncoderDecoderModel.from_pretrained("mareloraby/BERTShared-PoetryGen-arV01")
6
- # bertSharedM.cuda()
7
-
8
-
9
- def generate_response(text, k = 70, p = 0.9, nb = 4):
10
- prompt = f"{text}"
11
- encoded_prompt = tokenizerM.encode_plus(prompt, return_tensors = 'pt')#.to(device)
12
- gneration = bertSharedM.generate(
13
- input_ids = encoded_prompt.input_ids,
14
- attention_mask = encoded_prompt.attention_mask,
15
- do_sample = True,
16
- top_k= k,
17
- top_p = p,
18
- num_beams= nb,
19
- max_length =130,
20
- repetition_penalty = 2.0,
21
- no_repeat_ngram_size = 2,
22
- early_stopping=True)
23
-
24
- generated_text = tokenizerM.decode(gneration[0], skip_special_tokens=True)
25
- bayts = generated_text.split("[BSEP]")
26
- while("FSEP" not in bayts[-1]):
27
- bayts = bayts[:-1]
28
- bayts = bayts[:-1]
29
- temp_poem = ''
30
- for b in range(len(bayts)):
31
- temp_line = bayts[b].split('[FSEP]')
32
- temp_poem = temp_poem + temp_line[1] + ' - ' + temp_line[0] +'\n'
33
-
34
- return temp_poem
35
-
36
- iface = gr.Interface(fn=generate_response,
37
- title = 'BERTShared - topic based generation',
38
-
39
- inputs=[
40
- gr.inputs.Radio(['حزينه','هجاء','عتاب','غزل','مدح','رومنسيه','دينية'],label='Choose Topic'),
41
- gr.inputs.Slider(10, 200, step=10,default = 70, label='Top-K'),
42
- gr.inputs.Slider(0.10, 0.99, step=0.02, default = 0.90, label='Top-P'),
43
- #gr.inputs.Slider(1, 20, step=1, default = 4, label='Beams'),
44
-
45
- ],
46
- outputs="text")
47
-
48
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AchyuthGamer/OpenGPT/g4f/Provider/deprecated/DfeHub.py DELETED
@@ -1,77 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import json
4
- import re
5
- import time
6
-
7
- import requests
8
-
9
- from ...typing import Any, CreateResult
10
- from ..base_provider import BaseProvider
11
-
12
-
13
- class DfeHub(BaseProvider):
14
- url = "https://chat.dfehub.com/"
15
- supports_stream = True
16
- supports_gpt_35_turbo = True
17
-
18
- @staticmethod
19
- def create_completion(
20
- model: str,
21
- messages: list[dict[str, str]],
22
- stream: bool, **kwargs: Any) -> CreateResult:
23
-
24
- headers = {
25
- "authority" : "chat.dfehub.com",
26
- "accept" : "*/*",
27
- "accept-language" : "en,fr-FR;q=0.9,fr;q=0.8,es-ES;q=0.7,es;q=0.6,en-US;q=0.5,am;q=0.4,de;q=0.3",
28
- "content-type" : "application/json",
29
- "origin" : "https://chat.dfehub.com",
30
- "referer" : "https://chat.dfehub.com/",
31
- "sec-ch-ua" : '"Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"',
32
- "sec-ch-ua-mobile" : "?0",
33
- "sec-ch-ua-platform": '"macOS"',
34
- "sec-fetch-dest" : "empty",
35
- "sec-fetch-mode" : "cors",
36
- "sec-fetch-site" : "same-origin",
37
- "user-agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
38
- "x-requested-with" : "XMLHttpRequest",
39
- }
40
-
41
- json_data = {
42
- "messages" : messages,
43
- "model" : "gpt-3.5-turbo",
44
- "temperature" : kwargs.get("temperature", 0.5),
45
- "presence_penalty" : kwargs.get("presence_penalty", 0),
46
- "frequency_penalty" : kwargs.get("frequency_penalty", 0),
47
- "top_p" : kwargs.get("top_p", 1),
48
- "stream" : True
49
- }
50
-
51
- response = requests.post("https://chat.dfehub.com/api/openai/v1/chat/completions",
52
- headers=headers, json=json_data, timeout=3)
53
-
54
- for chunk in response.iter_lines():
55
- if b"detail" in chunk:
56
- delay = re.findall(r"\d+\.\d+", chunk.decode())
57
- delay = float(delay[-1])
58
- time.sleep(delay)
59
- yield from DfeHub.create_completion(model, messages, stream, **kwargs)
60
- if b"content" in chunk:
61
- data = json.loads(chunk.decode().split("data: ")[1])
62
- yield (data["choices"][0]["delta"]["content"])
63
-
64
- @classmethod
65
- @property
66
- def params(cls):
67
- params = [
68
- ("model", "str"),
69
- ("messages", "list[dict[str, str]]"),
70
- ("stream", "bool"),
71
- ("temperature", "float"),
72
- ("presence_penalty", "int"),
73
- ("frequency_penalty", "int"),
74
- ("top_p", "int"),
75
- ]
76
- param = ", ".join([": ".join(p) for p in params])
77
- return f"g4f.provider.{cls.__name__} supports: ({param})"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AchyuthGamer/OpenGPT/g4f/Provider/deprecated/GetGpt.py DELETED
@@ -1,88 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import json
4
- import os
5
- import uuid
6
-
7
- import requests
8
- from Crypto.Cipher import AES
9
-
10
- from ...typing import Any, CreateResult
11
- from ..base_provider import BaseProvider
12
-
13
-
14
- class GetGpt(BaseProvider):
15
- url = 'https://chat.getgpt.world/'
16
- supports_stream = True
17
- working = False
18
- supports_gpt_35_turbo = True
19
-
20
- @staticmethod
21
- def create_completion(
22
- model: str,
23
- messages: list[dict[str, str]],
24
- stream: bool, **kwargs: Any) -> CreateResult:
25
-
26
- headers = {
27
- 'Content-Type' : 'application/json',
28
- 'Referer' : 'https://chat.getgpt.world/',
29
- 'user-agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
30
- }
31
-
32
- data = json.dumps(
33
- {
34
- 'messages' : messages,
35
- 'frequency_penalty' : kwargs.get('frequency_penalty', 0),
36
- 'max_tokens' : kwargs.get('max_tokens', 4000),
37
- 'model' : 'gpt-3.5-turbo',
38
- 'presence_penalty' : kwargs.get('presence_penalty', 0),
39
- 'temperature' : kwargs.get('temperature', 1),
40
- 'top_p' : kwargs.get('top_p', 1),
41
- 'stream' : True,
42
- 'uuid' : str(uuid.uuid4())
43
- }
44
- )
45
-
46
- res = requests.post('https://chat.getgpt.world/api/chat/stream',
47
- headers=headers, json={'signature': _encrypt(data)}, stream=True)
48
-
49
- res.raise_for_status()
50
- for line in res.iter_lines():
51
- if b'content' in line:
52
- line_json = json.loads(line.decode('utf-8').split('data: ')[1])
53
- yield (line_json['choices'][0]['delta']['content'])
54
-
55
- @classmethod
56
- @property
57
- def params(cls):
58
- params = [
59
- ('model', 'str'),
60
- ('messages', 'list[dict[str, str]]'),
61
- ('stream', 'bool'),
62
- ('temperature', 'float'),
63
- ('presence_penalty', 'int'),
64
- ('frequency_penalty', 'int'),
65
- ('top_p', 'int'),
66
- ('max_tokens', 'int'),
67
- ]
68
- param = ', '.join([': '.join(p) for p in params])
69
- return f'g4f.provider.{cls.__name__} supports: ({param})'
70
-
71
-
72
- def _encrypt(e: str):
73
- t = os.urandom(8).hex().encode('utf-8')
74
- n = os.urandom(8).hex().encode('utf-8')
75
- r = e.encode('utf-8')
76
-
77
- cipher = AES.new(t, AES.MODE_CBC, n)
78
- ciphertext = cipher.encrypt(_pad_data(r))
79
-
80
- return ciphertext.hex() + t.decode('utf-8') + n.decode('utf-8')
81
-
82
-
83
- def _pad_data(data: bytes) -> bytes:
84
- block_size = AES.block_size
85
- padding_size = block_size - len(data) % block_size
86
- padding = bytes([padding_size] * padding_size)
87
-
88
- return data + padding
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Adapter/T2I-Adapter/ldm/models/diffusion/dpm_solver/sampler.py DELETED
@@ -1,87 +0,0 @@
1
- """SAMPLING ONLY."""
2
- import torch
3
-
4
- from .dpm_solver import NoiseScheduleVP, model_wrapper, DPM_Solver
5
-
6
-
7
- MODEL_TYPES = {
8
- "eps": "noise",
9
- "v": "v"
10
- }
11
-
12
-
13
- class DPMSolverSampler(object):
14
- def __init__(self, model, **kwargs):
15
- super().__init__()
16
- self.model = model
17
- to_torch = lambda x: x.clone().detach().to(torch.float32).to(model.device)
18
- self.register_buffer('alphas_cumprod', to_torch(model.alphas_cumprod))
19
-
20
- def register_buffer(self, name, attr):
21
- if type(attr) == torch.Tensor:
22
- if attr.device != torch.device("cuda"):
23
- attr = attr.to(torch.device("cuda"))
24
- setattr(self, name, attr)
25
-
26
- @torch.no_grad()
27
- def sample(self,
28
- S,
29
- batch_size,
30
- shape,
31
- conditioning=None,
32
- callback=None,
33
- normals_sequence=None,
34
- img_callback=None,
35
- quantize_x0=False,
36
- eta=0.,
37
- mask=None,
38
- x0=None,
39
- temperature=1.,
40
- noise_dropout=0.,
41
- score_corrector=None,
42
- corrector_kwargs=None,
43
- verbose=True,
44
- x_T=None,
45
- log_every_t=100,
46
- unconditional_guidance_scale=1.,
47
- unconditional_conditioning=None,
48
- # this has to come in the same format as the conditioning, # e.g. as encoded tokens, ...
49
- **kwargs
50
- ):
51
- if conditioning is not None:
52
- if isinstance(conditioning, dict):
53
- cbs = conditioning[list(conditioning.keys())[0]].shape[0]
54
- if cbs != batch_size:
55
- print(f"Warning: Got {cbs} conditionings but batch-size is {batch_size}")
56
- else:
57
- if conditioning.shape[0] != batch_size:
58
- print(f"Warning: Got {conditioning.shape[0]} conditionings but batch-size is {batch_size}")
59
-
60
- # sampling
61
- C, H, W = shape
62
- size = (batch_size, C, H, W)
63
-
64
- print(f'Data shape for DPM-Solver sampling is {size}, sampling steps {S}')
65
-
66
- device = self.model.betas.device
67
- if x_T is None:
68
- img = torch.randn(size, device=device)
69
- else:
70
- img = x_T
71
-
72
- ns = NoiseScheduleVP('discrete', alphas_cumprod=self.alphas_cumprod)
73
-
74
- model_fn = model_wrapper(
75
- lambda x, t, c: self.model.apply_model(x, t, c),
76
- ns,
77
- model_type=MODEL_TYPES[self.model.parameterization],
78
- guidance_type="classifier-free",
79
- condition=conditioning,
80
- unconditional_condition=unconditional_conditioning,
81
- guidance_scale=unconditional_guidance_scale,
82
- )
83
-
84
- dpm_solver = DPM_Solver(model_fn, ns, predict_x0=True, thresholding=False)
85
- x = dpm_solver.sample(img, steps=S, skip_type="time_uniform", method="multistep", order=2, lower_order_final=True)
86
-
87
- return x.to(device), None
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Adapter/T2I-Adapter/style.css DELETED
@@ -1,3 +0,0 @@
1
- h1 {
2
- text-align: center;
3
- }
 
 
 
 
spaces/Adapter/T2I-Adapter/train_depth.py DELETED
@@ -1,281 +0,0 @@
1
- import argparse
2
- import logging
3
- import os
4
- import os.path as osp
5
- import torch
6
- from basicsr.utils import (get_env_info, get_root_logger, get_time_str,
7
- scandir)
8
- from basicsr.utils.options import copy_opt_file, dict2str
9
- from omegaconf import OmegaConf
10
-
11
- from ldm.data.dataset_depth import DepthDataset
12
- from basicsr.utils.dist_util import get_dist_info, init_dist, master_only
13
- from ldm.modules.encoders.adapter import Adapter
14
- from ldm.util import load_model_from_config
15
-
16
-
17
- @master_only
18
- def mkdir_and_rename(path):
19
- """mkdirs. If path exists, rename it with timestamp and create a new one.
20
-
21
- Args:
22
- path (str): Folder path.
23
- """
24
- if osp.exists(path):
25
- new_name = path + '_archived_' + get_time_str()
26
- print(f'Path already exists. Rename it to {new_name}', flush=True)
27
- os.rename(path, new_name)
28
- os.makedirs(path, exist_ok=True)
29
- os.makedirs(osp.join(path, 'models'))
30
- os.makedirs(osp.join(path, 'training_states'))
31
- os.makedirs(osp.join(path, 'visualization'))
32
-
33
-
34
- def load_resume_state(opt):
35
- resume_state_path = None
36
- if opt.auto_resume:
37
- state_path = osp.join('experiments', opt.name, 'training_states')
38
- if osp.isdir(state_path):
39
- states = list(scandir(state_path, suffix='state', recursive=False, full_path=False))
40
- if len(states) != 0:
41
- states = [float(v.split('.state')[0]) for v in states]
42
- resume_state_path = osp.join(state_path, f'{max(states):.0f}.state')
43
- opt.resume_state_path = resume_state_path
44
-
45
- if resume_state_path is None:
46
- resume_state = None
47
- else:
48
- device_id = torch.cuda.current_device()
49
- resume_state = torch.load(resume_state_path, map_location=lambda storage, loc: storage.cuda(device_id))
50
- return resume_state
51
-
52
-
53
- def parsr_args():
54
- parser = argparse.ArgumentParser()
55
- parser.add_argument(
56
- "--bsize",
57
- type=int,
58
- default=8,
59
- )
60
- parser.add_argument(
61
- "--epochs",
62
- type=int,
63
- default=10000,
64
- )
65
- parser.add_argument(
66
- "--num_workers",
67
- type=int,
68
- default=8,
69
- )
70
- parser.add_argument(
71
- "--plms",
72
- action='store_true',
73
- help="use plms sampling",
74
- )
75
- parser.add_argument(
76
- "--auto_resume",
77
- action='store_true',
78
- help="use plms sampling",
79
- )
80
- parser.add_argument(
81
- "--ckpt",
82
- type=str,
83
- default="models/sd-v1-4.ckpt",
84
- help="path to checkpoint of model",
85
- )
86
- parser.add_argument(
87
- "--config",
88
- type=str,
89
- default="configs/stable-diffusion/sd-v1-train.yaml",
90
- help="path to config which constructs model",
91
- )
92
- parser.add_argument(
93
- "--name",
94
- type=str,
95
- default="train_depth",
96
- help="experiment name",
97
- )
98
- parser.add_argument(
99
- "--print_fq",
100
- type=int,
101
- default=100,
102
- help="path to config which constructs model",
103
- )
104
- parser.add_argument(
105
- "--H",
106
- type=int,
107
- default=512,
108
- help="image height, in pixel space",
109
- )
110
- parser.add_argument(
111
- "--W",
112
- type=int,
113
- default=512,
114
- help="image width, in pixel space",
115
- )
116
- parser.add_argument(
117
- "--C",
118
- type=int,
119
- default=4,
120
- help="latent channels",
121
- )
122
- parser.add_argument(
123
- "--f",
124
- type=int,
125
- default=8,
126
- help="downsampling factor",
127
- )
128
- parser.add_argument(
129
- "--sample_steps",
130
- type=int,
131
- default=50,
132
- help="number of ddim sampling steps",
133
- )
134
- parser.add_argument(
135
- "--n_samples",
136
- type=int,
137
- default=1,
138
- help="how many samples to produce for each given prompt. A.k.a. batch size",
139
- )
140
- parser.add_argument(
141
- "--scale",
142
- type=float,
143
- default=7.5,
144
- help="unconditional guidance scale: eps = eps(x, empty) + scale * (eps(x, cond) - eps(x, empty))",
145
- )
146
- parser.add_argument(
147
- "--gpus",
148
- default=[0, 1, 2, 3],
149
- help="gpu idx",
150
- )
151
- parser.add_argument(
152
- '--local_rank',
153
- default=0,
154
- type=int,
155
- help='node rank for distributed training'
156
- )
157
- parser.add_argument(
158
- '--launcher',
159
- default='pytorch',
160
- type=str,
161
- help='node rank for distributed training'
162
- )
163
- opt = parser.parse_args()
164
- return opt
165
-
166
-
167
- def main():
168
- opt = parsr_args()
169
- config = OmegaConf.load(f"{opt.config}")
170
-
171
- # distributed setting
172
- init_dist(opt.launcher)
173
- torch.backends.cudnn.benchmark = True
174
- device = 'cuda'
175
- torch.cuda.set_device(opt.local_rank)
176
-
177
- # dataset
178
- train_dataset = DepthDataset('datasets/laion_depth_meta_v1.txt')
179
- train_sampler = torch.utils.data.distributed.DistributedSampler(train_dataset)
180
- train_dataloader = torch.utils.data.DataLoader(
181
- train_dataset,
182
- batch_size=opt.bsize,
183
- shuffle=(train_sampler is None),
184
- num_workers=opt.num_workers,
185
- pin_memory=True,
186
- sampler=train_sampler)
187
-
188
- # stable diffusion
189
- model = load_model_from_config(config, f"{opt.ckpt}").to(device)
190
-
191
- # depth encoder
192
- model_ad = Adapter(cin=3 * 64, channels=[320, 640, 1280, 1280][:4], nums_rb=2, ksize=1, sk=True, use_conv=False).to(
193
- device)
194
-
195
- # to gpus
196
- model_ad = torch.nn.parallel.DistributedDataParallel(
197
- model_ad,
198
- device_ids=[opt.local_rank],
199
- output_device=opt.local_rank)
200
- model = torch.nn.parallel.DistributedDataParallel(
201
- model,
202
- device_ids=[opt.local_rank],
203
- output_device=opt.local_rank)
204
-
205
- # optimizer
206
- params = list(model_ad.parameters())
207
- optimizer = torch.optim.AdamW(params, lr=config['training']['lr'])
208
-
209
- experiments_root = osp.join('experiments', opt.name)
210
-
211
- # resume state
212
- resume_state = load_resume_state(opt)
213
- if resume_state is None:
214
- mkdir_and_rename(experiments_root)
215
- start_epoch = 0
216
- current_iter = 0
217
- # WARNING: should not use get_root_logger in the above codes, including the called functions
218
- # Otherwise the logger will not be properly initialized
219
- log_file = osp.join(experiments_root, f"train_{opt.name}_{get_time_str()}.log")
220
- logger = get_root_logger(logger_name='basicsr', log_level=logging.INFO, log_file=log_file)
221
- logger.info(get_env_info())
222
- logger.info(dict2str(config))
223
- else:
224
- # WARNING: should not use get_root_logger in the above codes, including the called functions
225
- # Otherwise the logger will not be properly initialized
226
- log_file = osp.join(experiments_root, f"train_{opt.name}_{get_time_str()}.log")
227
- logger = get_root_logger(logger_name='basicsr', log_level=logging.INFO, log_file=log_file)
228
- logger.info(get_env_info())
229
- logger.info(dict2str(config))
230
- resume_optimizers = resume_state['optimizers']
231
- optimizer.load_state_dict(resume_optimizers)
232
- logger.info(f"Resuming training from epoch: {resume_state['epoch']}, " f"iter: {resume_state['iter']}.")
233
- start_epoch = resume_state['epoch']
234
- current_iter = resume_state['iter']
235
-
236
- # copy the yml file to the experiment root
237
- copy_opt_file(opt.config, experiments_root)
238
-
239
- # training
240
- logger.info(f'Start training from epoch: {start_epoch}, iter: {current_iter}')
241
- for epoch in range(start_epoch, opt.epochs):
242
- train_dataloader.sampler.set_epoch(epoch)
243
- # train
244
- for _, data in enumerate(train_dataloader):
245
- current_iter += 1
246
- with torch.no_grad():
247
- c = model.module.get_learned_conditioning(data['sentence'])
248
- z = model.module.encode_first_stage((data['im'] * 2 - 1.).to(device))
249
- z = model.module.get_first_stage_encoding(z)
250
-
251
- optimizer.zero_grad()
252
- model.zero_grad()
253
- features_adapter = model_ad(data['depth'].to(device))
254
- l_pixel, loss_dict = model(z, c=c, features_adapter=features_adapter)
255
- l_pixel.backward()
256
- optimizer.step()
257
-
258
- if (current_iter + 1) % opt.print_fq == 0:
259
- logger.info(loss_dict)
260
-
261
- # save checkpoint
262
- rank, _ = get_dist_info()
263
- if (rank == 0) and ((current_iter + 1) % config['training']['save_freq'] == 0):
264
- save_filename = f'model_ad_{current_iter + 1}.pth'
265
- save_path = os.path.join(experiments_root, 'models', save_filename)
266
- save_dict = {}
267
- state_dict = model_ad.state_dict()
268
- for key, param in state_dict.items():
269
- if key.startswith('module.'): # remove unnecessary 'module.'
270
- key = key[7:]
271
- save_dict[key] = param.cpu()
272
- torch.save(save_dict, save_path)
273
- # save state
274
- state = {'epoch': epoch, 'iter': current_iter + 1, 'optimizers': optimizer.state_dict()}
275
- save_filename = f'{current_iter + 1}.state'
276
- save_path = os.path.join(experiments_root, 'training_states', save_filename)
277
- torch.save(state, save_path)
278
-
279
-
280
- if __name__ == '__main__':
281
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Aditya9790/yolo7-object-tracking/utils/aws/resume.py DELETED
@@ -1,37 +0,0 @@
1
- # Resume all interrupted trainings in yolor/ dir including DDP trainings
2
- # Usage: $ python utils/aws/resume.py
3
-
4
- import os
5
- import sys
6
- from pathlib import Path
7
-
8
- import torch
9
- import yaml
10
-
11
- sys.path.append('./') # to run '$ python *.py' files in subdirectories
12
-
13
- port = 0 # --master_port
14
- path = Path('').resolve()
15
- for last in path.rglob('*/**/last.pt'):
16
- ckpt = torch.load(last)
17
- if ckpt['optimizer'] is None:
18
- continue
19
-
20
- # Load opt.yaml
21
- with open(last.parent.parent / 'opt.yaml') as f:
22
- opt = yaml.load(f, Loader=yaml.SafeLoader)
23
-
24
- # Get device count
25
- d = opt['device'].split(',') # devices
26
- nd = len(d) # number of devices
27
- ddp = nd > 1 or (nd == 0 and torch.cuda.device_count() > 1) # distributed data parallel
28
-
29
- if ddp: # multi-GPU
30
- port += 1
31
- cmd = f'python -m torch.distributed.launch --nproc_per_node {nd} --master_port {port} train.py --resume {last}'
32
- else: # single-GPU
33
- cmd = f'python train.py --resume {last}'
34
-
35
- cmd += ' > /dev/null 2>&1 &' # redirect output to dev/null and run in daemon thread
36
- print(cmd)
37
- os.system(cmd)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/gridtable/ScrollMethods.js DELETED
@@ -1,13 +0,0 @@
1
- export default {
2
- scrollToRow(rowIndex) {
3
- var table = this.childrenMap.child;
4
- table.scrollToRow(rowIndex);
5
- return this;
6
- },
7
-
8
- scrollToNextRow(rowCount) {
9
- var table = this.childrenMap.child;
10
- table.scrollToNextRow(rowCount);
11
- return this;
12
- }
13
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/maker/builders/CreateNumberBar.js DELETED
@@ -1,20 +0,0 @@
1
- import MergeStyle from './utils/MergeStyle.js';
2
- import NumberBar from '../../numberbar/NumberBar.js';
3
- import CreateChild from './utils/CreateChild.js';
4
- import ReplaceSliderConfig from './utils/ReplaceSliderConfig.js';
5
-
6
- var CreateNumberBar = function (scene, data, view, styles, customBuilders) {
7
- data = MergeStyle(data, styles);
8
-
9
- // Replace data by child game object
10
- CreateChild(scene, data, 'background', view, styles, customBuilders);
11
- CreateChild(scene, data, 'icon', view, styles, customBuilders);
12
- ReplaceSliderConfig(scene, data.slider, view, styles, customBuilders);
13
- CreateChild(scene, data, 'text', view, styles, customBuilders);
14
-
15
- var gameObject = new NumberBar(scene, data);
16
- scene.add.existing(gameObject);
17
- return gameObject;
18
- };
19
-
20
- export default CreateNumberBar;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Alpaca233/SadTalker/src/face3d/models/losses.py DELETED
@@ -1,113 +0,0 @@
1
- import numpy as np
2
- import torch
3
- import torch.nn as nn
4
- from kornia.geometry import warp_affine
5
- import torch.nn.functional as F
6
-
7
- def resize_n_crop(image, M, dsize=112):
8
- # image: (b, c, h, w)
9
- # M : (b, 2, 3)
10
- return warp_affine(image, M, dsize=(dsize, dsize), align_corners=True)
11
-
12
- ### perceptual level loss
13
- class PerceptualLoss(nn.Module):
14
- def __init__(self, recog_net, input_size=112):
15
- super(PerceptualLoss, self).__init__()
16
- self.recog_net = recog_net
17
- self.preprocess = lambda x: 2 * x - 1
18
- self.input_size=input_size
19
- def forward(imageA, imageB, M):
20
- """
21
- 1 - cosine distance
22
- Parameters:
23
- imageA --torch.tensor (B, 3, H, W), range (0, 1) , RGB order
24
- imageB --same as imageA
25
- """
26
-
27
- imageA = self.preprocess(resize_n_crop(imageA, M, self.input_size))
28
- imageB = self.preprocess(resize_n_crop(imageB, M, self.input_size))
29
-
30
- # freeze bn
31
- self.recog_net.eval()
32
-
33
- id_featureA = F.normalize(self.recog_net(imageA), dim=-1, p=2)
34
- id_featureB = F.normalize(self.recog_net(imageB), dim=-1, p=2)
35
- cosine_d = torch.sum(id_featureA * id_featureB, dim=-1)
36
- # assert torch.sum((cosine_d > 1).float()) == 0
37
- return torch.sum(1 - cosine_d) / cosine_d.shape[0]
38
-
39
- def perceptual_loss(id_featureA, id_featureB):
40
- cosine_d = torch.sum(id_featureA * id_featureB, dim=-1)
41
- # assert torch.sum((cosine_d > 1).float()) == 0
42
- return torch.sum(1 - cosine_d) / cosine_d.shape[0]
43
-
44
- ### image level loss
45
- def photo_loss(imageA, imageB, mask, eps=1e-6):
46
- """
47
- l2 norm (with sqrt, to ensure backward stabililty, use eps, otherwise Nan may occur)
48
- Parameters:
49
- imageA --torch.tensor (B, 3, H, W), range (0, 1), RGB order
50
- imageB --same as imageA
51
- """
52
- loss = torch.sqrt(eps + torch.sum((imageA - imageB) ** 2, dim=1, keepdims=True)) * mask
53
- loss = torch.sum(loss) / torch.max(torch.sum(mask), torch.tensor(1.0).to(mask.device))
54
- return loss
55
-
56
- def landmark_loss(predict_lm, gt_lm, weight=None):
57
- """
58
- weighted mse loss
59
- Parameters:
60
- predict_lm --torch.tensor (B, 68, 2)
61
- gt_lm --torch.tensor (B, 68, 2)
62
- weight --numpy.array (1, 68)
63
- """
64
- if not weight:
65
- weight = np.ones([68])
66
- weight[28:31] = 20
67
- weight[-8:] = 20
68
- weight = np.expand_dims(weight, 0)
69
- weight = torch.tensor(weight).to(predict_lm.device)
70
- loss = torch.sum((predict_lm - gt_lm)**2, dim=-1) * weight
71
- loss = torch.sum(loss) / (predict_lm.shape[0] * predict_lm.shape[1])
72
- return loss
73
-
74
-
75
- ### regulization
76
- def reg_loss(coeffs_dict, opt=None):
77
- """
78
- l2 norm without the sqrt, from yu's implementation (mse)
79
- tf.nn.l2_loss https://www.tensorflow.org/api_docs/python/tf/nn/l2_loss
80
- Parameters:
81
- coeffs_dict -- a dict of torch.tensors , keys: id, exp, tex, angle, gamma, trans
82
-
83
- """
84
- # coefficient regularization to ensure plausible 3d faces
85
- if opt:
86
- w_id, w_exp, w_tex = opt.w_id, opt.w_exp, opt.w_tex
87
- else:
88
- w_id, w_exp, w_tex = 1, 1, 1, 1
89
- creg_loss = w_id * torch.sum(coeffs_dict['id'] ** 2) + \
90
- w_exp * torch.sum(coeffs_dict['exp'] ** 2) + \
91
- w_tex * torch.sum(coeffs_dict['tex'] ** 2)
92
- creg_loss = creg_loss / coeffs_dict['id'].shape[0]
93
-
94
- # gamma regularization to ensure a nearly-monochromatic light
95
- gamma = coeffs_dict['gamma'].reshape([-1, 3, 9])
96
- gamma_mean = torch.mean(gamma, dim=1, keepdims=True)
97
- gamma_loss = torch.mean((gamma - gamma_mean) ** 2)
98
-
99
- return creg_loss, gamma_loss
100
-
101
- def reflectance_loss(texture, mask):
102
- """
103
- minimize texture variance (mse), albedo regularization to ensure an uniform skin albedo
104
- Parameters:
105
- texture --torch.tensor, (B, N, 3)
106
- mask --torch.tensor, (N), 1 or 0
107
-
108
- """
109
- mask = mask.reshape([1, mask.shape[0], 1])
110
- texture_mean = torch.sum(mask * texture, dim=1, keepdims=True) / torch.sum(mask)
111
- loss = torch.sum(((texture - texture_mean) * mask)**2) / (texture.shape[0] * torch.sum(mask))
112
- return loss
113
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Amitesh007/elevenlabs-stt/README.md DELETED
@@ -1,12 +0,0 @@
1
- ---
2
- title: Elevenlabs Stt
3
- emoji: 🌖
4
- colorFrom: blue
5
- colorTo: indigo
6
- sdk: streamlit
7
- sdk_version: 1.19.0
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/docs/source/en/api/pipelines/stable_diffusion/image_variation.md DELETED
@@ -1,37 +0,0 @@
1
- <!--Copyright 2023 The HuggingFace Team. All rights reserved.
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
4
- the License. You may obtain a copy of the License at
5
-
6
- http://www.apache.org/licenses/LICENSE-2.0
7
-
8
- Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
9
- an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
- specific language governing permissions and limitations under the License.
11
- -->
12
-
13
- # Image variation
14
-
15
- The Stable Diffusion model can also generate variations from an input image. It uses a fine-tuned version of a Stable Diffusion model by [Justin Pinkney](https://www.justinpinkney.com/) from [Lambda](https://lambdalabs.com/).
16
-
17
- The original codebase can be found at [LambdaLabsML/lambda-diffusers](https://github.com/LambdaLabsML/lambda-diffusers#stable-diffusion-image-variations) and additional official checkpoints for image variation can be found at [lambdalabs/sd-image-variations-diffusers](https://huggingface.co/lambdalabs/sd-image-variations-diffusers).
18
-
19
- <Tip>
20
-
21
- Make sure to check out the Stable Diffusion [Tips](./overview#tips) section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!
22
-
23
- </Tip>
24
-
25
- ## StableDiffusionImageVariationPipeline
26
-
27
- [[autodoc]] StableDiffusionImageVariationPipeline
28
- - all
29
- - __call__
30
- - enable_attention_slicing
31
- - disable_attention_slicing
32
- - enable_xformers_memory_efficient_attention
33
- - disable_xformers_memory_efficient_attention
34
-
35
- ## StableDiffusionPipelineOutput
36
-
37
- [[autodoc]] pipelines.stable_diffusion.StableDiffusionPipelineOutput
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/docs/source/en/using-diffusers/controlling_generation.md DELETED
@@ -1,231 +0,0 @@
1
- <!--Copyright 2023 The HuggingFace Team. All rights reserved.
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
4
- the License. You may obtain a copy of the License at
5
-
6
- http://www.apache.org/licenses/LICENSE-2.0
7
-
8
- Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
9
- an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
- specific language governing permissions and limitations under the License.
11
- -->
12
-
13
- # Controlled generation
14
-
15
- Controlling outputs generated by diffusion models has been long pursued by the community and is now an active research topic. In many popular diffusion models, subtle changes in inputs, both images and text prompts, can drastically change outputs. In an ideal world we want to be able to control how semantics are preserved and changed.
16
-
17
- Most examples of preserving semantics reduce to being able to accurately map a change in input to a change in output. I.e. adding an adjective to a subject in a prompt preserves the entire image, only modifying the changed subject. Or, image variation of a particular subject preserves the subject's pose.
18
-
19
- Additionally, there are qualities of generated images that we would like to influence beyond semantic preservation. I.e. in general, we would like our outputs to be of good quality, adhere to a particular style, or be realistic.
20
-
21
- We will document some of the techniques `diffusers` supports to control generation of diffusion models. Much is cutting edge research and can be quite nuanced. If something needs clarifying or you have a suggestion, don't hesitate to open a discussion on the [forum](https://discuss.huggingface.co/) or a [GitHub issue](https://github.com/huggingface/diffusers/issues).
22
-
23
- We provide a high level explanation of how the generation can be controlled as well as a snippet of the technicals. For more in depth explanations on the technicals, the original papers which are linked from the pipelines are always the best resources.
24
-
25
- Depending on the use case, one should choose a technique accordingly. In many cases, these techniques can be combined. For example, one can combine Textual Inversion with SEGA to provide more semantic guidance to the outputs generated using Textual Inversion.
26
-
27
- Unless otherwise mentioned, these are techniques that work with existing models and don't require their own weights.
28
-
29
- 1. [Instruct Pix2Pix](#instruct-pix2pix)
30
- 2. [Pix2Pix Zero](#pix2pixzero)
31
- 3. [Attend and Excite](#attend-and-excite)
32
- 4. [Semantic Guidance](#semantic-guidance)
33
- 5. [Self-attention Guidance](#self-attention-guidance)
34
- 6. [Depth2Image](#depth2image)
35
- 7. [MultiDiffusion Panorama](#multidiffusion-panorama)
36
- 8. [DreamBooth](#dreambooth)
37
- 9. [Textual Inversion](#textual-inversion)
38
- 10. [ControlNet](#controlnet)
39
- 11. [Prompt Weighting](#prompt-weighting)
40
- 12. [Custom Diffusion](#custom-diffusion)
41
- 13. [Model Editing](#model-editing)
42
- 14. [DiffEdit](#diffedit)
43
-
44
- For convenience, we provide a table to denote which methods are inference-only and which require fine-tuning/training.
45
-
46
- | **Method** | **Inference only** | **Requires training /<br> fine-tuning** | **Comments** |
47
- | :-------------------------------------------------: | :----------------: | :-------------------------------------: | :---------------------------------------------------------------------------------------------: |
48
- | [Instruct Pix2Pix](#instruct-pix2pix) | ✅ | ❌ | Can additionally be<br>fine-tuned for better <br>performance on specific <br>edit instructions. |
49
- | [Pix2Pix Zero](#pix2pixzero) | ✅ | ❌ | |
50
- | [Attend and Excite](#attend-and-excite) | ✅ | ❌ | |
51
- | [Semantic Guidance](#semantic-guidance) | ✅ | ❌ | |
52
- | [Self-attention Guidance](#self-attention-guidance) | ✅ | ❌ | |
53
- | [Depth2Image](#depth2image) | ✅ | ❌ | |
54
- | [MultiDiffusion Panorama](#multidiffusion-panorama) | ✅ | ❌ | |
55
- | [DreamBooth](#dreambooth) | ❌ | ✅ | |
56
- | [Textual Inversion](#textual-inversion) | ❌ | ✅ | |
57
- | [ControlNet](#controlnet) | ✅ | ❌ | A ControlNet can be <br>trained/fine-tuned on<br>a custom conditioning. |
58
- | [Prompt Weighting](#prompt-weighting) | ✅ | ❌ | |
59
- | [Custom Diffusion](#custom-diffusion) | ❌ | ✅ | |
60
- | [Model Editing](#model-editing) | ✅ | ❌ | |
61
- | [DiffEdit](#diffedit) | ✅ | ❌ | |
62
- | [T2I-Adapter](#t2i-adapter) | ✅ | ❌ | |
63
-
64
- ## Instruct Pix2Pix
65
-
66
- [Paper](https://arxiv.org/abs/2211.09800)
67
-
68
- [Instruct Pix2Pix](../api/pipelines/stable_diffusion/pix2pix) is fine-tuned from stable diffusion to support editing input images. It takes as inputs an image and a prompt describing an edit, and it outputs the edited image.
69
- Instruct Pix2Pix has been explicitly trained to work well with [InstructGPT](https://openai.com/blog/instruction-following/)-like prompts.
70
-
71
- See [here](../api/pipelines/stable_diffusion/pix2pix) for more information on how to use it.
72
-
73
- ## Pix2Pix Zero
74
-
75
- [Paper](https://arxiv.org/abs/2302.03027)
76
-
77
- [Pix2Pix Zero](../api/pipelines/stable_diffusion/pix2pix_zero) allows modifying an image so that one concept or subject is translated to another one while preserving general image semantics.
78
-
79
- The denoising process is guided from one conceptual embedding towards another conceptual embedding. The intermediate latents are optimized during the denoising process to push the attention maps towards reference attention maps. The reference attention maps are from the denoising process of the input image and are used to encourage semantic preservation.
80
-
81
- Pix2Pix Zero can be used both to edit synthetic images as well as real images.
82
-
83
- - To edit synthetic images, one first generates an image given a caption.
84
- Next, we generate image captions for the concept that shall be edited and for the new target concept. We can use a model like [Flan-T5](https://huggingface.co/docs/transformers/model_doc/flan-t5) for this purpose. Then, "mean" prompt embeddings for both the source and target concepts are created via the text encoder. Finally, the pix2pix-zero algorithm is used to edit the synthetic image.
85
- - To edit a real image, one first generates an image caption using a model like [BLIP](https://huggingface.co/docs/transformers/model_doc/blip). Then one applies ddim inversion on the prompt and image to generate "inverse" latents. Similar to before, "mean" prompt embeddings for both source and target concepts are created and finally the pix2pix-zero algorithm in combination with the "inverse" latents is used to edit the image.
86
-
87
- <Tip>
88
-
89
- Pix2Pix Zero is the first model that allows "zero-shot" image editing. This means that the model
90
- can edit an image in less than a minute on a consumer GPU as shown [here](../api/pipelines/stable_diffusion/pix2pix_zero#usage-example).
91
-
92
- </Tip>
93
-
94
- As mentioned above, Pix2Pix Zero includes optimizing the latents (and not any of the UNet, VAE, or the text encoder) to steer the generation toward a specific concept. This means that the overall
95
- pipeline might require more memory than a standard [StableDiffusionPipeline](../api/pipelines/stable_diffusion/text2img).
96
-
97
- See [here](../api/pipelines/stable_diffusion/pix2pix_zero) for more information on how to use it.
98
-
99
- ## Attend and Excite
100
-
101
- [Paper](https://arxiv.org/abs/2301.13826)
102
-
103
- [Attend and Excite](../api/pipelines/stable_diffusion/attend_and_excite) allows subjects in the prompt to be faithfully represented in the final image.
104
-
105
- A set of token indices are given as input, corresponding to the subjects in the prompt that need to be present in the image. During denoising, each token index is guaranteed to have a minimum attention threshold for at least one patch of the image. The intermediate latents are iteratively optimized during the denoising process to strengthen the attention of the most neglected subject token until the attention threshold is passed for all subject tokens.
106
-
107
- Like Pix2Pix Zero, Attend and Excite also involves a mini optimization loop (leaving the pre-trained weights untouched) in its pipeline and can require more memory than the usual `StableDiffusionPipeline`.
108
-
109
- See [here](../api/pipelines/stable_diffusion/attend_and_excite) for more information on how to use it.
110
-
111
- ## Semantic Guidance (SEGA)
112
-
113
- [Paper](https://arxiv.org/abs/2301.12247)
114
-
115
- SEGA allows applying or removing one or more concepts from an image. The strength of the concept can also be controlled. I.e. the smile concept can be used to incrementally increase or decrease the smile of a portrait.
116
-
117
- Similar to how classifier free guidance provides guidance via empty prompt inputs, SEGA provides guidance on conceptual prompts. Multiple of these conceptual prompts can be applied simultaneously. Each conceptual prompt can either add or remove their concept depending on if the guidance is applied positively or negatively.
118
-
119
- Unlike Pix2Pix Zero or Attend and Excite, SEGA directly interacts with the diffusion process instead of performing any explicit gradient-based optimization.
120
-
121
- See [here](../api/pipelines/semantic_stable_diffusion) for more information on how to use it.
122
-
123
- ## Self-attention Guidance (SAG)
124
-
125
- [Paper](https://arxiv.org/abs/2210.00939)
126
-
127
- [Self-attention Guidance](../api/pipelines/stable_diffusion/self_attention_guidance) improves the general quality of images.
128
-
129
- SAG provides guidance from predictions not conditioned on high-frequency details to fully conditioned images. The high frequency details are extracted out of the UNet self-attention maps.
130
-
131
- See [here](../api/pipelines/stable_diffusion/self_attention_guidance) for more information on how to use it.
132
-
133
- ## Depth2Image
134
-
135
- [Project](https://huggingface.co/stabilityai/stable-diffusion-2-depth)
136
-
137
- [Depth2Image](../pipelines/stable_diffusion_2#depthtoimage) is fine-tuned from Stable Diffusion to better preserve semantics for text guided image variation.
138
-
139
- It conditions on a monocular depth estimate of the original image.
140
-
141
- See [here](../api/pipelines/stable_diffusion_2#depthtoimage) for more information on how to use it.
142
-
143
- <Tip>
144
-
145
- An important distinction between methods like InstructPix2Pix and Pix2Pix Zero is that the former
146
- involves fine-tuning the pre-trained weights while the latter does not. This means that you can
147
- apply Pix2Pix Zero to any of the available Stable Diffusion models.
148
-
149
- </Tip>
150
-
151
- ## MultiDiffusion Panorama
152
-
153
- [Paper](https://arxiv.org/abs/2302.08113)
154
-
155
- MultiDiffusion defines a new generation process over a pre-trained diffusion model. This process binds together multiple diffusion generation methods that can be readily applied to generate high quality and diverse images. Results adhere to user-provided controls, such as desired aspect ratio (e.g., panorama), and spatial guiding signals, ranging from tight segmentation masks to bounding boxes.
156
- [MultiDiffusion Panorama](../api/pipelines/stable_diffusion/panorama) allows to generate high-quality images at arbitrary aspect ratios (e.g., panoramas).
157
-
158
- See [here](../api/pipelines/stable_diffusion/panorama) for more information on how to use it to generate panoramic images.
159
-
160
- ## Fine-tuning your own models
161
-
162
- In addition to pre-trained models, Diffusers has training scripts for fine-tuning models on user-provided data.
163
-
164
- ## DreamBooth
165
-
166
- [DreamBooth](../training/dreambooth) fine-tunes a model to teach it about a new subject. I.e. a few pictures of a person can be used to generate images of that person in different styles.
167
-
168
- See [here](../training/dreambooth) for more information on how to use it.
169
-
170
- ## Textual Inversion
171
-
172
- [Textual Inversion](../training/text_inversion) fine-tunes a model to teach it about a new concept. I.e. a few pictures of a style of artwork can be used to generate images in that style.
173
-
174
- See [here](../training/text_inversion) for more information on how to use it.
175
-
176
- ## ControlNet
177
-
178
- [Paper](https://arxiv.org/abs/2302.05543)
179
-
180
- [ControlNet](../api/pipelines/controlnet) is an auxiliary network which adds an extra condition.
181
- [ControlNet](../api/pipelines/controlnet) is an auxiliary network which adds an extra condition.
182
- There are 8 canonical pre-trained ControlNets trained on different conditionings such as edge detection, scribbles,
183
- depth maps, and semantic segmentations.
184
-
185
- See [here](../api/pipelines/controlnet) for more information on how to use it.
186
-
187
- ## Prompt Weighting
188
-
189
- Prompt weighting is a simple technique that puts more attention weight on certain parts of the text
190
- input.
191
-
192
- For a more in-detail explanation and examples, see [here](../using-diffusers/weighted_prompts).
193
-
194
- ## Custom Diffusion
195
-
196
- [Custom Diffusion](../training/custom_diffusion) only fine-tunes the cross-attention maps of a pre-trained
197
- text-to-image diffusion model. It also allows for additionally performing textual inversion. It supports
198
- multi-concept training by design. Like DreamBooth and Textual Inversion, Custom Diffusion is also used to
199
- teach a pre-trained text-to-image diffusion model about new concepts to generate outputs involving the
200
- concept(s) of interest.
201
-
202
- For more details, check out our [official doc](../training/custom_diffusion).
203
-
204
- ## Model Editing
205
-
206
- [Paper](https://arxiv.org/abs/2303.08084)
207
-
208
- The [text-to-image model editing pipeline](../api/pipelines/stable_diffusion/model_editing) helps you mitigate some of the incorrect implicit assumptions a pre-trained text-to-image
209
- diffusion model might make about the subjects present in the input prompt. For example, if you prompt Stable Diffusion to generate images for "A pack of roses", the roses in the generated images
210
- are more likely to be red. This pipeline helps you change that assumption.
211
-
212
- To know more details, check out the [official doc](../api/pipelines/stable_diffusion/model_editing).
213
-
214
- ## DiffEdit
215
-
216
- [Paper](https://arxiv.org/abs/2210.11427)
217
-
218
- [DiffEdit](../api/pipelines/stable_diffusion/diffedit) allows for semantic editing of input images along with
219
- input prompts while preserving the original input images as much as possible.
220
-
221
- To know more details, check out the [official doc](../api/pipelines/stable_diffusion/model_editing).
222
-
223
- ## T2I-Adapter
224
-
225
- [Paper](https://arxiv.org/abs/2302.08453)
226
-
227
- [T2I-Adapter](../api/pipelines/stable_diffusion/adapter) is an auxiliary network which adds an extra condition.
228
- There are 8 canonical pre-trained adapters trained on different conditionings such as edge detection, sketch,
229
- depth maps, and semantic segmentations.
230
-
231
- See [here](../api/pipelines/stable_diffusion/adapter) for more information on how to use it.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Andy1621/uniformer_image_detection/configs/_base_/datasets/lvis_v0.5_instance.py DELETED
@@ -1,23 +0,0 @@
1
- _base_ = 'coco_instance.py'
2
- dataset_type = 'LVISV05Dataset'
3
- data_root = 'data/lvis_v0.5/'
4
- data = dict(
5
- samples_per_gpu=2,
6
- workers_per_gpu=2,
7
- train=dict(
8
- _delete_=True,
9
- type='ClassBalancedDataset',
10
- oversample_thr=1e-3,
11
- dataset=dict(
12
- type=dataset_type,
13
- ann_file=data_root + 'annotations/lvis_v0.5_train.json',
14
- img_prefix=data_root + 'train2017/')),
15
- val=dict(
16
- type=dataset_type,
17
- ann_file=data_root + 'annotations/lvis_v0.5_val.json',
18
- img_prefix=data_root + 'val2017/'),
19
- test=dict(
20
- type=dataset_type,
21
- ann_file=data_root + 'annotations/lvis_v0.5_val.json',
22
- img_prefix=data_root + 'val2017/'))
23
- evaluation = dict(metric=['bbox', 'segm'])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Andy1621/uniformer_image_detection/configs/htc/htc_x101_64x4d_fpn_dconv_c3-c5_mstrain_400_1400_16x1_20e_coco.py DELETED
@@ -1,42 +0,0 @@
1
- _base_ = './htc_r50_fpn_1x_coco.py'
2
- model = dict(
3
- pretrained='open-mmlab://resnext101_64x4d',
4
- backbone=dict(
5
- type='ResNeXt',
6
- depth=101,
7
- groups=64,
8
- base_width=4,
9
- num_stages=4,
10
- out_indices=(0, 1, 2, 3),
11
- frozen_stages=1,
12
- norm_cfg=dict(type='BN', requires_grad=True),
13
- norm_eval=True,
14
- style='pytorch',
15
- dcn=dict(type='DCN', deform_groups=1, fallback_on_stride=False),
16
- stage_with_dcn=(False, True, True, True)))
17
- # dataset settings
18
- img_norm_cfg = dict(
19
- mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
20
- train_pipeline = [
21
- dict(type='LoadImageFromFile'),
22
- dict(
23
- type='LoadAnnotations', with_bbox=True, with_mask=True, with_seg=True),
24
- dict(
25
- type='Resize',
26
- img_scale=[(1600, 400), (1600, 1400)],
27
- multiscale_mode='range',
28
- keep_ratio=True),
29
- dict(type='RandomFlip', flip_ratio=0.5),
30
- dict(type='Normalize', **img_norm_cfg),
31
- dict(type='Pad', size_divisor=32),
32
- dict(type='SegRescale', scale_factor=1 / 8),
33
- dict(type='DefaultFormatBundle'),
34
- dict(
35
- type='Collect',
36
- keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks', 'gt_semantic_seg']),
37
- ]
38
- data = dict(
39
- samples_per_gpu=1, workers_per_gpu=1, train=dict(pipeline=train_pipeline))
40
- # learning policy
41
- lr_config = dict(step=[16, 19])
42
- runner = dict(type='EpochBasedRunner', max_epochs=20)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AnishKumbhar/ChatBot/text-generation-webui-main/docs/GPTQ-models-(4-bit-mode).md DELETED
@@ -1,182 +0,0 @@
1
- GPTQ is a clever quantization algorithm that lightly reoptimizes the weights during quantization so that the accuracy loss is compensated relative to a round-to-nearest quantization. See the paper for more details: https://arxiv.org/abs/2210.17323
2
-
3
- 4-bit GPTQ models reduce VRAM usage by about 75%. So LLaMA-7B fits into a 6GB GPU, and LLaMA-30B fits into a 24GB GPU.
4
-
5
- ## Overview
6
-
7
- There are two ways of loading GPTQ models in the web UI at the moment:
8
-
9
- * Using AutoGPTQ:
10
- * supports more models
11
- * standardized (no need to guess any parameter)
12
- * is a proper Python library
13
- * ~no wheels are presently available so it requires manual compilation~
14
- * supports loading both triton and cuda models
15
-
16
- * Using GPTQ-for-LLaMa directly:
17
- * faster CPU offloading
18
- * faster multi-GPU inference
19
- * supports loading LoRAs using a monkey patch
20
- * requires you to manually figure out the wbits/groupsize/model_type parameters for the model to be able to load it
21
- * supports either only cuda or only triton depending on the branch
22
-
23
- For creating new quantizations, I recommend using AutoGPTQ: https://github.com/PanQiWei/AutoGPTQ
24
-
25
- ## AutoGPTQ
26
-
27
- ### Installation
28
-
29
- No additional steps are necessary as AutoGPTQ is already in the `requirements.txt` for the webui. If you still want or need to install it manually for whatever reason, these are the commands:
30
-
31
- ```
32
- conda activate textgen
33
- git clone https://github.com/PanQiWei/AutoGPTQ.git && cd AutoGPTQ
34
- pip install .
35
- ```
36
-
37
- The last command requires `nvcc` to be installed (see the [instructions above](https://github.com/oobabooga/text-generation-webui/blob/main/docs/GPTQ-models-(4-bit-mode).md#step-1-install-nvcc)).
38
-
39
- ### Usage
40
-
41
- When you quantize a model using AutoGPTQ, a folder containing a filed called `quantize_config.json` will be generated. Place that folder inside your `models/` folder and load it with the `--autogptq` flag:
42
-
43
- ```
44
- python server.py --autogptq --model model_name
45
- ```
46
-
47
- Alternatively, check the `autogptq` box in the "Model" tab of the UI before loading the model.
48
-
49
- ### Offloading
50
-
51
- In order to do CPU offloading or multi-gpu inference with AutoGPTQ, use the `--gpu-memory` flag. It is currently somewhat slower than offloading with the `--pre_layer` option in GPTQ-for-LLaMA.
52
-
53
- For CPU offloading:
54
-
55
- ```
56
- python server.py --autogptq --gpu-memory 3000MiB --model model_name
57
- ```
58
-
59
- For multi-GPU inference:
60
-
61
- ```
62
- python server.py --autogptq --gpu-memory 3000MiB 6000MiB --model model_name
63
- ```
64
-
65
- ### Using LoRAs with AutoGPTQ
66
-
67
- Works fine for a single LoRA.
68
-
69
- ## GPTQ-for-LLaMa
70
-
71
- GPTQ-for-LLaMa is the original adaptation of GPTQ for the LLaMA model. It was made possible by [@qwopqwop200](https://github.com/qwopqwop200/GPTQ-for-LLaMa): https://github.com/qwopqwop200/GPTQ-for-LLaMa
72
-
73
- A Python package containing both major CUDA versions of GPTQ-for-LLaMa is used to simplify installation and compatibility: https://github.com/jllllll/GPTQ-for-LLaMa-CUDA
74
-
75
- ### Precompiled wheels
76
-
77
- Kindly provided by our friend jllllll: https://github.com/jllllll/GPTQ-for-LLaMa-CUDA/releases
78
-
79
- Wheels are included in requirements.txt and are installed with the webui on supported systems.
80
-
81
- ### Manual installation
82
-
83
- #### Step 1: install nvcc
84
-
85
- ```
86
- conda activate textgen
87
- conda install cuda -c nvidia/label/cuda-11.7.1
88
- ```
89
-
90
- The command above takes some 10 minutes to run and shows no progress bar or updates along the way.
91
-
92
- You are also going to need to have a C++ compiler installed. On Linux, `sudo apt install build-essential` or equivalent is enough. On Windows, Visual Studio or Visual Studio Build Tools is required.
93
-
94
- If you're using an older version of CUDA toolkit (e.g. 11.7) but the latest version of `gcc` and `g++` (12.0+) on Linux, you should downgrade with: `conda install -c conda-forge gxx==11.3.0`. Kernel compilation will fail otherwise.
95
-
96
- #### Step 2: compile the CUDA extensions
97
-
98
- ```
99
- python -m pip install git+https://github.com/jllllll/GPTQ-for-LLaMa-CUDA -v
100
- ```
101
-
102
- ### Getting pre-converted LLaMA weights
103
-
104
- * Direct download (recommended):
105
-
106
- https://huggingface.co/Neko-Institute-of-Science/LLaMA-7B-4bit-128g
107
-
108
- https://huggingface.co/Neko-Institute-of-Science/LLaMA-13B-4bit-128g
109
-
110
- https://huggingface.co/Neko-Institute-of-Science/LLaMA-30B-4bit-128g
111
-
112
- https://huggingface.co/Neko-Institute-of-Science/LLaMA-65B-4bit-128g
113
-
114
- These models were converted with `desc_act=True`. They work just fine with ExLlama. For AutoGPTQ, they will only work on Linux with the `triton` option checked.
115
-
116
- * Torrent:
117
-
118
- https://github.com/oobabooga/text-generation-webui/pull/530#issuecomment-1483891617
119
-
120
- https://github.com/oobabooga/text-generation-webui/pull/530#issuecomment-1483941105
121
-
122
- These models were converted with `desc_act=False`. As such, they are less accurate, but they work with AutoGPTQ on Windows. The `128g` versions are better from 13b upwards, and worse for 7b. The tokenizer files in the torrents are outdated, in particular the files called `tokenizer_config.json` and `special_tokens_map.json`. Here you can find those files: https://huggingface.co/oobabooga/llama-tokenizer
123
-
124
- ### Starting the web UI:
125
-
126
- Use the `--gptq-for-llama` flag.
127
-
128
- For the models converted without `group-size`:
129
-
130
- ```
131
- python server.py --model llama-7b-4bit --gptq-for-llama
132
- ```
133
-
134
- For the models converted with `group-size`:
135
-
136
- ```
137
- python server.py --model llama-13b-4bit-128g --gptq-for-llama --wbits 4 --groupsize 128
138
- ```
139
-
140
- The command-line flags `--wbits` and `--groupsize` are automatically detected based on the folder names in many cases.
141
-
142
- ### CPU offloading
143
-
144
- It is possible to offload part of the layers of the 4-bit model to the CPU with the `--pre_layer` flag. The higher the number after `--pre_layer`, the more layers will be allocated to the GPU.
145
-
146
- With this command, I can run llama-7b with 4GB VRAM:
147
-
148
- ```
149
- python server.py --model llama-7b-4bit --pre_layer 20
150
- ```
151
-
152
- This is the performance:
153
-
154
- ```
155
- Output generated in 123.79 seconds (1.61 tokens/s, 199 tokens)
156
- ```
157
-
158
- You can also use multiple GPUs with `pre_layer` if using the oobabooga fork of GPTQ, eg `--pre_layer 30 60` will load a LLaMA-30B model half onto your first GPU and half onto your second, or `--pre_layer 20 40` will load 20 layers onto GPU-0, 20 layers onto GPU-1, and 20 layers offloaded to CPU.
159
-
160
- ### Using LoRAs with GPTQ-for-LLaMa
161
-
162
- This requires using a monkey patch that is supported by this web UI: https://github.com/johnsmith0031/alpaca_lora_4bit
163
-
164
- To use it:
165
-
166
- 1. Install alpaca_lora_4bit using pip
167
-
168
- ```
169
- git clone https://github.com/johnsmith0031/alpaca_lora_4bit.git
170
- cd alpaca_lora_4bit
171
- git fetch origin winglian-setup_pip
172
- git checkout winglian-setup_pip
173
- pip install .
174
- ```
175
-
176
- 2. Start the UI with the `--monkey-patch` flag:
177
-
178
- ```
179
- python server.py --model llama-7b-4bit-128g --listen --lora tloen_alpaca-lora-7b --monkey-patch
180
- ```
181
-
182
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AnishKumbhar/ChatBot/text-generation-webui-main/extensions/api/util.py DELETED
@@ -1,152 +0,0 @@
1
- import asyncio
2
- import functools
3
- import threading
4
- import time
5
- import traceback
6
- from threading import Thread
7
- from typing import Callable, Optional
8
-
9
- from modules import shared
10
- from modules.chat import load_character_memoized
11
- from modules.presets import load_preset_memoized
12
-
13
- # We use a thread local to store the asyncio lock, so that each thread
14
- # has its own lock. This isn't strictly necessary, but it makes it
15
- # such that if we can support multiple worker threads in the future,
16
- # thus handling multiple requests in parallel.
17
- api_tls = threading.local()
18
-
19
-
20
- def build_parameters(body, chat=False):
21
-
22
- generate_params = {
23
- 'max_new_tokens': int(body.get('max_new_tokens', body.get('max_length', 200))),
24
- 'auto_max_new_tokens': bool(body.get('auto_max_new_tokens', False)),
25
- 'max_tokens_second': int(body.get('max_tokens_second', 0)),
26
- 'do_sample': bool(body.get('do_sample', True)),
27
- 'temperature': float(body.get('temperature', 0.5)),
28
- 'top_p': float(body.get('top_p', 1)),
29
- 'typical_p': float(body.get('typical_p', body.get('typical', 1))),
30
- 'epsilon_cutoff': float(body.get('epsilon_cutoff', 0)),
31
- 'eta_cutoff': float(body.get('eta_cutoff', 0)),
32
- 'tfs': float(body.get('tfs', 1)),
33
- 'top_a': float(body.get('top_a', 0)),
34
- 'repetition_penalty': float(body.get('repetition_penalty', body.get('rep_pen', 1.1))),
35
- 'repetition_penalty_range': int(body.get('repetition_penalty_range', 0)),
36
- 'encoder_repetition_penalty': float(body.get('encoder_repetition_penalty', 1.0)),
37
- 'top_k': int(body.get('top_k', 0)),
38
- 'min_length': int(body.get('min_length', 0)),
39
- 'no_repeat_ngram_size': int(body.get('no_repeat_ngram_size', 0)),
40
- 'num_beams': int(body.get('num_beams', 1)),
41
- 'penalty_alpha': float(body.get('penalty_alpha', 0)),
42
- 'length_penalty': float(body.get('length_penalty', 1)),
43
- 'early_stopping': bool(body.get('early_stopping', False)),
44
- 'mirostat_mode': int(body.get('mirostat_mode', 0)),
45
- 'mirostat_tau': float(body.get('mirostat_tau', 5)),
46
- 'mirostat_eta': float(body.get('mirostat_eta', 0.1)),
47
- 'grammar_string': str(body.get('grammar_string', '')),
48
- 'guidance_scale': float(body.get('guidance_scale', 1)),
49
- 'negative_prompt': str(body.get('negative_prompt', '')),
50
- 'seed': int(body.get('seed', -1)),
51
- 'add_bos_token': bool(body.get('add_bos_token', True)),
52
- 'truncation_length': int(body.get('truncation_length', body.get('max_context_length', 2048))),
53
- 'custom_token_bans': str(body.get('custom_token_bans', '')),
54
- 'ban_eos_token': bool(body.get('ban_eos_token', False)),
55
- 'skip_special_tokens': bool(body.get('skip_special_tokens', True)),
56
- 'custom_stopping_strings': '', # leave this blank
57
- 'stopping_strings': body.get('stopping_strings', []),
58
- }
59
-
60
- preset_name = body.get('preset', 'None')
61
- if preset_name not in ['None', None, '']:
62
- preset = load_preset_memoized(preset_name)
63
- generate_params.update(preset)
64
-
65
- if chat:
66
- character = body.get('character')
67
- instruction_template = body.get('instruction_template', shared.settings['instruction_template'])
68
- if str(instruction_template) == "None":
69
- instruction_template = "Vicuna-v1.1"
70
- if str(character) == "None":
71
- character = "Assistant"
72
-
73
- name1, name2, _, greeting, context, _ = load_character_memoized(character, str(body.get('your_name', shared.settings['name1'])), '', instruct=False)
74
- name1_instruct, name2_instruct, _, _, context_instruct, turn_template = load_character_memoized(instruction_template, '', '', instruct=True)
75
- generate_params.update({
76
- 'mode': str(body.get('mode', 'chat')),
77
- 'name1': str(body.get('name1', name1)),
78
- 'name2': str(body.get('name2', name2)),
79
- 'context': str(body.get('context', context)),
80
- 'greeting': str(body.get('greeting', greeting)),
81
- 'name1_instruct': str(body.get('name1_instruct', name1_instruct)),
82
- 'name2_instruct': str(body.get('name2_instruct', name2_instruct)),
83
- 'context_instruct': str(body.get('context_instruct', context_instruct)),
84
- 'turn_template': str(body.get('turn_template', turn_template)),
85
- 'chat-instruct_command': str(body.get('chat_instruct_command', body.get('chat-instruct_command', shared.settings['chat-instruct_command']))),
86
- 'history': body.get('history', {'internal': [], 'visible': []})
87
- })
88
-
89
- return generate_params
90
-
91
-
92
- def try_start_cloudflared(port: int, tunnel_id: str, max_attempts: int = 3, on_start: Optional[Callable[[str], None]] = None):
93
- Thread(target=_start_cloudflared, args=[
94
- port, tunnel_id, max_attempts, on_start], daemon=True).start()
95
-
96
-
97
- def _start_cloudflared(port: int, tunnel_id: str, max_attempts: int = 3, on_start: Optional[Callable[[str], None]] = None):
98
- try:
99
- from flask_cloudflared import _run_cloudflared
100
- except ImportError:
101
- print('You should install flask_cloudflared manually')
102
- raise Exception(
103
- 'flask_cloudflared not installed. Make sure you installed the requirements.txt for this extension.')
104
-
105
- for _ in range(max_attempts):
106
- try:
107
- if tunnel_id is not None:
108
- public_url = _run_cloudflared(port, port + 1, tunnel_id=tunnel_id)
109
- else:
110
- public_url = _run_cloudflared(port, port + 1)
111
-
112
- if on_start:
113
- on_start(public_url)
114
-
115
- return
116
- except Exception:
117
- traceback.print_exc()
118
- time.sleep(3)
119
-
120
- raise Exception('Could not start cloudflared.')
121
-
122
-
123
- def _get_api_lock(tls) -> asyncio.Lock:
124
- """
125
- The streaming and blocking API implementations each run on their own
126
- thread, and multiplex requests using asyncio. If multiple outstanding
127
- requests are received at once, we will try to acquire the shared lock
128
- shared.generation_lock multiple times in succession in the same thread,
129
- which will cause a deadlock.
130
-
131
- To avoid this, we use this wrapper function to block on an asyncio
132
- lock, and then try and grab the shared lock only while holding
133
- the asyncio lock.
134
- """
135
- if not hasattr(tls, "asyncio_lock"):
136
- tls.asyncio_lock = asyncio.Lock()
137
-
138
- return tls.asyncio_lock
139
-
140
-
141
- def with_api_lock(func):
142
- """
143
- This decorator should be added to all streaming API methods which
144
- require access to the shared.generation_lock. It ensures that the
145
- tls.asyncio_lock is acquired before the method is called, and
146
- released afterwards.
147
- """
148
- @functools.wraps(func)
149
- async def api_wrapper(*args, **kwargs):
150
- async with _get_api_lock(api_tls):
151
- return await func(*args, **kwargs)
152
- return api_wrapper
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Annotation-AI/fast-segment-everything/app.py DELETED
@@ -1,17 +0,0 @@
1
- import os
2
-
3
-
4
- github_user = os.environ.get("GITHUB_USER")
5
- github_token = os.environ.get("GITHUB_TOKEN")
6
-
7
- repo_name = "annotation-ai/mlwiz-technical-demo"
8
-
9
- os.system(f"export GITHUB_USER={github_user}")
10
- os.system(f"export GITHUB_TOKEN={github_token}")
11
- os.system(f"git clone https://{github_user}:{github_token}@github.com/{repo_name}")
12
-
13
- cwd0 = os.getcwd()
14
- cwd1 = os.path.join(cwd0, "mlwiz-technical-demo/sam")
15
- os.chdir(cwd1)
16
- os.system("pip install -r requirements.txt")
17
- os.system("python app_everything.py")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Anonumous/RuImageCaptioning/app.py DELETED
@@ -1,242 +0,0 @@
1
- import torch
2
-
3
- import gradio as gr
4
-
5
- from PIL import Image
6
-
7
- import torch.nn as nn
8
- from torch.nn import functional as nnf
9
- from transformers import GPT2Tokenizer, GPT2LMHeadModel
10
- import cv2
11
- from PIL import Image
12
- from typing import Tuple, Optional, Union
13
-
14
- import clip
15
-
16
- gpt_model_name = 'sberbank-ai/rugpt3medium_based_on_gpt2'
17
-
18
-
19
- class MLP(nn.Module):
20
- def __init__(self, sizes: Tuple[int, ...], bias=True, act=nn.Tanh):
21
- super(MLP, self).__init__()
22
- layers = []
23
- for i in range(len(sizes) - 1):
24
- layers.append(nn.Linear(sizes[i], sizes[i + 1], bias=bias))
25
- if i < len(sizes) - 2:
26
- layers.append(act())
27
- self.model = nn.Sequential(*layers)
28
-
29
- # @autocast()
30
- def forward(self, x: torch.Tensor) -> torch.Tensor:
31
- return self.model(x)
32
-
33
-
34
- def freeze(
35
- model,
36
- freeze_emb=False,
37
- freeze_ln=False,
38
- freeze_attn=True,
39
- freeze_ff=True,
40
- freeze_other=False,
41
- ):
42
- for name, p in model.named_parameters():
43
- # freeze all parameters except the layernorm and positional embeddings
44
- name = name.lower()
45
- if 'ln' in name or 'norm' in name:
46
- p.requires_grad = not freeze_ln
47
- elif 'embeddings' in name:
48
- p.requires_grad = not freeze_emb
49
- elif 'mlp' in name:
50
- p.requires_grad = not freeze_ff
51
- elif 'attn' in name:
52
- p.requires_grad = not freeze_attn
53
- else:
54
- p.requires_grad = not freeze_other
55
-
56
- return model
57
-
58
-
59
- class ClipCaptionModel(nn.Module):
60
- def __init__(self, prefix_length: int, prefix_size: int = 768):
61
- super(ClipCaptionModel, self).__init__()
62
- self.prefix_length = prefix_length
63
- """
64
- ru gpts shit
65
- """
66
- self.gpt = GPT2LMHeadModel.from_pretrained(gpt_model_name)
67
-
68
- self.gpt_embedding_size = self.gpt.transformer.wte.weight.shape[1]
69
- self.clip_project = MLP((prefix_size, (self.gpt_embedding_size * prefix_length) // 2,
70
- self.gpt_embedding_size * prefix_length))
71
-
72
- def get_dummy_token(self, batch_size: int, device: torch.device) -> torch.Tensor:
73
- return torch.zeros(batch_size, self.prefix_length, dtype=torch.int64, device=device)
74
-
75
- # @autocast()
76
- def forward(self, tokens: torch.Tensor, prefix: torch.Tensor, mask: Optional[torch.Tensor] = None,
77
- labels: Optional[torch.Tensor] = None):
78
- embedding_text = self.gpt.transformer.wte(tokens)
79
-
80
- prefix_projections = self.clip_project(prefix.float()).view(-1, self.prefix_length, self.gpt_embedding_size)
81
-
82
- embedding_cat = torch.cat((prefix_projections, embedding_text), dim=1)
83
- if labels is not None:
84
- dummy_token = self.get_dummy_token(tokens.shape[0], tokens.device)
85
- labels = torch.cat((dummy_token, tokens), dim=1)
86
- out = self.gpt(inputs_embeds=embedding_cat, labels=labels, attention_mask=mask)
87
-
88
- return out
89
-
90
-
91
- class ClipCaptionPrefix(ClipCaptionModel):
92
- def parameters(self, recurse: bool = True):
93
- return self.clip_project.parameters()
94
-
95
- def train(self, mode: bool = True):
96
- super(ClipCaptionPrefix, self).train(mode)
97
- self.gpt.eval()
98
- return self
99
-
100
-
101
- def filter_ngrams(output_text):
102
- a_pos = output_text.find(' Ответ:')
103
- sec_a_pos = output_text.find(' Ответ:', a_pos + 1)
104
- return output_text[:sec_a_pos]
105
-
106
-
107
- def generate2(
108
- model,
109
- tokenizer,
110
- tokens=None,
111
- prompt='',
112
- embed=None,
113
- entry_count=1,
114
- entry_length=67, # maximum number of words
115
- top_p=0.98,
116
- temperature=1.,
117
- stop_token='.',
118
- ):
119
- model.eval()
120
- generated_num = 0
121
- generated_list = []
122
- stop_token_index = tokenizer.encode(stop_token)[0]
123
- filter_value = -float("Inf")
124
- device = next(model.parameters()).device
125
-
126
- with torch.no_grad():
127
- for entry_idx in range(entry_count):
128
- if not tokens:
129
- tokens = torch.tensor(tokenizer.encode(prompt))
130
- # print('tokens',tokens)
131
- tokens = tokens.unsqueeze(0).to(device)
132
-
133
- emb_tokens = model.gpt.transformer.wte(tokens)
134
-
135
- if embed is not None:
136
- generated = torch.cat((embed, emb_tokens), dim=1)
137
- else:
138
- generated = emb_tokens
139
-
140
- for i in range(entry_length):
141
- outputs = model.gpt(inputs_embeds=generated)
142
-
143
- logits = outputs.logits
144
- logits = logits[:, -1, :] / (temperature if temperature > 0 else 1.0)
145
- sorted_logits, sorted_indices = torch.sort(logits, descending=True)
146
- cumulative_probs = torch.cumsum(nnf.softmax(sorted_logits, dim=-1), dim=-1)
147
- sorted_indices_to_remove = cumulative_probs > top_p
148
- sorted_indices_to_remove[..., 1:] = sorted_indices_to_remove[..., :-1].clone()
149
- sorted_indices_to_remove[..., 0] = 0
150
-
151
- indices_to_remove = sorted_indices[sorted_indices_to_remove]
152
- logits[:, indices_to_remove] = filter_value
153
-
154
- top_k = 2000
155
- top_p = 0.98
156
- next_token = torch.argmax(logits, -1).unsqueeze(0)
157
- next_token_embed = model.gpt.transformer.wte(next_token)
158
- if tokens is None:
159
- tokens = next_token
160
- else:
161
- tokens = torch.cat((tokens, next_token), dim=1)
162
- generated = torch.cat((generated, next_token_embed), dim=1)
163
-
164
- if stop_token_index == next_token.item():
165
- break
166
-
167
- decoder_inputs_embeds = next_token_embed
168
-
169
- output_list = list(tokens.squeeze().cpu().numpy())
170
-
171
- output_text = tokenizer.decode(output_list)
172
- output_text = filter_ngrams(output_text)
173
- generated_list.append(output_text)
174
-
175
- return generated_list[0]
176
-
177
-
178
- def read_image(path):
179
- image = cv2.imread(path)
180
-
181
- size = 196, 196
182
- image = Image.fromarray(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
183
- image.thumbnail(size, Image.Resampling.LANCZOS)
184
-
185
- return image
186
-
187
-
188
- def create_emb(image):
189
- text = "Вопрос: что происходит на изображении? Ответ: "
190
- image = preprocess(image).unsqueeze(0).to(device)
191
- with torch.no_grad():
192
- prefix = clip_model.encode_image(image).to(device, dtype=torch.float32)
193
- prefix_embed = model.clip_project(prefix).reshape(1, prefix_length, -1)
194
- return (prefix, text)
195
-
196
-
197
- def get_caption(prefix, prompt=''):
198
- prefix = prefix.to(device)
199
- with torch.no_grad():
200
- prefix_embed = model.clip_project(prefix).reshape(1, prefix_length, -1)
201
- if prompt:
202
- generated_text_prefix = generate2(model, tokenizer, prompt=prompt, embed=prefix_embed)
203
- else:
204
- generated_text_prefix = generate2(model, tokenizer, embed=prefix_embed)
205
- return generated_text_prefix.replace('\n', ' ')
206
-
207
-
208
- def get_ans(clip_emb, prompt):
209
- output = get_caption(clip_emb, prompt=prompt)
210
- ans = output[len(prompt):].strip()
211
- return ans
212
-
213
-
214
- device = 'cpu'
215
- clip_model, preprocess = clip.load("ViT-L/14@336px", device=device, jit=False)
216
- tokenizer = GPT2Tokenizer.from_pretrained('sberbank-ai/rugpt3medium_based_on_gpt2')
217
- prefix_length = 30
218
- model_path = 'prefix_small_latest_gpt2_medium.pt'
219
- model = ClipCaptionPrefix(prefix_length)
220
- model.load_state_dict(torch.load(model_path, map_location='cpu'))
221
- model.to(device)
222
- model.eval()
223
-
224
-
225
-
226
- def classify_image(inp):
227
- print(type(inp))
228
- inp = Image.fromarray(inp)
229
- prefix, text = create_emb(inp)
230
- ans = get_ans(prefix, text)
231
- return ans
232
-
233
- image = gr.inputs.Image(shape=(196, 196))
234
- label = gr.outputs.Label(num_top_classes=3)
235
-
236
-
237
- iface = gr.Interface(fn=classify_image, description="RuImage Captioning trained for a image2text task to predict caption of image", inputs=image, outputs="text", examples=[
238
- ["1.png"],
239
- ["2.png"],
240
- ["3.png"]
241
- ])
242
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Anustup/NS_AI_LABS/app.py DELETED
@@ -1,263 +0,0 @@
1
- from typing import Iterator
2
-
3
- from io import StringIO
4
- import os
5
- import pathlib
6
- import tempfile
7
-
8
- # External programs
9
- import whisper
10
- import ffmpeg
11
-
12
- # UI
13
- import gradio as gr
14
-
15
- from src.download import ExceededMaximumDuration, download_url
16
- from src.utils import slugify, write_srt, write_vtt
17
- from src.vad import NonSpeechStrategy, PeriodicTranscriptionConfig, TranscriptionConfig, VadPeriodicTranscription, \
18
- VadSileroTranscription
19
-
20
- # Limitations (set to -1 to disable)
21
- DEFAULT_INPUT_AUDIO_MAX_DURATION = 600 # seconds
22
-
23
- # Whether or not to automatically delete all uploaded files, to save disk space
24
- DELETE_UPLOADED_FILES = True
25
-
26
- # Gradio seems to truncate files without keeping the extension, so we need to truncate the file prefix ourself
27
- MAX_FILE_PREFIX_LENGTH = 17
28
-
29
- LANGUAGES = [
30
- "English", "Hindi", "Tamil", "Urdu",
31
- "Malayalam", "Telugu", "Bengali", "Kannada",
32
- "Nepali", "Marathi", "Punjabi", "Sindhi",
33
- "Gujarati", "Sanskrit", "Assamese"]
34
-
35
-
36
- class WhisperTranscriber:
37
- def __init__(self, inputAudioMaxDuration: float = DEFAULT_INPUT_AUDIO_MAX_DURATION,
38
- deleteUploadedFiles: bool = DELETE_UPLOADED_FILES):
39
- self.model_cache = dict()
40
-
41
- self.vad_model = None
42
- self.inputAudioMaxDuration = inputAudioMaxDuration
43
- self.deleteUploadedFiles = deleteUploadedFiles
44
-
45
- def transcribe_webui(self, modelName, languageName, urlData, uploadFile, microphoneData, task, vad, vadMergeWindow,
46
- vadMaxMergeSize, vadPadding, vadPromptWindow):
47
- try:
48
- source, sourceName = self.__get_source(urlData, uploadFile, microphoneData)
49
-
50
- try:
51
- selectedLanguage = languageName.lower() if len(languageName) > 0 else None
52
- selectedModel = modelName if modelName is not None else "base"
53
-
54
- model = self.model_cache.get(selectedModel, None)
55
-
56
- if not model:
57
- model = whisper.load_model(selectedModel)
58
- self.model_cache[selectedModel] = model
59
-
60
- # Execute whisper
61
- result = self.transcribe_file(model, source, selectedLanguage, task, vad, vadMergeWindow,
62
- vadMaxMergeSize, vadPadding, vadPromptWindow)
63
-
64
- # Write result
65
- downloadDirectory = tempfile.mkdtemp()
66
-
67
- filePrefix = slugify(sourceName, allow_unicode=True)
68
- download, text, vtt = self.write_result(result, filePrefix, downloadDirectory)
69
-
70
- return download, text, vtt
71
-
72
- finally:
73
- # Cleanup source
74
- if self.deleteUploadedFiles:
75
- print("Deleting source file " + source)
76
- os.remove(source)
77
-
78
- except ExceededMaximumDuration as e:
79
- return [], ("[ERROR]: Maximum remote video length is " + str(e.maxDuration) + "s, file was " + str(
80
- e.videoDuration) + "s"), "[ERROR]"
81
-
82
- def transcribe_file(self, model: whisper.Whisper, audio_path: str, language: str, task: str = None, vad: str = None,
83
- vadMergeWindow: float = 5, vadMaxMergeSize: float = 150, vadPadding: float = 1,
84
- vadPromptWindow: float = 1, **decodeOptions: dict):
85
-
86
- initial_prompt = decodeOptions.pop('initial_prompt', None)
87
-
88
- if ('task' in decodeOptions):
89
- task = decodeOptions.pop('task')
90
-
91
- # Callable for processing an audio file
92
- whisperCallable = lambda audio, segment_index, prompt, detected_language: model.transcribe(audio, \
93
- language=language if language else detected_language,
94
- task=task, \
95
- initial_prompt=self._concat_prompt(
96
- initial_prompt,
97
- prompt) if segment_index == 0 else prompt, \
98
- **decodeOptions)
99
-
100
- # The results
101
- if (vad == 'silero-vad'):
102
- # Silero VAD where non-speech gaps are transcribed
103
- process_gaps = self._create_silero_config(NonSpeechStrategy.CREATE_SEGMENT, vadMergeWindow, vadMaxMergeSize,
104
- vadPadding, vadPromptWindow)
105
- result = self.vad_model.transcribe(audio_path, whisperCallable, process_gaps)
106
- elif (vad == 'silero-vad-skip-gaps'):
107
- # Silero VAD where non-speech gaps are simply ignored
108
- skip_gaps = self._create_silero_config(NonSpeechStrategy.SKIP, vadMergeWindow, vadMaxMergeSize, vadPadding,
109
- vadPromptWindow)
110
- result = self.vad_model.transcribe(audio_path, whisperCallable, skip_gaps)
111
- elif (vad == 'silero-vad-expand-into-gaps'):
112
- # Use Silero VAD where speech-segments are expanded into non-speech gaps
113
- expand_gaps = self._create_silero_config(NonSpeechStrategy.EXPAND_SEGMENT, vadMergeWindow, vadMaxMergeSize,
114
- vadPadding, vadPromptWindow)
115
- result = self.vad_model.transcribe(audio_path, whisperCallable, expand_gaps)
116
- elif (vad == 'periodic-vad'):
117
- # Very simple VAD - mark every 5 minutes as speech. This makes it less likely that Whisper enters an infinite loop, but
118
- # it may create a break in the middle of a sentence, causing some artifacts.
119
- periodic_vad = VadPeriodicTranscription()
120
- result = periodic_vad.transcribe(audio_path, whisperCallable,
121
- PeriodicTranscriptionConfig(periodic_duration=vadMaxMergeSize,
122
- max_prompt_window=vadPromptWindow))
123
- else:
124
- # Default VAD
125
- result = whisperCallable(audio_path, 0, None, None)
126
-
127
- return result
128
-
129
- def _concat_prompt(self, prompt1, prompt2):
130
- if (prompt1 is None):
131
- return prompt2
132
- elif (prompt2 is None):
133
- return prompt1
134
- else:
135
- return prompt1 + " " + prompt2
136
-
137
- def _create_silero_config(self, non_speech_strategy: NonSpeechStrategy, vadMergeWindow: float = 5,
138
- vadMaxMergeSize: float = 150, vadPadding: float = 1, vadPromptWindow: float = 1):
139
- # Use Silero VAD
140
- if (self.vad_model is None):
141
- self.vad_model = VadSileroTranscription()
142
-
143
- config = TranscriptionConfig(non_speech_strategy=non_speech_strategy,
144
- max_silent_period=vadMergeWindow, max_merge_size=vadMaxMergeSize,
145
- segment_padding_left=vadPadding, segment_padding_right=vadPadding,
146
- max_prompt_window=vadPromptWindow)
147
-
148
- return config
149
-
150
- def write_result(self, result: dict, source_name: str, output_dir: str):
151
- if not os.path.exists(output_dir):
152
- os.makedirs(output_dir)
153
-
154
- text = result["text"]
155
- language = result["language"]
156
- languageMaxLineWidth = self.__get_max_line_width(language)
157
-
158
- print("Max line width " + str(languageMaxLineWidth))
159
- vtt = self.__get_subs(result["segments"], "vtt", languageMaxLineWidth)
160
- srt = self.__get_subs(result["segments"], "srt", languageMaxLineWidth)
161
-
162
- output_files = []
163
- output_files.append(self.__create_file(srt, output_dir, source_name + "-subs.srt"));
164
- output_files.append(self.__create_file(vtt, output_dir, source_name + "-subs.vtt"));
165
- output_files.append(self.__create_file(text, output_dir, source_name + "-transcript.txt"));
166
-
167
- return output_files, text, vtt
168
-
169
- def clear_cache(self):
170
- self.model_cache = dict()
171
- self.vad_model = None
172
-
173
- def __get_source(self, urlData, uploadFile, microphoneData):
174
- if urlData:
175
- # Download from YouTube
176
- source = download_url(urlData, self.inputAudioMaxDuration)[0]
177
- else:
178
- # File input
179
- source = uploadFile if uploadFile is not None else microphoneData
180
-
181
- if self.inputAudioMaxDuration > 0:
182
- # Calculate audio length
183
- audioDuration = ffmpeg.probe(source)["format"]["duration"]
184
-
185
- if float(audioDuration) > self.inputAudioMaxDuration:
186
- raise ExceededMaximumDuration(videoDuration=audioDuration, maxDuration=self.inputAudioMaxDuration,
187
- message="Video is too long")
188
-
189
- file_path = pathlib.Path(source)
190
- sourceName = file_path.stem[:MAX_FILE_PREFIX_LENGTH] + file_path.suffix
191
-
192
- return source, sourceName
193
-
194
- def __get_max_line_width(self, language: str) -> int:
195
- if (language and language.lower() in ["japanese", "ja", "chinese", "zh"]):
196
- # Chinese characters and kana are wider, so limit line length to 40 characters
197
- return 40
198
- else:
199
- # TODO: Add more languages
200
- # 80 latin characters should fit on a 1080p/720p screen
201
- return 80
202
-
203
- def __get_subs(self, segments: Iterator[dict], format: str, maxLineWidth: int) -> str:
204
- segmentStream = StringIO()
205
-
206
- if format == 'vtt':
207
- write_vtt(segments, file=segmentStream, maxLineWidth=maxLineWidth)
208
- elif format == 'srt':
209
- write_srt(segments, file=segmentStream, maxLineWidth=maxLineWidth)
210
- else:
211
- raise Exception("Unknown format " + format)
212
-
213
- segmentStream.seek(0)
214
- return segmentStream.read()
215
-
216
- def __create_file(self, text: str, directory: str, fileName: str) -> str:
217
- # Write the text to a file
218
- with open(os.path.join(directory, fileName), 'w+', encoding="utf-8") as file:
219
- file.write(text)
220
-
221
- return file.name
222
-
223
-
224
- def create_ui(inputAudioMaxDuration, share=False, server_name: str = None):
225
- ui = WhisperTranscriber(inputAudioMaxDuration)
226
-
227
- ui_description = "NS AI LABS CUSTOMISED WHISPER WITH CUSTOM ASR LAYERS "
228
- ui_description += "YOU SPEAK IN ANY INDIAN LANGUAGE AT ANY CONDITION & PACE , WE WILL GIVE YOU BEST CONTEXTUAL " \
229
- "ASR IN ENGLISH "
230
- ui_description += " SUPPORTS HIN-ENGLISH TOO"
231
-
232
- ui_description += "\n\n\n\nFor longer audio files (>10 minutes) not in English, it is recommended that you select Silero VAD (Voice Activity Detector) in the VAD option."
233
-
234
- if inputAudioMaxDuration > 0:
235
- ui_description += "\n\n" + "Max audio file length: " + str(inputAudioMaxDuration) + " s"
236
-
237
- ui_article = "CHOOSE SMALL MODEL ( WE CUSTOMISED THIS ONLY )"
238
-
239
- demo = gr.Interface(fn=ui.transcribe_webui, description=ui_description, article=ui_article, inputs=[
240
- gr.Dropdown(choices=["tiny", "base", "small", "medium", "large"], value="medium", label="Model"),
241
- gr.Dropdown(choices=sorted(LANGUAGES), label="Language"),
242
- gr.Text(label="URL (cloudfont URL, etc.)"),
243
- gr.Audio(source="upload", type="filepath", label="Upload Audio"),
244
- gr.Audio(source="microphone", type="filepath", label="Microphone Input"),
245
- gr.Dropdown(choices=["transcribe", "translate"], label="Task"),
246
- gr.Dropdown(
247
- choices=["none", "silero-vad", "silero-vad-skip-gaps", "silero-vad-expand-into-gaps", "periodic-vad"],
248
- label="VAD"),
249
- gr.Number(label="VAD - Merge Window (s)", precision=0, value=5),
250
- gr.Number(label="VAD - Max Merge Size (s)", precision=0, value=30),
251
- gr.Number(label="VAD - Padding (s)", precision=None, value=1),
252
- gr.Number(label="VAD - Prompt Window (s)", precision=None, value=3)
253
- ], outputs=[
254
- gr.File(label="Download"),
255
- gr.Text(label="Transcription"),
256
- gr.Text(label="Segments")
257
- ])
258
-
259
- demo.launch(share=share, server_name=server_name)
260
-
261
-
262
- if __name__ == '__main__':
263
- create_ui(DEFAULT_INPUT_AUDIO_MAX_DURATION)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Arnx/MusicGenXvAKN/CONTRIBUTING.md DELETED
@@ -1,35 +0,0 @@
1
- # Contributing to Audiocraft
2
-
3
- We want to make contributing to this project as easy and transparent as
4
- possible.
5
-
6
- ## Pull Requests
7
-
8
- Audiocraft is the implementation of a research paper.
9
- Therefore, we do not plan on accepting many pull requests for new features.
10
- We certainly welcome them for bug fixes.
11
-
12
- 1. Fork the repo and create your branch from `main`.
13
- 2. If you've added code that should be tested, add tests.
14
- 3. If you've changed APIs, update the documentation.
15
- 4. Ensure the test suite passes.
16
- 5. Make sure your code lints.
17
- 6. If you haven't already, complete the Contributor License Agreement ("CLA").
18
-
19
- ## Contributor License Agreement ("CLA")
20
- In order to accept your pull request, we need you to submit a CLA. You only need
21
- to do this once to work on any of Meta's open source projects.
22
-
23
- Complete your CLA here: <https://code.facebook.com/cla>
24
-
25
- ## Issues
26
- We use GitHub issues to track public bugs. Please ensure your description is
27
- clear and has sufficient instructions to be able to reproduce the issue.
28
-
29
- Meta has a [bounty program](https://www.facebook.com/whitehat/) for the safe
30
- disclosure of security bugs. In those cases, please go through the process
31
- outlined on that page and do not file a public issue.
32
-
33
- ## License
34
- By contributing to encodec, you agree that your contributions will be licensed
35
- under the LICENSE file in the root directory of this source tree.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Artrajz/vits-simple-api/vits/bert/prosody_tool.py DELETED
@@ -1,426 +0,0 @@
1
- def is_chinese(uchar):
2
- if uchar >= u'\u4e00' and uchar <= u'\u9fa5':
3
- return True
4
- else:
5
- return False
6
-
7
-
8
- pinyin_dict = {
9
- "a": ("^", "a"),
10
- "ai": ("^", "ai"),
11
- "an": ("^", "an"),
12
- "ang": ("^", "ang"),
13
- "ao": ("^", "ao"),
14
- "ba": ("b", "a"),
15
- "bai": ("b", "ai"),
16
- "ban": ("b", "an"),
17
- "bang": ("b", "ang"),
18
- "bao": ("b", "ao"),
19
- "be": ("b", "e"),
20
- "bei": ("b", "ei"),
21
- "ben": ("b", "en"),
22
- "beng": ("b", "eng"),
23
- "bi": ("b", "i"),
24
- "bian": ("b", "ian"),
25
- "biao": ("b", "iao"),
26
- "bie": ("b", "ie"),
27
- "bin": ("b", "in"),
28
- "bing": ("b", "ing"),
29
- "bo": ("b", "o"),
30
- "bu": ("b", "u"),
31
- "ca": ("c", "a"),
32
- "cai": ("c", "ai"),
33
- "can": ("c", "an"),
34
- "cang": ("c", "ang"),
35
- "cao": ("c", "ao"),
36
- "ce": ("c", "e"),
37
- "cen": ("c", "en"),
38
- "ceng": ("c", "eng"),
39
- "cha": ("ch", "a"),
40
- "chai": ("ch", "ai"),
41
- "chan": ("ch", "an"),
42
- "chang": ("ch", "ang"),
43
- "chao": ("ch", "ao"),
44
- "che": ("ch", "e"),
45
- "chen": ("ch", "en"),
46
- "cheng": ("ch", "eng"),
47
- "chi": ("ch", "iii"),
48
- "chong": ("ch", "ong"),
49
- "chou": ("ch", "ou"),
50
- "chu": ("ch", "u"),
51
- "chua": ("ch", "ua"),
52
- "chuai": ("ch", "uai"),
53
- "chuan": ("ch", "uan"),
54
- "chuang": ("ch", "uang"),
55
- "chui": ("ch", "uei"),
56
- "chun": ("ch", "uen"),
57
- "chuo": ("ch", "uo"),
58
- "ci": ("c", "ii"),
59
- "cong": ("c", "ong"),
60
- "cou": ("c", "ou"),
61
- "cu": ("c", "u"),
62
- "cuan": ("c", "uan"),
63
- "cui": ("c", "uei"),
64
- "cun": ("c", "uen"),
65
- "cuo": ("c", "uo"),
66
- "da": ("d", "a"),
67
- "dai": ("d", "ai"),
68
- "dan": ("d", "an"),
69
- "dang": ("d", "ang"),
70
- "dao": ("d", "ao"),
71
- "de": ("d", "e"),
72
- "dei": ("d", "ei"),
73
- "den": ("d", "en"),
74
- "deng": ("d", "eng"),
75
- "di": ("d", "i"),
76
- "dia": ("d", "ia"),
77
- "dian": ("d", "ian"),
78
- "diao": ("d", "iao"),
79
- "die": ("d", "ie"),
80
- "ding": ("d", "ing"),
81
- "diu": ("d", "iou"),
82
- "dong": ("d", "ong"),
83
- "dou": ("d", "ou"),
84
- "du": ("d", "u"),
85
- "duan": ("d", "uan"),
86
- "dui": ("d", "uei"),
87
- "dun": ("d", "uen"),
88
- "duo": ("d", "uo"),
89
- "e": ("^", "e"),
90
- "ei": ("^", "ei"),
91
- "en": ("^", "en"),
92
- "ng": ("^", "en"),
93
- "eng": ("^", "eng"),
94
- "er": ("^", "er"),
95
- "fa": ("f", "a"),
96
- "fan": ("f", "an"),
97
- "fang": ("f", "ang"),
98
- "fei": ("f", "ei"),
99
- "fen": ("f", "en"),
100
- "feng": ("f", "eng"),
101
- "fo": ("f", "o"),
102
- "fou": ("f", "ou"),
103
- "fu": ("f", "u"),
104
- "ga": ("g", "a"),
105
- "gai": ("g", "ai"),
106
- "gan": ("g", "an"),
107
- "gang": ("g", "ang"),
108
- "gao": ("g", "ao"),
109
- "ge": ("g", "e"),
110
- "gei": ("g", "ei"),
111
- "gen": ("g", "en"),
112
- "geng": ("g", "eng"),
113
- "gong": ("g", "ong"),
114
- "gou": ("g", "ou"),
115
- "gu": ("g", "u"),
116
- "gua": ("g", "ua"),
117
- "guai": ("g", "uai"),
118
- "guan": ("g", "uan"),
119
- "guang": ("g", "uang"),
120
- "gui": ("g", "uei"),
121
- "gun": ("g", "uen"),
122
- "guo": ("g", "uo"),
123
- "ha": ("h", "a"),
124
- "hai": ("h", "ai"),
125
- "han": ("h", "an"),
126
- "hang": ("h", "ang"),
127
- "hao": ("h", "ao"),
128
- "he": ("h", "e"),
129
- "hei": ("h", "ei"),
130
- "hen": ("h", "en"),
131
- "heng": ("h", "eng"),
132
- "hong": ("h", "ong"),
133
- "hou": ("h", "ou"),
134
- "hu": ("h", "u"),
135
- "hua": ("h", "ua"),
136
- "huai": ("h", "uai"),
137
- "huan": ("h", "uan"),
138
- "huang": ("h", "uang"),
139
- "hui": ("h", "uei"),
140
- "hun": ("h", "uen"),
141
- "huo": ("h", "uo"),
142
- "ji": ("j", "i"),
143
- "jia": ("j", "ia"),
144
- "jian": ("j", "ian"),
145
- "jiang": ("j", "iang"),
146
- "jiao": ("j", "iao"),
147
- "jie": ("j", "ie"),
148
- "jin": ("j", "in"),
149
- "jing": ("j", "ing"),
150
- "jiong": ("j", "iong"),
151
- "jiu": ("j", "iou"),
152
- "ju": ("j", "v"),
153
- "juan": ("j", "van"),
154
- "jue": ("j", "ve"),
155
- "jun": ("j", "vn"),
156
- "ka": ("k", "a"),
157
- "kai": ("k", "ai"),
158
- "kan": ("k", "an"),
159
- "kang": ("k", "ang"),
160
- "kao": ("k", "ao"),
161
- "ke": ("k", "e"),
162
- "kei": ("k", "ei"),
163
- "ken": ("k", "en"),
164
- "keng": ("k", "eng"),
165
- "kong": ("k", "ong"),
166
- "kou": ("k", "ou"),
167
- "ku": ("k", "u"),
168
- "kua": ("k", "ua"),
169
- "kuai": ("k", "uai"),
170
- "kuan": ("k", "uan"),
171
- "kuang": ("k", "uang"),
172
- "kui": ("k", "uei"),
173
- "kun": ("k", "uen"),
174
- "kuo": ("k", "uo"),
175
- "la": ("l", "a"),
176
- "lai": ("l", "ai"),
177
- "lan": ("l", "an"),
178
- "lang": ("l", "ang"),
179
- "lao": ("l", "ao"),
180
- "le": ("l", "e"),
181
- "lei": ("l", "ei"),
182
- "leng": ("l", "eng"),
183
- "li": ("l", "i"),
184
- "lia": ("l", "ia"),
185
- "lian": ("l", "ian"),
186
- "liang": ("l", "iang"),
187
- "liao": ("l", "iao"),
188
- "lie": ("l", "ie"),
189
- "lin": ("l", "in"),
190
- "ling": ("l", "ing"),
191
- "liu": ("l", "iou"),
192
- "lo": ("l", "o"),
193
- "long": ("l", "ong"),
194
- "lou": ("l", "ou"),
195
- "lu": ("l", "u"),
196
- "lv": ("l", "v"),
197
- "luan": ("l", "uan"),
198
- "lve": ("l", "ve"),
199
- "lue": ("l", "ve"),
200
- "lun": ("l", "uen"),
201
- "luo": ("l", "uo"),
202
- "ma": ("m", "a"),
203
- "mai": ("m", "ai"),
204
- "man": ("m", "an"),
205
- "mang": ("m", "ang"),
206
- "mao": ("m", "ao"),
207
- "me": ("m", "e"),
208
- "mei": ("m", "ei"),
209
- "men": ("m", "en"),
210
- "meng": ("m", "eng"),
211
- "mi": ("m", "i"),
212
- "mian": ("m", "ian"),
213
- "miao": ("m", "iao"),
214
- "mie": ("m", "ie"),
215
- "min": ("m", "in"),
216
- "ming": ("m", "ing"),
217
- "miu": ("m", "iou"),
218
- "mo": ("m", "o"),
219
- "mou": ("m", "ou"),
220
- "mu": ("m", "u"),
221
- "na": ("n", "a"),
222
- "nai": ("n", "ai"),
223
- "nan": ("n", "an"),
224
- "nang": ("n", "ang"),
225
- "nao": ("n", "ao"),
226
- "ne": ("n", "e"),
227
- "nei": ("n", "ei"),
228
- "nen": ("n", "en"),
229
- "neng": ("n", "eng"),
230
- "ni": ("n", "i"),
231
- "nia": ("n", "ia"),
232
- "nian": ("n", "ian"),
233
- "niang": ("n", "iang"),
234
- "niao": ("n", "iao"),
235
- "nie": ("n", "ie"),
236
- "nin": ("n", "in"),
237
- "ning": ("n", "ing"),
238
- "niu": ("n", "iou"),
239
- "nong": ("n", "ong"),
240
- "nou": ("n", "ou"),
241
- "nu": ("n", "u"),
242
- "nv": ("n", "v"),
243
- "nuan": ("n", "uan"),
244
- "nve": ("n", "ve"),
245
- "nue": ("n", "ve"),
246
- "nuo": ("n", "uo"),
247
- "o": ("^", "o"),
248
- "ou": ("^", "ou"),
249
- "pa": ("p", "a"),
250
- "pai": ("p", "ai"),
251
- "pan": ("p", "an"),
252
- "pang": ("p", "ang"),
253
- "pao": ("p", "ao"),
254
- "pe": ("p", "e"),
255
- "pei": ("p", "ei"),
256
- "pen": ("p", "en"),
257
- "peng": ("p", "eng"),
258
- "pi": ("p", "i"),
259
- "pian": ("p", "ian"),
260
- "piao": ("p", "iao"),
261
- "pie": ("p", "ie"),
262
- "pin": ("p", "in"),
263
- "ping": ("p", "ing"),
264
- "po": ("p", "o"),
265
- "pou": ("p", "ou"),
266
- "pu": ("p", "u"),
267
- "qi": ("q", "i"),
268
- "qia": ("q", "ia"),
269
- "qian": ("q", "ian"),
270
- "qiang": ("q", "iang"),
271
- "qiao": ("q", "iao"),
272
- "qie": ("q", "ie"),
273
- "qin": ("q", "in"),
274
- "qing": ("q", "ing"),
275
- "qiong": ("q", "iong"),
276
- "qiu": ("q", "iou"),
277
- "qu": ("q", "v"),
278
- "quan": ("q", "van"),
279
- "que": ("q", "ve"),
280
- "qun": ("q", "vn"),
281
- "ran": ("r", "an"),
282
- "rang": ("r", "ang"),
283
- "rao": ("r", "ao"),
284
- "re": ("r", "e"),
285
- "ren": ("r", "en"),
286
- "reng": ("r", "eng"),
287
- "ri": ("r", "iii"),
288
- "rong": ("r", "ong"),
289
- "rou": ("r", "ou"),
290
- "ru": ("r", "u"),
291
- "rua": ("r", "ua"),
292
- "ruan": ("r", "uan"),
293
- "rui": ("r", "uei"),
294
- "run": ("r", "uen"),
295
- "ruo": ("r", "uo"),
296
- "sa": ("s", "a"),
297
- "sai": ("s", "ai"),
298
- "san": ("s", "an"),
299
- "sang": ("s", "ang"),
300
- "sao": ("s", "ao"),
301
- "se": ("s", "e"),
302
- "sen": ("s", "en"),
303
- "seng": ("s", "eng"),
304
- "sha": ("sh", "a"),
305
- "shai": ("sh", "ai"),
306
- "shan": ("sh", "an"),
307
- "shang": ("sh", "ang"),
308
- "shao": ("sh", "ao"),
309
- "she": ("sh", "e"),
310
- "shei": ("sh", "ei"),
311
- "shen": ("sh", "en"),
312
- "sheng": ("sh", "eng"),
313
- "shi": ("sh", "iii"),
314
- "shou": ("sh", "ou"),
315
- "shu": ("sh", "u"),
316
- "shua": ("sh", "ua"),
317
- "shuai": ("sh", "uai"),
318
- "shuan": ("sh", "uan"),
319
- "shuang": ("sh", "uang"),
320
- "shui": ("sh", "uei"),
321
- "shun": ("sh", "uen"),
322
- "shuo": ("sh", "uo"),
323
- "si": ("s", "ii"),
324
- "song": ("s", "ong"),
325
- "sou": ("s", "ou"),
326
- "su": ("s", "u"),
327
- "suan": ("s", "uan"),
328
- "sui": ("s", "uei"),
329
- "sun": ("s", "uen"),
330
- "suo": ("s", "uo"),
331
- "ta": ("t", "a"),
332
- "tai": ("t", "ai"),
333
- "tan": ("t", "an"),
334
- "tang": ("t", "ang"),
335
- "tao": ("t", "ao"),
336
- "te": ("t", "e"),
337
- "tei": ("t", "ei"),
338
- "teng": ("t", "eng"),
339
- "ti": ("t", "i"),
340
- "tian": ("t", "ian"),
341
- "tiao": ("t", "iao"),
342
- "tie": ("t", "ie"),
343
- "ting": ("t", "ing"),
344
- "tong": ("t", "ong"),
345
- "tou": ("t", "ou"),
346
- "tu": ("t", "u"),
347
- "tuan": ("t", "uan"),
348
- "tui": ("t", "uei"),
349
- "tun": ("t", "uen"),
350
- "tuo": ("t", "uo"),
351
- "wa": ("^", "ua"),
352
- "wai": ("^", "uai"),
353
- "wan": ("^", "uan"),
354
- "wang": ("^", "uang"),
355
- "wei": ("^", "uei"),
356
- "wen": ("^", "uen"),
357
- "weng": ("^", "ueng"),
358
- "wo": ("^", "uo"),
359
- "wu": ("^", "u"),
360
- "xi": ("x", "i"),
361
- "xia": ("x", "ia"),
362
- "xian": ("x", "ian"),
363
- "xiang": ("x", "iang"),
364
- "xiao": ("x", "iao"),
365
- "xie": ("x", "ie"),
366
- "xin": ("x", "in"),
367
- "xing": ("x", "ing"),
368
- "xiong": ("x", "iong"),
369
- "xiu": ("x", "iou"),
370
- "xu": ("x", "v"),
371
- "xuan": ("x", "van"),
372
- "xue": ("x", "ve"),
373
- "xun": ("x", "vn"),
374
- "ya": ("^", "ia"),
375
- "yan": ("^", "ian"),
376
- "yang": ("^", "iang"),
377
- "yao": ("^", "iao"),
378
- "ye": ("^", "ie"),
379
- "yi": ("^", "i"),
380
- "yin": ("^", "in"),
381
- "ying": ("^", "ing"),
382
- "yo": ("^", "iou"),
383
- "yong": ("^", "iong"),
384
- "you": ("^", "iou"),
385
- "yu": ("^", "v"),
386
- "yuan": ("^", "van"),
387
- "yue": ("^", "ve"),
388
- "yun": ("^", "vn"),
389
- "za": ("z", "a"),
390
- "zai": ("z", "ai"),
391
- "zan": ("z", "an"),
392
- "zang": ("z", "ang"),
393
- "zao": ("z", "ao"),
394
- "ze": ("z", "e"),
395
- "zei": ("z", "ei"),
396
- "zen": ("z", "en"),
397
- "zeng": ("z", "eng"),
398
- "zha": ("zh", "a"),
399
- "zhai": ("zh", "ai"),
400
- "zhan": ("zh", "an"),
401
- "zhang": ("zh", "ang"),
402
- "zhao": ("zh", "ao"),
403
- "zhe": ("zh", "e"),
404
- "zhei": ("zh", "ei"),
405
- "zhen": ("zh", "en"),
406
- "zheng": ("zh", "eng"),
407
- "zhi": ("zh", "iii"),
408
- "zhong": ("zh", "ong"),
409
- "zhou": ("zh", "ou"),
410
- "zhu": ("zh", "u"),
411
- "zhua": ("zh", "ua"),
412
- "zhuai": ("zh", "uai"),
413
- "zhuan": ("zh", "uan"),
414
- "zhuang": ("zh", "uang"),
415
- "zhui": ("zh", "uei"),
416
- "zhun": ("zh", "uen"),
417
- "zhuo": ("zh", "uo"),
418
- "zi": ("z", "ii"),
419
- "zong": ("z", "ong"),
420
- "zou": ("z", "ou"),
421
- "zu": ("z", "u"),
422
- "zuan": ("z", "uan"),
423
- "zui": ("z", "uei"),
424
- "zun": ("z", "uen"),
425
- "zuo": ("z", "uo"),
426
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/ArtyomKhyan/Detection/utils/google_utils.py DELETED
@@ -1,98 +0,0 @@
1
- # This file contains google utils: https://cloud.google.com/storage/docs/reference/libraries
2
- # pip install --upgrade google-cloud-storage
3
- # from google.cloud import storage
4
-
5
- import os
6
- import time
7
- from pathlib import Path
8
-
9
- def attempt_download(weights):
10
- # Attempt to download pretrained weights if not found locally
11
- weights = weights.strip()
12
- msg = weights + ' missing, try downloading from https://drive.google.com/drive/folders/1Drs_Aiu7xx6S-ix95f9kNsA6ueKRpN2J'
13
-
14
- r = 1
15
- if len(weights) > 0 and not os.path.isfile(weights):
16
- d = {'yolov3-spp.pt': '1mM67oNw4fZoIOL1c8M3hHmj66d8e-ni_', # yolov3-spp.yaml
17
- 'yolov5s.pt': '1R5T6rIyy3lLwgFXNms8whc-387H0tMQO', # yolov5s.yaml
18
- 'yolov5m.pt': '1vobuEExpWQVpXExsJ2w-Mbf3HJjWkQJr', # yolov5m.yaml
19
- 'yolov5l.pt': '1hrlqD1Wdei7UT4OgT785BEk1JwnSvNEV', # yolov5l.yaml
20
- 'yolov5x.pt': '1mM8aZJlWTxOg7BZJvNUMrTnA2AbeCVzS', # yolov5x.yaml
21
- }
22
-
23
- file = Path(weights).name
24
- if file in d:
25
- r = gdrive_download(id=d[file], name=weights)
26
-
27
- if not (r == 0 and os.path.exists(weights) and os.path.getsize(weights) > 1E6): # weights exist and > 1MB
28
- os.remove(weights) if os.path.exists(weights) else None # remove partial downloads
29
- s = "curl -L -o %s 'https://storage.googleapis.com/ultralytics/yolov5/ckpt/%s'" % (weights, file)
30
- r = os.system(s) # execute, capture return values
31
-
32
- # Error check
33
- if not (r == 0 and os.path.exists(weights) and os.path.getsize(weights) > 1E6): # weights exist and > 1MB
34
- os.remove(weights) if os.path.exists(weights) else None # remove partial downloads
35
- raise Exception(msg)
36
-
37
-
38
- def gdrive_download(id='1HaXkef9z6y5l4vUnCYgdmEAj61c6bfWO', name='coco.zip'):
39
- # https://gist.github.com/tanaikech/f0f2d122e05bf5f971611258c22c110f
40
- # Downloads a file from Google Drive, accepting presented query
41
- # from utils.google_utils import *; gdrive_download()
42
- t = time.time()
43
-
44
- print('Downloading https://drive.google.com/uc?export=download&id=%s as %s... ' % (id, name), end='')
45
- os.remove(name) if os.path.exists(name) else None # remove existing
46
- os.remove('cookie') if os.path.exists('cookie') else None
47
-
48
- # Attempt file download
49
- os.system("curl -c ./cookie -s -L \"https://drive.google.com/uc?export=download&id=%s\" > /dev/null" % id)
50
- if os.path.exists('cookie'): # large file
51
- s = "curl -Lb ./cookie \"https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=%s\" -o %s" % (
52
- id, name)
53
- else: # small file
54
- s = "curl -s -L -o %s 'https://drive.google.com/uc?export=download&id=%s'" % (name, id)
55
- r = os.system(s) # execute, capture return values
56
- os.remove('cookie') if os.path.exists('cookie') else None
57
-
58
- # Error check
59
- if r != 0:
60
- os.remove(name) if os.path.exists(name) else None # remove partial
61
- print('Download error ') # raise Exception('Download error')
62
- return r
63
-
64
- # Unzip if archive
65
- if name.endswith('.zip'):
66
- print('unzipping... ', end='')
67
- os.system('unzip -q %s' % name) # unzip
68
- os.remove(name) # remove zip to free space
69
-
70
- print('Done (%.1fs)' % (time.time() - t))
71
- return r
72
-
73
- # def upload_blob(bucket_name, source_file_name, destination_blob_name):
74
- # # Uploads a file to a bucket
75
- # # https://cloud.google.com/storage/docs/uploading-objects#storage-upload-object-python
76
- #
77
- # storage_client = storage.Client()
78
- # bucket = storage_client.get_bucket(bucket_name)
79
- # blob = bucket.blob(destination_blob_name)
80
- #
81
- # blob.upload_from_filename(source_file_name)
82
- #
83
- # print('File {} uploaded to {}.'.format(
84
- # source_file_name,
85
- # destination_blob_name))
86
- #
87
- #
88
- # def download_blob(bucket_name, source_blob_name, destination_file_name):
89
- # # Uploads a blob from a bucket
90
- # storage_client = storage.Client()
91
- # bucket = storage_client.get_bucket(bucket_name)
92
- # blob = bucket.blob(source_blob_name)
93
- #
94
- # blob.download_to_filename(destination_file_name)
95
- #
96
- # print('Blob {} downloaded to {}.'.format(
97
- # source_blob_name,
98
- # destination_file_name))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/chardet/jpcntx.py DELETED
@@ -1,238 +0,0 @@
1
- ######################## BEGIN LICENSE BLOCK ########################
2
- # The Original Code is Mozilla Communicator client code.
3
- #
4
- # The Initial Developer of the Original Code is
5
- # Netscape Communications Corporation.
6
- # Portions created by the Initial Developer are Copyright (C) 1998
7
- # the Initial Developer. All Rights Reserved.
8
- #
9
- # Contributor(s):
10
- # Mark Pilgrim - port to Python
11
- #
12
- # This library is free software; you can redistribute it and/or
13
- # modify it under the terms of the GNU Lesser General Public
14
- # License as published by the Free Software Foundation; either
15
- # version 2.1 of the License, or (at your option) any later version.
16
- #
17
- # This library is distributed in the hope that it will be useful,
18
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
- # Lesser General Public License for more details.
21
- #
22
- # You should have received a copy of the GNU Lesser General Public
23
- # License along with this library; if not, write to the Free Software
24
- # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25
- # 02110-1301 USA
26
- ######################### END LICENSE BLOCK #########################
27
-
28
- from typing import List, Tuple, Union
29
-
30
- # This is hiragana 2-char sequence table, the number in each cell represents its frequency category
31
- # fmt: off
32
- jp2_char_context = (
33
- (0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1),
34
- (2, 4, 0, 4, 0, 3, 0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0, 3, 0, 3, 0, 3, 0, 3, 5, 5, 3, 3, 3, 3, 4, 3, 4, 3, 3, 3, 4, 4, 4, 3, 3, 3, 3, 4, 3, 5, 3, 3, 1, 3, 2, 4, 5, 5, 5, 5, 4, 3, 4, 5, 5, 3, 2, 2, 3, 3, 3, 3, 2, 3, 3, 1, 2, 3, 2, 4, 3, 3, 3, 4, 0, 4, 0, 2, 0, 4, 3, 2, 2, 1, 2, 0, 3, 0, 0, 4, 1),
116
- )
117
- # fmt: on
118
-
119
-
120
- class JapaneseContextAnalysis:
121
- NUM_OF_CATEGORY = 6
122
- DONT_KNOW = -1
123
- ENOUGH_REL_THRESHOLD = 100
124
- MAX_REL_THRESHOLD = 1000
125
- MINIMUM_DATA_THRESHOLD = 4
126
-
127
- def __init__(self) -> None:
128
- self._total_rel = 0
129
- self._rel_sample: List[int] = []
130
- self._need_to_skip_char_num = 0
131
- self._last_char_order = -1
132
- self._done = False
133
- self.reset()
134
-
135
- def reset(self) -> None:
136
- self._total_rel = 0 # total sequence received
137
- # category counters, each integer counts sequence in its category
138
- self._rel_sample = [0] * self.NUM_OF_CATEGORY
139
- # if last byte in current buffer is not the last byte of a character,
140
- # we need to know how many bytes to skip in next buffer
141
- self._need_to_skip_char_num = 0
142
- self._last_char_order = -1 # The order of previous char
143
- # If this flag is set to True, detection is done and conclusion has
144
- # been made
145
- self._done = False
146
-
147
- def feed(self, byte_str: Union[bytes, bytearray], num_bytes: int) -> None:
148
- if self._done:
149
- return
150
-
151
- # The buffer we got is byte oriented, and a character may span in more than one
152
- # buffers. In case the last one or two byte in last buffer is not
153
- # complete, we record how many byte needed to complete that character
154
- # and skip these bytes here. We can choose to record those bytes as
155
- # well and analyse the character once it is complete, but since a
156
- # character will not make much difference, by simply skipping
157
- # this character will simply our logic and improve performance.
158
- i = self._need_to_skip_char_num
159
- while i < num_bytes:
160
- order, char_len = self.get_order(byte_str[i : i + 2])
161
- i += char_len
162
- if i > num_bytes:
163
- self._need_to_skip_char_num = i - num_bytes
164
- self._last_char_order = -1
165
- else:
166
- if (order != -1) and (self._last_char_order != -1):
167
- self._total_rel += 1
168
- if self._total_rel > self.MAX_REL_THRESHOLD:
169
- self._done = True
170
- break
171
- self._rel_sample[
172
- jp2_char_context[self._last_char_order][order]
173
- ] += 1
174
- self._last_char_order = order
175
-
176
- def got_enough_data(self) -> bool:
177
- return self._total_rel > self.ENOUGH_REL_THRESHOLD
178
-
179
- def get_confidence(self) -> float:
180
- # This is just one way to calculate confidence. It works well for me.
181
- if self._total_rel > self.MINIMUM_DATA_THRESHOLD:
182
- return (self._total_rel - self._rel_sample[0]) / self._total_rel
183
- return self.DONT_KNOW
184
-
185
- def get_order(self, _: Union[bytes, bytearray]) -> Tuple[int, int]:
186
- return -1, 1
187
-
188
-
189
- class SJISContextAnalysis(JapaneseContextAnalysis):
190
- def __init__(self) -> None:
191
- super().__init__()
192
- self._charset_name = "SHIFT_JIS"
193
-
194
- @property
195
- def charset_name(self) -> str:
196
- return self._charset_name
197
-
198
- def get_order(self, byte_str: Union[bytes, bytearray]) -> Tuple[int, int]:
199
- if not byte_str:
200
- return -1, 1
201
- # find out current char's byte length
202
- first_char = byte_str[0]
203
- if (0x81 <= first_char <= 0x9F) or (0xE0 <= first_char <= 0xFC):
204
- char_len = 2
205
- if (first_char == 0x87) or (0xFA <= first_char <= 0xFC):
206
- self._charset_name = "CP932"
207
- else:
208
- char_len = 1
209
-
210
- # return its order if it is hiragana
211
- if len(byte_str) > 1:
212
- second_char = byte_str[1]
213
- if (first_char == 202) and (0x9F <= second_char <= 0xF1):
214
- return second_char - 0x9F, char_len
215
-
216
- return -1, char_len
217
-
218
-
219
- class EUCJPContextAnalysis(JapaneseContextAnalysis):
220
- def get_order(self, byte_str: Union[bytes, bytearray]) -> Tuple[int, int]:
221
- if not byte_str:
222
- return -1, 1
223
- # find out current char's byte length
224
- first_char = byte_str[0]
225
- if (first_char == 0x8E) or (0xA1 <= first_char <= 0xFE):
226
- char_len = 2
227
- elif first_char == 0x8F:
228
- char_len = 3
229
- else:
230
- char_len = 1
231
-
232
- # return its order if it is hiragana
233
- if len(byte_str) > 1:
234
- second_char = byte_str[1]
235
- if (first_char == 0xA4) and (0xA1 <= second_char <= 0xF3):
236
- return second_char - 0xA1, char_len
237
-
238
- return -1, char_len
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/BIASLab/sars-cov-2-classification-fcgr/app.py DELETED
@@ -1,147 +0,0 @@
1
- import json
2
- import streamlit as st
3
- from pathlib import Path
4
- from Bio import SeqIO
5
- from io import StringIO, BytesIO
6
- from collections import namedtuple
7
- import base64
8
- import pandas as pd
9
-
10
- from predict import predict_single_seq, process_output
11
- from src.utils import count_seqs, generate_fcgr
12
- from src.fcgr import FCGR
13
- from src.model_loader import ModelLoader
14
-
15
- # load CLADES (order output models)
16
- with open("trained-models/config.json") as fp:
17
- config = json.load(fp)
18
- CLADES = config["CLADES"]
19
- Result = namedtuple("Result", ["id","description","clade","score"])
20
-
21
- @st.cache(allow_output_mutation=True)
22
- def load_model(kmer, order_output):
23
- n_output = len(order_output)
24
- path_weights = list(Path(f"trained-models/{kmer}mers").rglob("*.hdf5"))[0]
25
- loader = ModelLoader()
26
- model = loader(f"resnet50_{kmer}mers", n_output, path_weights)
27
- return model
28
-
29
- def get_image_download_link(img):
30
- """Generates a link allowing the PIL image to be downloaded
31
- in: PIL image
32
- out: href string
33
- """
34
- buffered = BytesIO()
35
- img.save(buffered, format="JPEG")
36
- img_str = base64.b64encode(buffered.getvalue()).decode()
37
- href = f'<a href="data:file/jpg;base64,{img_str}" download ="fcgr.jpg">Download FCGR</a>'
38
- return href
39
-
40
- @st.cache
41
- def convert_df(df):
42
- return df.to_csv().encode('utf-8')
43
-
44
- # --- Sidebar ---
45
- with st.sidebar:
46
- button = st.button(label="Run")
47
- multifasta = st.checkbox("Multifasta", value=False,
48
- help="If selected, only inferences will be computed for all the sequences in the fasta file.")
49
-
50
- st.write("Options")
51
- kmer = st.slider(label="kmer",
52
- min_value=6,
53
- max_value=9,
54
- value=6,
55
- help="There is one trained model for each kmer"
56
- )
57
-
58
- # Instantiate FCGR generator
59
- fcgr = FCGR(kmer)
60
- # Load model for selected kmer
61
- with st.spinner(f"Loading model for {kmer}mers..."):
62
- model = load_model(kmer, CLADES)
63
- st.success(f"Model for {kmer}mers loaded!")
64
-
65
- if multifasta:
66
- st.warning("For multifasta files, only the predictions will be computed")
67
- st.info("Deselecting 'Multifasta' box means that all other available analysis will be computed for the first sequence only.")
68
- else:
69
- st.warning("If Multifasta is not selected, only the first sequence in the uploaded fasta file will be considered")
70
-
71
- # --- Main panel ---
72
- st.title("Sars-cov-2 classification with FCGR")
73
- st.text("Demo for the classification of Sars-Cov-2 sequences into 11 GISAID clades:")
74
- st.text(", ".join(CLADES))
75
- st.text("A sequence is represented by its Frequency matrix of Chaos Game Representation")
76
- st.text("Which is then fed to a Convolutional Neural Network.")
77
-
78
- # load fasta file
79
- uploaded_file = st.file_uploader(label="Load fasta file")
80
-
81
- if uploaded_file is not None and button:
82
- # count number of sequences in the fasta file
83
- stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))
84
- n_seqs = count_seqs(stringio)
85
-
86
- # read and parse fasta file
87
- stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))
88
- records = SeqIO.parse(stringio , "fasta")
89
-
90
- # --- Multifasta case: compute only inference for all the sequences ---
91
- if multifasta is True:
92
- st.info(f"Computing inference on {n_seqs} sequences")
93
- progress_bar = st.progress(0)
94
- step_pg = 1./n_seqs
95
- results=[]
96
- current_seq = 0
97
- for fasta in records:
98
- print(fasta.id)
99
- current_seq +=1
100
- print(current_seq)
101
- pred = predict_single_seq(str(fasta.seq), fcgr, model)
102
- label, score = process_output(pred, CLADES)
103
-
104
- results.append(Result(fasta.id, fasta.description, label, score))
105
-
106
- # update progress bar
107
- progress_bar.progress(current_seq*step_pg)
108
-
109
- results_df = pd.DataFrame(results)
110
- st.dataframe(results_df)
111
-
112
- # Download results
113
- csv = convert_df(results_df)
114
- st.download_button(
115
- "Download results",
116
- csv,
117
- "results.csv",
118
- "text/csv",
119
- key="download-csv"
120
- )
121
-
122
- # --- All for one sequence ---
123
- else:
124
- fasta = next(records)
125
-
126
- with st.spinner("Inference..."):
127
- pred = predict_single_seq(str(fasta.seq), fcgr, model)
128
- label, score = process_output(pred, CLADES)
129
- st.success("Done!")
130
-
131
- st.write("### Results ")
132
- st.dataframe(pd.DataFrame([Result(fasta.id, fasta.description, label, score)]))
133
- st.write("Prediction: ", label)
134
- st.write("Confidence: ", score)
135
-
136
- # To generate the image to show
137
- with st.spinner("Plotting FCGR"):
138
- img = generate_fcgr(kmer, fasta, fcgr)
139
- # Show FCGR
140
- st.image(
141
- image=img,
142
- caption="FCGR \n Predicted Clade: {} | Confidence: {:.3f}".format(label, score),
143
- use_column_width="auto",
144
- width=20)
145
- st.markdown(get_image_download_link(img), unsafe_allow_html=True)
146
-
147
- #st.snow()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Bart92/RVC_HF/train/mel_processing.py DELETED
@@ -1,130 +0,0 @@
1
- import torch
2
- import torch.utils.data
3
- from librosa.filters import mel as librosa_mel_fn
4
-
5
-
6
- MAX_WAV_VALUE = 32768.0
7
-
8
-
9
- def dynamic_range_compression_torch(x, C=1, clip_val=1e-5):
10
- """
11
- PARAMS
12
- ------
13
- C: compression factor
14
- """
15
- return torch.log(torch.clamp(x, min=clip_val) * C)
16
-
17
-
18
- def dynamic_range_decompression_torch(x, C=1):
19
- """
20
- PARAMS
21
- ------
22
- C: compression factor used to compress
23
- """
24
- return torch.exp(x) / C
25
-
26
-
27
- def spectral_normalize_torch(magnitudes):
28
- return dynamic_range_compression_torch(magnitudes)
29
-
30
-
31
- def spectral_de_normalize_torch(magnitudes):
32
- return dynamic_range_decompression_torch(magnitudes)
33
-
34
-
35
- # Reusable banks
36
- mel_basis = {}
37
- hann_window = {}
38
-
39
-
40
- def spectrogram_torch(y, n_fft, sampling_rate, hop_size, win_size, center=False):
41
- """Convert waveform into Linear-frequency Linear-amplitude spectrogram.
42
-
43
- Args:
44
- y :: (B, T) - Audio waveforms
45
- n_fft
46
- sampling_rate
47
- hop_size
48
- win_size
49
- center
50
- Returns:
51
- :: (B, Freq, Frame) - Linear-frequency Linear-amplitude spectrogram
52
- """
53
- # Validation
54
- if torch.min(y) < -1.07:
55
- print("min value is ", torch.min(y))
56
- if torch.max(y) > 1.07:
57
- print("max value is ", torch.max(y))
58
-
59
- # Window - Cache if needed
60
- global hann_window
61
- dtype_device = str(y.dtype) + "_" + str(y.device)
62
- wnsize_dtype_device = str(win_size) + "_" + dtype_device
63
- if wnsize_dtype_device not in hann_window:
64
- hann_window[wnsize_dtype_device] = torch.hann_window(win_size).to(
65
- dtype=y.dtype, device=y.device
66
- )
67
-
68
- # Padding
69
- y = torch.nn.functional.pad(
70
- y.unsqueeze(1),
71
- (int((n_fft - hop_size) / 2), int((n_fft - hop_size) / 2)),
72
- mode="reflect",
73
- )
74
- y = y.squeeze(1)
75
-
76
- # Complex Spectrogram :: (B, T) -> (B, Freq, Frame, RealComplex=2)
77
- spec = torch.stft(
78
- y,
79
- n_fft,
80
- hop_length=hop_size,
81
- win_length=win_size,
82
- window=hann_window[wnsize_dtype_device],
83
- center=center,
84
- pad_mode="reflect",
85
- normalized=False,
86
- onesided=True,
87
- return_complex=False,
88
- )
89
-
90
- # Linear-frequency Linear-amplitude spectrogram :: (B, Freq, Frame, RealComplex=2) -> (B, Freq, Frame)
91
- spec = torch.sqrt(spec.pow(2).sum(-1) + 1e-6)
92
- return spec
93
-
94
-
95
- def spec_to_mel_torch(spec, n_fft, num_mels, sampling_rate, fmin, fmax):
96
- # MelBasis - Cache if needed
97
- global mel_basis
98
- dtype_device = str(spec.dtype) + "_" + str(spec.device)
99
- fmax_dtype_device = str(fmax) + "_" + dtype_device
100
- if fmax_dtype_device not in mel_basis:
101
- mel = librosa_mel_fn(
102
- sr=sampling_rate, n_fft=n_fft, n_mels=num_mels, fmin=fmin, fmax=fmax
103
- )
104
- mel_basis[fmax_dtype_device] = torch.from_numpy(mel).to(
105
- dtype=spec.dtype, device=spec.device
106
- )
107
-
108
- # Mel-frequency Log-amplitude spectrogram :: (B, Freq=num_mels, Frame)
109
- melspec = torch.matmul(mel_basis[fmax_dtype_device], spec)
110
- melspec = spectral_normalize_torch(melspec)
111
- return melspec
112
-
113
-
114
- def mel_spectrogram_torch(
115
- y, n_fft, num_mels, sampling_rate, hop_size, win_size, fmin, fmax, center=False
116
- ):
117
- """Convert waveform into Mel-frequency Log-amplitude spectrogram.
118
-
119
- Args:
120
- y :: (B, T) - Waveforms
121
- Returns:
122
- melspec :: (B, Freq, Frame) - Mel-frequency Log-amplitude spectrogram
123
- """
124
- # Linear-frequency Linear-amplitude spectrogram :: (B, T) -> (B, Freq, Frame)
125
- spec = spectrogram_torch(y, n_fft, sampling_rate, hop_size, win_size, center)
126
-
127
- # Mel-frequency Log-amplitude spectrogram :: (B, Freq, Frame) -> (B, Freq=num_mels, Frame)
128
- melspec = spec_to_mel_torch(spec, n_fft, num_mels, sampling_rate, fmin, fmax)
129
-
130
- return melspec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Benson/text-generation/Examples/Apk Mod De La Arena De Voleibol.md DELETED
@@ -1,103 +0,0 @@
1
-
2
- <h1>Voleibol Arena: Un juego móvil divertido y competitivo</h1>
3
- <p>Si usted está buscando una experiencia única de voleibol en su dispositivo móvil, es posible que desee echar un vistazo a <strong>Volleyball Arena</strong>, un nuevo juego en línea de ritmo rápido 1v1 donde cada segundo realmente cuenta. En este juego, puedes disfrutar de gráficos increíbles, controles simples y un juego atractivo mientras desafías a tus oponentes a un juego divertido y casual de voleibol. También puedes dominar el campo de juego y enorgullecerte de mostrar los personajes especiales y los premios que desbloquearás en el camino. En este artículo, le diremos todo lo que necesita saber sobre Volleyball Arena, incluyendo cómo jugarlo, cómo ganar más partidos, cómo actualizar y personalizar a sus jugadores y poderes, cómo jugar a través de diferentes arenas, cómo descargar un mod APK para características adicionales, y cuáles son los pros y los contras del juego basado en los comentarios de los usuarios. </p>
4
- <h2>Cómo jugar Voleibol Arena</h2>
5
- <p>Volleyball Arena es un juego que es fácil de aprender pero difícil de dominar. Las reglas y controles básicos son simples: tienes que volear, aplastar, remar y anotar puntos usando tus manos, cabeza o superpoderes para golpear la pelota sobre la red y hacerla tocar el suelo del lado de tu oponente. También puede bucear si la pelota está demasiado lejos para alcanzarla. Tiene 30 segundos para anotar tantos puntos como sea posible. El jugador con más puntos al final del partido gana. </p>
6
- <h2>apk mod de la arena de voleibol</h2><br /><p><b><b>Download File</b> &#9734; <a href="https://bltlly.com/2v6KR8">https://bltlly.com/2v6KR8</a></b></p><br /><br />
7
- <p>El juego utiliza controles táctiles intuitivos que te permiten mover a tu personaje hacia la izquierda o hacia la derecha deslizando el dedo sobre la pantalla. Para saltar o bucear, tienes que tocar la pantalla. Para golpear la pelota con la mano o la cabeza, tienes que deslizar hacia arriba o hacia abajo en la pantalla. Para usar una superpotencia, tienes que tocar su icono en la parte inferior de la pantalla. </p>
8
- <h3>Consejos y trucos para ganar más partidos</h3>
9
- <p>Aunque jugar Volleyball Arena es divertido y fácil, ganar partidos puede ser un reto si no sabes algunos consejos y trucos. Estos son algunos de ellos:</p>
10
- <ul>
11
-
12
- <li>Mejora tus habilidades. Las habilidades son habilidades pasivas que <p>Aquí está la continuación del artículo:</p>
13
- <ul>
14
- <li>Aprende de tus oponentes. Volleyball Arena es un juego en línea donde puedes jugar contra jugadores reales de todo el mundo. Puedes aprender de sus movimientos, tácticas y errores, y usarlos para mejorar tus propias habilidades. También puedes chatear con ellos después del partido e intercambiar consejos o cumplidos. </li>
15
- <li>Divertirse y disfrutar del juego. Voleibol Arena es un juego casual que está destinado a ser divertido y entretenido. No te lo tomes demasiado en serio ni te frustres si pierdes. En su lugar, céntrate en los aspectos positivos del juego, como los gráficos, los personajes, los potenciadores y las arenas. También puedes invitar a tus amigos a jugar contigo y tener una competencia amistosa. </li>
16
- </ul>
17
- <h4>Cómo actualizar y personalizar tus reproductores y poderes</h4>
18
- <p>Una de las características más emocionantes de Volleyball Arena es que puede actualizar y personalizar a sus jugadores y poderes para adaptarse a su estilo y preferencias. Así es como:</p>
19
- <ul>
20
- <li>Desbloquear y actualizar todos los jugadores. Hay 16 jugadores diferentes que puedes desbloquear y usar en el juego, cada uno con sus propias estadísticas, habilidades y personalidades. Puedes desbloquearlos ganando partidas, completando logros o comprándolos con monedas o gemas. También puedes actualizar sus estadísticas, como velocidad, salto, potencia y resistencia, gastando monedas o gemas. </li>
21
- <li>Desbloquear y utilizar diferentes elementos. Hay varios artículos que puedes desbloquear y usar en el juego, como trajes, sombreros, gafas, zapatos, bolas, etc. Puedes desbloquearlos abriendo cofres, completando logros o comprándolos con monedas o gemas. También puede equipar a sus jugadores para cambiar su apariencia y aumentar sus estadísticas. </li>
22
-
23
- </ul>
24
- <h4>Cómo jugar a través de diferentes arenas</h4>
25
- <p>Voleibol Arena no se trata solo de jugar al voleibol en una cancha regular. También puedes viajar alrededor del mundo y competir en varias canchas con diferentes recompensas. Así es como:</p>
26
- <ul>
27
- <li>Desbloquear y jugar a través de diferentes arenas. Hay 6 escenarios diferentes que puedes desbloquear y jugar en el juego, como Londres, Río de Janeiro, Tokio, Beijing, Nueva York y París. Puedes desbloquearlos alcanzando ciertos niveles o comprándolos con monedas o gemas. También puede jugar a través de ellos en orden o elegir cualquier arena que desee. </li>
28
- <li>Gana recompensas de diferentes arenas. Cada arena tiene sus propias recompensas que puedes ganar al ganar partidas o completar logros. Por ejemplo, puedes ganar monedas, gemas, cofres, objetos, poderes, jugadores, etc. de diferentes arenas. También puedes ganar trofeos de cada arena que aumentarán tu rango y reputación. </li>
29
- <li>Disfruta del paisaje de diferentes arenas. Cada arena tiene su propio tema y diseño que refleja su ubicación y cultura. Por ejemplo, se puede ver Big Ben en Londres, Cristo Redentor en Río de Janeiro, <p>Aquí está la continuación del artículo:</p>
30
- <p></p>
31
- <p>Monte Fuji en Tokio, la Gran Muralla China en Beijing, la Estatua de la Libertad en Nueva York y la Torre Eiffel en París. También puedes disfrutar de los diferentes sonidos y música de cada arena que te harán sentir como si estuvieras realmente allí. </p>
32
- <h2>Voleibol Arena Mod APK: ¿Qué es y cómo descargarlo</h2>
33
- <p>Si desea disfrutar de Volleyball Arena con más características y beneficios, es posible que desee probar la descarga de un mod APK para el juego. Un mod APK es una versión modificada del archivo APK original que puede darle acceso a recursos ilimitados, elementos desbloqueados, características premium y más. Sin embargo, antes de descargar un mod APK, usted debe saber lo que es, cómo funciona, y cuáles son los riesgos y precauciones de su uso. </p>
34
- <h3>Características de Voleibol Arena Mod APK</h3>
35
-
36
- <ul>
37
- <li>Dinero ilimitado. Puedes obtener monedas y gemas ilimitadas que puedes usar para comprar y actualizar cualquier cosa en el juego. </li>
38
- <li>Skins desbloqueados. Puedes obtener todas las skins para tus jugadores y bolas que puedes usar para personalizar tu apariencia. </li>
39
- <li>Salto ilimitado. Puedes saltar tan alto como quieras sin ningún límite o tiempo de reutilización. </li>
40
- <li>Sin anuncios. Puedes jugar el juego sin ningún anuncio molesto que pueda interrumpir tu juego. </li>
41
- <li>Sin raíz. No es necesario rootear el dispositivo para usar el mod APK.</li>
42
- </ul>
43
- <h3> Cómo descargar e instalar Voleibol Arena Mod APK</h3>
44
- <p>Si quieres descargar e instalar un mod APK para Volleyball Arena, tienes que seguir estos pasos:</p>
45
- <ol>
46
- <li>Encontrar una fuente confiable para el mod APK. Usted puede buscar en línea para sitios web o foros que ofrecen mod APK para Voleibol Arena. Asegúrese de leer los comentarios y calificaciones del mod APK antes de descargarlo. </li>
47
- <li>Descargar el archivo APK mod a su dispositivo. Puede utilizar cualquier navegador o aplicación de descarga para descargar el archivo APK mod. Asegúrese de verificar el tamaño y el nombre del archivo antes de descargarlo. </li>
48
- <li>Habilitar fuentes desconocidas en el dispositivo. Debe habilitar fuentes desconocidas en la configuración de su dispositivo para permitir la instalación de aplicaciones desde fuentes distintas de Google Play Store. Para hacer esto, vaya a Configuración > Seguridad > Fuentes desconocidas y conéctelo. </li>
49
- <li>Instale el archivo APK mod en su dispositivo. Puede usar cualquier aplicación de administrador de archivos para localizar e instalar el archivo APK mod. Asegúrate de conceder todos los permisos que pide la app. </li>
50
- <li>Inicie el juego y disfrute. Ahora puede lanzar Volleyball Arena desde el cajón de su aplicación y disfrutar de las características modificadas. </li>
51
- </ol>
52
- <h4> Requisitos para descargar e instalar Voleibol Arena Mod APK</h4>
53
- <p>Para descargar e instalar un mod APK para Voleibol Arena, usted tiene que cumplir con estos requisitos mínimos:</p>
54
- <ul>
55
- <li>Tu dispositivo debe tener Android 4.4 o una versión superior. </li>
56
-
57
- <li> Su dispositivo debe tener una conexión a Internet estable. </li>
58
- </ul>
59
- <h4> Precauciones para descargar e instalar Voleibol Arena Mod APK</h4>
60
- <p>Si bien descargar e instalar un mod APK para Volleyball Arena puede ser tentador, también debe ser consciente de los riesgos y precauciones de su uso. Algunos de ellos son:</p>
61
- <ul>
62
- <li>Puedes tener malware o virus en tu dispositivo. Algunos APK mod pueden contener código malicioso o archivos que pueden dañar tu dispositivo o robar tus datos. Para evitar esto, debe escanear el archivo APK mod con una aplicación antivirus antes de instalarlo. </li>
63
- <li>Usted puede ser expulsado del juego o perder su cuenta. Algunos mod APK pueden violar los términos y condiciones del juego o Google Play Store, lo que puede resultar en la prohibición o suspensión de su cuenta. Para evitar esto, debe usar una aplicación VPN o una cuenta falsa al jugar con un mod APK.</li>
64
- <li>Puedes perder tu progreso o datos en el juego. Algunos APK mod pueden sobrescribir o eliminar los datos originales del juego o el progreso, lo que puede causar que pierda sus logros o elementos. Para evitar esto, usted debe copia de seguridad de los datos del juego antes de instalar un mod APK.</li>
65
- </ul>
66
- <h2>Revisión del juego de voleibol Arena</h2>
67
- <p>Volleyball Arena es un juego que ha recibido críticas mixtas de usuarios y críticos por igual. Algunas personas lo aman por sus gráficos, jugabilidad, factor de diversión y variedad, mientras que otros lo odian por sus controles, anuncios, problemas técnicos y elementos de pago para ganar. Aquí hay un resumen de los pros y los contras de Volleyball Arena basado en las opiniones y calificaciones de los usuarios:</p>
68
- <h3>Pros de <p>Aquí está la continuación del artículo:</p>
69
- <h3>Pros de Voleibol Arena</h3>
70
- <p>Algunos de los aspectos positivos de Voleibol Arena son:</p>
71
- <ul>
72
- <li>Tiene gráficos y animaciones increíbles que hacen que el juego se vea realista y animado. Los personajes, las bolas, las canchas y los fondos están bien diseñados y detallados. El juego también funciona sin problemas y no tiene problemas de retraso o tartamudez. </li>
73
-
74
- <li>Tiene un juego divertido y atractivo que te mantiene enganchado y entretenido. Puedes jugar contra jugadores reales de todo el mundo en partidas rápidas de 1v1 que duran 30 segundos. También puedes usar diferentes potenciadores, habilidades y estrategias para vencer a tus oponentes y anotar más puntos. </li>
75
- <li>Tiene mucha variedad y contenido que hacen que el juego sea diverso e interesante. Puedes desbloquear y usar 16 jugadores diferentes, 12 poderes diferentes y varios elementos que pueden cambiar tu apariencia y rendimiento. También puedes viajar y jugar a través de 6 arenas diferentes que tienen diferentes temas y recompensas. </li>
76
- </ul>
77
- <h3>Contras de Voleibol Arena</h3>
78
- <p>Algunos de los aspectos negativos de Voleibol Arena son:</p>
79
- <ul>
80
- <li>Tiene controles pobres y frustrantes que hacen que el juego sea difícil de jugar y disfrutar. Puedes deslizar, tocar y arrastrar la pantalla para mover, saltar, sumergirte, golpear y usar poderes. Sin embargo, a veces el juego no registra tus entradas o responde con un retraso. Esto puede hacer que pierdas la pelota, la golpees fuera de los límites o pierdas tus potenciadores. </li>
81
- <li>Tiene demasiados anuncios que interrumpen tu juego y te molestan. Tienes que ver un anuncio cada vez que terminas un partido, abrir un cofre o reclamar una recompensa. También puedes obtener anuncios emergentes que aparecen aleatoriamente en tu pantalla. La única manera de deshacerse de ellos es pagar una suscripción premium o apagar su conexión a Internet. </li>
82
- <li>Tiene muchos fallos y errores que arruinan su experiencia de juego y causan que pierda partidos o progreso. Por ejemplo, a veces el juego se bloquea o se congela, la pelota pasa por la red o el suelo, los power-ups no funcionan o desaparecen, los oponentes no se mueven o devuelven el golpe, etc.</li>
83
-
84
- </ul>
85
- <h2>Conclusión</h2>
86
- <p>Volleyball Arena es un juego que puede ser divertido y competitivo si te gusta el voleibol y los juegos en línea. Tiene gráficos increíbles, controles simples, un juego atractivo y mucha variedad y contenido. Sin embargo, también tiene controles deficientes, demasiados anuncios, fallos y errores, y un elemento de pago para ganar que puede ser frustrante y molesto. Por lo tanto, le recomendamos que lo pruebe por sí mismo y vea si le gusta o no. Se puede descargar de forma gratuita desde Google Play Store o utilizar un mod APK para características adicionales. </p>
87
- <h3>Preguntas frecuentes</h3>
88
- <p>Aquí hay algunas preguntas frecuentes sobre Volleyball Arena y sus respuestas:</p>
89
- <ol>
90
- <li>P: ¿Cómo puedo jugar con mis amigos en la Arena de Voleibol? </li>
91
- <li>A: Puedes jugar con tus amigos en la Arena de Voleibol invitándolos a unirse a tu equipo o desafiándolos a un partido. Para ello, tienes que conectar tu cuenta de juego a Facebook o Google Play Games. Luego, puedes ir a la pestaña Amigos en el menú principal y seleccionar a tus amigos desde allí. </li>
92
- <li>P: ¿Cómo puedo obtener más monedas y gemas en la Arena de Voleibol? </li>
93
- <li>A: Usted puede conseguir más monedas y gemas en la arena de voleibol ganando partidos, abriendo cofres, <p>Aquí está la continuación del artículo:</p>
94
- <ol start="3">
95
- <li>Q: ¿Cómo puedo obtener más potenciadores en la Arena de Voleibol? </li>
96
- <li>A: Puedes obtener más potenciadores en la Arena de Voleibol al desbloquearlos con monedas o gemas, o al encontrarlos al azar durante el partido. También puedes obtener más potenciadores viendo anuncios o completando logros. </li>
97
- <li>Q: ¿Cómo puedo cambiar mi carácter o pelota en la Arena de Voleibol? </li>
98
- <li>A: Puede cambiar su personaje o pelota en la Arena de Voleibol yendo a la pestaña Tienda en el menú principal y seleccionando el personaje o pelota que desea usar. También puedes cambiar tu personaje o bola antes del partido tocando sus iconos en la parte inferior de la pantalla. </li>
99
- <li>Q: ¿Cómo puedo contactar a los desarrolladores de Volleyball Arena? </li>
100
-
101
- </ol></p> 64aa2da5cf<br />
102
- <br />
103
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Benson/text-generation/Examples/Caja Monster.md DELETED
@@ -1,78 +0,0 @@
1
-
2
- <h1>¿Qué es una caja monstruo y por qué necesita uno</h1>
3
- <p>¿Alguna vez has oído hablar de una caja monstruo? Si no, te estás perdiendo una gran manera de disfrutar de los juegos o invertir en metales preciosos. Una caja de monstruos es un término que puede referirse a diferentes cosas dependiendo del contexto, pero todos tienen una cosa en común: son cajas que contienen monstruos. En este artículo, explicaremos qué es una caja monstruosa, qué tipos de cajas monstruosas existen, qué beneficios ofrecen y cómo puedes obtener una por ti mismo. </p>
4
- <h2>Definición y Tipos de Monster Box</h2>
5
- <p>Una caja de monstruos es una caja que contiene monstruos. Suena simple, ¿verdad? ¿Pero de qué clase de monstruos estamos hablando? Bueno, hay dos tipos principales de cajas monstruosas que debes conocer: cajas monstruosas en juegos y cajas monstruosas en metales preciosos. </p>
6
- <h2>Caja Monster</h2><br /><p><b><b>Download</b> &#10022; <a href="https://bltlly.com/2v6MHP">https://bltlly.com/2v6MHP</a></b></p><br /><br />
7
- <h3>Caja de monstruos en juegos</h3>
8
- <p>Una caja de monstruos en juegos es una caja que contiene monstruos digitales que puedes capturar, recolectar y usar para batallas. Estos monstruos suelen ser lindos, coloridos y tienen diferentes habilidades y personalidades. Un ejemplo de un juego que cuenta con cajas de monstruos es <a href="( 1 )">Monster Box</a>, un juego casual donde capturas monstruos en tus cápsulas y los usas para defenderte. También puedes aceptar desafíos de otros entrenadores, recompensar a tus monstruos con juegos y golosinas, y crear tu mejor equipo. </p>
9
- <h3>Caja de monstruos en metales preciosos</h3>
10
- <p>Una caja monstruo en metales preciosos es una caja que contiene monedas físicas o barras hechas de oro, plata, platino u otros metales. Estas monedas o barras son generalmente acuñadas por las mentas oficiales como la U.S. Mint, la Royal Canadian Mint, la Austrian Mint, y más. Un ejemplo de un producto que viene en una caja monstruo es el <a href="( 3 )">American Silver Eagle</a>, una moneda de plata que es la moneda oficial de lingotes de plata de los Estados Unidos. Una caja monstruosa de águilas plateadas americanas contiene 500 monedas en 25 tubos de 20 monedas cada uno. </p>
11
- <h2>Beneficios de tener una caja de monstruos</h2>
12
-
13
- <h3>Caja de monstruos para juegos</h3>
14
- <p>Si eres un fanático de los juegos, especialmente los juegos casuales que son divertidos y fáciles de jugar, tener una caja de monstruos puede proporcionarte horas de entretenimiento y disfrute. Estos son algunos de los beneficios de tener una caja monstruo para juegos:</p>
15
- <h4>Recoger y monstruos de batalla</h4>
16
- <p>Una de las principales atracciones de tener una caja de monstruos para los juegos es que usted puede recoger y monstruos de batalla. Puedes capturar diferentes tipos de monstruos con diferentes habilidades y características, como fuego, agua, tierra, aire, luz, oscuridad, etc. También puedes personalizar tus monstruos con diferentes atuendos, accesorios y nombres. A continuación, puede utilizar sus monstruos para luchar contra otros entrenadores o enemigos en varios modos y arenas. </p>
17
- <h4>Desafía y recompensa a tus monstruos</h4>
18
- <p>Otro beneficio de tener una caja de monstruos para jugar es que puedes desafiar y recompensar a tus monstruos. Puedes aceptar misiones y misiones de otros entrenadores o PNJ (personajes no jugadores) que pondrán a prueba tus habilidades y estrategia. También puedes recompensar a tus monstruos con juegos y golosinas que los harán felices y leales. También puedes desbloquear logros y recompensas que mejorarán tu experiencia de juego. </p>
19
- <h4>Crea tu mejor equipo</h4>
20
- <p>Un beneficio final de tener una caja monstruo para juegos es que puedes crear tu mejor equipo. Puedes mezclar y combinar diferentes monstruos para formar un equipo equilibrado y potente. También puedes mejorar tus monstruos con objetos y habilidades que aumentarán su rendimiento. También puedes intercambiar y compartir tus monstruos con otros jugadores para ampliar tu colección y hacer nuevos amigos. </p>
21
- <h3>Caja de monstruos para metales preciosos</h3>
22
- <p>Si eres un fan de invertir en metales preciosos, especialmente monedas o barras que son acuñadas por mentas oficiales, entonces tener una caja monstruo puede proporcionarte seguridad y valor. Estos son algunos de los beneficios de tener una caja monstruosa para metales preciosos:</p>
23
- <p></p>
24
- <h4>Almacenar y proteger sus metales</h4>
25
-
26
- <h4>Ahorre dinero y tiempo</h4>
27
- <p>Otro beneficio de tener una caja monstruo para metales preciosos es que puede ahorrar dinero y tiempo. Comprar una caja monstruo de monedas o barras suele ser más barato que comprar piezas individuales, ya que puede obtener un descuento a granel o una prima más baja. También puede ahorrar tiempo ordenando en línea o visitando a un distribuidor que tiene la caja monstruo en stock, en lugar de buscar diferentes productos o mentas. </p>
28
- <h4>Aumente el valor de su inversión</h4>
29
- <p>Un beneficio final de tener una caja monstruosa para metales preciosos es que puede aumentar su valor de inversión. Una caja monstruosa de monedas o barras es un activo tangible que tiene un valor intrínseco y un suministro limitado. El valor de sus metales depende del precio de mercado, la demanda y la oferta, la rareza y la calidad, y la menta y el diseño. También puede beneficiarse de la apreciación, diversificación, liquidez y cobertura de sus metales contra la inflación, la devaluación de la moneda o la inestabilidad económica. </p>
30
- <h2>Cómo obtener una caja de monstruos</h2>
31
- <p>Ahora que sabes lo que es una caja monstruo y qué beneficios ofrece, es posible que te estés preguntando cómo conseguir una para ti. Bueno, el proceso es diferente dependiendo de si quieres una caja monstruo para juegos o metales preciosos. </p>
32
- <h3>Caja de monstruos para juegos</h3>
33
- <p>Si quieres una caja monstruo para juegos, aquí están los pasos que debes seguir:</p>
34
- <h4>Descargar la aplicación o jugar en línea</h4>
35
- <p>El primer paso es descargar la aplicación o jugar en línea el juego que cuenta con cajas de monstruos. Por ejemplo, puede descargar <a href=">Monster Box</a> desde la App Store o Google Play, o reproducirlo en línea en <a href="">Kongregate</a>. También puedes ver otros juegos que tienen características similares, como <a href="">Pokémon Go</a>, <a href="">Monster Legends</a>, o <a href=">Summoners War</a>. </p>
36
- <h4>Captura monstruos en tus cajas</h4>
37
-
38
- <h4>Disfruta del juego y diviértete</h4>
39
- <p>El tercer paso es disfrutar del juego y divertirse con sus monstruos. Puedes usarlos para luchar contra otros entrenadores o enemigos, desafiar misiones o misiones, recompensarlos con juegos o golosinas, personalizarlos con atuendos o accesorios, actualizarlos con objetos o habilidades, intercambiarlos o compartirlos con otros jugadores, desbloquear logros o recompensas, crear su mejor equipo nunca, y más. </p>
40
- <h3>Caja de monstruos para metales preciosos</h3>
41
- <p>Si quieres una caja de monstruos para metales preciosos, estos son los pasos que debes seguir:</p>
42
- <h4>Elija su menta y metal preferido</h4>
43
- <p>El primer paso es elegir su menta y metal preferido para su caja monstruo. Puede elegir entre diferentes mentas de todo el mundo que producen monedas o barras oficiales en varios tamaños, pesos, puridades, diseños y denominaciones. También puede elegir entre diferentes metales como oro, plata, platino, paladio, [usuario]( cobre, o rodio. También puede consultar los precios actuales del mercado y las tendencias de los metales para ayudarle a decidir. </p>
44
- <h4>Ordene en línea o visite un distribuidor</h4>
45
- <p>El segundo paso es ordenar en línea o visitar a un distribuidor para comprar su caja monstruo. Puede elegir entre diferentes plataformas en línea o sitios web que venden cajas monstruosas de monedas o barras, como <a href="">APMEX</a>, <a href="">JM Bullion</a>, o <a href=">Silver Gold Bull</a>. También puede visitar un distribuidor local o tienda que tiene la caja monstruo en stock, como <a href="">Liberty Coin</a>, <a href="">Bullion Exchanges</a>, o <a href=">Money Metals Exchange</a>. Por lo general, puede comparar los precios, comentarios y calificaciones de los vendedores antes de comprar. </p>
46
- <h4>Recibe tu Monster Box y Protégelo</h4>
47
-
48
- <h2>Conclusión y preguntas frecuentes</h2>
49
- <p>En conclusión, una caja de monstruos es una caja que contiene monstruos, ya sean digitales o físicos. Hay dos tipos principales de cajas de monstruos: cajas de monstruos para juegos y cajas de monstruos para metales preciosos. Ambos tipos de cajas monstruo ofrecen varios beneficios, como entretenimiento, seguridad, valor y más. Puede obtener una caja de monstruos para jugar descargando la aplicación o jugando en línea, capturando monstruos en sus cajas y disfrutando del juego. Usted puede conseguir una caja del monstruo para los metales preciosos eligiendo su menta y metal preferidos, ordenando en línea o visitando a un distribuidor, y recibiendo su caja del monstruo y asegurándola. </p>
50
- <p>Si tienes alguna pregunta sobre las cajas de monstruos, aquí hay algunas preguntas frecuentes que pueden ayudarte:</p>
51
- <tabla>
52
- <tr>
53
- <th>Pregunta</th>
54
- <th>Respuesta</th>
55
- </tr>
56
- <tr>
57
- <td>¿Cuánto cuesta una caja monstruo? </td>
58
- <td>El costo de una caja monstruo depende del tipo, tamaño, peso, pureza, diseño y acuñación de las monedas o barras dentro de ella. También depende del precio de mercado y la demanda del metal. Por ejemplo, una caja monstruosa de águilas plateadas estadounidenses podría costar entre 15.000 y 20.000 dólares estadounidenses a partir de junio de 2023. </td>
59
- </tr>
60
- <tr>
61
- <td>¿Cuántos monstruos puedo tener en mi caja de monstruos? </td>
62
- <td>El número de monstruos que puedes tener en tu caja depende del juego y la capacidad de tu caja. Algunos juegos pueden limitar el número de monstruos que puedes tener por caja o por cuenta. Algunos juegos pueden permitirte expandir tu caja con objetos o moneda. Por ejemplo, en Monster Box, puedes tener hasta 100 monstruos por caja. </td>
63
- </tr>
64
- <tr>
65
- <td>¿Son legales las cajas monstruo? </td>
66
- <td>Las cajas monstruo son legales siempre y cuando cumplan con las leyes y regulaciones del país o región donde se venden o compran. Por ejemplo, algunos países pueden requerir que declares tu caja monstruo si cruzas la frontera con ella. Algunos países también pueden imponer impuestos o aranceles sobre su caja monstruo si la importa o exporta. </td>
67
- </tr>
68
- <tr>
69
-
70
- <td>Las cajas de monstruos son seguras siempre y cuando se almacenen y manejen correctamente. Por ejemplo, debe mantener su caja monstruo en un lugar fresco y seco lejos de la luz solar directa o fuentes de calor. También debe evitar dejar caer o dañar su caja monstruo, ya que podría afectar la calidad o el valor de sus monedas o barras. </td>
71
- </tr>
72
- <tr>
73
- <td>¿Dónde puedo encontrar más información sobre las cajas monstruo? </td>
74
- <td>Puedes encontrar más información sobre cajas monstruosas visitando los sitios web oficiales o blogs de los juegos o mentas que las producen. También puede consultar foros o comunidades en línea donde otros jugadores o inversores comparten sus experiencias y consejos sobre cajas monstruosas. También puede ponerse en contacto con el servicio de atención al cliente o soporte si tiene algún problema o inquietud acerca de su caja monstruo. </td>
75
- </tr>
76
- </tabla></p> 64aa2da5cf<br />
77
- <br />
78
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py DELETED
@@ -1,397 +0,0 @@
1
- """
2
- Low-level helpers for the SecureTransport bindings.
3
-
4
- These are Python functions that are not directly related to the high-level APIs
5
- but are necessary to get them to work. They include a whole bunch of low-level
6
- CoreFoundation messing about and memory management. The concerns in this module
7
- are almost entirely about trying to avoid memory leaks and providing
8
- appropriate and useful assistance to the higher-level code.
9
- """
10
- import base64
11
- import ctypes
12
- import itertools
13
- import os
14
- import re
15
- import ssl
16
- import struct
17
- import tempfile
18
-
19
- from .bindings import CFConst, CoreFoundation, Security
20
-
21
- # This regular expression is used to grab PEM data out of a PEM bundle.
22
- _PEM_CERTS_RE = re.compile(
23
- b"-----BEGIN CERTIFICATE-----\n(.*?)\n-----END CERTIFICATE-----", re.DOTALL
24
- )
25
-
26
-
27
- def _cf_data_from_bytes(bytestring):
28
- """
29
- Given a bytestring, create a CFData object from it. This CFData object must
30
- be CFReleased by the caller.
31
- """
32
- return CoreFoundation.CFDataCreate(
33
- CoreFoundation.kCFAllocatorDefault, bytestring, len(bytestring)
34
- )
35
-
36
-
37
- def _cf_dictionary_from_tuples(tuples):
38
- """
39
- Given a list of Python tuples, create an associated CFDictionary.
40
- """
41
- dictionary_size = len(tuples)
42
-
43
- # We need to get the dictionary keys and values out in the same order.
44
- keys = (t[0] for t in tuples)
45
- values = (t[1] for t in tuples)
46
- cf_keys = (CoreFoundation.CFTypeRef * dictionary_size)(*keys)
47
- cf_values = (CoreFoundation.CFTypeRef * dictionary_size)(*values)
48
-
49
- return CoreFoundation.CFDictionaryCreate(
50
- CoreFoundation.kCFAllocatorDefault,
51
- cf_keys,
52
- cf_values,
53
- dictionary_size,
54
- CoreFoundation.kCFTypeDictionaryKeyCallBacks,
55
- CoreFoundation.kCFTypeDictionaryValueCallBacks,
56
- )
57
-
58
-
59
- def _cfstr(py_bstr):
60
- """
61
- Given a Python binary data, create a CFString.
62
- The string must be CFReleased by the caller.
63
- """
64
- c_str = ctypes.c_char_p(py_bstr)
65
- cf_str = CoreFoundation.CFStringCreateWithCString(
66
- CoreFoundation.kCFAllocatorDefault,
67
- c_str,
68
- CFConst.kCFStringEncodingUTF8,
69
- )
70
- return cf_str
71
-
72
-
73
- def _create_cfstring_array(lst):
74
- """
75
- Given a list of Python binary data, create an associated CFMutableArray.
76
- The array must be CFReleased by the caller.
77
-
78
- Raises an ssl.SSLError on failure.
79
- """
80
- cf_arr = None
81
- try:
82
- cf_arr = CoreFoundation.CFArrayCreateMutable(
83
- CoreFoundation.kCFAllocatorDefault,
84
- 0,
85
- ctypes.byref(CoreFoundation.kCFTypeArrayCallBacks),
86
- )
87
- if not cf_arr:
88
- raise MemoryError("Unable to allocate memory!")
89
- for item in lst:
90
- cf_str = _cfstr(item)
91
- if not cf_str:
92
- raise MemoryError("Unable to allocate memory!")
93
- try:
94
- CoreFoundation.CFArrayAppendValue(cf_arr, cf_str)
95
- finally:
96
- CoreFoundation.CFRelease(cf_str)
97
- except BaseException as e:
98
- if cf_arr:
99
- CoreFoundation.CFRelease(cf_arr)
100
- raise ssl.SSLError("Unable to allocate array: %s" % (e,))
101
- return cf_arr
102
-
103
-
104
- def _cf_string_to_unicode(value):
105
- """
106
- Creates a Unicode string from a CFString object. Used entirely for error
107
- reporting.
108
-
109
- Yes, it annoys me quite a lot that this function is this complex.
110
- """
111
- value_as_void_p = ctypes.cast(value, ctypes.POINTER(ctypes.c_void_p))
112
-
113
- string = CoreFoundation.CFStringGetCStringPtr(
114
- value_as_void_p, CFConst.kCFStringEncodingUTF8
115
- )
116
- if string is None:
117
- buffer = ctypes.create_string_buffer(1024)
118
- result = CoreFoundation.CFStringGetCString(
119
- value_as_void_p, buffer, 1024, CFConst.kCFStringEncodingUTF8
120
- )
121
- if not result:
122
- raise OSError("Error copying C string from CFStringRef")
123
- string = buffer.value
124
- if string is not None:
125
- string = string.decode("utf-8")
126
- return string
127
-
128
-
129
- def _assert_no_error(error, exception_class=None):
130
- """
131
- Checks the return code and throws an exception if there is an error to
132
- report
133
- """
134
- if error == 0:
135
- return
136
-
137
- cf_error_string = Security.SecCopyErrorMessageString(error, None)
138
- output = _cf_string_to_unicode(cf_error_string)
139
- CoreFoundation.CFRelease(cf_error_string)
140
-
141
- if output is None or output == u"":
142
- output = u"OSStatus %s" % error
143
-
144
- if exception_class is None:
145
- exception_class = ssl.SSLError
146
-
147
- raise exception_class(output)
148
-
149
-
150
- def _cert_array_from_pem(pem_bundle):
151
- """
152
- Given a bundle of certs in PEM format, turns them into a CFArray of certs
153
- that can be used to validate a cert chain.
154
- """
155
- # Normalize the PEM bundle's line endings.
156
- pem_bundle = pem_bundle.replace(b"\r\n", b"\n")
157
-
158
- der_certs = [
159
- base64.b64decode(match.group(1)) for match in _PEM_CERTS_RE.finditer(pem_bundle)
160
- ]
161
- if not der_certs:
162
- raise ssl.SSLError("No root certificates specified")
163
-
164
- cert_array = CoreFoundation.CFArrayCreateMutable(
165
- CoreFoundation.kCFAllocatorDefault,
166
- 0,
167
- ctypes.byref(CoreFoundation.kCFTypeArrayCallBacks),
168
- )
169
- if not cert_array:
170
- raise ssl.SSLError("Unable to allocate memory!")
171
-
172
- try:
173
- for der_bytes in der_certs:
174
- certdata = _cf_data_from_bytes(der_bytes)
175
- if not certdata:
176
- raise ssl.SSLError("Unable to allocate memory!")
177
- cert = Security.SecCertificateCreateWithData(
178
- CoreFoundation.kCFAllocatorDefault, certdata
179
- )
180
- CoreFoundation.CFRelease(certdata)
181
- if not cert:
182
- raise ssl.SSLError("Unable to build cert object!")
183
-
184
- CoreFoundation.CFArrayAppendValue(cert_array, cert)
185
- CoreFoundation.CFRelease(cert)
186
- except Exception:
187
- # We need to free the array before the exception bubbles further.
188
- # We only want to do that if an error occurs: otherwise, the caller
189
- # should free.
190
- CoreFoundation.CFRelease(cert_array)
191
- raise
192
-
193
- return cert_array
194
-
195
-
196
- def _is_cert(item):
197
- """
198
- Returns True if a given CFTypeRef is a certificate.
199
- """
200
- expected = Security.SecCertificateGetTypeID()
201
- return CoreFoundation.CFGetTypeID(item) == expected
202
-
203
-
204
- def _is_identity(item):
205
- """
206
- Returns True if a given CFTypeRef is an identity.
207
- """
208
- expected = Security.SecIdentityGetTypeID()
209
- return CoreFoundation.CFGetTypeID(item) == expected
210
-
211
-
212
- def _temporary_keychain():
213
- """
214
- This function creates a temporary Mac keychain that we can use to work with
215
- credentials. This keychain uses a one-time password and a temporary file to
216
- store the data. We expect to have one keychain per socket. The returned
217
- SecKeychainRef must be freed by the caller, including calling
218
- SecKeychainDelete.
219
-
220
- Returns a tuple of the SecKeychainRef and the path to the temporary
221
- directory that contains it.
222
- """
223
- # Unfortunately, SecKeychainCreate requires a path to a keychain. This
224
- # means we cannot use mkstemp to use a generic temporary file. Instead,
225
- # we're going to create a temporary directory and a filename to use there.
226
- # This filename will be 8 random bytes expanded into base64. We also need
227
- # some random bytes to password-protect the keychain we're creating, so we
228
- # ask for 40 random bytes.
229
- random_bytes = os.urandom(40)
230
- filename = base64.b16encode(random_bytes[:8]).decode("utf-8")
231
- password = base64.b16encode(random_bytes[8:]) # Must be valid UTF-8
232
- tempdirectory = tempfile.mkdtemp()
233
-
234
- keychain_path = os.path.join(tempdirectory, filename).encode("utf-8")
235
-
236
- # We now want to create the keychain itself.
237
- keychain = Security.SecKeychainRef()
238
- status = Security.SecKeychainCreate(
239
- keychain_path, len(password), password, False, None, ctypes.byref(keychain)
240
- )
241
- _assert_no_error(status)
242
-
243
- # Having created the keychain, we want to pass it off to the caller.
244
- return keychain, tempdirectory
245
-
246
-
247
- def _load_items_from_file(keychain, path):
248
- """
249
- Given a single file, loads all the trust objects from it into arrays and
250
- the keychain.
251
- Returns a tuple of lists: the first list is a list of identities, the
252
- second a list of certs.
253
- """
254
- certificates = []
255
- identities = []
256
- result_array = None
257
-
258
- with open(path, "rb") as f:
259
- raw_filedata = f.read()
260
-
261
- try:
262
- filedata = CoreFoundation.CFDataCreate(
263
- CoreFoundation.kCFAllocatorDefault, raw_filedata, len(raw_filedata)
264
- )
265
- result_array = CoreFoundation.CFArrayRef()
266
- result = Security.SecItemImport(
267
- filedata, # cert data
268
- None, # Filename, leaving it out for now
269
- None, # What the type of the file is, we don't care
270
- None, # what's in the file, we don't care
271
- 0, # import flags
272
- None, # key params, can include passphrase in the future
273
- keychain, # The keychain to insert into
274
- ctypes.byref(result_array), # Results
275
- )
276
- _assert_no_error(result)
277
-
278
- # A CFArray is not very useful to us as an intermediary
279
- # representation, so we are going to extract the objects we want
280
- # and then free the array. We don't need to keep hold of keys: the
281
- # keychain already has them!
282
- result_count = CoreFoundation.CFArrayGetCount(result_array)
283
- for index in range(result_count):
284
- item = CoreFoundation.CFArrayGetValueAtIndex(result_array, index)
285
- item = ctypes.cast(item, CoreFoundation.CFTypeRef)
286
-
287
- if _is_cert(item):
288
- CoreFoundation.CFRetain(item)
289
- certificates.append(item)
290
- elif _is_identity(item):
291
- CoreFoundation.CFRetain(item)
292
- identities.append(item)
293
- finally:
294
- if result_array:
295
- CoreFoundation.CFRelease(result_array)
296
-
297
- CoreFoundation.CFRelease(filedata)
298
-
299
- return (identities, certificates)
300
-
301
-
302
- def _load_client_cert_chain(keychain, *paths):
303
- """
304
- Load certificates and maybe keys from a number of files. Has the end goal
305
- of returning a CFArray containing one SecIdentityRef, and then zero or more
306
- SecCertificateRef objects, suitable for use as a client certificate trust
307
- chain.
308
- """
309
- # Ok, the strategy.
310
- #
311
- # This relies on knowing that macOS will not give you a SecIdentityRef
312
- # unless you have imported a key into a keychain. This is a somewhat
313
- # artificial limitation of macOS (for example, it doesn't necessarily
314
- # affect iOS), but there is nothing inside Security.framework that lets you
315
- # get a SecIdentityRef without having a key in a keychain.
316
- #
317
- # So the policy here is we take all the files and iterate them in order.
318
- # Each one will use SecItemImport to have one or more objects loaded from
319
- # it. We will also point at a keychain that macOS can use to work with the
320
- # private key.
321
- #
322
- # Once we have all the objects, we'll check what we actually have. If we
323
- # already have a SecIdentityRef in hand, fab: we'll use that. Otherwise,
324
- # we'll take the first certificate (which we assume to be our leaf) and
325
- # ask the keychain to give us a SecIdentityRef with that cert's associated
326
- # key.
327
- #
328
- # We'll then return a CFArray containing the trust chain: one
329
- # SecIdentityRef and then zero-or-more SecCertificateRef objects. The
330
- # responsibility for freeing this CFArray will be with the caller. This
331
- # CFArray must remain alive for the entire connection, so in practice it
332
- # will be stored with a single SSLSocket, along with the reference to the
333
- # keychain.
334
- certificates = []
335
- identities = []
336
-
337
- # Filter out bad paths.
338
- paths = (path for path in paths if path)
339
-
340
- try:
341
- for file_path in paths:
342
- new_identities, new_certs = _load_items_from_file(keychain, file_path)
343
- identities.extend(new_identities)
344
- certificates.extend(new_certs)
345
-
346
- # Ok, we have everything. The question is: do we have an identity? If
347
- # not, we want to grab one from the first cert we have.
348
- if not identities:
349
- new_identity = Security.SecIdentityRef()
350
- status = Security.SecIdentityCreateWithCertificate(
351
- keychain, certificates[0], ctypes.byref(new_identity)
352
- )
353
- _assert_no_error(status)
354
- identities.append(new_identity)
355
-
356
- # We now want to release the original certificate, as we no longer
357
- # need it.
358
- CoreFoundation.CFRelease(certificates.pop(0))
359
-
360
- # We now need to build a new CFArray that holds the trust chain.
361
- trust_chain = CoreFoundation.CFArrayCreateMutable(
362
- CoreFoundation.kCFAllocatorDefault,
363
- 0,
364
- ctypes.byref(CoreFoundation.kCFTypeArrayCallBacks),
365
- )
366
- for item in itertools.chain(identities, certificates):
367
- # ArrayAppendValue does a CFRetain on the item. That's fine,
368
- # because the finally block will release our other refs to them.
369
- CoreFoundation.CFArrayAppendValue(trust_chain, item)
370
-
371
- return trust_chain
372
- finally:
373
- for obj in itertools.chain(identities, certificates):
374
- CoreFoundation.CFRelease(obj)
375
-
376
-
377
- TLS_PROTOCOL_VERSIONS = {
378
- "SSLv2": (0, 2),
379
- "SSLv3": (3, 0),
380
- "TLSv1": (3, 1),
381
- "TLSv1.1": (3, 2),
382
- "TLSv1.2": (3, 3),
383
- }
384
-
385
-
386
- def _build_tls_unknown_ca_alert(version):
387
- """
388
- Builds a TLS alert record for an unknown CA.
389
- """
390
- ver_maj, ver_min = TLS_PROTOCOL_VERSIONS[version]
391
- severity_fatal = 0x02
392
- description_unknown_ca = 0x30
393
- msg = struct.pack(">BB", severity_fatal, description_unknown_ca)
394
- msg_len = len(msg)
395
- record_type_alert = 0x15
396
- record = struct.pack(">BBBH", record_type_alert, ver_maj, ver_min, msg_len) + msg
397
- return record
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/detectron2/modeling/anchor_generator.py DELETED
@@ -1,365 +0,0 @@
1
- # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
2
- import copy
3
- import math
4
- from typing import List
5
- import torch
6
- from torch import nn
7
-
8
- from detectron2.layers import ShapeSpec
9
- from detectron2.structures import Boxes, RotatedBoxes
10
- from detectron2.utils.registry import Registry
11
-
12
- ANCHOR_GENERATOR_REGISTRY = Registry("ANCHOR_GENERATOR")
13
- ANCHOR_GENERATOR_REGISTRY.__doc__ = """
14
- Registry for modules that creates object detection anchors for feature maps.
15
-
16
- The registered object will be called with `obj(cfg, input_shape)`.
17
- """
18
-
19
-
20
- class BufferList(nn.Module):
21
- """
22
- Similar to nn.ParameterList, but for buffers
23
- """
24
-
25
- def __init__(self, buffers=None):
26
- super(BufferList, self).__init__()
27
- if buffers is not None:
28
- self.extend(buffers)
29
-
30
- def extend(self, buffers):
31
- offset = len(self)
32
- for i, buffer in enumerate(buffers):
33
- self.register_buffer(str(offset + i), buffer)
34
- return self
35
-
36
- def __len__(self):
37
- return len(self._buffers)
38
-
39
- def __iter__(self):
40
- return iter(self._buffers.values())
41
-
42
-
43
- def _create_grid_offsets(size, stride, offset, device):
44
- grid_height, grid_width = size
45
- shifts_x = torch.arange(
46
- offset * stride, grid_width * stride, step=stride, dtype=torch.float32, device=device
47
- )
48
- shifts_y = torch.arange(
49
- offset * stride, grid_height * stride, step=stride, dtype=torch.float32, device=device
50
- )
51
-
52
- shift_y, shift_x = torch.meshgrid(shifts_y, shifts_x)
53
- shift_x = shift_x.reshape(-1)
54
- shift_y = shift_y.reshape(-1)
55
- return shift_x, shift_y
56
-
57
-
58
- @ANCHOR_GENERATOR_REGISTRY.register()
59
- class DefaultAnchorGenerator(nn.Module):
60
- """
61
- For a set of image sizes and feature maps, computes a set of anchors.
62
- """
63
-
64
- def __init__(self, cfg, input_shape: List[ShapeSpec]):
65
- super().__init__()
66
- # fmt: off
67
- sizes = cfg.MODEL.ANCHOR_GENERATOR.SIZES
68
- aspect_ratios = cfg.MODEL.ANCHOR_GENERATOR.ASPECT_RATIOS
69
- self.strides = [x.stride for x in input_shape]
70
- self.offset = cfg.MODEL.ANCHOR_GENERATOR.OFFSET
71
-
72
- assert 0.0 <= self.offset < 1.0, self.offset
73
-
74
- # fmt: on
75
- """
76
- sizes (list[list[int]]): sizes[i] is the list of anchor sizes to use
77
- for the i-th feature map. If len(sizes) == 1, then the same list of
78
- anchor sizes, given by sizes[0], is used for all feature maps. Anchor
79
- sizes are given in absolute lengths in units of the input image;
80
- they do not dynamically scale if the input image size changes.
81
- aspect_ratios (list[list[float]]): aspect_ratios[i] is the list of
82
- anchor aspect ratios to use for the i-th feature map. If
83
- len(aspect_ratios) == 1, then the same list of anchor aspect ratios,
84
- given by aspect_ratios[0], is used for all feature maps.
85
- strides (list[int]): stride of each input feature.
86
- """
87
-
88
- self.num_features = len(self.strides)
89
- self.cell_anchors = self._calculate_anchors(sizes, aspect_ratios)
90
-
91
- def _calculate_anchors(self, sizes, aspect_ratios):
92
- # If one size (or aspect ratio) is specified and there are multiple feature
93
- # maps, then we "broadcast" anchors of that single size (or aspect ratio)
94
- # over all feature maps.
95
- if len(sizes) == 1:
96
- sizes *= self.num_features
97
- if len(aspect_ratios) == 1:
98
- aspect_ratios *= self.num_features
99
- assert self.num_features == len(sizes)
100
- assert self.num_features == len(aspect_ratios)
101
-
102
- cell_anchors = [
103
- self.generate_cell_anchors(s, a).float() for s, a in zip(sizes, aspect_ratios)
104
- ]
105
-
106
- return BufferList(cell_anchors)
107
-
108
- @property
109
- def box_dim(self):
110
- """
111
- Returns:
112
- int: the dimension of each anchor box.
113
- """
114
- return 4
115
-
116
- @property
117
- def num_cell_anchors(self):
118
- """
119
- Returns:
120
- list[int]: Each int is the number of anchors at every pixel
121
- location, on that feature map.
122
- For example, if at every pixel we use anchors of 3 aspect
123
- ratios and 5 sizes, the number of anchors is 15.
124
- (See also ANCHOR_GENERATOR.SIZES and ANCHOR_GENERATOR.ASPECT_RATIOS in config)
125
-
126
- In standard RPN models, `num_cell_anchors` on every feature map is the same.
127
- """
128
- return [len(cell_anchors) for cell_anchors in self.cell_anchors]
129
-
130
- def grid_anchors(self, grid_sizes):
131
- anchors = []
132
- for size, stride, base_anchors in zip(grid_sizes, self.strides, self.cell_anchors):
133
- shift_x, shift_y = _create_grid_offsets(size, stride, self.offset, base_anchors.device)
134
- shifts = torch.stack((shift_x, shift_y, shift_x, shift_y), dim=1)
135
-
136
- anchors.append((shifts.view(-1, 1, 4) + base_anchors.view(1, -1, 4)).reshape(-1, 4))
137
-
138
- return anchors
139
-
140
- def generate_cell_anchors(self, sizes=(32, 64, 128, 256, 512), aspect_ratios=(0.5, 1, 2)):
141
- """
142
- Generate a tensor storing anchor boxes, which are continuous geometric rectangles
143
- centered on one feature map point sample. We can later build the set of anchors
144
- for the entire feature map by tiling these tensors; see `meth:grid_anchors`.
145
-
146
- Args:
147
- sizes (tuple[float]): Absolute size (i.e. sqrt of area) of the anchors in the units
148
- of pixels on the input image (the input received by the network, after
149
- undergoing necessary scaling).
150
- aspect_ratios (tuple[float]]): Aspect ratios of the boxes computed as box
151
- height / width.
152
-
153
- Returns:
154
- Tensor of shape (len(sizes) * len(aspect_ratios), 4) storing anchor boxes
155
- in XYXY format.
156
- """
157
-
158
- # This is different from the anchor generator defined in the original Faster R-CNN
159
- # code or Detectron. They yield the same AP, however the old version defines cell
160
- # anchors in a less natural way with a shift relative to the feature grid and
161
- # quantization that results in slightly different sizes for different aspect ratios.
162
- # See also https://github.com/facebookresearch/Detectron/issues/227
163
-
164
- anchors = []
165
- for size in sizes:
166
- area = size ** 2.0
167
- for aspect_ratio in aspect_ratios:
168
- # s * s = w * h
169
- # a = h / w
170
- # ... some algebra ...
171
- # w = sqrt(s * s / a)
172
- # h = a * w
173
- w = math.sqrt(area / aspect_ratio)
174
- h = aspect_ratio * w
175
- x0, y0, x1, y1 = -w / 2.0, -h / 2.0, w / 2.0, h / 2.0
176
- anchors.append([x0, y0, x1, y1])
177
- return torch.tensor(anchors)
178
-
179
- def forward(self, features):
180
- """
181
- Args:
182
- features (list[Tensor]): list of backbone feature maps on which to generate anchors.
183
-
184
- Returns:
185
- list[list[Boxes]]: a list of #image elements. Each is a list of #feature level Boxes.
186
- The Boxes contains anchors of this image on the specific feature level.
187
- """
188
- num_images = len(features[0])
189
- grid_sizes = [feature_map.shape[-2:] for feature_map in features]
190
- anchors_over_all_feature_maps = self.grid_anchors(grid_sizes)
191
-
192
- anchors_in_image = []
193
- for anchors_per_feature_map in anchors_over_all_feature_maps:
194
- boxes = Boxes(anchors_per_feature_map)
195
- anchors_in_image.append(boxes)
196
-
197
- anchors = [copy.deepcopy(anchors_in_image) for _ in range(num_images)]
198
- return anchors
199
-
200
-
201
- @ANCHOR_GENERATOR_REGISTRY.register()
202
- class RotatedAnchorGenerator(nn.Module):
203
- """
204
- The anchor generator used by Rotated RPN (RRPN).
205
- """
206
-
207
- def __init__(self, cfg, input_shape: List[ShapeSpec]):
208
- super().__init__()
209
- # fmt: off
210
- sizes = cfg.MODEL.ANCHOR_GENERATOR.SIZES
211
- aspect_ratios = cfg.MODEL.ANCHOR_GENERATOR.ASPECT_RATIOS
212
- angles = cfg.MODEL.ANCHOR_GENERATOR.ANGLES
213
- self.strides = [x.stride for x in input_shape]
214
- self.offset = cfg.MODEL.ANCHOR_GENERATOR.OFFSET
215
-
216
- assert 0.0 <= self.offset < 1.0, self.offset
217
-
218
- # fmt: on
219
-
220
- self.num_features = len(self.strides)
221
- self.cell_anchors = self._calculate_anchors(sizes, aspect_ratios, angles, self.strides)
222
-
223
- def _calculate_anchors(self, sizes, aspect_ratios, angles, feature_strides):
224
- """
225
- Args:
226
- sizes (list[list[int]]): sizes[i] is the list of anchor sizes to use
227
- for the i-th feature map. If len(sizes) == 1, then the same list of
228
- anchor sizes, given by sizes[0], is used for all feature maps. Anchor
229
- sizes are given in absolute lengths in units of the input image;
230
- they do not dynamically scale if the input image size changes.
231
- aspect_ratios (list[list[float]]): aspect_ratios[i] is the list of
232
- anchor aspect ratios to use for the i-th feature map. If
233
- len(aspect_ratios) == 1, then the same list of anchor aspect ratios,
234
- given by aspect_ratios[0], is used for all feature maps.
235
- angles (list[list[float]]): angles[i] is the list of
236
- anchor angles to use for the i-th feature map. If
237
- len(angles) == 1, then the same list of anchor angles,
238
- given by angles[0], is used for all feature maps.
239
- feature_strides (list[number]): list of feature map strides (with respect
240
- to the input image) for each input feature map.
241
- """
242
-
243
- # If one size (or aspect ratio) is specified and there are multiple feature
244
- # maps, then we "broadcast" anchors of that single size
245
- # (or aspect ratio/angle) over all feature maps.
246
-
247
- if len(sizes) == 1:
248
- sizes *= self.num_features
249
- if len(aspect_ratios) == 1:
250
- aspect_ratios *= self.num_features
251
- if len(angles) == 1:
252
- angles *= self.num_features
253
- assert self.num_features == len(sizes)
254
- assert self.num_features == len(aspect_ratios)
255
- assert self.num_features == len(angles)
256
-
257
- cell_anchors = [
258
- self.generate_cell_anchors(size, aspect_ratio, angle).float()
259
- for size, aspect_ratio, angle in zip(sizes, aspect_ratios, angles)
260
- ]
261
-
262
- return BufferList(cell_anchors)
263
-
264
- @property
265
- def box_dim(self):
266
- """
267
- Returns:
268
- int: the dimension of each anchor box.
269
- """
270
- return 5
271
-
272
- @property
273
- def num_cell_anchors(self):
274
- """
275
- Returns:
276
- list[int]: Each int is the number of anchors at every pixel
277
- location, on that feature map.
278
- For example, if at every pixel we use anchors of 3 aspect
279
- ratios, 2 sizes and 5 angles, the number of anchors is 30.
280
- (See also ANCHOR_GENERATOR.SIZES, ANCHOR_GENERATOR.ASPECT_RATIOS
281
- and ANCHOR_GENERATOR.ANGLES in config)
282
-
283
- In standard RRPN models, `num_cell_anchors` on every feature map is the same.
284
- """
285
- return [len(cell_anchors) for cell_anchors in self.cell_anchors]
286
-
287
- def grid_anchors(self, grid_sizes):
288
- anchors = []
289
- for size, stride, base_anchors in zip(grid_sizes, self.strides, self.cell_anchors):
290
- shift_x, shift_y = _create_grid_offsets(size, stride, self.offset, base_anchors.device)
291
- zeros = torch.zeros_like(shift_x)
292
- shifts = torch.stack((shift_x, shift_y, zeros, zeros, zeros), dim=1)
293
-
294
- anchors.append((shifts.view(-1, 1, 5) + base_anchors.view(1, -1, 5)).reshape(-1, 5))
295
-
296
- return anchors
297
-
298
- def generate_cell_anchors(
299
- self,
300
- sizes=(32, 64, 128, 256, 512),
301
- aspect_ratios=(0.5, 1, 2),
302
- angles=(-90, -60, -30, 0, 30, 60, 90),
303
- ):
304
- """
305
- Generate a tensor storing anchor boxes, which are continuous geometric rectangles
306
- centered on one feature map point sample. We can later build the set of anchors
307
- for the entire feature map by tiling these tensors; see `meth:grid_anchors`.
308
-
309
- Args:
310
- sizes (tuple[float]): Absolute size of the anchors in the units of the input
311
- image (the input received by the network, after undergoing necessary scaling).
312
- The absolute size is given as the side length of a box.
313
- aspect_ratios (tuple[float]]): Aspect ratios of the boxes computed as box
314
- height / width.
315
- angles (tuple[float]]): Angles of boxes indicating how many degrees
316
- the boxes are rotated counter-clockwise.
317
-
318
- Returns:
319
- Tensor of shape (len(sizes) * len(aspect_ratios) * len(angles), 5)
320
- storing anchor boxes in (x_ctr, y_ctr, w, h, angle) format.
321
- """
322
- anchors = []
323
- for size in sizes:
324
- area = size ** 2.0
325
- for aspect_ratio in aspect_ratios:
326
- # s * s = w * h
327
- # a = h / w
328
- # ... some algebra ...
329
- # w = sqrt(s * s / a)
330
- # h = a * w
331
- w = math.sqrt(area / aspect_ratio)
332
- h = aspect_ratio * w
333
- anchors.extend([0, 0, w, h, a] for a in angles)
334
-
335
- return torch.tensor(anchors)
336
-
337
- def forward(self, features):
338
- """
339
- Args:
340
- features (list[Tensor]): list of backbone feature maps on which to generate anchors.
341
-
342
- Returns:
343
- list[list[RotatedBoxes]]:
344
- a list of #image elements. Each is a list of #feature level RotatedBoxes.
345
- The RotatedBoxes contains anchors of this image on the specific feature level.
346
- """
347
- num_images = len(features[0])
348
- grid_sizes = [feature_map.shape[-2:] for feature_map in features]
349
- anchors_over_all_feature_maps = self.grid_anchors(grid_sizes)
350
-
351
- anchors_in_image = []
352
- for anchors_per_feature_map in anchors_over_all_feature_maps:
353
- boxes = RotatedBoxes(anchors_per_feature_map)
354
- anchors_in_image.append(boxes)
355
-
356
- anchors = [copy.deepcopy(anchors_in_image) for _ in range(num_images)]
357
- return anchors
358
-
359
-
360
- def build_anchor_generator(cfg, input_shape):
361
- """
362
- Built an anchor generator from `cfg.MODEL.ANCHOR_GENERATOR.NAME`.
363
- """
364
- anchor_generator = cfg.MODEL.ANCHOR_GENERATOR.NAME
365
- return ANCHOR_GENERATOR_REGISTRY.get(anchor_generator)(cfg, input_shape)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/projects/DensePose/dev/run_inference_tests.sh DELETED
@@ -1,33 +0,0 @@
1
- #!/bin/bash -e
2
- # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
3
-
4
- BIN="python train_net.py"
5
- OUTPUT="inference_test_output"
6
- NUM_GPUS=2
7
- IMS_PER_GPU=2
8
- IMS_PER_BATCH=$(( NUM_GPUS * IMS_PER_GPU ))
9
-
10
- CFG_LIST=( "${@:1}" )
11
-
12
- if [ ${#CFG_LIST[@]} -eq 0 ]; then
13
- CFG_LIST=( ./configs/quick_schedules/*inference_acc_test.yaml )
14
- fi
15
-
16
- echo "========================================================================"
17
- echo "Configs to run:"
18
- echo "${CFG_LIST[@]}"
19
- echo "========================================================================"
20
-
21
- for cfg in "${CFG_LIST[@]}"; do
22
- echo "========================================================================"
23
- echo "Running $cfg ..."
24
- echo "========================================================================"
25
- $BIN \
26
- --eval-only \
27
- --num-gpus $NUM_GPUS \
28
- --config-file "$cfg" \
29
- OUTPUT_DIR "$OUTPUT" \
30
- SOLVER.IMS_PER_BATCH $IMS_PER_BATCH
31
- rm -rf $OUTPUT
32
- done
33
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/projects/TensorMask/tensormask/config.py DELETED
@@ -1,50 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
3
-
4
- from detectron2.config import CfgNode as CN
5
-
6
-
7
- def add_tensormask_config(cfg):
8
- """
9
- Add config for TensorMask.
10
- """
11
- cfg.MODEL.TENSOR_MASK = CN()
12
-
13
- # Anchor parameters
14
- cfg.MODEL.TENSOR_MASK.IN_FEATURES = ["p2", "p3", "p4", "p5", "p6", "p7"]
15
-
16
- # Convolutions to use in the towers
17
- cfg.MODEL.TENSOR_MASK.NUM_CONVS = 4
18
-
19
- # Number of foreground classes.
20
- cfg.MODEL.TENSOR_MASK.NUM_CLASSES = 80
21
- # Channel size for the classification tower
22
- cfg.MODEL.TENSOR_MASK.CLS_CHANNELS = 256
23
-
24
- cfg.MODEL.TENSOR_MASK.SCORE_THRESH_TEST = 0.05
25
- # Only the top (1000 * #levels) candidate boxes across all levels are
26
- # considered jointly during test (to improve speed)
27
- cfg.MODEL.TENSOR_MASK.TOPK_CANDIDATES_TEST = 6000
28
- cfg.MODEL.TENSOR_MASK.NMS_THRESH_TEST = 0.5
29
-
30
- # Box parameters
31
- # Channel size for the box tower
32
- cfg.MODEL.TENSOR_MASK.BBOX_CHANNELS = 128
33
- # Weights on (dx, dy, dw, dh)
34
- cfg.MODEL.TENSOR_MASK.BBOX_REG_WEIGHTS = (1.5, 1.5, 0.75, 0.75)
35
-
36
- # Loss parameters
37
- cfg.MODEL.TENSOR_MASK.FOCAL_LOSS_GAMMA = 3.0
38
- cfg.MODEL.TENSOR_MASK.FOCAL_LOSS_ALPHA = 0.3
39
-
40
- # Mask parameters
41
- # Channel size for the mask tower
42
- cfg.MODEL.TENSOR_MASK.MASK_CHANNELS = 128
43
- # Mask loss weight
44
- cfg.MODEL.TENSOR_MASK.MASK_LOSS_WEIGHT = 2.0
45
- # weight on positive pixels within the mask
46
- cfg.MODEL.TENSOR_MASK.POSITIVE_WEIGHT = 1.5
47
- # Whether to predict in the aligned representation
48
- cfg.MODEL.TENSOR_MASK.ALIGNED_ON = False
49
- # Whether to use the bipyramid architecture
50
- cfg.MODEL.TENSOR_MASK.BIPYRAMID_ON = False