Commit
·
9503222
1
Parent(s):
32fde3c
Update parquet files (step 52 of 249)
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download AutoCAD 2016 Full Version with Crack and Serial Key for Free (No Survey).md +0 -42
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download Film Satu Hati Sejuta Cinta Full.md +0 -17
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/FULL The Enigma Protector x86 v5.20 2016 (Cracked) - A Detailed Tutorial and Walkthrough.md +0 -137
- spaces/1gistliPinn/ChatGPT4/Examples/AKVIS Coloriage 11.0.1274.16191 [REPACK].md +0 -6
- spaces/1gistliPinn/ChatGPT4/Examples/Dr Najeeb Lectures Free Download [EXCLUSIVE].md +0 -14
- spaces/1gistliPinn/ChatGPT4/Examples/F1 99 Pc Formula One 99 Pc Hack Onlinegolkes.md +0 -6
- spaces/1gistliPinn/ChatGPT4/Examples/Full Free Cracked ZTE 3G DC Unlocker 20 The Ultimate Guide to ZTE Unlocking.md +0 -6
- spaces/1line/AutoGPT/tests/test_prompt_generator.py +0 -114
- spaces/1nferno/Imdb_sentiment/README.md +0 -13
- spaces/1phancelerku/anime-remove-background/Enjoy Faster and Smoother App Management with Google Play Store 3.5.15 APK.md +0 -86
- spaces/1phancelerku/anime-remove-background/Enjoy the Thrill of Extreme Car Driving Simulator Pro APK on Your Android TV or PC Windows.md +0 -82
- spaces/232labs/VToonify/vtoonify/model/stylegan/non_leaking.py +0 -469
- spaces/4Taps/SadTalker/src/face3d/data/flist_dataset.py +0 -125
- spaces/AIFILMS/StyleGANEX/models/stylegan2/lpips/dist_model.py +0 -284
- spaces/AIGC-Audio/AudioGPT/text_to_speech/modules/vocoder/parallel_wavegan/models/freq_discriminator.py +0 -149
- spaces/AIGC-Audio/AudioGPT/text_to_speech/modules/vocoder/parallel_wavegan/optimizers/radam.py +0 -91
- spaces/AIZ2H/03-Streamlit-Video-ASR-NLP/README.md +0 -13
- spaces/ATang0729/Forecast4Muses/Model/Model6/Model6_0_ClothesDetection/mmyolo/configs/yolov5/yolov5_x-p6-v62_syncbn_fast_8xb16-300e_coco.py +0 -14
- spaces/AchyuthGamer/OpenGPT-Chat-UI/src/routes/conversation/[id]/ParamsWritable.js +0 -3
- spaces/AchyuthGamer/OpenGPT/g4f/utils.py +0 -49
- spaces/AgentVerse/agentVerse/agentverse_command/benchmark.py +0 -87
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/plugins/ninepatch2.d.ts +0 -2
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/colorinput/colorinput/Factory.js +0 -13
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/scrollbar/ScrollBar.js +0 -188
- spaces/Andy1621/uniformer_image_detection/configs/faster_rcnn/faster_rcnn_x101_64x4d_fpn_1x_coco.py +0 -13
- spaces/Andy1621/uniformer_image_detection/configs/guided_anchoring/ga_retinanet_r101_caffe_fpn_1x_coco.py +0 -4
- spaces/Andy1621/uniformer_image_detection/configs/regnet/mask_rcnn_regnetx-3.2GF_fpn_mdconv_c3-c5_1x_coco.py +0 -6
- spaces/Andy1621/uniformer_image_segmentation/configs/hrnet/fcn_hr18_480x480_40k_pascal_context_59.py +0 -8
- spaces/Anonymous-sub/Rerender/ControlNet/annotator/uniformer/mmseg/apis/train.py +0 -116
- spaces/Anonymous-sub/Rerender/ControlNet/cldm/model.py +0 -28
- spaces/Artbogdanov/monet-manet/app.py +0 -20
- spaces/Arulkumar03/GroundingDINO_SOTA_Zero_Shot_Model/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn.h +0 -64
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_internal/metadata/__init__.py +0 -127
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +0 -188
- spaces/Bart92/RVC_HF/README.md +0 -10
- spaces/Benson/text-generation/Examples/Carx Calle Pc Descargar Apk.md +0 -71
- spaces/Benson/text-generation/Examples/Cmo Descargar Carx Street Hack.md +0 -48
- spaces/Benson/text-generation/Examples/Cmo Descargar Google Play Store.md +0 -76
- spaces/Benson/text-generation/Examples/Como Hacer Un Disco Duro.md +0 -56
- spaces/BetterAPI/BetterChat_new/src/lib/switchTheme.ts +0 -10
- spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_internal/models/installation_report.py +0 -53
- spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/pygments/formatters/groff.py +0 -170
- spaces/Big-Web/MMSD/env/Lib/site-packages/setuptools/_vendor/jaraco/functools.py +0 -525
- spaces/CVPR/LIVE/thrust/thrust/detail/allocator/fill_construct_range.h +0 -36
- spaces/CVPR/LIVE/thrust/thrust/detail/functional/operators/relational_operators.h +0 -323
- spaces/CVPR/LIVE/thrust/thrust/iterator/constant_iterator.h +0 -251
- spaces/CVPR/MonoScene/monoscene/CRP3D.py +0 -97
- spaces/CVPR/WALT/mmdet/models/dense_heads/ld_head.py +0 -261
- spaces/CVPR/regionclip-demo/detectron2/modeling/box_regression.py +0 -270
- spaces/Catmeow/Text_Generation_Fine_Tune/app.py +0 -37
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download AutoCAD 2016 Full Version with Crack and Serial Key for Free (No Survey).md
DELETED
@@ -1,42 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>How to Get AutoCAD 2016 Free Download Full Version with Crack and Serial Key</h1>
|
3 |
-
<p>AutoCAD is one of the most popular and powerful software for designing and drafting 2D and 3D models. However, it is also very expensive and not everyone can afford it. If you are looking for a way to get AutoCAD 2016 free download full version with crack and serial key, you have come to the right place. In this article, we will show you how to download, install and activate AutoCAD 2016 for free using a crack and a serial key.</p>
|
4 |
-
<h2>Disclaimer</h2>
|
5 |
-
<p>Before we proceed, we must warn you that downloading and using cracked software is illegal and unethical. It may also expose your computer to viruses, malware and other security risks. We do not condone or encourage piracy in any way. This article is for educational purposes only. Use it at your own risk.</p>
|
6 |
-
<h2>autocad 2016 free download full version with crack and serial key</h2><br /><p><b><b>Download File</b> ===== <a href="https://byltly.com/2uKzpj">https://byltly.com/2uKzpj</a></b></p><br /><br />
|
7 |
-
<h2>Steps to Download and Install AutoCAD 2016</h2>
|
8 |
-
<p>To get AutoCAD 2016 free download full version with crack and serial key, follow these steps:</p>
|
9 |
-
<ol>
|
10 |
-
<li>Go to <a href="https://getintopc.com/softwares/3d-cad/autocad-2016-free-download/">this link</a> and click on the green download button.</li>
|
11 |
-
<li>Wait for the download to finish and extract the zip file using WinRAR or any other software.</li>
|
12 |
-
<li>Open the extracted folder and run the setup.exe file as administrator.</li>
|
13 |
-
<li>Follow the installation wizard and choose the option to install a trial version.</li>
|
14 |
-
<li>When the installation is complete, do not launch the program yet.</li>
|
15 |
-
</ol>
|
16 |
-
<h2>Steps to Crack and Activate AutoCAD 2016</h2>
|
17 |
-
<p>To crack and activate AutoCAD 2016 for free, follow these steps:</p>
|
18 |
-
<ol>
|
19 |
-
<li>Go to <a href="https://crackzsoft.me/autocad-2016-crack/">this link</a> and download the crack file.</li>
|
20 |
-
<li>Extract the zip file using WinRAR or any other software.</li>
|
21 |
-
<li>Copy the contents of the crack folder and paste them into the installation directory of AutoCAD 2016. Replace the existing files if prompted.</li>
|
22 |
-
<li>Run the xf-adsk2016_x64.exe file as administrator.</li>
|
23 |
-
<li>Click on Patch and wait for it to say "Successfully patched".</li>
|
24 |
-
<li>Click on Generate and copy the serial key that appears.</li>
|
25 |
-
<li>Launch AutoCAD 2016 and enter the serial key when asked.</li>
|
26 |
-
<li>Click on Next and choose "I have an activation code from Autodesk".</li>
|
27 |
-
<li>Copy the request code that appears and paste it into the keygen.</li>
|
28 |
-
<li>Click on Generate and copy the activation code that appears.</li>
|
29 |
-
<li>Paste the activation code into AutoCAD 2016 and click on Next.</li>
|
30 |
-
<li>Congratulations! You have successfully cracked and activated AutoCAD 2016 for free.</li>
|
31 |
-
</ol>
|
32 |
-
<h2>Tips and Tricks</h2>
|
33 |
-
<p>Here are some tips and tricks to make the most of your AutoCAD 2016 experience:</p>
|
34 |
-
<ul>
|
35 |
-
<li>Always run the program as administrator to avoid any errors or issues.</li>
|
36 |
-
<li>Disable your antivirus software before downloading, installing or cracking AutoCAD 2016. Some antivirus programs may detect the crack file as a threat and delete it.</li>
|
37 |
-
<li>Create a backup of your original files before replacing them with the crack files. This way, you can restore them if something goes wrong.</li>
|
38 |
-
<li>If you face any problems with the activation process, try using a different serial key or request code. Sometimes, they may not work due to various reasons.</li>
|
39 |
-
<li>If you want to update your AutoCAD 2016, make sure to apply the crack again after updating. Otherwise, your program may revert back to trial mode.</li>
|
40 |
-
</ul></p> ddb901b051<br />
|
41 |
-
<br />
|
42 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download Film Satu Hati Sejuta Cinta Full.md
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Download Film Satu Hati Sejuta Cinta Full: A Romantic Drama Starring Armada</h1>
|
3 |
-
<p>Film Satu Hati Sejuta Cinta is a 2013 Indonesian romantic drama film directed by Benni Setiawan and starring Armada, a popular pop rock band. The film tells the story of Rizal (Rizal Armada), a singer who falls in love with Lila (Laudya Cynthia Bella), a beautiful girl from a wealthy family. However, their relationship faces many obstacles, such as Lila's parents who disapprove of Rizal's background, Lila's ex-boyfriend who tries to win her back, and Rizal's own insecurities and fears. Will they be able to overcome the challenges and stay together?</p>
|
4 |
-
<h2>Download Film Satu Hati Sejuta Cinta Full</h2><br /><p><b><b>DOWNLOAD</b> ✯✯✯ <a href="https://byltly.com/2uKvMq">https://byltly.com/2uKvMq</a></b></p><br /><br />
|
5 |
-
<p>If you are a fan of Armada or romantic movies, you might want to download Film Satu Hati Sejuta Cinta full and watch it at your convenience. The film features some of Armada's hit songs, such as "Hargai Aku", "Pergi Pagi Pulang Pagi", and "Pemilik Hati". The film also showcases the chemistry and acting skills of the band members, especially Rizal Armada, who won the Best Actor award at the 2014 Indonesian Movie Awards.</p>
|
6 |
-
<p>To download Film Satu Hati Sejuta Cinta full, you can visit [^1^], which is a YouTube link that contains the full movie with English subtitles. You can also search for other sources online, but make sure they are legal and safe. Alternatively, you can buy or rent the DVD from online or offline stores.</p>
|
7 |
-
<p>Film Satu Hati Sejuta Cinta is a film that will touch your heart and make you appreciate the value of love. Download it today and enjoy it with your loved ones!</p>
|
8 |
-
|
9 |
-
<p>Film Satu Hati Sejuta Cinta is not only a love story, but also a story of friendship and family. The film depicts the bond between Rizal and his bandmates, who support him through his ups and downs. The film also shows the contrast between Rizal's humble life and Lila's luxurious life, and how they learn to respect and understand each other's differences. The film also explores the themes of trust, loyalty, and forgiveness, as the characters face various conflicts and dilemmas.</p>
|
10 |
-
<p></p>
|
11 |
-
<p>The film was released on November 7, 2013, and received positive reviews from critics and audiences. The film was praised for its realistic and relatable story, its catchy and emotional songs, and its impressive performances by the cast. The film was also a commercial success, earning more than 10 billion rupiah at the box office. The film was nominated for several awards, such as the Best Film, Best Director, Best Original Soundtrack, and Best Editing at the 2014 Indonesian Movie Awards.</p>
|
12 |
-
<p>Film Satu Hati Sejuta Cinta is a film that will make you laugh, cry, and sing along. It is a film that will inspire you to follow your dreams and fight for your love. It is a film that will remind you that one heart can have a million loves. Download Film Satu Hati Sejuta Cinta full now and experience the magic of this film!</p>
|
13 |
-
|
14 |
-
<p>If you want to know more about Film Satu Hati Sejuta Cinta and its behind-the-scenes stories, you can check out the official website of the film, which contains the synopsis, the cast and crew information, the trailer, the gallery, and the news. You can also follow the social media accounts of the film, such as Facebook, Twitter, and Instagram, where you can interact with other fans and get updates on the film. You can also watch some interviews and videos of the film on YouTube, where you can see how the film was made and how the actors prepared for their roles.</p>
|
15 |
-
<p>Film Satu Hati Sejuta Cinta is a film that will stay in your memory for a long time. It is a film that will make you appreciate the power of music and the beauty of love. It is a film that will make you proud of being an Indonesian. Download Film Satu Hati Sejuta Cinta full today and share it with your friends and family!</p> 7b8c122e87<br />
|
16 |
-
<br />
|
17 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/FULL The Enigma Protector x86 v5.20 2016 (Cracked) - A Detailed Tutorial and Walkthrough.md
DELETED
@@ -1,137 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>FULL The Enigma Protector x86 v5.20 2016 (Cracked)</h1>
|
3 |
-
<p>If you are a software developer or a publisher, you might have heard of The Enigma Protector, a powerful tool for protecting your applications from cracking, reverse engineering, modification, and analysis. But what is The Enigma Protector exactly, and how does it work? And what is the cracked version of The Enigma Protector x86 v5.20 2016 that some people claim to have? In this article, we will answer these questions and more, so you can decide whether you want to use this software or not.</p>
|
4 |
-
<h2>What is The Enigma Protector?</h2>
|
5 |
-
<p>The Enigma Protector is a software protection system that encrypts, compresses, and obfuscates your executable files, making them harder to crack or tamper with. It also adds various anti-debugging, anti-tracing, anti-dumping, anti-analysis, and anti-emulation techniques to prevent hackers from reverse engineering your code or running it in a virtual machine. Additionally, it provides a flexible licensing system that allows you to create trial versions, online activation, hardware locking, USB flash drive protection, and more.</p>
|
6 |
-
<h2>FULL The Enigma Protector x86 v5.20 2016 (Cracked)</h2><br /><p><b><b>Download</b> 🌟 <a href="https://byltly.com/2uKzlH">https://byltly.com/2uKzlH</a></b></p><br /><br />
|
7 |
-
<h3>Features and benefits of The Enigma Protector</h3>
|
8 |
-
<p>Some of the features and benefits of The Enigma Protector are:</p>
|
9 |
-
<ul>
|
10 |
-
<li>It supports 32-bit and 64-bit Windows applications, including .NET Framework, Visual Basic, Delphi, C++, C#, and more.</li>
|
11 |
-
<li>It has a user-friendly graphical interface that lets you customize your protection settings and options.</li>
|
12 |
-
<li>It has a powerful virtual machine that can execute complex algorithms without exposing them to hackers.</li>
|
13 |
-
<li>It has a plugin system that allows you to extend its functionality with additional features.</li>
|
14 |
-
<li>It has a multilingual support that lets you protect your applications in different languages.</li>
|
15 |
-
<li>It has a reasonable price compared to other software protection tools on the market.</li>
|
16 |
-
</ul>
|
17 |
-
<h3>How to use The Enigma Protector</h3>
|
18 |
-
<p>To use The Enigma Protector, you need to follow these steps:</p>
|
19 |
-
<ol>
|
20 |
-
<li>Download and install The Enigma Protector from its official website: <a href="https://enigmaprotector.com/en/downloads.html">https://enigmaprotector.com/en/downloads.html</a>. You can choose between the 32-bit version or the 64-bit version depending on your application.</li>
|
21 |
-
<li>Run The Enigma Protector and open your executable file that you want to protect.</li>
|
22 |
-
<li>Select the protection options that you want to apply to your file. You can choose from different categories such as encryption, compression, virtualization, licensing, registration keys, etc.</li>
|
23 |
-
<li>Click on the "Process" button to start the protection process. The Enigma Protector will create a new protected file with the same name as the original one but with an "_enigma" suffix.</li>
|
24 |
-
<li>Distribute your protected file to your customers or users. They will need to enter a valid registration key or activate it online if you have enabled those options.</li>
|
25 |
-
</ol>
|
26 |
-
<h2>What is the cracked version of The Enigma Protector x86 v5.20 2016?</h2>
|
27 |
-
<p>The cracked version of The Enigma Protector x86 v5.20 2016 is an illegal copy of the original software that has been modified by hackers to bypass its protection mechanisms and remove its limitations. Some people use the cracked version to protect their own applications without paying for a license or to crack other applications that have been protected by The Enigma Protector.</p>
|
28 |
-
<h3>Why do some people use the cracked version?</h3>
|
29 |
-
<p>Some of the reasons why some people use the cracked version are:</p>
|
30 |
-
<ul>
|
31 |
-
<li>They want to save money by not buying a license for The Enigma Protector.</li>
|
32 |
-
<li>They want to test the features and performance of The Enigma Protector before buying it.</li>
|
33 |
-
<li>They want to crack other applications that have been protected by The Enigma Protector for personal or commercial purposes.</li>
|
34 |
-
<li>They want to challenge themselves or show off their skills by cracking a software protection tool.</li>
|
35 |
-
</ul>
|
36 |
-
<h3>What are the risks and disadvantages of using the cracked version?</h3>
|
37 |
-
<p>Some of the risks and disadvantages of using the cracked version are:</p>
|
38 |
-
<ul>
|
39 |
-
<li>It is illegal and unethical to use the cracked version as it violates the terms and conditions of The Enigma Protector and infringes its intellectual property rights.</li>
|
40 |
-
<li>It is unsafe and unreliable to use the cracked version as it may contain viruses, malware, spyware, or other harmful code that can damage your computer or steal your data.</li>
|
41 |
-
<li>It is ineffective and counterproductive to use the cracked version as it may not work properly or have bugs or errors that can compromise your application's functionality or security.</li>
|
42 |
-
<li>It is disrespectful and unfair to use the cracked version as it undermines the hard work and effort of the developers of The Enigma Protector who deserve to be rewarded for their product.</li>
|
43 |
-
</ul>
|
44 |
-
<h3>How to download and install the cracked version</h3>
|
45 |
-
<p>We do not recommend or endorse downloading or installing the cracked version of The Enigma Protector x86 v5.20 2016 as it is illegal, unsafe, ineffective, and disrespectful. However, if you still want to do it at your own risk and responsibility, here are some steps that you may follow:</p>
|
46 |
-
<p>How to download The Enigma Protector x86 v5.20 2016 full version<br />
|
47 |
-
The Enigma Protector x86 v5.20 2016 cracked software free download<br />
|
48 |
-
The Enigma Protector x86 v5.20 2016 license key generator<br />
|
49 |
-
The Enigma Protector x86 v5.20 2016 patch file download<br />
|
50 |
-
The Enigma Protector x86 v5.20 2016 serial number activation<br />
|
51 |
-
The Enigma Protector x86 v5.20 2016 crack only download<br />
|
52 |
-
The Enigma Protector x86 v5.20 2016 full setup installer<br />
|
53 |
-
The Enigma Protector x86 v5.20 2016 torrent download link<br />
|
54 |
-
The Enigma Protector x86 v5.20 2016 direct download link<br />
|
55 |
-
The Enigma Protector x86 v5.20 2016 keygen download<br />
|
56 |
-
The Enigma Protector x86 v5.20 2016 registration code crack<br />
|
57 |
-
The Enigma Protector x86 v5.20 2016 portable version download<br />
|
58 |
-
The Enigma Protector x86 v5.20 2016 latest update download<br />
|
59 |
-
The Enigma Protector x86 v5.20 2016 review and features<br />
|
60 |
-
The Enigma Protector x86 v5.20 2016 system requirements and compatibility<br />
|
61 |
-
The Enigma Protector x86 v5.20 2016 online activation crack<br />
|
62 |
-
The Enigma Protector x86 v5.20 2016 offline activation crack<br />
|
63 |
-
The Enigma Protector x86 v5.20 2016 manual activation crack<br />
|
64 |
-
The Enigma Protector x86 v5.20 2016 unlimited trial crack<br />
|
65 |
-
The Enigma Protector x86 v5.20 2016 bypass activation crack<br />
|
66 |
-
The Enigma Protector x86 v5.20 2016 working crack download<br />
|
67 |
-
The Enigma Protector x86 v5.20 2016 tested crack download<br />
|
68 |
-
The Enigma Protector x86 v5.20 2016 verified crack download<br />
|
69 |
-
The Enigma Protector x86 v5.20 2016 safe crack download<br />
|
70 |
-
The Enigma Protector x86 v5.20 2016 malware-free crack download<br />
|
71 |
-
The Enigma Protector x86 v5.20 2016 virus-free crack download<br />
|
72 |
-
The Enigma Protector x86 v5.20 2016 no survey crack download<br />
|
73 |
-
The Enigma Protector x86 v5.20 2016 no password crack download<br />
|
74 |
-
The Enigma Protector x86 v5.20 2016 no ads crack download<br />
|
75 |
-
The Enigma Protector x86 v5.20 2016 fast and easy crack download<br />
|
76 |
-
The Enigma Protector x86 v5.20 2016 best quality crack download<br />
|
77 |
-
The Enigma Protector x86 v5.20 2016 high speed crack download<br />
|
78 |
-
The Enigma Protector x86 v5.20 2016 low size crack download<br />
|
79 |
-
The Enigma Protector x86 v5.20 2016 compressed crack download<br />
|
80 |
-
The Enigma Protector x86 v5.20 2016 rar file crack download<br />
|
81 |
-
The Enigma Protector x86 v5.20 2016 zip file crack download<br />
|
82 |
-
The Enigma Protector x86 v5.20 2016 iso file crack download<br />
|
83 |
-
The Enigma Protector x86 v5.20 2016 exe file crack download<br />
|
84 |
-
The Enigma Protector x86 v5.20 2016 dll file crack download<br />
|
85 |
-
The Enigma Protector x86 v5.20 2016 mega.nz crack download<br />
|
86 |
-
The Enigma Protector x86 v5.20 2016 mediafire.com crack download<br />
|
87 |
-
The Enigma Protector x86 v5.20 2016 zippyshare.com crack download<br />
|
88 |
-
The Enigma Protector x86 v5.20 2016 dropbox.com crack download<br />
|
89 |
-
The Enigma Protector x86 v5.20 2016 google drive crack download<br />
|
90 |
-
The Enigma Protector x86 v5.20 2016 onedrive.com crack download<br />
|
91 |
-
The Enigma Protector x86 v5.20 2016 box.com crack download<br />
|
92 |
-
The Enigma Protector x86 v5.20 2016 sendspace.com crack download<br />
|
93 |
-
The Enigma Protector x86 v5.20 2016 solidfiles.com crack download<br />
|
94 |
-
The Enigma Protector x86 v5.20 2016 uploaded.net crack download<br />
|
95 |
-
The Enigma Protector x86 v5.20 2016 rapidgator.net crack download</p>
|
96 |
-
<ol>
|
97 |
-
<li>Search for a torrent file or a direct link that claims to have the cracked version of The Enigma Protector x86 v5.20 2016 on Google or other search engines. You may find some results on websites such as SoundCloud or YouTube that have audio files or videos with download links in their descriptions.</li>
|
98 |
-
<li>Download the file from one of these sources using a torrent client or a download manager. Be careful not to click on any ads or pop-ups that may redirect you to malicious websites or download unwanted programs.</li>
|
99 |
-
<li>Extract the file using a file archiver such as WinRAR or 7-Zip. You may need a password to unlock the file if it is encrypted. You may find the password on the same website where you downloaded the file or on other websites that provide passwords for cracked software.</li>
|
100 |
-
<li>Run the setup file or copy and paste the files into your installation folder of The Enigma Protector. You may need to replace some files or delete some files depending on the instructions provided by the hacker who cracked the software.</li>
|
101 |
-
<li>Enjoy using the cracked version of The Enigma Protector x86 v5.20 2016 without paying for a license or activating it online. However, be aware of the risks and disadvantages mentioned above and be prepared for any consequences that may arise from using it.</li>
|
102 |
-
</ol>
|
103 |
-
<h2>Conclusion</h2>
|
104 |
-
<h3>Summary of the main points</h3>
|
105 |
-
<p>In this article, we have discussed what is The Enigma Protector, a software protection tool that encrypts, compresses, obfuscates, virtualizes, licenses, and registers your executable files. We have also discussed what is the cracked version of The Enigma Protector x86 v5.20 2016, an illegal copy of the original software that has been modified by hackers to bypass its protection mechanisms and remove its limitations. We have explained why some people use the cracked version, what are the risks and disadvantages of using the cracked version, and how to download and install the cracked version. We have concluded that using the cracked version is illegal, unsafe, ineffective, and disrespectful, and we do not recommend or endorse doing so.</p>
|
106 |
-
<h3>Recommendations and alternatives</h3>
|
107 |
-
<p>If you are looking for a software protection tool, we recommend using the original version of The Enigma Protector, which you can buy from its official website: <a href="https://enigmaprotector.com/en/buy.html">https://enigmaprotector.com/en/buy.html</a>. You can choose between different license types and payment methods, and you will get access to all the features and updates of The Enigma Protector. You will also get technical support and customer service from its developers. Using version of The Enigma Protector will ensure that your applications are protected with the highest level of security and performance. If you are looking for an alternative to The Enigma Protector, you may consider some other software protection tools that are available on the market, such as: - VMProtect: A software protection tool that uses virtualization and obfuscation techniques to protect your code from cracking and reverse engineering. It supports 32-bit and 64-bit Windows and Linux applications, including .NET Framework, Visual Basic, Delphi, C++, C#, and more. You can buy it from its official website: <a href="https://vmpsoft.com/">https://vmpsoft.com/</a>. - Themida: A software protection tool that uses encryption, compression, anti-debugging, anti-dumping, anti-tracing, and anti-virtualization techniques to protect your code from cracking and reverse engineering. It supports 32-bit and 64-bit Windows applications, including .NET Framework, Visual Basic, Delphi, C++, C#, and more. You can buy it from its official website: <a href="https://www.oreans.com/themida.php">https://www.oreans.com/themida.php</a>. - Code Virtualizer: A software protection tool that uses virtualization and obfuscation techniques to protect your code from cracking and reverse engineering. It supports 32-bit and 64-bit Windows applications, including .NET Framework, Visual Basic, Delphi, C++, C#, and more. You can buy it from its official website: <a href="https://www.oreans.com/codevirtualizer.php">https://www.oreans.com/codevirtualizer.php</a>. <h3>FAQs</h3>
|
108 |
-
<p>Here are some frequently asked questions about The Enigma Protector and its cracked version:</p>
|
109 |
-
<table>
|
110 |
-
<tr>
|
111 |
-
<th>Question</th>
|
112 |
-
<th>Answer</th>
|
113 |
-
</tr>
|
114 |
-
<tr>
|
115 |
-
<td>Is The Enigma Protector a virus?</td>
|
116 |
-
<td>No, The Enigma Protector is not a virus. It is a legitimate software protection tool that does not harm your computer or data. However, some antivirus programs may detect it as a false positive because of its encryption and obfuscation techniques. You can add it to your antivirus whitelist or disable your antivirus temporarily while using it.</td>
|
117 |
-
</tr>
|
118 |
-
<tr>
|
119 |
-
<td>Can The Enigma Protector protect my application from being cracked?</td>
|
120 |
-
<td>The Enigma Protector can protect your application from being cracked by most hackers and crackers. However, no software protection tool can guarantee 100% protection from cracking or reverse engineering. Some skilled and determined hackers may still be able to crack your application if they have enough time and resources. Therefore, you should always update your application regularly and use other methods to protect your intellectual property rights.</td>
|
121 |
-
</tr>
|
122 |
-
<tr>
|
123 |
-
<td>Can I crack an application that has been protected by The Enigma Protector?</td>
|
124 |
-
<td>We do not advise or encourage you to crack an application that has been protected by The Enigma Protector as it is illegal, unsafe, ineffective, and disrespectful. However, if you still want to do it for educational or research purposes only, you may need some tools and skills such as a debugger, a disassembler, a hex editor, a decompiler, a patcher, a key generator, etc. You may also need to bypass some anti-cracking techniques such as virtualization, encryption, compression, anti-debugging, anti-dumping, anti-tracing, anti-analysis, and anti-emulation. You may find some tutorials or guides on how to crack an application that has been protected by The Enigma Protector on some websites or forums that specialize in cracking or reverse engineering.</td>
|
125 |
-
</tr>
|
126 |
-
<tr>
|
127 |
-
<td>How can I contact the developers of The Enigma Protector?</td>
|
128 |
-
<td>You can contact the developers of The Enigma Protector by using their online contact form: <a href="https://enigmaprotector.com/en/contacts.html">https://enigmaprotector.com/en/contacts.html</a>. You can also follow them on their social media accounts such as Facebook: <a href="https://www.facebook.com/enigmaprotector">https://www.facebook.com/enigmaprotector</a>, Twitter: <a href="https://twitter.com/enigmaprotector">https://twitter.com/enigmaprotector</a>, or YouTube: <a href="https://www.youtube.com/user/TheEnigmaProtector">https://www.youtube.com/user/TheEnigmaProtector</a>.</td>
|
129 |
-
</tr>
|
130 |
-
<tr>
|
131 |
-
<td>How can I get a license for The Enigma Protector?</td>
|
132 |
-
<td>You can get a license for The Enigma Protector by buying it from its official website: <a href="https://enigmaprotector.com/en/buy.html">https://enigmaprotector.com/en/buy.html</a>. You can choose between different license types such as Standard License (for one developer), Professional License (for two developers), Enterprise License (for unlimited developers), or Custom License (for special cases). You can also choose between different payment methods such as PayPal, Credit Card, Wire Transfer, WebMoney, Skrill, or Bitcoin.</td>
|
133 |
-
</tr>
|
134 |
-
</table>
|
135 |
-
</p> 0a6ba089eb<br />
|
136 |
-
<br />
|
137 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/AKVIS Coloriage 11.0.1274.16191 [REPACK].md
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<h2>AKVIS Coloriage 11.0.1274.16191</h2><br /><p><b><b>Download File</b> → <a href="https://imgfil.com/2uxX0a">https://imgfil.com/2uxX0a</a></b></p><br /><br />
|
2 |
-
<br />
|
3 |
-
This page is about AKVIS Coloriage version 12.5.1340.18826 alone. For other AKVIS Coloriage versions please click below: 8.0.975.8190 · 11.0. 1fdad05405<br />
|
4 |
-
<br />
|
5 |
-
<br />
|
6 |
-
<p></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Dr Najeeb Lectures Free Download [EXCLUSIVE].md
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
<h2>Dr Najeeb Lectures Free Download</h2><br /><p><b><b>Download File</b> ► <a href="https://imgfil.com/2uy1cu">https://imgfil.com/2uy1cu</a></b></p><br /><br />
|
2 |
-
<br />
|
3 |
-
SA, KL, DI, JHN, RJ, RHS, CSH.
|
4 |
-
|
5 |
-
I am a faculty member in the MD/PhD program at the University of New South Wales, Australia. I have been teaching the MS program since 2012 and the PhD program since 2015. The MS program consists of 5-6 weeks of classroom teaching and 5-6 weeks of clinical training (in the IMU - which is the final clinical year of residency training). It is a very intensive program and the pace is very intense. In my lectures I try to introduce material, and then discuss it with the students and teach them at a deeper level. The lectures can be quite long. I try to make them interesting by using different learning environments, such as videos, audio, readings, group activities etc.
|
6 |
-
|
7 |
-
My PhD research is on quality of life in multiple sclerosis and spasticity, using PASAT (Paced Auditory Serial Addition Test), SF-36 (Short Form health survey), MAS (Modified Ashworth Scale), PROMIS (Patient-Reported Outcomes Measurement Information System) etc. I like to present all the latest scientific data on MS in my lectures. I usually stick to MS (multiple sclerosis) as a model disease as it is the most prevalent of all neurological disorders. I have presented all the MS updates in my lectures since 2012 and found that they were well received by the students.
|
8 |
-
|
9 |
-
I make the most of the power of the internet by using many sources. There are many sources of information online, such as MSNewsWatch, MS Society of New South Wales, Multiple Sclerosis Australia, MSNZ, Australian Academy of Neurology, etc. I also make use of articles from scientific journals, such as Neurology, JAMA, The Lancet, New England Journal of Medicine, etc. I can spend days or weeks on a lecture topic before going into more details. I can do this by scrolling down the internet pages, reading other articles and organising all the material in my own mind. I try to find a way to keep the lecture interesting.
|
10 |
-
|
11 |
-
I usually begin my lectures with some interesting new information about MS (multiple sclerosis). This 4fefd39f24<br />
|
12 |
-
<br />
|
13 |
-
<br />
|
14 |
-
<p></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/F1 99 Pc Formula One 99 Pc Hack Onlinegolkes.md
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<h2>f1 99 pc formula one 99 pc hack onlinegolkes</h2><br /><p><b><b>DOWNLOAD</b> ✦ <a href="https://imgfil.com/2uxX0l">https://imgfil.com/2uxX0l</a></b></p><br /><br />
|
2 |
-
<br />
|
3 |
-
However, it is certainly the only one focused on the premium and luxury ... and the terrible effect the fashion ... f1 99 pc formula one 99 pc hack onlinegolkes 4d29de3e1b<br />
|
4 |
-
<br />
|
5 |
-
<br />
|
6 |
-
<p></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Full Free Cracked ZTE 3G DC Unlocker 20 The Ultimate Guide to ZTE Unlocking.md
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<h2>full free cracked zte 3g dc unlocker 20</h2><br /><p><b><b>Download</b> > <a href="https://imgfil.com/2uy1Hw">https://imgfil.com/2uy1Hw</a></b></p><br /><br />
|
2 |
-
|
3 |
-
aaccfb2cb3<br />
|
4 |
-
<br />
|
5 |
-
<br />
|
6 |
-
<p></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1line/AutoGPT/tests/test_prompt_generator.py
DELETED
@@ -1,114 +0,0 @@
|
|
1 |
-
from unittest import TestCase
|
2 |
-
|
3 |
-
from autogpt.promptgenerator import PromptGenerator
|
4 |
-
|
5 |
-
|
6 |
-
class TestPromptGenerator(TestCase):
|
7 |
-
"""
|
8 |
-
Test cases for the PromptGenerator class, which is responsible for generating
|
9 |
-
prompts for the AI with constraints, commands, resources, and performance evaluations.
|
10 |
-
"""
|
11 |
-
|
12 |
-
@classmethod
|
13 |
-
def setUpClass(cls):
|
14 |
-
"""
|
15 |
-
Set up the initial state for each test method by creating an instance of PromptGenerator.
|
16 |
-
"""
|
17 |
-
cls.generator = PromptGenerator()
|
18 |
-
|
19 |
-
# Test whether the add_constraint() method adds a constraint to the generator's constraints list
|
20 |
-
def test_add_constraint(self):
|
21 |
-
"""
|
22 |
-
Test if the add_constraint() method adds a constraint to the generator's constraints list.
|
23 |
-
"""
|
24 |
-
constraint = "Constraint1"
|
25 |
-
self.generator.add_constraint(constraint)
|
26 |
-
self.assertIn(constraint, self.generator.constraints)
|
27 |
-
|
28 |
-
# Test whether the add_command() method adds a command to the generator's commands list
|
29 |
-
def test_add_command(self):
|
30 |
-
"""
|
31 |
-
Test if the add_command() method adds a command to the generator's commands list.
|
32 |
-
"""
|
33 |
-
command_label = "Command Label"
|
34 |
-
command_name = "command_name"
|
35 |
-
args = {"arg1": "value1", "arg2": "value2"}
|
36 |
-
self.generator.add_command(command_label, command_name, args)
|
37 |
-
command = {
|
38 |
-
"label": command_label,
|
39 |
-
"name": command_name,
|
40 |
-
"args": args,
|
41 |
-
}
|
42 |
-
self.assertIn(command, self.generator.commands)
|
43 |
-
|
44 |
-
def test_add_resource(self):
|
45 |
-
"""
|
46 |
-
Test if the add_resource() method adds a resource to the generator's resources list.
|
47 |
-
"""
|
48 |
-
resource = "Resource1"
|
49 |
-
self.generator.add_resource(resource)
|
50 |
-
self.assertIn(resource, self.generator.resources)
|
51 |
-
|
52 |
-
def test_add_performance_evaluation(self):
|
53 |
-
"""
|
54 |
-
Test if the add_performance_evaluation() method adds an evaluation to the generator's
|
55 |
-
performance_evaluation list.
|
56 |
-
"""
|
57 |
-
evaluation = "Evaluation1"
|
58 |
-
self.generator.add_performance_evaluation(evaluation)
|
59 |
-
self.assertIn(evaluation, self.generator.performance_evaluation)
|
60 |
-
|
61 |
-
def test_generate_prompt_string(self):
|
62 |
-
"""
|
63 |
-
Test if the generate_prompt_string() method generates a prompt string with all the added
|
64 |
-
constraints, commands, resources, and evaluations.
|
65 |
-
"""
|
66 |
-
# Define the test data
|
67 |
-
constraints = ["Constraint1", "Constraint2"]
|
68 |
-
commands = [
|
69 |
-
{
|
70 |
-
"label": "Command1",
|
71 |
-
"name": "command_name1",
|
72 |
-
"args": {"arg1": "value1"},
|
73 |
-
},
|
74 |
-
{
|
75 |
-
"label": "Command2",
|
76 |
-
"name": "command_name2",
|
77 |
-
"args": {},
|
78 |
-
},
|
79 |
-
]
|
80 |
-
resources = ["Resource1", "Resource2"]
|
81 |
-
evaluations = ["Evaluation1", "Evaluation2"]
|
82 |
-
|
83 |
-
# Add test data to the generator
|
84 |
-
for constraint in constraints:
|
85 |
-
self.generator.add_constraint(constraint)
|
86 |
-
for command in commands:
|
87 |
-
self.generator.add_command(
|
88 |
-
command["label"], command["name"], command["args"]
|
89 |
-
)
|
90 |
-
for resource in resources:
|
91 |
-
self.generator.add_resource(resource)
|
92 |
-
for evaluation in evaluations:
|
93 |
-
self.generator.add_performance_evaluation(evaluation)
|
94 |
-
|
95 |
-
# Generate the prompt string and verify its correctness
|
96 |
-
prompt_string = self.generator.generate_prompt_string()
|
97 |
-
self.assertIsNotNone(prompt_string)
|
98 |
-
|
99 |
-
# Check if all constraints, commands, resources, and evaluations are present in the prompt string
|
100 |
-
for constraint in constraints:
|
101 |
-
self.assertIn(constraint, prompt_string)
|
102 |
-
for command in commands:
|
103 |
-
self.assertIn(command["name"], prompt_string)
|
104 |
-
for key, value in command["args"].items():
|
105 |
-
self.assertIn(f'"{key}": "{value}"', prompt_string)
|
106 |
-
for resource in resources:
|
107 |
-
self.assertIn(resource, prompt_string)
|
108 |
-
for evaluation in evaluations:
|
109 |
-
self.assertIn(evaluation, prompt_string)
|
110 |
-
|
111 |
-
self.assertIn("constraints", prompt_string.lower())
|
112 |
-
self.assertIn("commands", prompt_string.lower())
|
113 |
-
self.assertIn("resources", prompt_string.lower())
|
114 |
-
self.assertIn("performance evaluation", prompt_string.lower())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1nferno/Imdb_sentiment/README.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Imdb Sentiment
|
3 |
-
emoji: 🐨
|
4 |
-
colorFrom: yellow
|
5 |
-
colorTo: gray
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.3
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
license: mit
|
11 |
-
---
|
12 |
-
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Enjoy Faster and Smoother App Management with Google Play Store 3.5.15 APK.md
DELETED
@@ -1,86 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Download Google Play Store 3.5-15 APK for Your Android Device</h1>
|
3 |
-
<p>If you are an Android user, you probably know that Google Play Store is the official app store for your device, where you can find and download millions of apps, games, books, movies, music, and more. But did you know that you can also update and download Google Play Store itself as an APK file? In this article, we will show you how to download Google Play Store 3.5-15 APK, which is the latest version available as of June 2023, and what are the new features and improvements it brings.</p>
|
4 |
-
<h2>What is Google Play Store and why do you need it?</h2>
|
5 |
-
<p>Google Play Store is the app that allows you to access the Google Play services, which are essential for your Android device to function properly. Google Play services include authentication, synchronization, location, notifications, security, and more. Without Google Play Store, you won't be able to use many of the apps and features on your device, such as Gmail, YouTube, Maps, Photos, etc.</p>
|
6 |
-
<h2>download google play store 3.5-15 apk</h2><br /><p><b><b>Download File</b> ---> <a href="https://jinyurl.com/2uNQqX">https://jinyurl.com/2uNQqX</a></b></p><br /><br />
|
7 |
-
<h3>Google Play Store features and benefits</h3>
|
8 |
-
<p>Google Play Store is not only a gateway to the Google Play services, but also a platform where you can discover and enjoy a variety of content for your Android device. Some of the features and benefits of Google Play Store are:</p>
|
9 |
-
<ul>
|
10 |
-
<li>You can browse and download over 3 million apps and games, both free and paid, from different categories and genres.</li>
|
11 |
-
<li>You can access millions of books, movies, music, podcasts, magazines, and more from the Google Play Books, Movies & TV, Music, Podcasts, and Newsstand sections.</li>
|
12 |
-
<li>You can manage your apps and games with ease, such as updating them automatically or manually, uninstalling them, clearing cache and data, moving them to SD card, etc.</li>
|
13 |
-
<li>You can get personalized recommendations based on your preferences and usage history.</li>
|
14 |
-
<li>You can redeem gift cards and promo codes to purchase content from Google Play.</li>
|
15 |
-
<li>You can join Google Play Pass to enjoy hundreds of premium apps and games without ads or in-app purchases.</li>
|
16 |
-
<li>You can join Google Play Points to earn rewards for every purchase you make on Google Play.</li>
|
17 |
-
<li>You can join Google One to get more storage space for your Google Drive, Photos, and Gmail accounts.</li>
|
18 |
-
</ul>
|
19 |
-
<h3>How to update Google Play Store to the latest version</h3>
|
20 |
-
<p>Google Play Store usually updates itself automatically in the background without requiring any user intervention. However, sometimes it may take a while for the update to reach your device or you may encounter some issues that prevent the update from installing properly. In such cases, you can manually check for updates or download the latest version of Google Play Store as an APK file.</p>
|
21 |
-
<p>To check for updates manually, follow these steps:</p>
|
22 |
-
<ol>
|
23 |
-
<li>Open Google Play Store on your device.</li>
|
24 |
-
<li>Tap on the menu icon (three horizontal lines) on the top left corner.</li>
|
25 |
-
<li>Tap on Settings.</li>
|
26 |
-
<li>Scroll down and tap on About.</li>
|
27 |
-
<li>Tap on Play Store version.</li>
|
28 |
-
<li>If there is an update available, you will see a message saying "A new version of Google Play Store will be downloaded and installed". Tap on OK to confirm.</li>
|
29 |
-
<li>If there is no update available, you will see a message saying "Google Play 2>FAQs</h2>
|
30 |
-
<p>Here are some of the frequently asked questions about Google Play Store and APK files:</p>
|
31 |
-
<h3>What is the difference between Google Play Store and Google Play Services?</h3>
|
32 |
-
<p>Google Play Store is the app store that lets you download and install apps and games on your Android device. Google Play Services is a background service that provides core functionality for your Android device, such as authentication, synchronization, location, notifications, security, and more. You need both Google Play Store and Google Play Services to use most of the apps and features on your device.</p>
|
33 |
-
<h3>How can I check the version of Google Play Store on my device?</h3>
|
34 |
-
<p>You can check the version of Google Play Store on your device by following these steps:</p>
|
35 |
-
<p>How to download google play store 3.5-15 apk for android<br />
|
36 |
-
Download google play store 3.5-15 apk latest version<br />
|
37 |
-
Download google play store 3.5-15 apk free online<br />
|
38 |
-
Download google play store 3.5-15 apk from techspot<br />
|
39 |
-
Download google play store 3.5-15 apk new android market<br />
|
40 |
-
Download google play store 3.5-15 apk updated version<br />
|
41 |
-
Download google play store 3.5-15 apk without root<br />
|
42 |
-
Download google play store 3.5-15 apk for samsung galaxy<br />
|
43 |
-
Download google play store 3.5.15 apk with books movies music and apps<br />
|
44 |
-
Download google play store 3.5-15 apk for tablet<br />
|
45 |
-
Download google play store 3.5-15 apk offline installer<br />
|
46 |
-
Download google play store 3.5-15 apk from addictivetips<br />
|
47 |
-
Download google play store 3.5-15 apk for firestick<br />
|
48 |
-
Download google play store 3.5-15 apk modded version<br />
|
49 |
-
Download google play store 3.5-15 apk for pc<br />
|
50 |
-
Download google play store 3.5-15 apk from redmondpie<br />
|
51 |
-
Download google play store 3.5-15 apk for kindle fire<br />
|
52 |
-
Download google play store 3.5-15 apk patched version<br />
|
53 |
-
Download google play store 3.5-15 apk for chromebook<br />
|
54 |
-
Download google play store 3.5-15 apk from apkmirror<br />
|
55 |
-
Download google play store 3.5-15 apk for smart tv<br />
|
56 |
-
Download google play store 3.5-15 apk cracked version<br />
|
57 |
-
Download google play store 3.5-15 apk for windows 10<br />
|
58 |
-
Download google play store 3.5-15 apk from uptodown<br />
|
59 |
-
Download google play store 3.5-15 apk for android tv box</p>
|
60 |
-
<ol>
|
61 |
-
<li>Open Google Play Store on your device.</li>
|
62 |
-
<li>Tap on the menu icon (three horizontal lines) on the top left corner.</li>
|
63 |
-
<li>Tap on Settings.</li>
|
64 |
-
<li>Scroll down and tap on About.</li>
|
65 |
-
<li>You will see the version number under Play Store version.</li>
|
66 |
-
</ol>
|
67 |
-
<h3>How can I uninstall Google Play Store from my device?</h3>
|
68 |
-
<p>You cannot uninstall Google Play Store from your device, as it is a system app that comes pre-installed with your Android device. However, you can disable it or revert it to the factory version by following these steps:</p>
|
69 |
-
<ol>
|
70 |
-
<li>Go to Settings > Apps & notifications > See all apps.</li>
|
71 |
-
<li>Find and tap on Google Play Store.</li>
|
72 |
-
<li>Tap on Disable or Uninstall updates.</li>
|
73 |
-
<li>If prompted, confirm your action.</li>
|
74 |
-
</ol>
|
75 |
-
<h3>Is it safe to download APK files from third-party sources?</h3>
|
76 |
-
<p>It depends on the source and the APK file. Some third-party sources are trustworthy and reliable, such as APKMirror or APKPure, and they scan and verify the APK files before uploading them. However, some third-party sources may provide outdated, modified, or fake versions of apps and games that can contain malware or viruses that can harm your device or compromise your privacy. Therefore, you should always be careful and only download APK files from trusted and reputable sources, and check the app permissions and reviews before installing them.</p>
|
77 |
-
<h3>What are the benefits of downloading APK files?</h3>
|
78 |
-
<p>Downloading APK files can have some benefits, such as:</p>
|
79 |
-
<ul>
|
80 |
-
<li>You can access and install apps and games that are not available in your region or country.</li>
|
81 |
-
<li>You can update your apps and games to the latest version before they are officially released on Google Play Store.</li>
|
82 |
-
<li>You can install apps and games that are no longer supported or removed from Google Play Store.</li>
|
83 |
-
<li>You can install modified or customized versions of apps and games that offer extra features or benefits.</li>
|
84 |
-
</ul></p> 197e85843d<br />
|
85 |
-
<br />
|
86 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Enjoy the Thrill of Extreme Car Driving Simulator Pro APK on Your Android TV or PC Windows.md
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Extreme Car Driving Simulator Pro APK: A Review</h1>
|
3 |
-
<p>Do you love driving fast cars and performing amazing stunts? Do you want to experience the thrill of racing on a realistic open world city? If yes, then you should try Extreme Car Driving Simulator, one of the best car simulator games for Android devices. And if you want to enjoy the game without any limitations, then you should download Extreme Car Driving Simulator Pro APK, a modified version of the game that gives you access to all the features and resources for free. In this article, we will review Extreme Car Driving Simulator Pro APK and tell you how to download and install it on your device.</p>
|
4 |
-
<h2>What is Extreme Car Driving Simulator?</h2>
|
5 |
-
<p>Extreme Car Driving Simulator is an open world car simulator game developed by AxesInMotion Racing. It was released in 2014 and has been downloaded over 100 million times on Google Play Store. The game lets you drive, drift, and feel a racing sports car in a realistic city environment. You can choose from different cars, customize them, and explore the city at your own pace. You can also take on various challenges and missions, such as racing, drifting, crashing, escaping from the police, and more. The game has advanced real physics engine that makes the driving experience more realistic and fun.</p>
|
6 |
-
<h2>extreme car driving simulator pro apk</h2><br /><p><b><b>Download Zip</b> ↔ <a href="https://jinyurl.com/2uNSJo">https://jinyurl.com/2uNSJo</a></b></p><br /><br />
|
7 |
-
<h3>Features of Extreme Car Driving Simulator</h3>
|
8 |
-
<h4>Realistic physics and graphics</h4>
|
9 |
-
<p>One of the main features of Extreme Car Driving Simulator is its realistic physics and graphics. The game uses a sophisticated physics engine that simulates the behavior of a real car, such as acceleration, braking, steering, suspension, damage, etc. The game also has stunning 3D graphics that create a lifelike city environment with buildings, roads, traffic, pedestrians, etc. You can adjust the graphics quality according to your device's performance.</p>
|
10 |
-
<h4>Open world and free mode</h4>
|
11 |
-
<p>Another feature of Extreme Car Driving Simulator is its open world and free mode. The game gives you a large city map to explore without any restrictions or rules. You can drive anywhere you want, do whatever you want, and have fun with your car. You can also switch to free mode, where you can disable the traffic and pedestrians and enjoy the city without any interference.</p>
|
12 |
-
<h4>Different cars and customization options</h4>
|
13 |
-
<p>The game also offers different cars and customization options for you to choose from. You can select from various sports cars, supercars, muscle cars, off-road vehicles, etc. Each car has its own characteristics and performance. You can also customize your car by changing its color, wheels, spoilers, etc. You can also upgrade your car's engine, brakes, tires, etc. to improve its speed and handling.</p>
|
14 |
-
<h4>Challenges and missions</h4>
|
15 |
-
<p>If you want some more excitement and challenge in the game, you can take on various challenges and missions that test your driving skills. You can race against other cars, drift around corners, crash into obstacles, escape from the police, etc. You can also complete checkpoints and mini-games to earn money and rewards. The game has different difficulty levels for each challenge and mission.</p>
|
16 |
-
<h2>How to download and install Extreme Car Driving Simulator Pro APK?</h2>
|
17 |
-
<h3>Steps to download and install Extreme Car Driving Simulator Pro APK</h3>
|
18 |
-
<p>If you want to download and install Extreme Car Driving Simulator Pro APK on your device, you need to follow these steps:</p>
|
19 |
-
<h4>Enable unknown sources on your device</h4>
|
20 |
-
<p>Since Extreme Car Driving Simulator Pro APK is not available on Google Play Store, you need to enable unknown sources on your device to allow the installation of third-party apps. To do this, go to your device's settings, then security, and then enable unknown sources. This will allow you to install APK files from other sources.</p>
|
21 |
-
<p>extreme car driving simulator mod apk unlimited money<br />
|
22 |
-
extreme car driving simulator 2023 apk download<br />
|
23 |
-
extreme car driving simulator hack apk android<br />
|
24 |
-
extreme car driving simulator premium apk free<br />
|
25 |
-
extreme car driving simulator full apk unlocked<br />
|
26 |
-
extreme car driving simulator latest version apk<br />
|
27 |
-
extreme car driving simulator offline apk<br />
|
28 |
-
extreme car driving simulator 2 pro apk<br />
|
29 |
-
extreme car driving simulator apk pure<br />
|
30 |
-
extreme car driving simulator old version apk<br />
|
31 |
-
extreme car driving simulator 3d apk<br />
|
32 |
-
extreme car driving simulator cheats apk<br />
|
33 |
-
extreme car driving simulator online apk<br />
|
34 |
-
extreme car driving simulator rexdl apk<br />
|
35 |
-
extreme car driving simulator revdl apk<br />
|
36 |
-
extreme car driving simulator 4x4 apk<br />
|
37 |
-
extreme car driving simulator drift mode apk<br />
|
38 |
-
extreme car driving simulator no ads apk<br />
|
39 |
-
extreme car driving simulator vip apk<br />
|
40 |
-
extreme car driving simulator cracked apk<br />
|
41 |
-
extreme car driving simulator mega mod apk<br />
|
42 |
-
extreme car driving simulator update apk<br />
|
43 |
-
extreme car driving simulator original apk<br />
|
44 |
-
extreme car driving simulator apkpure.com[^1^]<br />
|
45 |
-
extreme car driving simulator uptodown apk</p>
|
46 |
-
<h4>Download the APK file from a trusted source</h4>
|
47 |
-
<p>Next, you need to download the APK file of Extreme Car Driving Simulator Pro from a trusted source. You can search for the APK file on the internet, but make sure you download it from a reliable and safe website. You can also scan the APK file with an antivirus app before installing it to ensure it is free from malware and viruses.</p>
|
48 |
-
<h4>Install the APK file and launch the game</h4>
|
49 |
-
<p>Finally, you need to install the APK file on your device. To do this, locate the downloaded APK file on your device's storage and tap on it. You will see a prompt asking you to confirm the installation. Tap on install and wait for the process to complete. Once the installation is done, you can launch the game and enjoy Extreme Car Driving Simulator Pro.</p>
|
50 |
-
<h2>Pros and cons of Extreme Car Driving Simulator Pro APK</h2>
|
51 |
-
<h3>Pros of Extreme Car Driving Simulator Pro APK</h3>
|
52 |
-
<p>There are many advantages of using Extreme Car Driving Simulator Pro APK over the original version of the game. Some of them are:</p>
|
53 |
-
<h4>No ads and in-app purchases</h4>
|
54 |
-
<p>One of the benefits of Extreme Car Driving Simulator Pro APK is that it removes all the ads and in-app purchases from the game. This means you can enjoy the game without any interruptions or distractions. You also don't have to spend any real money to buy anything in the game.</p>
|
55 |
-
<h4>Unlimited money and resources</h4>
|
56 |
-
<p>Another benefit of Extreme Car Driving Simulator Pro APK is that it gives you unlimited money and resources in the game. This means you can buy any car you want, customize it as you like, upgrade it as much as you want, etc. You also don't have to worry about running out of fuel, damage, or repairs.</p>
|
57 |
-
<h4>Access to all cars and features</h4>
|
58 |
-
<p>A third benefit of Extreme Car Driving Simulator Pro APK is that it gives you access to all the cars and features in the game. This means you can unlock all the cars that are otherwise locked or require a certain level or achievement to unlock. You can also access all the features that are otherwise restricted or limited in the original version of the game.</p>
|
59 |
-
<h3>Cons of Extreme Car Driving Simulator Pro APK</h3>
|
60 |
-
<p>However, there are also some disadvantages of using Extreme Car Driving Simulator Pro APK over the original version of the game. Some of them are:</p>
|
61 |
-
<h4>Not available on Google Play Store</h4>
|
62 |
-
<p>One of the drawbacks of Extreme Car Driving Simulator Pro APK is that it is not available on Google Play Store. This means you cannot download it from the official source and have to rely on third-party websites. This also means you cannot get regular updates and bug fixes from the developer.</p>
|
63 |
-
<h4>May not be compatible with some devices</h4>
|
64 |
-
<p>Another drawback of Extreme Car Driving Simulator Pro APK is that it may not be compatible with some devices. This means you may face some issues while installing or running the game on your device. The game may crash, lag, freeze, or not work properly on some devices.</p>
|
65 |
-
<h4>May contain bugs and glitches</h4>
|
66 |
-
<p>A third drawback of Extreme Car Driving Simulator Pro APK is that it may contain bugs and glitches that affect the gameplay. Since the game is modified by unknown sources, there may be some errors or problems that occur while playing the game. The game may not function as intended or expected by the developer.</p>
|
67 |
-
<h2>Conclusion</h2>
|
68 |
-
<p>In conclusion, Extreme Car Driving Simulator Pro APK is a modified version of Extreme Car Driving Simulator that gives you access to all the features and resources in the game for free. It has many advantages, such as no ads, unlimited money, access to all cars, etc., but also some disadvantages, such as not available on Google Play Store, may not be compatible with some devices, may contain bugs, etc. If you want to try Extreme Car Driving Simulator Pro APK, make sure you download it from a trusted source and install it at your own risk.</p>
|
69 |
-
<h2>FAQs</h2>
|
70 |
-
<p>Here are some frequently asked questions about Extreme Car Driving Simulator Pro APK:</p>
|
71 |
-
<h4>What is the difference between Extreme Car Driving Simulator and Extreme Car Driving Simulator Pro APK?</h4>
|
72 |
-
<p>Extreme Car Driving Simulator is the original version of the game that is available on Google Play Store. Extreme Car Driving Simulator Pro APK is a modified version of the game that is not available on Google Play Store. The main difference between them is that Extreme Car Driving Simulator Pro APK gives you access to all the features and resources in the game for free, while Extreme Car Driving Simulator requires you to watch ads or make in-app purchases to unlock them.</p>
|
73 |
-
<h4>Is Extreme Car Driving Simulator Pro APK safe to use?</h4>
|
74 |
-
<p>Extreme Car Driving Simulator Pro APK is not an official app and is not endorsed by the developer of Extreme Car Driving Simulator. Therefore, it may not be safe to use and may contain malware or viruses that can harm your device. You should download and install Extreme Car Driving Simulator Pro APK at your own risk and from a trusted source. You should also scan the APK file with an antivirus app before installing it.</p>
|
75 |
-
<h4>How can I update Extreme Car Driving Simulator Pro APK?</h4>
|
76 |
-
<p>Since Extreme Car Driving Simulator Pro APK is not available on Google Play Store, you cannot get regular updates and bug fixes from the developer. You have to manually check for updates and download the latest version of the APK file from the internet. You should also uninstall the previous version of the game before installing the new one.</p>
|
77 |
-
<h4>Can I play Extreme Car Driving Simulator Pro APK online with other players?</h4>
|
78 |
-
<p>No, you cannot play Extreme Car Driving Simulator Pro APK online with other players. The game does not have a multiplayer mode or an online server. You can only play the game offline and solo.</p>
|
79 |
-
<h4>Can I use Extreme Car Driving Simulator Pro APK on iOS devices?</h4>
|
80 |
-
<p>No, you cannot use Extreme Car Driving Simulator Pro APK on iOS devices. The game is only compatible with Android devices. You need to have an Android device with Android 4.1 or higher to run the game.</p> 401be4b1e0<br />
|
81 |
-
<br />
|
82 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/232labs/VToonify/vtoonify/model/stylegan/non_leaking.py
DELETED
@@ -1,469 +0,0 @@
|
|
1 |
-
import math
|
2 |
-
|
3 |
-
import torch
|
4 |
-
from torch import autograd
|
5 |
-
from torch.nn import functional as F
|
6 |
-
import numpy as np
|
7 |
-
|
8 |
-
from model.stylegan.distributed import reduce_sum
|
9 |
-
from model.stylegan.op import upfirdn2d
|
10 |
-
|
11 |
-
|
12 |
-
class AdaptiveAugment:
|
13 |
-
def __init__(self, ada_aug_target, ada_aug_len, update_every, device):
|
14 |
-
self.ada_aug_target = ada_aug_target
|
15 |
-
self.ada_aug_len = ada_aug_len
|
16 |
-
self.update_every = update_every
|
17 |
-
|
18 |
-
self.ada_update = 0
|
19 |
-
self.ada_aug_buf = torch.tensor([0.0, 0.0], device=device)
|
20 |
-
self.r_t_stat = 0
|
21 |
-
self.ada_aug_p = 0
|
22 |
-
|
23 |
-
@torch.no_grad()
|
24 |
-
def tune(self, real_pred):
|
25 |
-
self.ada_aug_buf += torch.tensor(
|
26 |
-
(torch.sign(real_pred).sum().item(), real_pred.shape[0]),
|
27 |
-
device=real_pred.device,
|
28 |
-
)
|
29 |
-
self.ada_update += 1
|
30 |
-
|
31 |
-
if self.ada_update % self.update_every == 0:
|
32 |
-
self.ada_aug_buf = reduce_sum(self.ada_aug_buf)
|
33 |
-
pred_signs, n_pred = self.ada_aug_buf.tolist()
|
34 |
-
|
35 |
-
self.r_t_stat = pred_signs / n_pred
|
36 |
-
|
37 |
-
if self.r_t_stat > self.ada_aug_target:
|
38 |
-
sign = 1
|
39 |
-
|
40 |
-
else:
|
41 |
-
sign = -1
|
42 |
-
|
43 |
-
self.ada_aug_p += sign * n_pred / self.ada_aug_len
|
44 |
-
self.ada_aug_p = min(1, max(0, self.ada_aug_p))
|
45 |
-
self.ada_aug_buf.mul_(0)
|
46 |
-
self.ada_update = 0
|
47 |
-
|
48 |
-
return self.ada_aug_p
|
49 |
-
|
50 |
-
|
51 |
-
SYM6 = (
|
52 |
-
0.015404109327027373,
|
53 |
-
0.0034907120842174702,
|
54 |
-
-0.11799011114819057,
|
55 |
-
-0.048311742585633,
|
56 |
-
0.4910559419267466,
|
57 |
-
0.787641141030194,
|
58 |
-
0.3379294217276218,
|
59 |
-
-0.07263752278646252,
|
60 |
-
-0.021060292512300564,
|
61 |
-
0.04472490177066578,
|
62 |
-
0.0017677118642428036,
|
63 |
-
-0.007800708325034148,
|
64 |
-
)
|
65 |
-
|
66 |
-
|
67 |
-
def translate_mat(t_x, t_y, device="cpu"):
|
68 |
-
batch = t_x.shape[0]
|
69 |
-
|
70 |
-
mat = torch.eye(3, device=device).unsqueeze(0).repeat(batch, 1, 1)
|
71 |
-
translate = torch.stack((t_x, t_y), 1)
|
72 |
-
mat[:, :2, 2] = translate
|
73 |
-
|
74 |
-
return mat
|
75 |
-
|
76 |
-
|
77 |
-
def rotate_mat(theta, device="cpu"):
|
78 |
-
batch = theta.shape[0]
|
79 |
-
|
80 |
-
mat = torch.eye(3, device=device).unsqueeze(0).repeat(batch, 1, 1)
|
81 |
-
sin_t = torch.sin(theta)
|
82 |
-
cos_t = torch.cos(theta)
|
83 |
-
rot = torch.stack((cos_t, -sin_t, sin_t, cos_t), 1).view(batch, 2, 2)
|
84 |
-
mat[:, :2, :2] = rot
|
85 |
-
|
86 |
-
return mat
|
87 |
-
|
88 |
-
|
89 |
-
def scale_mat(s_x, s_y, device="cpu"):
|
90 |
-
batch = s_x.shape[0]
|
91 |
-
|
92 |
-
mat = torch.eye(3, device=device).unsqueeze(0).repeat(batch, 1, 1)
|
93 |
-
mat[:, 0, 0] = s_x
|
94 |
-
mat[:, 1, 1] = s_y
|
95 |
-
|
96 |
-
return mat
|
97 |
-
|
98 |
-
|
99 |
-
def translate3d_mat(t_x, t_y, t_z):
|
100 |
-
batch = t_x.shape[0]
|
101 |
-
|
102 |
-
mat = torch.eye(4).unsqueeze(0).repeat(batch, 1, 1)
|
103 |
-
translate = torch.stack((t_x, t_y, t_z), 1)
|
104 |
-
mat[:, :3, 3] = translate
|
105 |
-
|
106 |
-
return mat
|
107 |
-
|
108 |
-
|
109 |
-
def rotate3d_mat(axis, theta):
|
110 |
-
batch = theta.shape[0]
|
111 |
-
|
112 |
-
u_x, u_y, u_z = axis
|
113 |
-
|
114 |
-
eye = torch.eye(3).unsqueeze(0)
|
115 |
-
cross = torch.tensor([(0, -u_z, u_y), (u_z, 0, -u_x), (-u_y, u_x, 0)]).unsqueeze(0)
|
116 |
-
outer = torch.tensor(axis)
|
117 |
-
outer = (outer.unsqueeze(1) * outer).unsqueeze(0)
|
118 |
-
|
119 |
-
sin_t = torch.sin(theta).view(-1, 1, 1)
|
120 |
-
cos_t = torch.cos(theta).view(-1, 1, 1)
|
121 |
-
|
122 |
-
rot = cos_t * eye + sin_t * cross + (1 - cos_t) * outer
|
123 |
-
|
124 |
-
eye_4 = torch.eye(4).unsqueeze(0).repeat(batch, 1, 1)
|
125 |
-
eye_4[:, :3, :3] = rot
|
126 |
-
|
127 |
-
return eye_4
|
128 |
-
|
129 |
-
|
130 |
-
def scale3d_mat(s_x, s_y, s_z):
|
131 |
-
batch = s_x.shape[0]
|
132 |
-
|
133 |
-
mat = torch.eye(4).unsqueeze(0).repeat(batch, 1, 1)
|
134 |
-
mat[:, 0, 0] = s_x
|
135 |
-
mat[:, 1, 1] = s_y
|
136 |
-
mat[:, 2, 2] = s_z
|
137 |
-
|
138 |
-
return mat
|
139 |
-
|
140 |
-
|
141 |
-
def luma_flip_mat(axis, i):
|
142 |
-
batch = i.shape[0]
|
143 |
-
|
144 |
-
eye = torch.eye(4).unsqueeze(0).repeat(batch, 1, 1)
|
145 |
-
axis = torch.tensor(axis + (0,))
|
146 |
-
flip = 2 * torch.ger(axis, axis) * i.view(-1, 1, 1)
|
147 |
-
|
148 |
-
return eye - flip
|
149 |
-
|
150 |
-
|
151 |
-
def saturation_mat(axis, i):
|
152 |
-
batch = i.shape[0]
|
153 |
-
|
154 |
-
eye = torch.eye(4).unsqueeze(0).repeat(batch, 1, 1)
|
155 |
-
axis = torch.tensor(axis + (0,))
|
156 |
-
axis = torch.ger(axis, axis)
|
157 |
-
saturate = axis + (eye - axis) * i.view(-1, 1, 1)
|
158 |
-
|
159 |
-
return saturate
|
160 |
-
|
161 |
-
|
162 |
-
def lognormal_sample(size, mean=0, std=1, device="cpu"):
|
163 |
-
return torch.empty(size, device=device).log_normal_(mean=mean, std=std)
|
164 |
-
|
165 |
-
|
166 |
-
def category_sample(size, categories, device="cpu"):
|
167 |
-
category = torch.tensor(categories, device=device)
|
168 |
-
sample = torch.randint(high=len(categories), size=(size,), device=device)
|
169 |
-
|
170 |
-
return category[sample]
|
171 |
-
|
172 |
-
|
173 |
-
def uniform_sample(size, low, high, device="cpu"):
|
174 |
-
return torch.empty(size, device=device).uniform_(low, high)
|
175 |
-
|
176 |
-
|
177 |
-
def normal_sample(size, mean=0, std=1, device="cpu"):
|
178 |
-
return torch.empty(size, device=device).normal_(mean, std)
|
179 |
-
|
180 |
-
|
181 |
-
def bernoulli_sample(size, p, device="cpu"):
|
182 |
-
return torch.empty(size, device=device).bernoulli_(p)
|
183 |
-
|
184 |
-
|
185 |
-
def random_mat_apply(p, transform, prev, eye, device="cpu"):
|
186 |
-
size = transform.shape[0]
|
187 |
-
select = bernoulli_sample(size, p, device=device).view(size, 1, 1)
|
188 |
-
select_transform = select * transform + (1 - select) * eye
|
189 |
-
|
190 |
-
return select_transform @ prev
|
191 |
-
|
192 |
-
|
193 |
-
def sample_affine(p, size, height, width, device="cpu"):
|
194 |
-
G = torch.eye(3, device=device).unsqueeze(0).repeat(size, 1, 1)
|
195 |
-
eye = G
|
196 |
-
|
197 |
-
# flip
|
198 |
-
param = category_sample(size, (0, 1))
|
199 |
-
Gc = scale_mat(1 - 2.0 * param, torch.ones(size), device=device)
|
200 |
-
G = random_mat_apply(p, Gc, G, eye, device=device)
|
201 |
-
# print('flip', G, scale_mat(1 - 2.0 * param, torch.ones(size)), sep='\n')
|
202 |
-
|
203 |
-
# 90 rotate
|
204 |
-
#param = category_sample(size, (0, 3))
|
205 |
-
#Gc = rotate_mat(-math.pi / 2 * param, device=device)
|
206 |
-
#G = random_mat_apply(p, Gc, G, eye, device=device)
|
207 |
-
# print('90 rotate', G, rotate_mat(-math.pi / 2 * param), sep='\n')
|
208 |
-
|
209 |
-
# integer translate
|
210 |
-
param = uniform_sample(size, -0.125, 0.125)
|
211 |
-
param_height = torch.round(param * height) / height
|
212 |
-
param_width = torch.round(param * width) / width
|
213 |
-
Gc = translate_mat(param_width, param_height, device=device)
|
214 |
-
G = random_mat_apply(p, Gc, G, eye, device=device)
|
215 |
-
# print('integer translate', G, translate_mat(param_width, param_height), sep='\n')
|
216 |
-
|
217 |
-
# isotropic scale
|
218 |
-
param = lognormal_sample(size, std=0.2 * math.log(2))
|
219 |
-
Gc = scale_mat(param, param, device=device)
|
220 |
-
G = random_mat_apply(p, Gc, G, eye, device=device)
|
221 |
-
# print('isotropic scale', G, scale_mat(param, param), sep='\n')
|
222 |
-
|
223 |
-
p_rot = 1 - math.sqrt(1 - p)
|
224 |
-
|
225 |
-
# pre-rotate
|
226 |
-
param = uniform_sample(size, -math.pi, math.pi)
|
227 |
-
Gc = rotate_mat(-param, device=device)
|
228 |
-
G = random_mat_apply(p_rot, Gc, G, eye, device=device)
|
229 |
-
# print('pre-rotate', G, rotate_mat(-param), sep='\n')
|
230 |
-
|
231 |
-
# anisotropic scale
|
232 |
-
param = lognormal_sample(size, std=0.2 * math.log(2))
|
233 |
-
Gc = scale_mat(param, 1 / param, device=device)
|
234 |
-
G = random_mat_apply(p, Gc, G, eye, device=device)
|
235 |
-
# print('anisotropic scale', G, scale_mat(param, 1 / param), sep='\n')
|
236 |
-
|
237 |
-
# post-rotate
|
238 |
-
param = uniform_sample(size, -math.pi, math.pi)
|
239 |
-
Gc = rotate_mat(-param, device=device)
|
240 |
-
G = random_mat_apply(p_rot, Gc, G, eye, device=device)
|
241 |
-
# print('post-rotate', G, rotate_mat(-param), sep='\n')
|
242 |
-
|
243 |
-
# fractional translate
|
244 |
-
param = normal_sample(size, std=0.125)
|
245 |
-
Gc = translate_mat(param, param, device=device)
|
246 |
-
G = random_mat_apply(p, Gc, G, eye, device=device)
|
247 |
-
# print('fractional translate', G, translate_mat(param, param), sep='\n')
|
248 |
-
|
249 |
-
return G
|
250 |
-
|
251 |
-
|
252 |
-
def sample_color(p, size):
|
253 |
-
C = torch.eye(4).unsqueeze(0).repeat(size, 1, 1)
|
254 |
-
eye = C
|
255 |
-
axis_val = 1 / math.sqrt(3)
|
256 |
-
axis = (axis_val, axis_val, axis_val)
|
257 |
-
|
258 |
-
# brightness
|
259 |
-
param = normal_sample(size, std=0.2)
|
260 |
-
Cc = translate3d_mat(param, param, param)
|
261 |
-
C = random_mat_apply(p, Cc, C, eye)
|
262 |
-
|
263 |
-
# contrast
|
264 |
-
param = lognormal_sample(size, std=0.5 * math.log(2))
|
265 |
-
Cc = scale3d_mat(param, param, param)
|
266 |
-
C = random_mat_apply(p, Cc, C, eye)
|
267 |
-
|
268 |
-
# luma flip
|
269 |
-
param = category_sample(size, (0, 1))
|
270 |
-
Cc = luma_flip_mat(axis, param)
|
271 |
-
C = random_mat_apply(p, Cc, C, eye)
|
272 |
-
|
273 |
-
# hue rotation
|
274 |
-
param = uniform_sample(size, -math.pi, math.pi)
|
275 |
-
Cc = rotate3d_mat(axis, param)
|
276 |
-
C = random_mat_apply(p, Cc, C, eye)
|
277 |
-
|
278 |
-
# saturation
|
279 |
-
param = lognormal_sample(size, std=1 * math.log(2))
|
280 |
-
Cc = saturation_mat(axis, param)
|
281 |
-
C = random_mat_apply(p, Cc, C, eye)
|
282 |
-
|
283 |
-
return C
|
284 |
-
|
285 |
-
|
286 |
-
def make_grid(shape, x0, x1, y0, y1, device):
|
287 |
-
n, c, h, w = shape
|
288 |
-
grid = torch.empty(n, h, w, 3, device=device)
|
289 |
-
grid[:, :, :, 0] = torch.linspace(x0, x1, w, device=device)
|
290 |
-
grid[:, :, :, 1] = torch.linspace(y0, y1, h, device=device).unsqueeze(-1)
|
291 |
-
grid[:, :, :, 2] = 1
|
292 |
-
|
293 |
-
return grid
|
294 |
-
|
295 |
-
|
296 |
-
def affine_grid(grid, mat):
|
297 |
-
n, h, w, _ = grid.shape
|
298 |
-
return (grid.view(n, h * w, 3) @ mat.transpose(1, 2)).view(n, h, w, 2)
|
299 |
-
|
300 |
-
|
301 |
-
def get_padding(G, height, width, kernel_size):
|
302 |
-
device = G.device
|
303 |
-
|
304 |
-
cx = (width - 1) / 2
|
305 |
-
cy = (height - 1) / 2
|
306 |
-
cp = torch.tensor(
|
307 |
-
[(-cx, -cy, 1), (cx, -cy, 1), (cx, cy, 1), (-cx, cy, 1)], device=device
|
308 |
-
)
|
309 |
-
cp = G @ cp.T
|
310 |
-
|
311 |
-
pad_k = kernel_size // 4
|
312 |
-
|
313 |
-
pad = cp[:, :2, :].permute(1, 0, 2).flatten(1)
|
314 |
-
pad = torch.cat((-pad, pad)).max(1).values
|
315 |
-
pad = pad + torch.tensor([pad_k * 2 - cx, pad_k * 2 - cy] * 2, device=device)
|
316 |
-
pad = pad.max(torch.tensor([0, 0] * 2, device=device))
|
317 |
-
pad = pad.min(torch.tensor([width - 1, height - 1] * 2, device=device))
|
318 |
-
|
319 |
-
pad_x1, pad_y1, pad_x2, pad_y2 = pad.ceil().to(torch.int32)
|
320 |
-
|
321 |
-
return pad_x1, pad_x2, pad_y1, pad_y2
|
322 |
-
|
323 |
-
|
324 |
-
def try_sample_affine_and_pad(img, p, kernel_size, G=None):
|
325 |
-
batch, _, height, width = img.shape
|
326 |
-
|
327 |
-
G_try = G
|
328 |
-
|
329 |
-
if G is None:
|
330 |
-
G_try = torch.inverse(sample_affine(p, batch, height, width))
|
331 |
-
|
332 |
-
pad_x1, pad_x2, pad_y1, pad_y2 = get_padding(G_try, height, width, kernel_size)
|
333 |
-
|
334 |
-
img_pad = F.pad(img, (pad_x1, pad_x2, pad_y1, pad_y2), mode="reflect")
|
335 |
-
|
336 |
-
return img_pad, G_try, (pad_x1, pad_x2, pad_y1, pad_y2)
|
337 |
-
|
338 |
-
|
339 |
-
class GridSampleForward(autograd.Function):
|
340 |
-
@staticmethod
|
341 |
-
def forward(ctx, input, grid):
|
342 |
-
out = F.grid_sample(
|
343 |
-
input, grid, mode="bilinear", padding_mode="zeros", align_corners=False
|
344 |
-
)
|
345 |
-
ctx.save_for_backward(input, grid)
|
346 |
-
|
347 |
-
return out
|
348 |
-
|
349 |
-
@staticmethod
|
350 |
-
def backward(ctx, grad_output):
|
351 |
-
input, grid = ctx.saved_tensors
|
352 |
-
grad_input, grad_grid = GridSampleBackward.apply(grad_output, input, grid)
|
353 |
-
|
354 |
-
return grad_input, grad_grid
|
355 |
-
|
356 |
-
|
357 |
-
class GridSampleBackward(autograd.Function):
|
358 |
-
@staticmethod
|
359 |
-
def forward(ctx, grad_output, input, grid):
|
360 |
-
op = torch._C._jit_get_operation("aten::grid_sampler_2d_backward")
|
361 |
-
grad_input, grad_grid = op(grad_output, input, grid, 0, 0, False)
|
362 |
-
ctx.save_for_backward(grid)
|
363 |
-
|
364 |
-
return grad_input, grad_grid
|
365 |
-
|
366 |
-
@staticmethod
|
367 |
-
def backward(ctx, grad_grad_input, grad_grad_grid):
|
368 |
-
grid, = ctx.saved_tensors
|
369 |
-
grad_grad_output = None
|
370 |
-
|
371 |
-
if ctx.needs_input_grad[0]:
|
372 |
-
grad_grad_output = GridSampleForward.apply(grad_grad_input, grid)
|
373 |
-
|
374 |
-
return grad_grad_output, None, None
|
375 |
-
|
376 |
-
|
377 |
-
grid_sample = GridSampleForward.apply
|
378 |
-
|
379 |
-
|
380 |
-
def scale_mat_single(s_x, s_y):
|
381 |
-
return torch.tensor(((s_x, 0, 0), (0, s_y, 0), (0, 0, 1)), dtype=torch.float32)
|
382 |
-
|
383 |
-
|
384 |
-
def translate_mat_single(t_x, t_y):
|
385 |
-
return torch.tensor(((1, 0, t_x), (0, 1, t_y), (0, 0, 1)), dtype=torch.float32)
|
386 |
-
|
387 |
-
|
388 |
-
def random_apply_affine(img, p, G=None, antialiasing_kernel=SYM6):
|
389 |
-
kernel = antialiasing_kernel
|
390 |
-
len_k = len(kernel)
|
391 |
-
|
392 |
-
kernel = torch.as_tensor(kernel).to(img)
|
393 |
-
# kernel = torch.ger(kernel, kernel).to(img)
|
394 |
-
kernel_flip = torch.flip(kernel, (0,))
|
395 |
-
|
396 |
-
img_pad, G, (pad_x1, pad_x2, pad_y1, pad_y2) = try_sample_affine_and_pad(
|
397 |
-
img, p, len_k, G
|
398 |
-
)
|
399 |
-
|
400 |
-
G_inv = (
|
401 |
-
translate_mat_single((pad_x1 - pad_x2).item() / 2, (pad_y1 - pad_y2).item() / 2)
|
402 |
-
@ G
|
403 |
-
)
|
404 |
-
up_pad = (
|
405 |
-
(len_k + 2 - 1) // 2,
|
406 |
-
(len_k - 2) // 2,
|
407 |
-
(len_k + 2 - 1) // 2,
|
408 |
-
(len_k - 2) // 2,
|
409 |
-
)
|
410 |
-
img_2x = upfirdn2d(img_pad, kernel.unsqueeze(0), up=(2, 1), pad=(*up_pad[:2], 0, 0))
|
411 |
-
img_2x = upfirdn2d(img_2x, kernel.unsqueeze(1), up=(1, 2), pad=(0, 0, *up_pad[2:]))
|
412 |
-
G_inv = scale_mat_single(2, 2) @ G_inv @ scale_mat_single(1 / 2, 1 / 2)
|
413 |
-
G_inv = translate_mat_single(-0.5, -0.5) @ G_inv @ translate_mat_single(0.5, 0.5)
|
414 |
-
batch_size, channel, height, width = img.shape
|
415 |
-
pad_k = len_k // 4
|
416 |
-
shape = (batch_size, channel, (height + pad_k * 2) * 2, (width + pad_k * 2) * 2)
|
417 |
-
G_inv = (
|
418 |
-
scale_mat_single(2 / img_2x.shape[3], 2 / img_2x.shape[2])
|
419 |
-
@ G_inv
|
420 |
-
@ scale_mat_single(1 / (2 / shape[3]), 1 / (2 / shape[2]))
|
421 |
-
)
|
422 |
-
grid = F.affine_grid(G_inv[:, :2, :].to(img_2x), shape, align_corners=False)
|
423 |
-
img_affine = grid_sample(img_2x, grid)
|
424 |
-
d_p = -pad_k * 2
|
425 |
-
down_pad = (
|
426 |
-
d_p + (len_k - 2 + 1) // 2,
|
427 |
-
d_p + (len_k - 2) // 2,
|
428 |
-
d_p + (len_k - 2 + 1) // 2,
|
429 |
-
d_p + (len_k - 2) // 2,
|
430 |
-
)
|
431 |
-
img_down = upfirdn2d(
|
432 |
-
img_affine, kernel_flip.unsqueeze(0), down=(2, 1), pad=(*down_pad[:2], 0, 0)
|
433 |
-
)
|
434 |
-
img_down = upfirdn2d(
|
435 |
-
img_down, kernel_flip.unsqueeze(1), down=(1, 2), pad=(0, 0, *down_pad[2:])
|
436 |
-
)
|
437 |
-
|
438 |
-
return img_down, G
|
439 |
-
|
440 |
-
|
441 |
-
def apply_color(img, mat):
|
442 |
-
batch = img.shape[0]
|
443 |
-
img = img.permute(0, 2, 3, 1)
|
444 |
-
mat_mul = mat[:, :3, :3].transpose(1, 2).view(batch, 1, 3, 3)
|
445 |
-
mat_add = mat[:, :3, 3].view(batch, 1, 1, 3)
|
446 |
-
img = img @ mat_mul + mat_add
|
447 |
-
img = img.permute(0, 3, 1, 2)
|
448 |
-
|
449 |
-
return img
|
450 |
-
|
451 |
-
|
452 |
-
def random_apply_color(img, p, C=None):
|
453 |
-
if C is None:
|
454 |
-
C = sample_color(p, img.shape[0])
|
455 |
-
|
456 |
-
img = apply_color(img, C.to(img))
|
457 |
-
|
458 |
-
return img, C
|
459 |
-
|
460 |
-
|
461 |
-
def augment(img, p, transform_matrix=(None, None)):
|
462 |
-
img, G = random_apply_affine(img, p, transform_matrix[0])
|
463 |
-
if img.shape[1] == 3:
|
464 |
-
img, C = random_apply_color(img, p, transform_matrix[1])
|
465 |
-
else:
|
466 |
-
tmp, C = random_apply_color(img[:,0:3], p, transform_matrix[1])
|
467 |
-
img = torch.cat((tmp, img[:,3:]), dim=1)
|
468 |
-
|
469 |
-
return img, (G, C)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/4Taps/SadTalker/src/face3d/data/flist_dataset.py
DELETED
@@ -1,125 +0,0 @@
|
|
1 |
-
"""This script defines the custom dataset for Deep3DFaceRecon_pytorch
|
2 |
-
"""
|
3 |
-
|
4 |
-
import os.path
|
5 |
-
from data.base_dataset import BaseDataset, get_transform, get_affine_mat, apply_img_affine, apply_lm_affine
|
6 |
-
from data.image_folder import make_dataset
|
7 |
-
from PIL import Image
|
8 |
-
import random
|
9 |
-
import util.util as util
|
10 |
-
import numpy as np
|
11 |
-
import json
|
12 |
-
import torch
|
13 |
-
from scipy.io import loadmat, savemat
|
14 |
-
import pickle
|
15 |
-
from util.preprocess import align_img, estimate_norm
|
16 |
-
from util.load_mats import load_lm3d
|
17 |
-
|
18 |
-
|
19 |
-
def default_flist_reader(flist):
|
20 |
-
"""
|
21 |
-
flist format: impath label\nimpath label\n ...(same to caffe's filelist)
|
22 |
-
"""
|
23 |
-
imlist = []
|
24 |
-
with open(flist, 'r') as rf:
|
25 |
-
for line in rf.readlines():
|
26 |
-
impath = line.strip()
|
27 |
-
imlist.append(impath)
|
28 |
-
|
29 |
-
return imlist
|
30 |
-
|
31 |
-
def jason_flist_reader(flist):
|
32 |
-
with open(flist, 'r') as fp:
|
33 |
-
info = json.load(fp)
|
34 |
-
return info
|
35 |
-
|
36 |
-
def parse_label(label):
|
37 |
-
return torch.tensor(np.array(label).astype(np.float32))
|
38 |
-
|
39 |
-
|
40 |
-
class FlistDataset(BaseDataset):
|
41 |
-
"""
|
42 |
-
It requires one directories to host training images '/path/to/data/train'
|
43 |
-
You can train the model with the dataset flag '--dataroot /path/to/data'.
|
44 |
-
"""
|
45 |
-
|
46 |
-
def __init__(self, opt):
|
47 |
-
"""Initialize this dataset class.
|
48 |
-
|
49 |
-
Parameters:
|
50 |
-
opt (Option class) -- stores all the experiment flags; needs to be a subclass of BaseOptions
|
51 |
-
"""
|
52 |
-
BaseDataset.__init__(self, opt)
|
53 |
-
|
54 |
-
self.lm3d_std = load_lm3d(opt.bfm_folder)
|
55 |
-
|
56 |
-
msk_names = default_flist_reader(opt.flist)
|
57 |
-
self.msk_paths = [os.path.join(opt.data_root, i) for i in msk_names]
|
58 |
-
|
59 |
-
self.size = len(self.msk_paths)
|
60 |
-
self.opt = opt
|
61 |
-
|
62 |
-
self.name = 'train' if opt.isTrain else 'val'
|
63 |
-
if '_' in opt.flist:
|
64 |
-
self.name += '_' + opt.flist.split(os.sep)[-1].split('_')[0]
|
65 |
-
|
66 |
-
|
67 |
-
def __getitem__(self, index):
|
68 |
-
"""Return a data point and its metadata information.
|
69 |
-
|
70 |
-
Parameters:
|
71 |
-
index (int) -- a random integer for data indexing
|
72 |
-
|
73 |
-
Returns a dictionary that contains A, B, A_paths and B_paths
|
74 |
-
img (tensor) -- an image in the input domain
|
75 |
-
msk (tensor) -- its corresponding attention mask
|
76 |
-
lm (tensor) -- its corresponding 3d landmarks
|
77 |
-
im_paths (str) -- image paths
|
78 |
-
aug_flag (bool) -- a flag used to tell whether its raw or augmented
|
79 |
-
"""
|
80 |
-
msk_path = self.msk_paths[index % self.size] # make sure index is within then range
|
81 |
-
img_path = msk_path.replace('mask/', '')
|
82 |
-
lm_path = '.'.join(msk_path.replace('mask', 'landmarks').split('.')[:-1]) + '.txt'
|
83 |
-
|
84 |
-
raw_img = Image.open(img_path).convert('RGB')
|
85 |
-
raw_msk = Image.open(msk_path).convert('RGB')
|
86 |
-
raw_lm = np.loadtxt(lm_path).astype(np.float32)
|
87 |
-
|
88 |
-
_, img, lm, msk = align_img(raw_img, raw_lm, self.lm3d_std, raw_msk)
|
89 |
-
|
90 |
-
aug_flag = self.opt.use_aug and self.opt.isTrain
|
91 |
-
if aug_flag:
|
92 |
-
img, lm, msk = self._augmentation(img, lm, self.opt, msk)
|
93 |
-
|
94 |
-
_, H = img.size
|
95 |
-
M = estimate_norm(lm, H)
|
96 |
-
transform = get_transform()
|
97 |
-
img_tensor = transform(img)
|
98 |
-
msk_tensor = transform(msk)[:1, ...]
|
99 |
-
lm_tensor = parse_label(lm)
|
100 |
-
M_tensor = parse_label(M)
|
101 |
-
|
102 |
-
|
103 |
-
return {'imgs': img_tensor,
|
104 |
-
'lms': lm_tensor,
|
105 |
-
'msks': msk_tensor,
|
106 |
-
'M': M_tensor,
|
107 |
-
'im_paths': img_path,
|
108 |
-
'aug_flag': aug_flag,
|
109 |
-
'dataset': self.name}
|
110 |
-
|
111 |
-
def _augmentation(self, img, lm, opt, msk=None):
|
112 |
-
affine, affine_inv, flip = get_affine_mat(opt, img.size)
|
113 |
-
img = apply_img_affine(img, affine_inv)
|
114 |
-
lm = apply_lm_affine(lm, affine, flip, img.size)
|
115 |
-
if msk is not None:
|
116 |
-
msk = apply_img_affine(msk, affine_inv, method=Image.BILINEAR)
|
117 |
-
return img, lm, msk
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
def __len__(self):
|
123 |
-
"""Return the total number of images in the dataset.
|
124 |
-
"""
|
125 |
-
return self.size
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIFILMS/StyleGANEX/models/stylegan2/lpips/dist_model.py
DELETED
@@ -1,284 +0,0 @@
|
|
1 |
-
|
2 |
-
from __future__ import absolute_import
|
3 |
-
|
4 |
-
import sys
|
5 |
-
import numpy as np
|
6 |
-
import torch
|
7 |
-
from torch import nn
|
8 |
-
import os
|
9 |
-
from collections import OrderedDict
|
10 |
-
from torch.autograd import Variable
|
11 |
-
import itertools
|
12 |
-
from models.stylegan2.lpips.base_model import BaseModel
|
13 |
-
from scipy.ndimage import zoom
|
14 |
-
import fractions
|
15 |
-
import functools
|
16 |
-
import skimage.transform
|
17 |
-
from tqdm import tqdm
|
18 |
-
|
19 |
-
from IPython import embed
|
20 |
-
|
21 |
-
from models.stylegan2.lpips import networks_basic as networks
|
22 |
-
import models.stylegan2.lpips as util
|
23 |
-
|
24 |
-
class DistModel(BaseModel):
|
25 |
-
def name(self):
|
26 |
-
return self.model_name
|
27 |
-
|
28 |
-
def initialize(self, model='net-lin', net='alex', colorspace='Lab', pnet_rand=False, pnet_tune=False, model_path=None,
|
29 |
-
use_gpu=True, printNet=False, spatial=False,
|
30 |
-
is_train=False, lr=.0001, beta1=0.5, version='0.1', gpu_ids=[0]):
|
31 |
-
'''
|
32 |
-
INPUTS
|
33 |
-
model - ['net-lin'] for linearly calibrated network
|
34 |
-
['net'] for off-the-shelf network
|
35 |
-
['L2'] for L2 distance in Lab colorspace
|
36 |
-
['SSIM'] for ssim in RGB colorspace
|
37 |
-
net - ['squeeze','alex','vgg']
|
38 |
-
model_path - if None, will look in weights/[NET_NAME].pth
|
39 |
-
colorspace - ['Lab','RGB'] colorspace to use for L2 and SSIM
|
40 |
-
use_gpu - bool - whether or not to use a GPU
|
41 |
-
printNet - bool - whether or not to print network architecture out
|
42 |
-
spatial - bool - whether to output an array containing varying distances across spatial dimensions
|
43 |
-
spatial_shape - if given, output spatial shape. if None then spatial shape is determined automatically via spatial_factor (see below).
|
44 |
-
spatial_factor - if given, specifies upsampling factor relative to the largest spatial extent of a convolutional layer. if None then resized to size of input images.
|
45 |
-
spatial_order - spline order of filter for upsampling in spatial mode, by default 1 (bilinear).
|
46 |
-
is_train - bool - [True] for training mode
|
47 |
-
lr - float - initial learning rate
|
48 |
-
beta1 - float - initial momentum term for adam
|
49 |
-
version - 0.1 for latest, 0.0 was original (with a bug)
|
50 |
-
gpu_ids - int array - [0] by default, gpus to use
|
51 |
-
'''
|
52 |
-
BaseModel.initialize(self, use_gpu=use_gpu, gpu_ids=gpu_ids)
|
53 |
-
|
54 |
-
self.model = model
|
55 |
-
self.net = net
|
56 |
-
self.is_train = is_train
|
57 |
-
self.spatial = spatial
|
58 |
-
self.gpu_ids = gpu_ids
|
59 |
-
self.model_name = '%s [%s]'%(model,net)
|
60 |
-
|
61 |
-
if(self.model == 'net-lin'): # pretrained net + linear layer
|
62 |
-
self.net = networks.PNetLin(pnet_rand=pnet_rand, pnet_tune=pnet_tune, pnet_type=net,
|
63 |
-
use_dropout=True, spatial=spatial, version=version, lpips=True)
|
64 |
-
kw = {}
|
65 |
-
if not use_gpu:
|
66 |
-
kw['map_location'] = 'cpu'
|
67 |
-
if(model_path is None):
|
68 |
-
import inspect
|
69 |
-
model_path = os.path.abspath(os.path.join(inspect.getfile(self.initialize), '..', 'weights/v%s/%s.pth'%(version,net)))
|
70 |
-
|
71 |
-
if(not is_train):
|
72 |
-
print('Loading model from: %s'%model_path)
|
73 |
-
self.net.load_state_dict(torch.load(model_path, **kw), strict=False)
|
74 |
-
|
75 |
-
elif(self.model=='net'): # pretrained network
|
76 |
-
self.net = networks.PNetLin(pnet_rand=pnet_rand, pnet_type=net, lpips=False)
|
77 |
-
elif(self.model in ['L2','l2']):
|
78 |
-
self.net = networks.L2(use_gpu=use_gpu,colorspace=colorspace) # not really a network, only for testing
|
79 |
-
self.model_name = 'L2'
|
80 |
-
elif(self.model in ['DSSIM','dssim','SSIM','ssim']):
|
81 |
-
self.net = networks.DSSIM(use_gpu=use_gpu,colorspace=colorspace)
|
82 |
-
self.model_name = 'SSIM'
|
83 |
-
else:
|
84 |
-
raise ValueError("Model [%s] not recognized." % self.model)
|
85 |
-
|
86 |
-
self.parameters = list(self.net.parameters())
|
87 |
-
|
88 |
-
if self.is_train: # training mode
|
89 |
-
# extra network on top to go from distances (d0,d1) => predicted human judgment (h*)
|
90 |
-
self.rankLoss = networks.BCERankingLoss()
|
91 |
-
self.parameters += list(self.rankLoss.net.parameters())
|
92 |
-
self.lr = lr
|
93 |
-
self.old_lr = lr
|
94 |
-
self.optimizer_net = torch.optim.Adam(self.parameters, lr=lr, betas=(beta1, 0.999))
|
95 |
-
else: # test mode
|
96 |
-
self.net.eval()
|
97 |
-
|
98 |
-
if(use_gpu):
|
99 |
-
self.net.to(gpu_ids[0])
|
100 |
-
self.net = torch.nn.DataParallel(self.net, device_ids=gpu_ids)
|
101 |
-
if(self.is_train):
|
102 |
-
self.rankLoss = self.rankLoss.to(device=gpu_ids[0]) # just put this on GPU0
|
103 |
-
|
104 |
-
if(printNet):
|
105 |
-
print('---------- Networks initialized -------------')
|
106 |
-
networks.print_network(self.net)
|
107 |
-
print('-----------------------------------------------')
|
108 |
-
|
109 |
-
def forward(self, in0, in1, retPerLayer=False):
|
110 |
-
''' Function computes the distance between image patches in0 and in1
|
111 |
-
INPUTS
|
112 |
-
in0, in1 - torch.Tensor object of shape Nx3xXxY - image patch scaled to [-1,1]
|
113 |
-
OUTPUT
|
114 |
-
computed distances between in0 and in1
|
115 |
-
'''
|
116 |
-
|
117 |
-
return self.net.forward(in0, in1, retPerLayer=retPerLayer)
|
118 |
-
|
119 |
-
# ***** TRAINING FUNCTIONS *****
|
120 |
-
def optimize_parameters(self):
|
121 |
-
self.forward_train()
|
122 |
-
self.optimizer_net.zero_grad()
|
123 |
-
self.backward_train()
|
124 |
-
self.optimizer_net.step()
|
125 |
-
self.clamp_weights()
|
126 |
-
|
127 |
-
def clamp_weights(self):
|
128 |
-
for module in self.net.modules():
|
129 |
-
if(hasattr(module, 'weight') and module.kernel_size==(1,1)):
|
130 |
-
module.weight.data = torch.clamp(module.weight.data,min=0)
|
131 |
-
|
132 |
-
def set_input(self, data):
|
133 |
-
self.input_ref = data['ref']
|
134 |
-
self.input_p0 = data['p0']
|
135 |
-
self.input_p1 = data['p1']
|
136 |
-
self.input_judge = data['judge']
|
137 |
-
|
138 |
-
if(self.use_gpu):
|
139 |
-
self.input_ref = self.input_ref.to(device=self.gpu_ids[0])
|
140 |
-
self.input_p0 = self.input_p0.to(device=self.gpu_ids[0])
|
141 |
-
self.input_p1 = self.input_p1.to(device=self.gpu_ids[0])
|
142 |
-
self.input_judge = self.input_judge.to(device=self.gpu_ids[0])
|
143 |
-
|
144 |
-
self.var_ref = Variable(self.input_ref,requires_grad=True)
|
145 |
-
self.var_p0 = Variable(self.input_p0,requires_grad=True)
|
146 |
-
self.var_p1 = Variable(self.input_p1,requires_grad=True)
|
147 |
-
|
148 |
-
def forward_train(self): # run forward pass
|
149 |
-
# print(self.net.module.scaling_layer.shift)
|
150 |
-
# print(torch.norm(self.net.module.net.slice1[0].weight).item(), torch.norm(self.net.module.lin0.model[1].weight).item())
|
151 |
-
|
152 |
-
self.d0 = self.forward(self.var_ref, self.var_p0)
|
153 |
-
self.d1 = self.forward(self.var_ref, self.var_p1)
|
154 |
-
self.acc_r = self.compute_accuracy(self.d0,self.d1,self.input_judge)
|
155 |
-
|
156 |
-
self.var_judge = Variable(1.*self.input_judge).view(self.d0.size())
|
157 |
-
|
158 |
-
self.loss_total = self.rankLoss.forward(self.d0, self.d1, self.var_judge*2.-1.)
|
159 |
-
|
160 |
-
return self.loss_total
|
161 |
-
|
162 |
-
def backward_train(self):
|
163 |
-
torch.mean(self.loss_total).backward()
|
164 |
-
|
165 |
-
def compute_accuracy(self,d0,d1,judge):
|
166 |
-
''' d0, d1 are Variables, judge is a Tensor '''
|
167 |
-
d1_lt_d0 = (d1<d0).cpu().data.numpy().flatten()
|
168 |
-
judge_per = judge.cpu().numpy().flatten()
|
169 |
-
return d1_lt_d0*judge_per + (1-d1_lt_d0)*(1-judge_per)
|
170 |
-
|
171 |
-
def get_current_errors(self):
|
172 |
-
retDict = OrderedDict([('loss_total', self.loss_total.data.cpu().numpy()),
|
173 |
-
('acc_r', self.acc_r)])
|
174 |
-
|
175 |
-
for key in retDict.keys():
|
176 |
-
retDict[key] = np.mean(retDict[key])
|
177 |
-
|
178 |
-
return retDict
|
179 |
-
|
180 |
-
def get_current_visuals(self):
|
181 |
-
zoom_factor = 256/self.var_ref.data.size()[2]
|
182 |
-
|
183 |
-
ref_img = util.tensor2im(self.var_ref.data)
|
184 |
-
p0_img = util.tensor2im(self.var_p0.data)
|
185 |
-
p1_img = util.tensor2im(self.var_p1.data)
|
186 |
-
|
187 |
-
ref_img_vis = zoom(ref_img,[zoom_factor, zoom_factor, 1],order=0)
|
188 |
-
p0_img_vis = zoom(p0_img,[zoom_factor, zoom_factor, 1],order=0)
|
189 |
-
p1_img_vis = zoom(p1_img,[zoom_factor, zoom_factor, 1],order=0)
|
190 |
-
|
191 |
-
return OrderedDict([('ref', ref_img_vis),
|
192 |
-
('p0', p0_img_vis),
|
193 |
-
('p1', p1_img_vis)])
|
194 |
-
|
195 |
-
def save(self, path, label):
|
196 |
-
if(self.use_gpu):
|
197 |
-
self.save_network(self.net.module, path, '', label)
|
198 |
-
else:
|
199 |
-
self.save_network(self.net, path, '', label)
|
200 |
-
self.save_network(self.rankLoss.net, path, 'rank', label)
|
201 |
-
|
202 |
-
def update_learning_rate(self,nepoch_decay):
|
203 |
-
lrd = self.lr / nepoch_decay
|
204 |
-
lr = self.old_lr - lrd
|
205 |
-
|
206 |
-
for param_group in self.optimizer_net.param_groups:
|
207 |
-
param_group['lr'] = lr
|
208 |
-
|
209 |
-
print('update lr [%s] decay: %f -> %f' % (type,self.old_lr, lr))
|
210 |
-
self.old_lr = lr
|
211 |
-
|
212 |
-
def score_2afc_dataset(data_loader, func, name=''):
|
213 |
-
''' Function computes Two Alternative Forced Choice (2AFC) score using
|
214 |
-
distance function 'func' in dataset 'data_loader'
|
215 |
-
INPUTS
|
216 |
-
data_loader - CustomDatasetDataLoader object - contains a TwoAFCDataset inside
|
217 |
-
func - callable distance function - calling d=func(in0,in1) should take 2
|
218 |
-
pytorch tensors with shape Nx3xXxY, and return numpy array of length N
|
219 |
-
OUTPUTS
|
220 |
-
[0] - 2AFC score in [0,1], fraction of time func agrees with human evaluators
|
221 |
-
[1] - dictionary with following elements
|
222 |
-
d0s,d1s - N arrays containing distances between reference patch to perturbed patches
|
223 |
-
gts - N array in [0,1], preferred patch selected by human evaluators
|
224 |
-
(closer to "0" for left patch p0, "1" for right patch p1,
|
225 |
-
"0.6" means 60pct people preferred right patch, 40pct preferred left)
|
226 |
-
scores - N array in [0,1], corresponding to what percentage function agreed with humans
|
227 |
-
CONSTS
|
228 |
-
N - number of test triplets in data_loader
|
229 |
-
'''
|
230 |
-
|
231 |
-
d0s = []
|
232 |
-
d1s = []
|
233 |
-
gts = []
|
234 |
-
|
235 |
-
for data in tqdm(data_loader.load_data(), desc=name):
|
236 |
-
d0s+=func(data['ref'],data['p0']).data.cpu().numpy().flatten().tolist()
|
237 |
-
d1s+=func(data['ref'],data['p1']).data.cpu().numpy().flatten().tolist()
|
238 |
-
gts+=data['judge'].cpu().numpy().flatten().tolist()
|
239 |
-
|
240 |
-
d0s = np.array(d0s)
|
241 |
-
d1s = np.array(d1s)
|
242 |
-
gts = np.array(gts)
|
243 |
-
scores = (d0s<d1s)*(1.-gts) + (d1s<d0s)*gts + (d1s==d0s)*.5
|
244 |
-
|
245 |
-
return(np.mean(scores), dict(d0s=d0s,d1s=d1s,gts=gts,scores=scores))
|
246 |
-
|
247 |
-
def score_jnd_dataset(data_loader, func, name=''):
|
248 |
-
''' Function computes JND score using distance function 'func' in dataset 'data_loader'
|
249 |
-
INPUTS
|
250 |
-
data_loader - CustomDatasetDataLoader object - contains a JNDDataset inside
|
251 |
-
func - callable distance function - calling d=func(in0,in1) should take 2
|
252 |
-
pytorch tensors with shape Nx3xXxY, and return pytorch array of length N
|
253 |
-
OUTPUTS
|
254 |
-
[0] - JND score in [0,1], mAP score (area under precision-recall curve)
|
255 |
-
[1] - dictionary with following elements
|
256 |
-
ds - N array containing distances between two patches shown to human evaluator
|
257 |
-
sames - N array containing fraction of people who thought the two patches were identical
|
258 |
-
CONSTS
|
259 |
-
N - number of test triplets in data_loader
|
260 |
-
'''
|
261 |
-
|
262 |
-
ds = []
|
263 |
-
gts = []
|
264 |
-
|
265 |
-
for data in tqdm(data_loader.load_data(), desc=name):
|
266 |
-
ds+=func(data['p0'],data['p1']).data.cpu().numpy().tolist()
|
267 |
-
gts+=data['same'].cpu().numpy().flatten().tolist()
|
268 |
-
|
269 |
-
sames = np.array(gts)
|
270 |
-
ds = np.array(ds)
|
271 |
-
|
272 |
-
sorted_inds = np.argsort(ds)
|
273 |
-
ds_sorted = ds[sorted_inds]
|
274 |
-
sames_sorted = sames[sorted_inds]
|
275 |
-
|
276 |
-
TPs = np.cumsum(sames_sorted)
|
277 |
-
FPs = np.cumsum(1-sames_sorted)
|
278 |
-
FNs = np.sum(sames_sorted)-TPs
|
279 |
-
|
280 |
-
precs = TPs/(TPs+FPs)
|
281 |
-
recs = TPs/(TPs+FNs)
|
282 |
-
score = util.voc_ap(recs,precs)
|
283 |
-
|
284 |
-
return(score, dict(ds=ds,sames=sames))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIGC-Audio/AudioGPT/text_to_speech/modules/vocoder/parallel_wavegan/models/freq_discriminator.py
DELETED
@@ -1,149 +0,0 @@
|
|
1 |
-
import torch
|
2 |
-
import torch.nn as nn
|
3 |
-
|
4 |
-
|
5 |
-
class BasicDiscriminatorBlock(nn.Module):
|
6 |
-
def __init__(self, in_channel, out_channel):
|
7 |
-
super(BasicDiscriminatorBlock, self).__init__()
|
8 |
-
self.block = nn.Sequential(
|
9 |
-
nn.utils.weight_norm(nn.Conv1d(
|
10 |
-
in_channel,
|
11 |
-
out_channel,
|
12 |
-
kernel_size=3,
|
13 |
-
stride=2,
|
14 |
-
padding=1,
|
15 |
-
)),
|
16 |
-
nn.LeakyReLU(0.2, True),
|
17 |
-
|
18 |
-
nn.utils.weight_norm(nn.Conv1d(
|
19 |
-
out_channel,
|
20 |
-
out_channel,
|
21 |
-
kernel_size=3,
|
22 |
-
stride=1,
|
23 |
-
padding=1,
|
24 |
-
)),
|
25 |
-
nn.LeakyReLU(0.2, True),
|
26 |
-
|
27 |
-
nn.utils.weight_norm(nn.Conv1d(
|
28 |
-
out_channel,
|
29 |
-
out_channel,
|
30 |
-
kernel_size=3,
|
31 |
-
stride=1,
|
32 |
-
padding=1,
|
33 |
-
)),
|
34 |
-
nn.LeakyReLU(0.2, True),
|
35 |
-
|
36 |
-
nn.utils.weight_norm(nn.Conv1d(
|
37 |
-
out_channel,
|
38 |
-
out_channel,
|
39 |
-
kernel_size=3,
|
40 |
-
stride=1,
|
41 |
-
padding=1,
|
42 |
-
)),
|
43 |
-
|
44 |
-
)
|
45 |
-
|
46 |
-
def forward(self, x):
|
47 |
-
return self.block(x)
|
48 |
-
|
49 |
-
|
50 |
-
class ResDiscriminatorBlock(nn.Module):
|
51 |
-
def __init__(self, in_channel, out_channel):
|
52 |
-
super(ResDiscriminatorBlock, self).__init__()
|
53 |
-
self.block1 = nn.Sequential(
|
54 |
-
nn.utils.weight_norm(nn.Conv1d(
|
55 |
-
in_channel,
|
56 |
-
out_channel,
|
57 |
-
kernel_size=3,
|
58 |
-
stride=2,
|
59 |
-
padding=1,
|
60 |
-
)),
|
61 |
-
nn.LeakyReLU(0.2, True),
|
62 |
-
|
63 |
-
nn.utils.weight_norm(nn.Conv1d(
|
64 |
-
out_channel,
|
65 |
-
out_channel,
|
66 |
-
kernel_size=3,
|
67 |
-
stride=1,
|
68 |
-
padding=1,
|
69 |
-
)),
|
70 |
-
)
|
71 |
-
|
72 |
-
self.shortcut1 = nn.utils.weight_norm(nn.Conv1d(
|
73 |
-
in_channel,
|
74 |
-
out_channel,
|
75 |
-
kernel_size=1,
|
76 |
-
stride=2,
|
77 |
-
))
|
78 |
-
|
79 |
-
self.block2 = nn.Sequential(
|
80 |
-
nn.utils.weight_norm(nn.Conv1d(
|
81 |
-
out_channel,
|
82 |
-
out_channel,
|
83 |
-
kernel_size=3,
|
84 |
-
stride=1,
|
85 |
-
padding=1,
|
86 |
-
)),
|
87 |
-
nn.LeakyReLU(0.2, True),
|
88 |
-
|
89 |
-
nn.utils.weight_norm(nn.Conv1d(
|
90 |
-
out_channel,
|
91 |
-
out_channel,
|
92 |
-
kernel_size=3,
|
93 |
-
stride=1,
|
94 |
-
padding=1,
|
95 |
-
)),
|
96 |
-
)
|
97 |
-
|
98 |
-
self.shortcut2 = nn.utils.weight_norm(nn.Conv1d(
|
99 |
-
out_channel,
|
100 |
-
out_channel,
|
101 |
-
kernel_size=1,
|
102 |
-
stride=1,
|
103 |
-
))
|
104 |
-
|
105 |
-
def forward(self, x):
|
106 |
-
x1 = self.block1(x)
|
107 |
-
x1 = x1 + self.shortcut1(x)
|
108 |
-
return self.block2(x1) + self.shortcut2(x1)
|
109 |
-
|
110 |
-
|
111 |
-
class ResNet18Discriminator(nn.Module):
|
112 |
-
def __init__(self, stft_channel, in_channel=64):
|
113 |
-
super(ResNet18Discriminator, self).__init__()
|
114 |
-
self.input = nn.Sequential(
|
115 |
-
nn.utils.weight_norm(nn.Conv1d(stft_channel, in_channel, kernel_size=7, stride=2, padding=1, )),
|
116 |
-
nn.LeakyReLU(0.2, True),
|
117 |
-
)
|
118 |
-
self.df1 = BasicDiscriminatorBlock(in_channel, in_channel)
|
119 |
-
self.df2 = ResDiscriminatorBlock(in_channel, in_channel * 2)
|
120 |
-
self.df3 = ResDiscriminatorBlock(in_channel * 2, in_channel * 4)
|
121 |
-
self.df4 = ResDiscriminatorBlock(in_channel * 4, in_channel * 8)
|
122 |
-
|
123 |
-
def forward(self, x):
|
124 |
-
x = self.input(x)
|
125 |
-
x = self.df1(x)
|
126 |
-
x = self.df2(x)
|
127 |
-
x = self.df3(x)
|
128 |
-
return self.df4(x)
|
129 |
-
|
130 |
-
|
131 |
-
class FrequencyDiscriminator(nn.Module):
|
132 |
-
def __init__(self, in_channel=64, fft_size=1024, hop_length=256, win_length=1024, window="hann_window"):
|
133 |
-
super(FrequencyDiscriminator, self).__init__()
|
134 |
-
self.fft_size = fft_size
|
135 |
-
self.hop_length = hop_length
|
136 |
-
self.win_length = win_length
|
137 |
-
self.window = nn.Parameter(getattr(torch, window)(win_length), requires_grad=False)
|
138 |
-
self.stft_channel = fft_size // 2 + 1
|
139 |
-
self.resnet_disc = ResNet18Discriminator(self.stft_channel, in_channel)
|
140 |
-
|
141 |
-
def forward(self, x):
|
142 |
-
x_stft = torch.stft(x, self.fft_size, self.hop_length, self.win_length, self.window)
|
143 |
-
real = x_stft[..., 0]
|
144 |
-
imag = x_stft[..., 1]
|
145 |
-
|
146 |
-
x_real = self.resnet_disc(real)
|
147 |
-
x_imag = self.resnet_disc(imag)
|
148 |
-
|
149 |
-
return x_real, x_imag
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIGC-Audio/AudioGPT/text_to_speech/modules/vocoder/parallel_wavegan/optimizers/radam.py
DELETED
@@ -1,91 +0,0 @@
|
|
1 |
-
# -*- coding: utf-8 -*-
|
2 |
-
|
3 |
-
"""RAdam optimizer.
|
4 |
-
|
5 |
-
This code is drived from https://github.com/LiyuanLucasLiu/RAdam.
|
6 |
-
"""
|
7 |
-
|
8 |
-
import math
|
9 |
-
import torch
|
10 |
-
|
11 |
-
from torch.optim.optimizer import Optimizer
|
12 |
-
|
13 |
-
|
14 |
-
class RAdam(Optimizer):
|
15 |
-
"""Rectified Adam optimizer."""
|
16 |
-
|
17 |
-
def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=0):
|
18 |
-
"""Initilize RAdam optimizer."""
|
19 |
-
defaults = dict(lr=lr, betas=betas, eps=eps, weight_decay=weight_decay)
|
20 |
-
self.buffer = [[None, None, None] for ind in range(10)]
|
21 |
-
super(RAdam, self).__init__(params, defaults)
|
22 |
-
|
23 |
-
def __setstate__(self, state):
|
24 |
-
"""Set state."""
|
25 |
-
super(RAdam, self).__setstate__(state)
|
26 |
-
|
27 |
-
def step(self, closure=None):
|
28 |
-
"""Run one step."""
|
29 |
-
loss = None
|
30 |
-
if closure is not None:
|
31 |
-
loss = closure()
|
32 |
-
|
33 |
-
for group in self.param_groups:
|
34 |
-
|
35 |
-
for p in group['params']:
|
36 |
-
if p.grad is None:
|
37 |
-
continue
|
38 |
-
grad = p.grad.data.float()
|
39 |
-
if grad.is_sparse:
|
40 |
-
raise RuntimeError('RAdam does not support sparse gradients')
|
41 |
-
|
42 |
-
p_data_fp32 = p.data.float()
|
43 |
-
|
44 |
-
state = self.state[p]
|
45 |
-
|
46 |
-
if len(state) == 0:
|
47 |
-
state['step'] = 0
|
48 |
-
state['exp_avg'] = torch.zeros_like(p_data_fp32)
|
49 |
-
state['exp_avg_sq'] = torch.zeros_like(p_data_fp32)
|
50 |
-
else:
|
51 |
-
state['exp_avg'] = state['exp_avg'].type_as(p_data_fp32)
|
52 |
-
state['exp_avg_sq'] = state['exp_avg_sq'].type_as(p_data_fp32)
|
53 |
-
|
54 |
-
exp_avg, exp_avg_sq = state['exp_avg'], state['exp_avg_sq']
|
55 |
-
beta1, beta2 = group['betas']
|
56 |
-
|
57 |
-
exp_avg_sq.mul_(beta2).addcmul_(1 - beta2, grad, grad)
|
58 |
-
exp_avg.mul_(beta1).add_(1 - beta1, grad)
|
59 |
-
|
60 |
-
state['step'] += 1
|
61 |
-
buffered = self.buffer[int(state['step'] % 10)]
|
62 |
-
if state['step'] == buffered[0]:
|
63 |
-
N_sma, step_size = buffered[1], buffered[2]
|
64 |
-
else:
|
65 |
-
buffered[0] = state['step']
|
66 |
-
beta2_t = beta2 ** state['step']
|
67 |
-
N_sma_max = 2 / (1 - beta2) - 1
|
68 |
-
N_sma = N_sma_max - 2 * state['step'] * beta2_t / (1 - beta2_t)
|
69 |
-
buffered[1] = N_sma
|
70 |
-
|
71 |
-
# more conservative since it's an approximated value
|
72 |
-
if N_sma >= 5:
|
73 |
-
step_size = math.sqrt(
|
74 |
-
(1 - beta2_t) * (N_sma - 4) / (N_sma_max - 4) * (N_sma - 2) / N_sma * N_sma_max / (N_sma_max - 2)) / (1 - beta1 ** state['step']) # NOQA
|
75 |
-
else:
|
76 |
-
step_size = 1.0 / (1 - beta1 ** state['step'])
|
77 |
-
buffered[2] = step_size
|
78 |
-
|
79 |
-
if group['weight_decay'] != 0:
|
80 |
-
p_data_fp32.add_(-group['weight_decay'] * group['lr'], p_data_fp32)
|
81 |
-
|
82 |
-
# more conservative since it's an approximated value
|
83 |
-
if N_sma >= 5:
|
84 |
-
denom = exp_avg_sq.sqrt().add_(group['eps'])
|
85 |
-
p_data_fp32.addcdiv_(-step_size * group['lr'], exp_avg, denom)
|
86 |
-
else:
|
87 |
-
p_data_fp32.add_(-step_size * group['lr'], exp_avg)
|
88 |
-
|
89 |
-
p.data.copy_(p_data_fp32)
|
90 |
-
|
91 |
-
return loss
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIZ2H/03-Streamlit-Video-ASR-NLP/README.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: StreamlitVideoASRNLP
|
3 |
-
emoji: 📹🗣️
|
4 |
-
colorFrom: yellow
|
5 |
-
colorTo: gray
|
6 |
-
sdk: streamlit
|
7 |
-
sdk_version: 1.10.0
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
license: apache-2.0
|
11 |
-
---
|
12 |
-
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/ATang0729/Forecast4Muses/Model/Model6/Model6_0_ClothesDetection/mmyolo/configs/yolov5/yolov5_x-p6-v62_syncbn_fast_8xb16-300e_coco.py
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
_base_ = './yolov5_m-p6-v62_syncbn_fast_8xb16-300e_coco.py'
|
2 |
-
deepen_factor = 1.33
|
3 |
-
widen_factor = 1.25
|
4 |
-
|
5 |
-
model = dict(
|
6 |
-
backbone=dict(
|
7 |
-
deepen_factor=deepen_factor,
|
8 |
-
widen_factor=widen_factor,
|
9 |
-
),
|
10 |
-
neck=dict(
|
11 |
-
deepen_factor=deepen_factor,
|
12 |
-
widen_factor=widen_factor,
|
13 |
-
),
|
14 |
-
bbox_head=dict(head_module=dict(widen_factor=widen_factor)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AchyuthGamer/OpenGPT-Chat-UI/src/routes/conversation/[id]/ParamsWritable.js
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
import { writable } from "svelte/store";
|
2 |
-
|
3 |
-
export const params_writable = writable("");
|
|
|
|
|
|
|
|
spaces/AchyuthGamer/OpenGPT/g4f/utils.py
DELETED
@@ -1,49 +0,0 @@
|
|
1 |
-
import browser_cookie3
|
2 |
-
|
3 |
-
|
4 |
-
class Utils:
|
5 |
-
browsers = [
|
6 |
-
browser_cookie3.chrome, # 62.74% market share
|
7 |
-
browser_cookie3.safari, # 24.12% market share
|
8 |
-
browser_cookie3.firefox, # 4.56% market share
|
9 |
-
browser_cookie3.edge, # 2.85% market share
|
10 |
-
browser_cookie3.opera, # 1.69% market share
|
11 |
-
browser_cookie3.brave, # 0.96% market share
|
12 |
-
browser_cookie3.opera_gx, # 0.64% market share
|
13 |
-
browser_cookie3.vivaldi, # 0.32% market share
|
14 |
-
]
|
15 |
-
|
16 |
-
def get_cookies(domain: str, setName: str = None, setBrowser: str = False) -> dict:
|
17 |
-
cookies = {}
|
18 |
-
|
19 |
-
if setBrowser != False:
|
20 |
-
for browser in Utils.browsers:
|
21 |
-
if browser.__name__ == setBrowser:
|
22 |
-
try:
|
23 |
-
for c in browser(domain_name=domain):
|
24 |
-
if c.name not in cookies:
|
25 |
-
cookies = cookies | {c.name: c.value}
|
26 |
-
|
27 |
-
except Exception as e:
|
28 |
-
pass
|
29 |
-
|
30 |
-
else:
|
31 |
-
for browser in Utils.browsers:
|
32 |
-
try:
|
33 |
-
for c in browser(domain_name=domain):
|
34 |
-
if c.name not in cookies:
|
35 |
-
cookies = cookies | {c.name: c.value}
|
36 |
-
|
37 |
-
except Exception as e:
|
38 |
-
pass
|
39 |
-
|
40 |
-
if setName:
|
41 |
-
try:
|
42 |
-
return {setName: cookies[setName]}
|
43 |
-
|
44 |
-
except ValueError:
|
45 |
-
print(f'Error: could not find {setName} cookie in any browser.')
|
46 |
-
exit(1)
|
47 |
-
|
48 |
-
else:
|
49 |
-
return cookies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/agentverse_command/benchmark.py
DELETED
@@ -1,87 +0,0 @@
|
|
1 |
-
import logging
|
2 |
-
import os
|
3 |
-
import json
|
4 |
-
import shutil
|
5 |
-
|
6 |
-
# from agentverse.agentverse import AgentVerse
|
7 |
-
from agentverse.tasksolving import TaskSolving
|
8 |
-
from agentverse.logging import get_logger
|
9 |
-
from argparse import ArgumentParser
|
10 |
-
import asyncio
|
11 |
-
from dataloader import dataloader_registry
|
12 |
-
|
13 |
-
parser = ArgumentParser()
|
14 |
-
|
15 |
-
parser.add_argument("--task", type=str, default="tasksolving/responsegen")
|
16 |
-
parser.add_argument(
|
17 |
-
"--tasks_dir",
|
18 |
-
type=str,
|
19 |
-
default=os.path.join(os.path.dirname(__file__), "..", "agentverse", "tasks"),
|
20 |
-
)
|
21 |
-
parser.add_argument("--dataset_path", type=str, required=True)
|
22 |
-
parser.add_argument("--output_path", type=str, default=None)
|
23 |
-
parser.add_argument("--has_tools", action="store_true")
|
24 |
-
parser.add_argument("--tool_tmp_path", type=str)
|
25 |
-
parser.add_argument("--overwrite", action="store_true")
|
26 |
-
parser.add_argument("--debug", action="store_true")
|
27 |
-
args = parser.parse_args()
|
28 |
-
|
29 |
-
|
30 |
-
logger = get_logger()
|
31 |
-
logger.set_level(logging.DEBUG if args.debug else logging.INFO)
|
32 |
-
|
33 |
-
|
34 |
-
def get_dataloader(task, dataset_path):
|
35 |
-
return dataloader_registry.build(task, path=dataset_path)
|
36 |
-
|
37 |
-
|
38 |
-
def cli_main():
|
39 |
-
dataloader = get_dataloader(args.task, args.dataset_path)
|
40 |
-
if args.output_path is None:
|
41 |
-
os.makedirs(f"./results/{args.task}", exist_ok=True)
|
42 |
-
args.output_path = f"./results/{args.task}"
|
43 |
-
else:
|
44 |
-
os.makedirs(args.output_path, exist_ok=True)
|
45 |
-
shutil.copyfile(
|
46 |
-
f"{args.tasks_dir}/{args.task}/config.yaml",
|
47 |
-
f"{args.output_path}/config.yaml",
|
48 |
-
)
|
49 |
-
|
50 |
-
skip_cnt = 0
|
51 |
-
if not args.overwrite and os.path.exists(f"{args.output_path}/results.jsonl"):
|
52 |
-
with open(f"{args.output_path}/results.jsonl", "r") as f:
|
53 |
-
for line in f:
|
54 |
-
if line.strip():
|
55 |
-
skip_cnt += 1
|
56 |
-
f = open(f"{args.output_path}/results.jsonl", "w" if args.overwrite else "a")
|
57 |
-
for i, example in enumerate(dataloader):
|
58 |
-
if i < skip_cnt:
|
59 |
-
continue
|
60 |
-
logger.info(f"Input: {example['input']}\nAnswer: {example['answer']}")
|
61 |
-
if args.has_tools:
|
62 |
-
assert args.tool_tmp_path is not None
|
63 |
-
with open(args.tool_tmp_path, "w") as f:
|
64 |
-
f.write(json.dumps(example["tools"]))
|
65 |
-
agentverse = TaskSolving.from_task(args.task, args.tasks_dir)
|
66 |
-
agentverse.environment.set_task_description(example["input"])
|
67 |
-
# print(args.single_agent)
|
68 |
-
# print(args.discussion_mode)
|
69 |
-
# exit()
|
70 |
-
plan, result, logs = agentverse.run()
|
71 |
-
f.write(
|
72 |
-
json.dumps(
|
73 |
-
{
|
74 |
-
"input": example["input"],
|
75 |
-
"response": plan,
|
76 |
-
"label": example["answer"],
|
77 |
-
"logs": logs,
|
78 |
-
}
|
79 |
-
)
|
80 |
-
+ "\n"
|
81 |
-
)
|
82 |
-
f.flush()
|
83 |
-
f.close()
|
84 |
-
|
85 |
-
|
86 |
-
if __name__ == "__main__":
|
87 |
-
cli_main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/plugins/ninepatch2.d.ts
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
import NinePatch from './gameobjects/blitter/ninepatch/NinePatch';
|
2 |
-
export default NinePatch;
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/colorinput/colorinput/Factory.js
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
import ColorInput from './ColorInput.js';
|
2 |
-
import ObjectFactory from '../../ObjectFactory.js';
|
3 |
-
import SetValue from '../../../../plugins/utils/object/SetValue.js';
|
4 |
-
|
5 |
-
ObjectFactory.register('colorInput', function (config) {
|
6 |
-
var gameObject = new ColorInput(this.scene, config);
|
7 |
-
this.scene.add.existing(gameObject);
|
8 |
-
return gameObject;
|
9 |
-
});
|
10 |
-
|
11 |
-
SetValue(window, 'RexPlugins.UI.ColorInput', ColorInput);
|
12 |
-
|
13 |
-
export default ColorInput;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/scrollbar/ScrollBar.js
DELETED
@@ -1,188 +0,0 @@
|
|
1 |
-
import Sizer from '../sizer/Sizer.js';
|
2 |
-
import Slider from '../slider/Slider.js';
|
3 |
-
import InTouching from '../intouching/InTouching.js';
|
4 |
-
|
5 |
-
const GetValue = Phaser.Utils.Objects.GetValue;
|
6 |
-
|
7 |
-
class ScrollBar extends Sizer {
|
8 |
-
constructor(scene, config) {
|
9 |
-
// Create sizer
|
10 |
-
super(scene, config);
|
11 |
-
this.type = 'rexScrollBar';
|
12 |
-
|
13 |
-
// Add elements
|
14 |
-
var background = GetValue(config, 'background', undefined);
|
15 |
-
|
16 |
-
var buttonsConfig = GetValue(config, 'buttons', undefined);
|
17 |
-
var button0 = GetValue(buttonsConfig, 'top', GetValue(buttonsConfig, 'left', undefined));
|
18 |
-
var button1 = GetValue(buttonsConfig, 'bottom', GetValue(buttonsConfig, 'right', undefined));
|
19 |
-
|
20 |
-
var slider,
|
21 |
-
sliderConfig = GetValue(config, 'slider', undefined);
|
22 |
-
|
23 |
-
if (background) {
|
24 |
-
this.addBackground(background);
|
25 |
-
}
|
26 |
-
|
27 |
-
if (button0) {
|
28 |
-
this.add(button0);
|
29 |
-
|
30 |
-
var inTouching = new InTouching(button0);
|
31 |
-
inTouching
|
32 |
-
.on('intouch', function () {
|
33 |
-
if (!this.enable) {
|
34 |
-
return;
|
35 |
-
}
|
36 |
-
var step = (!slider.reverseAxis) ? -this.scrollStep : this.scrollStep;
|
37 |
-
this.value += step;
|
38 |
-
}, this)
|
39 |
-
}
|
40 |
-
|
41 |
-
if (sliderConfig) {
|
42 |
-
sliderConfig.orientation = this.orientation;
|
43 |
-
sliderConfig.eventEmitter = this;
|
44 |
-
sliderConfig.value = null;
|
45 |
-
|
46 |
-
var proportion;
|
47 |
-
if (this.orientation === 0) {
|
48 |
-
var sliderWidth = GetValue(sliderConfig, 'width', undefined);
|
49 |
-
proportion = (sliderWidth === undefined) ? 1 : 0;
|
50 |
-
} else {
|
51 |
-
var sliderHeight = GetValue(sliderConfig, 'height', undefined);
|
52 |
-
proportion = (sliderHeight === undefined) ? 1 : 0;
|
53 |
-
}
|
54 |
-
|
55 |
-
slider = new Slider(scene, sliderConfig);
|
56 |
-
scene.add.existing(slider);
|
57 |
-
this.add(
|
58 |
-
slider,
|
59 |
-
{
|
60 |
-
proportion: proportion,
|
61 |
-
}
|
62 |
-
)
|
63 |
-
}
|
64 |
-
|
65 |
-
if (button1) {
|
66 |
-
this.add(button1);
|
67 |
-
|
68 |
-
var inTouching = new InTouching(button1);
|
69 |
-
inTouching
|
70 |
-
.on('intouch', function () {
|
71 |
-
if (!this.enable) {
|
72 |
-
return;
|
73 |
-
}
|
74 |
-
var step = (!slider.reverseAxis) ? this.scrollStep : -this.scrollStep;
|
75 |
-
this.value += step;
|
76 |
-
}, this)
|
77 |
-
}
|
78 |
-
|
79 |
-
var buttons = [button0, button1];
|
80 |
-
|
81 |
-
this.addChildrenMap('background', background);
|
82 |
-
this.addChildrenMap('slider', slider);
|
83 |
-
this.addChildrenMap('buttons', buttons);
|
84 |
-
|
85 |
-
var callback = GetValue(config, 'valuechangeCallback', null);
|
86 |
-
if (callback !== null) {
|
87 |
-
var scope = GetValue(config, 'valuechangeCallbackScope', undefined);
|
88 |
-
this.on('valuechange', callback, scope);
|
89 |
-
}
|
90 |
-
this.setEnable(GetValue(config, 'enable', undefined));
|
91 |
-
this.setValue(GetValue(config, 'value', 0));
|
92 |
-
this.setScrollStep(GetValue(buttonsConfig, 'step', 0.01));
|
93 |
-
}
|
94 |
-
|
95 |
-
setScrollStep(value) {
|
96 |
-
this.scrollStep = value;
|
97 |
-
return this;
|
98 |
-
}
|
99 |
-
|
100 |
-
get enable() {
|
101 |
-
if (this.childrenMap.slider) {
|
102 |
-
return this.childrenMap.slider.enable;
|
103 |
-
} else {
|
104 |
-
return false;
|
105 |
-
}
|
106 |
-
}
|
107 |
-
|
108 |
-
set enable(value) {
|
109 |
-
if (this.childrenMap.slider) {
|
110 |
-
this.childrenMap.slider.setEnable(value);
|
111 |
-
}
|
112 |
-
}
|
113 |
-
|
114 |
-
setEnable(enable) {
|
115 |
-
if (enable === undefined) {
|
116 |
-
enable = true;
|
117 |
-
}
|
118 |
-
this.enable = enable;
|
119 |
-
return this;
|
120 |
-
}
|
121 |
-
|
122 |
-
get value() {
|
123 |
-
if (this.childrenMap.slider) {
|
124 |
-
return this.childrenMap.slider.value;
|
125 |
-
} else {
|
126 |
-
return 0;
|
127 |
-
}
|
128 |
-
}
|
129 |
-
|
130 |
-
set value(value) {
|
131 |
-
if (!this.childrenMap.slider) {
|
132 |
-
return;
|
133 |
-
}
|
134 |
-
this.childrenMap.slider.value = value;
|
135 |
-
}
|
136 |
-
|
137 |
-
setValue(value, min, max) {
|
138 |
-
if (this.childrenMap.slider) {
|
139 |
-
this.childrenMap.slider.setValue(value, min, max);
|
140 |
-
}
|
141 |
-
return this;
|
142 |
-
}
|
143 |
-
|
144 |
-
addValue(inc, min, max) {
|
145 |
-
if (this.childrenMap.slider) {
|
146 |
-
this.childrenMap.slider.addValue(inc, min, max);
|
147 |
-
}
|
148 |
-
return this;
|
149 |
-
}
|
150 |
-
|
151 |
-
getValue(min, max) {
|
152 |
-
if (this.childrenMap.slider) {
|
153 |
-
return this.childrenMap.slider.getValue(min, max);
|
154 |
-
} else {
|
155 |
-
return 0;
|
156 |
-
}
|
157 |
-
}
|
158 |
-
|
159 |
-
easeValueTo(value, min, max) {
|
160 |
-
if (this.childrenMap.slider) {
|
161 |
-
this.childrenMap.slider.easeValueTo(value, min, max);
|
162 |
-
}
|
163 |
-
return this;
|
164 |
-
}
|
165 |
-
|
166 |
-
stopEaseValue() {
|
167 |
-
if (this.childrenMap.slider) {
|
168 |
-
this.childrenMap.slider.stopEaseValue();
|
169 |
-
}
|
170 |
-
return this;
|
171 |
-
}
|
172 |
-
|
173 |
-
setEaseValueDuration(duration) {
|
174 |
-
if (this.childrenMap.slider) {
|
175 |
-
this.childrenMap.slider.setEaseValueDuration(duration);
|
176 |
-
}
|
177 |
-
return this;
|
178 |
-
}
|
179 |
-
|
180 |
-
setEaseValueFunction(ease) {
|
181 |
-
if (this.childrenMap.slider) {
|
182 |
-
this.childrenMap.slider.setEaseValueFunction(ease);
|
183 |
-
}
|
184 |
-
return this;
|
185 |
-
}
|
186 |
-
}
|
187 |
-
|
188 |
-
export default ScrollBar;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/faster_rcnn/faster_rcnn_x101_64x4d_fpn_1x_coco.py
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
_base_ = './faster_rcnn_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 |
-
style='pytorch'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/guided_anchoring/ga_retinanet_r101_caffe_fpn_1x_coco.py
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
_base_ = './ga_retinanet_r50_caffe_fpn_1x_coco.py'
|
2 |
-
model = dict(
|
3 |
-
pretrained='open-mmlab://detectron2/resnet101_caffe',
|
4 |
-
backbone=dict(depth=101))
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/regnet/mask_rcnn_regnetx-3.2GF_fpn_mdconv_c3-c5_1x_coco.py
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
_base_ = 'mask_rcnn_regnetx-3.2GF_fpn_1x_coco.py'
|
2 |
-
model = dict(
|
3 |
-
pretrained='open-mmlab://regnetx_3.2gf',
|
4 |
-
backbone=dict(
|
5 |
-
dcn=dict(type='DCNv2', deform_groups=1, fallback_on_stride=False),
|
6 |
-
stage_with_dcn=(False, True, True, True)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_segmentation/configs/hrnet/fcn_hr18_480x480_40k_pascal_context_59.py
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
_base_ = [
|
2 |
-
'../_base_/models/fcn_hr18.py', '../_base_/datasets/pascal_context_59.py',
|
3 |
-
'../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py'
|
4 |
-
]
|
5 |
-
model = dict(
|
6 |
-
decode_head=dict(num_classes=59),
|
7 |
-
test_cfg=dict(mode='slide', crop_size=(480, 480), stride=(320, 320)))
|
8 |
-
optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Anonymous-sub/Rerender/ControlNet/annotator/uniformer/mmseg/apis/train.py
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
import random
|
2 |
-
import warnings
|
3 |
-
|
4 |
-
import numpy as np
|
5 |
-
import torch
|
6 |
-
from annotator.uniformer.mmcv.parallel import MMDataParallel, MMDistributedDataParallel
|
7 |
-
from annotator.uniformer.mmcv.runner import build_optimizer, build_runner
|
8 |
-
|
9 |
-
from annotator.uniformer.mmseg.core import DistEvalHook, EvalHook
|
10 |
-
from annotator.uniformer.mmseg.datasets import build_dataloader, build_dataset
|
11 |
-
from annotator.uniformer.mmseg.utils import get_root_logger
|
12 |
-
|
13 |
-
|
14 |
-
def set_random_seed(seed, deterministic=False):
|
15 |
-
"""Set random seed.
|
16 |
-
|
17 |
-
Args:
|
18 |
-
seed (int): Seed to be used.
|
19 |
-
deterministic (bool): Whether to set the deterministic option for
|
20 |
-
CUDNN backend, i.e., set `torch.backends.cudnn.deterministic`
|
21 |
-
to True and `torch.backends.cudnn.benchmark` to False.
|
22 |
-
Default: False.
|
23 |
-
"""
|
24 |
-
random.seed(seed)
|
25 |
-
np.random.seed(seed)
|
26 |
-
torch.manual_seed(seed)
|
27 |
-
torch.cuda.manual_seed_all(seed)
|
28 |
-
if deterministic:
|
29 |
-
torch.backends.cudnn.deterministic = True
|
30 |
-
torch.backends.cudnn.benchmark = False
|
31 |
-
|
32 |
-
|
33 |
-
def train_segmentor(model,
|
34 |
-
dataset,
|
35 |
-
cfg,
|
36 |
-
distributed=False,
|
37 |
-
validate=False,
|
38 |
-
timestamp=None,
|
39 |
-
meta=None):
|
40 |
-
"""Launch segmentor training."""
|
41 |
-
logger = get_root_logger(cfg.log_level)
|
42 |
-
|
43 |
-
# prepare data loaders
|
44 |
-
dataset = dataset if isinstance(dataset, (list, tuple)) else [dataset]
|
45 |
-
data_loaders = [
|
46 |
-
build_dataloader(
|
47 |
-
ds,
|
48 |
-
cfg.data.samples_per_gpu,
|
49 |
-
cfg.data.workers_per_gpu,
|
50 |
-
# cfg.gpus will be ignored if distributed
|
51 |
-
len(cfg.gpu_ids),
|
52 |
-
dist=distributed,
|
53 |
-
seed=cfg.seed,
|
54 |
-
drop_last=True) for ds in dataset
|
55 |
-
]
|
56 |
-
|
57 |
-
# put model on gpus
|
58 |
-
if distributed:
|
59 |
-
find_unused_parameters = cfg.get('find_unused_parameters', False)
|
60 |
-
# Sets the `find_unused_parameters` parameter in
|
61 |
-
# torch.nn.parallel.DistributedDataParallel
|
62 |
-
model = MMDistributedDataParallel(
|
63 |
-
model.cuda(),
|
64 |
-
device_ids=[torch.cuda.current_device()],
|
65 |
-
broadcast_buffers=False,
|
66 |
-
find_unused_parameters=find_unused_parameters)
|
67 |
-
else:
|
68 |
-
model = MMDataParallel(
|
69 |
-
model.cuda(cfg.gpu_ids[0]), device_ids=cfg.gpu_ids)
|
70 |
-
|
71 |
-
# build runner
|
72 |
-
optimizer = build_optimizer(model, cfg.optimizer)
|
73 |
-
|
74 |
-
if cfg.get('runner') is None:
|
75 |
-
cfg.runner = {'type': 'IterBasedRunner', 'max_iters': cfg.total_iters}
|
76 |
-
warnings.warn(
|
77 |
-
'config is now expected to have a `runner` section, '
|
78 |
-
'please set `runner` in your config.', UserWarning)
|
79 |
-
|
80 |
-
runner = build_runner(
|
81 |
-
cfg.runner,
|
82 |
-
default_args=dict(
|
83 |
-
model=model,
|
84 |
-
batch_processor=None,
|
85 |
-
optimizer=optimizer,
|
86 |
-
work_dir=cfg.work_dir,
|
87 |
-
logger=logger,
|
88 |
-
meta=meta))
|
89 |
-
|
90 |
-
# register hooks
|
91 |
-
runner.register_training_hooks(cfg.lr_config, cfg.optimizer_config,
|
92 |
-
cfg.checkpoint_config, cfg.log_config,
|
93 |
-
cfg.get('momentum_config', None))
|
94 |
-
|
95 |
-
# an ugly walkaround to make the .log and .log.json filenames the same
|
96 |
-
runner.timestamp = timestamp
|
97 |
-
|
98 |
-
# register eval hooks
|
99 |
-
if validate:
|
100 |
-
val_dataset = build_dataset(cfg.data.val, dict(test_mode=True))
|
101 |
-
val_dataloader = build_dataloader(
|
102 |
-
val_dataset,
|
103 |
-
samples_per_gpu=1,
|
104 |
-
workers_per_gpu=cfg.data.workers_per_gpu,
|
105 |
-
dist=distributed,
|
106 |
-
shuffle=False)
|
107 |
-
eval_cfg = cfg.get('evaluation', {})
|
108 |
-
eval_cfg['by_epoch'] = cfg.runner['type'] != 'IterBasedRunner'
|
109 |
-
eval_hook = DistEvalHook if distributed else EvalHook
|
110 |
-
runner.register_hook(eval_hook(val_dataloader, **eval_cfg), priority='LOW')
|
111 |
-
|
112 |
-
if cfg.resume_from:
|
113 |
-
runner.resume(cfg.resume_from)
|
114 |
-
elif cfg.load_from:
|
115 |
-
runner.load_checkpoint(cfg.load_from)
|
116 |
-
runner.run(data_loaders, cfg.workflow)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Anonymous-sub/Rerender/ControlNet/cldm/model.py
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
import torch
|
3 |
-
|
4 |
-
from omegaconf import OmegaConf
|
5 |
-
from ldm.util import instantiate_from_config
|
6 |
-
|
7 |
-
|
8 |
-
def get_state_dict(d):
|
9 |
-
return d.get('state_dict', d)
|
10 |
-
|
11 |
-
|
12 |
-
def load_state_dict(ckpt_path, location='cpu'):
|
13 |
-
_, extension = os.path.splitext(ckpt_path)
|
14 |
-
if extension.lower() == ".safetensors":
|
15 |
-
import safetensors.torch
|
16 |
-
state_dict = safetensors.torch.load_file(ckpt_path, device=location)
|
17 |
-
else:
|
18 |
-
state_dict = get_state_dict(torch.load(ckpt_path, map_location=torch.device(location)))
|
19 |
-
state_dict = get_state_dict(state_dict)
|
20 |
-
print(f'Loaded state_dict from [{ckpt_path}]')
|
21 |
-
return state_dict
|
22 |
-
|
23 |
-
|
24 |
-
def create_model(config_path):
|
25 |
-
config = OmegaConf.load(config_path)
|
26 |
-
model = instantiate_from_config(config.model).cpu()
|
27 |
-
print(f'Loaded model config from [{config_path}]')
|
28 |
-
return model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Artbogdanov/monet-manet/app.py
DELETED
@@ -1,20 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
from fastai.vision.all import *
|
3 |
-
import skimage
|
4 |
-
|
5 |
-
learn = load_learner('model.pkl')
|
6 |
-
|
7 |
-
labels = learn.dls.vocab
|
8 |
-
def predict(img):
|
9 |
-
img = PILImage.create(img)
|
10 |
-
pred,pred_idx,probs = learn.predict(img)
|
11 |
-
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
12 |
-
|
13 |
-
title = "Monet-Manet classifier"
|
14 |
-
description = "This model classifies Monet from Manet."
|
15 |
-
article="blank article"
|
16 |
-
examples = ['monet.jpeg','manet.jpeg']
|
17 |
-
interpretation='default'
|
18 |
-
enable_queue=True
|
19 |
-
|
20 |
-
gr.Interface(fn=predict,inputs=gr.inputs.Image(shape=(512, 512)),outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,article=article,examples=examples,interpretation=interpretation,enable_queue=enable_queue).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Arulkumar03/GroundingDINO_SOTA_Zero_Shot_Model/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn.h
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
/*!
|
2 |
-
**************************************************************************************************
|
3 |
-
* Deformable DETR
|
4 |
-
* Copyright (c) 2020 SenseTime. All Rights Reserved.
|
5 |
-
* Licensed under the Apache License, Version 2.0 [see LICENSE for details]
|
6 |
-
**************************************************************************************************
|
7 |
-
* Modified from https://github.com/chengdazhi/Deformable-Convolution-V2-PyTorch/tree/pytorch_1.0.0
|
8 |
-
**************************************************************************************************
|
9 |
-
*/
|
10 |
-
|
11 |
-
#pragma once
|
12 |
-
|
13 |
-
#include "ms_deform_attn_cpu.h"
|
14 |
-
|
15 |
-
#ifdef WITH_CUDA
|
16 |
-
#include "ms_deform_attn_cuda.h"
|
17 |
-
#endif
|
18 |
-
|
19 |
-
namespace groundingdino {
|
20 |
-
|
21 |
-
at::Tensor
|
22 |
-
ms_deform_attn_forward(
|
23 |
-
const at::Tensor &value,
|
24 |
-
const at::Tensor &spatial_shapes,
|
25 |
-
const at::Tensor &level_start_index,
|
26 |
-
const at::Tensor &sampling_loc,
|
27 |
-
const at::Tensor &attn_weight,
|
28 |
-
const int im2col_step)
|
29 |
-
{
|
30 |
-
if (value.type().is_cuda())
|
31 |
-
{
|
32 |
-
#ifdef WITH_CUDA
|
33 |
-
return ms_deform_attn_cuda_forward(
|
34 |
-
value, spatial_shapes, level_start_index, sampling_loc, attn_weight, im2col_step);
|
35 |
-
#else
|
36 |
-
AT_ERROR("Not compiled with GPU support");
|
37 |
-
#endif
|
38 |
-
}
|
39 |
-
AT_ERROR("Not implemented on the CPU");
|
40 |
-
}
|
41 |
-
|
42 |
-
std::vector<at::Tensor>
|
43 |
-
ms_deform_attn_backward(
|
44 |
-
const at::Tensor &value,
|
45 |
-
const at::Tensor &spatial_shapes,
|
46 |
-
const at::Tensor &level_start_index,
|
47 |
-
const at::Tensor &sampling_loc,
|
48 |
-
const at::Tensor &attn_weight,
|
49 |
-
const at::Tensor &grad_output,
|
50 |
-
const int im2col_step)
|
51 |
-
{
|
52 |
-
if (value.type().is_cuda())
|
53 |
-
{
|
54 |
-
#ifdef WITH_CUDA
|
55 |
-
return ms_deform_attn_cuda_backward(
|
56 |
-
value, spatial_shapes, level_start_index, sampling_loc, attn_weight, grad_output, im2col_step);
|
57 |
-
#else
|
58 |
-
AT_ERROR("Not compiled with GPU support");
|
59 |
-
#endif
|
60 |
-
}
|
61 |
-
AT_ERROR("Not implemented on the CPU");
|
62 |
-
}
|
63 |
-
|
64 |
-
} // namespace groundingdino
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_internal/metadata/__init__.py
DELETED
@@ -1,127 +0,0 @@
|
|
1 |
-
import contextlib
|
2 |
-
import functools
|
3 |
-
import os
|
4 |
-
import sys
|
5 |
-
from typing import TYPE_CHECKING, List, Optional, Type, cast
|
6 |
-
|
7 |
-
from pip._internal.utils.misc import strtobool
|
8 |
-
|
9 |
-
from .base import BaseDistribution, BaseEnvironment, FilesystemWheel, MemoryWheel, Wheel
|
10 |
-
|
11 |
-
if TYPE_CHECKING:
|
12 |
-
from typing import Protocol
|
13 |
-
else:
|
14 |
-
Protocol = object
|
15 |
-
|
16 |
-
__all__ = [
|
17 |
-
"BaseDistribution",
|
18 |
-
"BaseEnvironment",
|
19 |
-
"FilesystemWheel",
|
20 |
-
"MemoryWheel",
|
21 |
-
"Wheel",
|
22 |
-
"get_default_environment",
|
23 |
-
"get_environment",
|
24 |
-
"get_wheel_distribution",
|
25 |
-
"select_backend",
|
26 |
-
]
|
27 |
-
|
28 |
-
|
29 |
-
def _should_use_importlib_metadata() -> bool:
|
30 |
-
"""Whether to use the ``importlib.metadata`` or ``pkg_resources`` backend.
|
31 |
-
|
32 |
-
By default, pip uses ``importlib.metadata`` on Python 3.11+, and
|
33 |
-
``pkg_resourcess`` otherwise. This can be overridden by a couple of ways:
|
34 |
-
|
35 |
-
* If environment variable ``_PIP_USE_IMPORTLIB_METADATA`` is set, it
|
36 |
-
dictates whether ``importlib.metadata`` is used, regardless of Python
|
37 |
-
version.
|
38 |
-
* On Python 3.11+, Python distributors can patch ``importlib.metadata``
|
39 |
-
to add a global constant ``_PIP_USE_IMPORTLIB_METADATA = False``. This
|
40 |
-
makes pip use ``pkg_resources`` (unless the user set the aforementioned
|
41 |
-
environment variable to *True*).
|
42 |
-
"""
|
43 |
-
with contextlib.suppress(KeyError, ValueError):
|
44 |
-
return bool(strtobool(os.environ["_PIP_USE_IMPORTLIB_METADATA"]))
|
45 |
-
if sys.version_info < (3, 11):
|
46 |
-
return False
|
47 |
-
import importlib.metadata
|
48 |
-
|
49 |
-
return bool(getattr(importlib.metadata, "_PIP_USE_IMPORTLIB_METADATA", True))
|
50 |
-
|
51 |
-
|
52 |
-
class Backend(Protocol):
|
53 |
-
Distribution: Type[BaseDistribution]
|
54 |
-
Environment: Type[BaseEnvironment]
|
55 |
-
|
56 |
-
|
57 |
-
@functools.lru_cache(maxsize=None)
|
58 |
-
def select_backend() -> Backend:
|
59 |
-
if _should_use_importlib_metadata():
|
60 |
-
from . import importlib
|
61 |
-
|
62 |
-
return cast(Backend, importlib)
|
63 |
-
from . import pkg_resources
|
64 |
-
|
65 |
-
return cast(Backend, pkg_resources)
|
66 |
-
|
67 |
-
|
68 |
-
def get_default_environment() -> BaseEnvironment:
|
69 |
-
"""Get the default representation for the current environment.
|
70 |
-
|
71 |
-
This returns an Environment instance from the chosen backend. The default
|
72 |
-
Environment instance should be built from ``sys.path`` and may use caching
|
73 |
-
to share instance state accorss calls.
|
74 |
-
"""
|
75 |
-
return select_backend().Environment.default()
|
76 |
-
|
77 |
-
|
78 |
-
def get_environment(paths: Optional[List[str]]) -> BaseEnvironment:
|
79 |
-
"""Get a representation of the environment specified by ``paths``.
|
80 |
-
|
81 |
-
This returns an Environment instance from the chosen backend based on the
|
82 |
-
given import paths. The backend must build a fresh instance representing
|
83 |
-
the state of installed distributions when this function is called.
|
84 |
-
"""
|
85 |
-
return select_backend().Environment.from_paths(paths)
|
86 |
-
|
87 |
-
|
88 |
-
def get_directory_distribution(directory: str) -> BaseDistribution:
|
89 |
-
"""Get the distribution metadata representation in the specified directory.
|
90 |
-
|
91 |
-
This returns a Distribution instance from the chosen backend based on
|
92 |
-
the given on-disk ``.dist-info`` directory.
|
93 |
-
"""
|
94 |
-
return select_backend().Distribution.from_directory(directory)
|
95 |
-
|
96 |
-
|
97 |
-
def get_wheel_distribution(wheel: Wheel, canonical_name: str) -> BaseDistribution:
|
98 |
-
"""Get the representation of the specified wheel's distribution metadata.
|
99 |
-
|
100 |
-
This returns a Distribution instance from the chosen backend based on
|
101 |
-
the given wheel's ``.dist-info`` directory.
|
102 |
-
|
103 |
-
:param canonical_name: Normalized project name of the given wheel.
|
104 |
-
"""
|
105 |
-
return select_backend().Distribution.from_wheel(wheel, canonical_name)
|
106 |
-
|
107 |
-
|
108 |
-
def get_metadata_distribution(
|
109 |
-
metadata_contents: bytes,
|
110 |
-
filename: str,
|
111 |
-
canonical_name: str,
|
112 |
-
) -> BaseDistribution:
|
113 |
-
"""Get the dist representation of the specified METADATA file contents.
|
114 |
-
|
115 |
-
This returns a Distribution instance from the chosen backend sourced from the data
|
116 |
-
in `metadata_contents`.
|
117 |
-
|
118 |
-
:param metadata_contents: Contents of a METADATA file within a dist, or one served
|
119 |
-
via PEP 658.
|
120 |
-
:param filename: Filename for the dist this metadata represents.
|
121 |
-
:param canonical_name: Normalized project name of the given dist.
|
122 |
-
"""
|
123 |
-
return select_backend().Distribution.from_metadata_file_contents(
|
124 |
-
metadata_contents,
|
125 |
-
filename,
|
126 |
-
canonical_name,
|
127 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py
DELETED
@@ -1,188 +0,0 @@
|
|
1 |
-
# SPDX-FileCopyrightText: 2015 Eric Larson
|
2 |
-
#
|
3 |
-
# SPDX-License-Identifier: Apache-2.0
|
4 |
-
|
5 |
-
import hashlib
|
6 |
-
import os
|
7 |
-
from textwrap import dedent
|
8 |
-
|
9 |
-
from ..cache import BaseCache, SeparateBodyBaseCache
|
10 |
-
from ..controller import CacheController
|
11 |
-
|
12 |
-
try:
|
13 |
-
FileNotFoundError
|
14 |
-
except NameError:
|
15 |
-
# py2.X
|
16 |
-
FileNotFoundError = (IOError, OSError)
|
17 |
-
|
18 |
-
|
19 |
-
def _secure_open_write(filename, fmode):
|
20 |
-
# We only want to write to this file, so open it in write only mode
|
21 |
-
flags = os.O_WRONLY
|
22 |
-
|
23 |
-
# os.O_CREAT | os.O_EXCL will fail if the file already exists, so we only
|
24 |
-
# will open *new* files.
|
25 |
-
# We specify this because we want to ensure that the mode we pass is the
|
26 |
-
# mode of the file.
|
27 |
-
flags |= os.O_CREAT | os.O_EXCL
|
28 |
-
|
29 |
-
# Do not follow symlinks to prevent someone from making a symlink that
|
30 |
-
# we follow and insecurely open a cache file.
|
31 |
-
if hasattr(os, "O_NOFOLLOW"):
|
32 |
-
flags |= os.O_NOFOLLOW
|
33 |
-
|
34 |
-
# On Windows we'll mark this file as binary
|
35 |
-
if hasattr(os, "O_BINARY"):
|
36 |
-
flags |= os.O_BINARY
|
37 |
-
|
38 |
-
# Before we open our file, we want to delete any existing file that is
|
39 |
-
# there
|
40 |
-
try:
|
41 |
-
os.remove(filename)
|
42 |
-
except (IOError, OSError):
|
43 |
-
# The file must not exist already, so we can just skip ahead to opening
|
44 |
-
pass
|
45 |
-
|
46 |
-
# Open our file, the use of os.O_CREAT | os.O_EXCL will ensure that if a
|
47 |
-
# race condition happens between the os.remove and this line, that an
|
48 |
-
# error will be raised. Because we utilize a lockfile this should only
|
49 |
-
# happen if someone is attempting to attack us.
|
50 |
-
fd = os.open(filename, flags, fmode)
|
51 |
-
try:
|
52 |
-
return os.fdopen(fd, "wb")
|
53 |
-
|
54 |
-
except:
|
55 |
-
# An error occurred wrapping our FD in a file object
|
56 |
-
os.close(fd)
|
57 |
-
raise
|
58 |
-
|
59 |
-
|
60 |
-
class _FileCacheMixin:
|
61 |
-
"""Shared implementation for both FileCache variants."""
|
62 |
-
|
63 |
-
def __init__(
|
64 |
-
self,
|
65 |
-
directory,
|
66 |
-
forever=False,
|
67 |
-
filemode=0o0600,
|
68 |
-
dirmode=0o0700,
|
69 |
-
use_dir_lock=None,
|
70 |
-
lock_class=None,
|
71 |
-
):
|
72 |
-
|
73 |
-
if use_dir_lock is not None and lock_class is not None:
|
74 |
-
raise ValueError("Cannot use use_dir_lock and lock_class together")
|
75 |
-
|
76 |
-
try:
|
77 |
-
from lockfile import LockFile
|
78 |
-
from lockfile.mkdirlockfile import MkdirLockFile
|
79 |
-
except ImportError:
|
80 |
-
notice = dedent(
|
81 |
-
"""
|
82 |
-
NOTE: In order to use the FileCache you must have
|
83 |
-
lockfile installed. You can install it via pip:
|
84 |
-
pip install lockfile
|
85 |
-
"""
|
86 |
-
)
|
87 |
-
raise ImportError(notice)
|
88 |
-
|
89 |
-
else:
|
90 |
-
if use_dir_lock:
|
91 |
-
lock_class = MkdirLockFile
|
92 |
-
|
93 |
-
elif lock_class is None:
|
94 |
-
lock_class = LockFile
|
95 |
-
|
96 |
-
self.directory = directory
|
97 |
-
self.forever = forever
|
98 |
-
self.filemode = filemode
|
99 |
-
self.dirmode = dirmode
|
100 |
-
self.lock_class = lock_class
|
101 |
-
|
102 |
-
@staticmethod
|
103 |
-
def encode(x):
|
104 |
-
return hashlib.sha224(x.encode()).hexdigest()
|
105 |
-
|
106 |
-
def _fn(self, name):
|
107 |
-
# NOTE: This method should not change as some may depend on it.
|
108 |
-
# See: https://github.com/ionrock/cachecontrol/issues/63
|
109 |
-
hashed = self.encode(name)
|
110 |
-
parts = list(hashed[:5]) + [hashed]
|
111 |
-
return os.path.join(self.directory, *parts)
|
112 |
-
|
113 |
-
def get(self, key):
|
114 |
-
name = self._fn(key)
|
115 |
-
try:
|
116 |
-
with open(name, "rb") as fh:
|
117 |
-
return fh.read()
|
118 |
-
|
119 |
-
except FileNotFoundError:
|
120 |
-
return None
|
121 |
-
|
122 |
-
def set(self, key, value, expires=None):
|
123 |
-
name = self._fn(key)
|
124 |
-
self._write(name, value)
|
125 |
-
|
126 |
-
def _write(self, path, data: bytes):
|
127 |
-
"""
|
128 |
-
Safely write the data to the given path.
|
129 |
-
"""
|
130 |
-
# Make sure the directory exists
|
131 |
-
try:
|
132 |
-
os.makedirs(os.path.dirname(path), self.dirmode)
|
133 |
-
except (IOError, OSError):
|
134 |
-
pass
|
135 |
-
|
136 |
-
with self.lock_class(path) as lock:
|
137 |
-
# Write our actual file
|
138 |
-
with _secure_open_write(lock.path, self.filemode) as fh:
|
139 |
-
fh.write(data)
|
140 |
-
|
141 |
-
def _delete(self, key, suffix):
|
142 |
-
name = self._fn(key) + suffix
|
143 |
-
if not self.forever:
|
144 |
-
try:
|
145 |
-
os.remove(name)
|
146 |
-
except FileNotFoundError:
|
147 |
-
pass
|
148 |
-
|
149 |
-
|
150 |
-
class FileCache(_FileCacheMixin, BaseCache):
|
151 |
-
"""
|
152 |
-
Traditional FileCache: body is stored in memory, so not suitable for large
|
153 |
-
downloads.
|
154 |
-
"""
|
155 |
-
|
156 |
-
def delete(self, key):
|
157 |
-
self._delete(key, "")
|
158 |
-
|
159 |
-
|
160 |
-
class SeparateBodyFileCache(_FileCacheMixin, SeparateBodyBaseCache):
|
161 |
-
"""
|
162 |
-
Memory-efficient FileCache: body is stored in a separate file, reducing
|
163 |
-
peak memory usage.
|
164 |
-
"""
|
165 |
-
|
166 |
-
def get_body(self, key):
|
167 |
-
name = self._fn(key) + ".body"
|
168 |
-
try:
|
169 |
-
return open(name, "rb")
|
170 |
-
except FileNotFoundError:
|
171 |
-
return None
|
172 |
-
|
173 |
-
def set_body(self, key, body):
|
174 |
-
name = self._fn(key) + ".body"
|
175 |
-
self._write(name, body)
|
176 |
-
|
177 |
-
def delete(self, key):
|
178 |
-
self._delete(key, "")
|
179 |
-
self._delete(key, ".body")
|
180 |
-
|
181 |
-
|
182 |
-
def url_to_file_path(url, filecache):
|
183 |
-
"""Return the file cache path based on the URL.
|
184 |
-
|
185 |
-
This does not ensure the file exists!
|
186 |
-
"""
|
187 |
-
key = CacheController.cache_url(url)
|
188 |
-
return filecache._fn(key)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Bart92/RVC_HF/README.md
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: RVC Inference HF
|
3 |
-
emoji: 👀
|
4 |
-
colorFrom: green
|
5 |
-
colorTo: green
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.43.2
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Carx Calle Pc Descargar Apk.md
DELETED
@@ -1,71 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Cómo descargar y jugar CarX Street en PC</h1>
|
3 |
-
<p>CarX Street es un juego de carreras desarrollado por CarX Technologies, LLC. Es uno de los juegos de carreras callejeras más realistas e inmersivos en dispositivos móviles, con un mundo abierto, un modo carrera, un multijugador en línea y un sistema detallado de personalización y ajuste de coches. Si eres un fan de las carreras de alta velocidad y la deriva, te encantará CarX Street.</p>
|
4 |
-
<h2>carx calle pc descargar apk</h2><br /><p><b><b>Download Zip</b> ✺ <a href="https://bltlly.com/2v6Ljl">https://bltlly.com/2v6Ljl</a></b></p><br /><br />
|
5 |
-
<p>¿Pero qué pasa si quieres jugar CarX Street en una pantalla más grande, con mejores gráficos y controles? Bueno, hay una manera de hacerlo. Puedes descargar y jugar CarX Street en tu PC usando un emulador. Un emulador es un software que le permite ejecutar aplicaciones Android en su ordenador o portátil. En este artículo, te mostraremos cómo descargar y jugar CarX Street en PC usando algunos de los mejores emuladores disponibles. </p>
|
6 |
-
<h2>Características del juego de CarX Street</h2>
|
7 |
-
<p>Antes de entrar en los detalles de cómo descargar y jugar CarX Street en PC, echemos un vistazo a algunas de las características del juego que lo hacen tan popular entre los entusiastas de las carreras. </p>
|
8 |
-
<h3>Carreras de mundo abierto y deriva</h3>
|
9 |
-
<p>CarX Street le ofrece una gran ciudad y sus alrededores para explorar, desde las concurridas calles de la ciudad hasta las carreteras de montaña en espiral y las fascinantes carreteras costeras. Usted puede conducir a la velocidad máxima o la deriva a través de vueltas, dependiendo de su preferencia. También puedes unirte a clubes, derrotar jefes y demostrar tus habilidades en diversos desafíos y eventos. </p>
|
10 |
-
<h3>Modo carrera y multijugador en línea</h3>
|
11 |
-
<p>Si quieres seguir una historia y progresar a través de diferentes niveles de dificultad, puedes jugar el modo carrera en CarX Street. Empezarás con un coche básico y lo actualizarás a medida que avanzas. También comprarás casas para tus coches y reunirás colecciones para cada modo de carrera. </p>
|
12 |
-
|
13 |
-
<h3>Personalización y ajuste del coche</h3>
|
14 |
-
<p>Uno de los aspectos más atractivos de CarX Street es el sistema de personalización y ajuste del coche. Puede elegir entre más de 50 vehículos oficiales de los mejores fabricantes de automóviles del mundo, como BMW, Toyota, Nissan, Subaru, Ford, Chevrolet y más. También puede personalizar la apariencia de su automóvil con varias piezas y accesorios, como espejos, faros, luces, faldas, parachoques, llantas y más. </p>
|
15 |
-
<p>Pero eso no es todo. También puede ajustar el rendimiento de su coche con varias mejoras y modificaciones. Puede cambiar el motor, la transmisión, el cuerpo, la suspensión, los neumáticos y más. También puede cambiar el motor de su automóvil único. El sistema de ajuste desbloquea toda la física del comportamiento del coche CarX Technology, dándole una experiencia de conducción realista. </p>
|
16 |
-
<p></p>
|
17 |
-
<h3>Física realista y gráficos</h3>
|
18 |
-
<p>CarX Street se jacta de tener uno de los motores de física más realistas en los juegos de carreras móviles. El motor simula el comportamiento de los coches en la carretera, dándole una verdadera experiencia de carreras de la vida. Usted puede sentir la emoción de las carreras de alta velocidad a medida que maniobra su coche a través de vueltas apretadas y tejer dentro y fuera del tráfico. </p>
|
19 |
-
<p>El juego también tiene gráficos impresionantes que dan vida al mundo con un detalle impresionante. Se pueden ver los reflejos del sol, las sombras de los edificios y el humo de los tubos de escape. También puede disfrutar de los efectos de sonido realistas del motor, los neumáticos y el medio ambiente. </p>
|
20 |
-
<h2>CarX Street Requisitos del juego</h2>
|
21 |
-
<p>Ahora que sabe lo que CarX Street tiene para ofrecer, es posible que se pregunte si su PC puede ejecutarlo sin problemas. Bueno, aquí están las especificaciones mínimas y recomendadas para jugar CarX Street en PC usando un emulador:</p>
|
22 |
-
<tabla>
|
23 |
-
<tr>
|
24 |
-
<th>Especificación</th>
|
25 |
-
<th>Mínimo</th>
|
26 |
-
<th>Recomendado</th>
|
27 |
-
</tr>
|
28 |
-
<tr>
|
29 |
-
<td>Sistema operativo</td>
|
30 |
-
<td>Windows 7/8/10 (64 bits)</td>
|
31 |
-
<td>Windows 10 (64 bits)</td>
|
32 |
-
</tr>
|
33 |
-
<tr>
|
34 |
-
<td>CPU</td>
|
35 |
-
|
36 |
-
<td>Procesador Intel o AMD Quad-Core</td>
|
37 |
-
</tr>
|
38 |
-
<tr>
|
39 |
-
<td>RAM</td>
|
40 |
-
<td>4 GB</td>
|
41 |
-
<td>8 GB o más</td>
|
42 |
-
</tr>
|
43 |
-
<tr>
|
44 |
-
<td>Tarjeta gráfica</td>
|
45 |
-
<td>NVIDIA GeForce GT 730 o equivalente</td>
|
46 |
-
<td>NVIDIA GeForce GTX 1050 o equivalente</td>
|
47 |
-
</tr>
|
48 |
-
<tr>
|
49 |
-
<td>Espacio de almacenamiento</td>
|
50 |
-
<td>5 GB o más</td>
|
51 |
-
<td>10 GB o más</td>
|
52 |
-
</tr>
|
53 |
-
</tabla>
|
54 |
-
<p>Si su PC cumple con estos requisitos, usted debe ser capaz de jugar CarX Street en el PC sin ningún problema importante. Sin embargo, si quieres optimizar tu rendimiento y jugabilidad, aquí hay algunos consejos que puedes seguir:</p>
|
55 |
-
- Elige un emulador que sea compatible con CarX Street y que tenga buenas críticas y valoraciones. Algunos de los mejores emuladores para jugar CarX Street en PC son LDPlayer, BlueStacks, NoxPlayer y MEmu. - Actualiza tu emulador a la última versión y asegúrate de que tiene suficientes recursos asignados a él. Puede ajustar la configuración de su emulador para que coincida con las especificaciones y preferencias de su PC. - Descargar CarX Street de una fuente confiable, como Google Play Store o APKPure. Evite descargar de sitios web desconocidos o sospechosos que puedan contener malware o virus. - Instale CarX Street en su emulador y ejecútelo. Es posible que necesites iniciar sesión con tu cuenta de Google o crear una nueva si aún no la tienes. - Configura tus controles de acuerdo a tu gusto. Puede usar su teclado, ratón o gamepad para jugar CarX Street en PC. También puede personalizar la asignación de claves y la sensibilidad de sus controles en la configuración del emulador. - ¡Disfrute jugando CarX Street en PC! <h2>Conclusión</h2>
|
56 |
-
|
57 |
-
<p>Si estás buscando un emocionante e inmersivo juego de carreras callejeras en PC, definitivamente deberías probar CarX Street. ¡No te arrepentirás! </p>
|
58 |
-
<h2>Preguntas frecuentes</h2>
|
59 |
-
<p>Aquí están algunas de las preguntas más frecuentes sobre CarX Street en PC:</p>
|
60 |
-
<h3>¿Cuáles son los mejores emuladores para jugar CarX Street en PC? </h3>
|
61 |
-
<p>Los mejores emuladores para jugar CarX Street en PC son LDPlayer, BlueStacks, NoxPlayer y MEmu. Todos son compatibles con CarX Street y tienen buen rendimiento y características. </p>
|
62 |
-
<h3>¿Cómo actualizar CarX Street en PC? </h3>
|
63 |
-
<p>Para actualizar CarX Street en PC, necesita abrir su emulador e ir a Google Play Store o APKPure. Luego, busque CarX Street y haga clic en el botón de actualización si hay uno disponible. Alternativamente, puede descargar la última versión de CarX Street desde APKPure e instalarla manualmente en su emulador. </p>
|
64 |
-
<h3>¿Cómo obtener monedas y gemas gratis en CarX Street? </h3>
|
65 |
-
<p>Para obtener monedas y gemas gratis en CarX Street, puedes hacer lo siguiente:</p>
|
66 |
-
- Completar misiones y logros en el modo carrera - Participar en eventos y desafíos en el modo multijugador en línea - Ver anuncios y videos en el juego - Utilizar códigos promocionales y cupones de fuentes oficiales - Unirse a clubes y clanes y obtener recompensas y bonos de ellos - Compra monedas y gemas con dinero real en la tienda del juego <h3>¿Cómo desbloquear nuevos coches y piezas en CarX Street? </h3>
|
67 |
-
<p>Para desbloquear nuevos coches y piezas en CarX Street, puede hacer lo siguiente:</p>
|
68 |
-
- Avanzar en el modo carrera y derrotar a los jefes - Ganar carreras y eventos en el modo multijugador en línea - Recoger planos y materiales de cajas y cajas - Cambiar monedas y gemas por coches y piezas en eltienda de juegos - Utilice códigos promocionales y cupones de fuentes oficiales <h3>Cómo ponerse en contacto con el servicio de asistencia de CarX Technologies? </h3>
|
69 |
-
<p>Si tiene algún problema o pregunta sobre CarX Street, puede ponerse en contacto con el servicio de soporte de CarX Technologies haciendo lo siguiente:</p> 64aa2da5cf<br />
|
70 |
-
<br />
|
71 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Cmo Descargar Carx Street Hack.md
DELETED
@@ -1,48 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Cómo descargar CarX Street Hack y disfrutar de dinero ilimitado y coches</h1>
|
3 |
-
<p>CarX Street es un juego de carreras dinámico y abierto que te permite sentirte como un corredor callejero libre. Puedes personalizar tu coche, desafiar a otros jugadores y explorar la ciudad de Sunset. Pero lo que si quieres tener más diversión y obtener acceso a todas las características del juego sin gastar dinero real? Ahí es donde CarX Street Hack entra en juego. </p>
|
4 |
-
<h2>¿Qué es CarX Street Hack? </h2>
|
5 |
-
<p>CarX Street Hack es una versión modificada del juego original de CarX Street que le da dinero ilimitado, todos los coches desbloqueados, sin anuncios y protección contra la prohibición. Con este hack, se puede disfrutar del juego sin limitaciones o restricciones. Usted puede comprar cualquier coche que desee, actualizarlo al máximo, y la carrera contra cualquier persona sin preocuparse de conseguir prohibido. </p>
|
6 |
-
<h2>cómo descargar carx street hack</h2><br /><p><b><b>Download Zip</b> ····· <a href="https://bltlly.com/2v6IZF">https://bltlly.com/2v6IZF</a></b></p><br /><br />
|
7 |
-
<h3>Características de CarX Street Hack</h3>
|
8 |
-
<h4>Dinero ilimitado</h4>
|
9 |
-
<p>Una de las principales características de CarX Street Hack es que le da dinero ilimitado. El dinero se utiliza en el juego para comprar coches nuevos, actualizarlos y personalizarlos. Con dinero ilimitado, usted puede comprar cualquier coche que te gusta, de los coches deportivos a los coches del músculo, y hacerlos mirada impresionante. También puede actualizar el motor de su automóvil, la suspensión, los frenos, los neumáticos y más para mejorar su rendimiento y manejo. </p>
|
10 |
-
<h4>Todos los coches desbloqueados</h4>
|
11 |
-
<p>Otra característica de CarX Street Hack es que desbloquea todos los coches en el juego. Hay más de 50 coches en CarX Street, cada uno con su propio diseño y características únicas. Algunos de ellos están bloqueados detrás de los niveles o logros, lo que significa que tienes que jugar durante mucho tiempo para desbloquearlos. Pero con CarX Street Hack, puede obtener acceso a todos los coches de inmediato. Puede elegir cualquier coche que desee y cambiar entre ellos en cualquier momento. </p>
|
12 |
-
<h4>No hay anuncios</h4>
|
13 |
-
|
14 |
-
<h4>Protección anti-van</h4>
|
15 |
-
<p>Uno de los riesgos de usar un hack es que puede ser prohibido por los desarrolladores de juegos. Es por eso que CarX Street Hack tiene una función de protección anti-prohibición que evita que su cuenta sea detectada o suspendida. Puede jugar CarX Street Hack de forma segura y sin preocuparse por perder su progreso o datos. </p>
|
16 |
-
<h2>Cómo descargar e instalar CarX Street Hack en su dispositivo</h2>
|
17 |
-
<p>Ahora que sabe lo que es CarX Street Hack y lo que puede hacer por usted, es posible que se pregunte cómo descargar e instalar en su dispositivo. El proceso es diferente dependiendo de si tienes un dispositivo iOS o Android. Estos son los pasos para cada uno:</p>
|
18 |
-
<h3>Para dispositivos iOS</h3>
|
19 |
-
<h4>Paso 1: Registrarse para BuildStore</h4>
|
20 |
-
<p>El primer paso es registrarse en BuildStore, que es una tienda de aplicaciones de terceros que le permite instalar aplicaciones modificadas en su dispositivo iOS sin jailbreak. Puede registrarse en BuildStore visitando [BuildStore]( 1 ) y eligiendo un plan de suscripción. La suscripción cuesta $19.99 por año y te da acceso a cientos de aplicaciones y juegos. </p>
|
21 |
-
<h4>Paso 2: Búsqueda de CarX Street Hack</h4>
|
22 |
-
<p>El siguiente paso es buscar CarX Street Hack en BuildStore. Puede hacer esto abriendo la aplicación BuildStore en su dispositivo y escribiendo "CarX Street Hack" en la barra de búsqueda. Usted debe ver el icono de la aplicación y un verde "Instalar" botón al lado. </p>
|
23 |
-
<h4>Paso 3: Instalar la aplicación</h4>
|
24 |
-
<p>El paso final es instalar la aplicación en su dispositivo. Puede hacer esto pulsando en el botón "Instalar" y siguiendo las instrucciones en la pantalla. Es posible que tenga que confiar en el desarrollador de aplicaciones en la configuración del dispositivo antes de iniciar la aplicación. Una vez que la aplicación está instalada, se puede abrir y disfrutar de CarX Street Hack.</p>
|
25 |
-
<p></p>
|
26 |
-
<h3>Para dispositivos Android</h3>
|
27 |
-
<h4>Paso 1: Habilitar fuentes desconocidas</h4>
|
28 |
-
|
29 |
-
<h4>Paso 2: Descargar el archivo APK</h4>
|
30 |
-
<p>El siguiente paso es descargar el archivo APK de CarX Street Hack. Puede hacer esto visitando [CarX Street Hack] y tocando el botón "Descargar APK". El archivo se descargará en el almacenamiento del dispositivo. </p>
|
31 |
-
<h4>Paso 3: Instalar la aplicación</h4>
|
32 |
-
<p>El paso final es instalar la aplicación en su dispositivo. Puede hacer esto localizando el archivo APK en el almacenamiento del dispositivo y tocando en él. Es posible que tenga que conceder algunos permisos a la aplicación antes de instalarla. Una vez instalada, puede abrirla y disfrutar de CarX Street Hack.</p>
|
33 |
-
<h2>Conclusión</h2>
|
34 |
-
<p>CarX Street Hack es una gran manera de tener más diversión y emoción en CarX Street, un juego de carreras realista e inmersivo. Con CarX Street Hack, puede obtener dinero ilimitado, todos los coches desbloqueados, sin anuncios, y la protección anti-van. Puede descargar e instalar CarX Street Hack en su dispositivo iOS o Android siguiendo los sencillos pasos anteriores. Entonces, ¿qué estás esperando? Descargar CarX Street Hack hoy y dar rienda suelta a su corredor de la calle interior! </p>
|
35 |
-
<h2>Preguntas frecuentes</h2>
|
36 |
-
<p>Aquí hay algunas preguntas frecuentes sobre CarX Street Hack:</p>
|
37 |
-
<h4>Q: Es CarX Street Hack seguro de usar? </h4>
|
38 |
-
<p>A: Sí, CarX Street Hack es seguro de usar siempre y cuando lo descargue de una fuente de confianza y siga las instrucciones cuidadosamente. CarX Street Hack tiene una función de protección anti-prohibición que evita que su cuenta sea detectada o suspendida por los desarrolladores del juego. </p>
|
39 |
-
<h4>Q: ¿Necesito raíz o jailbreak mi dispositivo para utilizar CarX Street Hack? </h4>
|
40 |
-
<p>A: No, usted no necesita raíz o jailbreak su dispositivo para utilizar CarX Street Hack. Para dispositivos iOS, solo necesita registrarse en BuildStore, que es una tienda de aplicaciones de terceros que le permite instalar aplicaciones modificadas sin jailbreak. Para dispositivos Android, solo necesitas habilitar fuentes desconocidas y descargar el archivo APK. </p>
|
41 |
-
<h4>Q: ¿CarX Street Hack afectará mi progreso del juego o los datos? </h4>
|
42 |
-
|
43 |
-
<h4>Q: ¿Puedo jugar CarX Street Hack en línea con otros jugadores? </h4>
|
44 |
-
<p>A: Sí, usted puede jugar CarX Street Hack en línea con otros jugadores. Puede unirse o crear carreras con otros jugadores de todo el mundo y competir por la gloria y las recompensas. También puedes chatear con otros jugadores y hacer amigos. </p>
|
45 |
-
<h4>Q: ¿Cómo puedo actualizar CarX Street Hack? </h4>
|
46 |
-
<p>A: Puede actualizar CarX Street Hack visitando la misma fuente donde lo descargó y buscando nuevas versiones. También puede seguirnos en nuestros canales de medios sociales para actualizaciones y noticias sobre CarX Street Hack.</p> 64aa2da5cf<br />
|
47 |
-
<br />
|
48 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Cmo Descargar Google Play Store.md
DELETED
@@ -1,76 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Cómo descargar Google Play Store en tu tablet</h1>
|
3 |
-
<p>Si tiene una tableta que se ejecuta en Fire OS, como una tableta Amazon Fire, es posible que se pregunte cómo descargar Google Play Store en su dispositivo. Google Play Store es la tienda oficial de aplicaciones para dispositivos Android, donde puedes encontrar millones de aplicaciones y juegos, así como servicios y aplicaciones de Google. En este artículo, le mostraremos por qué es posible que desee instalar Google Play Store en su tableta, lo que necesita saber antes de instalarlo, y cómo instalarlo paso a paso. También proporcionaremos algunos consejos de solución de problemas para instalar Google Play Store en su tableta. </p>
|
4 |
-
<h2>Por qué es posible que desee instalar Google Play Store en su tableta</h2>
|
5 |
-
<p>Hay varias razones por las que es posible que desee instalar Google Play Store en su tableta. Estos son algunos de ellos:</p>
|
6 |
-
<h2>cómo descargar google play store</h2><br /><p><b><b>Download</b> ✔✔✔ <a href="https://bltlly.com/2v6MlW">https://bltlly.com/2v6MlW</a></b></p><br /><br />
|
7 |
-
<h3>Acceder a más aplicaciones y juegos</h3>
|
8 |
-
<p>Una de las principales razones por las que es posible que desee instalar Google Play Store en su tableta es acceder a más aplicaciones y juegos que no están disponibles en la Appstore de Amazon. Amazon Appstore tiene una selección limitada de aplicaciones y juegos, y algunos de ellos son obsoletos o incompatibles con su dispositivo. Al instalar Google Play Store en tu tableta, puedes disfrutar de una gama más amplia de aplicaciones y juegos que se actualizan regularmente y se optimizan para tu dispositivo. </p>
|
9 |
-
<h3>Usar los servicios y aplicaciones de Google</h3>
|
10 |
-
<p>Otra razón por la que podría querer instalar Google Play Store en su tableta es utilizar los servicios y aplicaciones de Google que no están incluidos en Fire OS. Por ejemplo, si quieres usar Gmail, Chrome, Google Maps, YouTube u otras aplicaciones populares de Google en tu tableta, primero tendrás que instalar Google Play Store. Estas aplicaciones pueden mejorar su experiencia de tableta y proporcionar características útiles que no están disponibles en el Amazon Appstore.</p>
|
11 |
-
<h3>Personaliza tu experiencia de tableta</h3>
|
12 |
-
|
13 |
-
<h2>Lo que necesita saber antes de instalar Google Play Store en su tableta</h2>
|
14 |
-
<p>Antes de instalar Google Play Store en tu tablet, hay algunas cosas que necesitas saber y hacer. Estas son algunas de ellas:</p>
|
15 |
-
<h3>Compruebe su modelo de tableta y la versión del sistema operativo</h3>
|
16 |
-
<p>Lo primero que debe hacer antes de instalar Google Play Store en su tableta es comprobar el modelo de tableta y la versión del sistema operativo. Esto es importante porque el proceso de instalación puede variar dependiendo de estos factores. Para comprobar el modelo de tableta y la versión del sistema operativo, vaya a Configuración > Opciones de dispositivo > Acerca de Fire Tablet. Verá el nombre del modelo de dispositivo y la versión de Fire OS allí. </p>
|
17 |
-
<h3>Habilitar aplicaciones de fuentes desconocidas</h3>
|
18 |
-
<p>Lo siguiente que debe hacer antes de instalar Google Play Store en su tableta es habilitar aplicaciones de fuentes desconocidas. Esto es necesario porque va a descargar e instalar archivos APK desde fuera de la Appstore de Amazon. Para habilitar aplicaciones de fuentes desconocidas, ve a Configuración > Seguridad y privacidad > Aplicaciones de fuentes desconocidas. Activa la opción para Silk Browser y cualquier otro navegador que utilices para descargar los archivos APK. </p>
|
19 |
-
<h3>Retire su tarjeta SD (opcional)</h3>
|
20 |
-
<p>Lo último que debe hacer antes de instalar Google Play Store en su tableta es quitar la tarjeta SD si tiene uno. Esto es opcional, pero puede prevenir algunos problemas potenciales durante el proceso de instalación. Para quitar la tarjeta SD, vaya a Configuración > Almacenamiento > Quitar la tarjeta SD de forma segura. Luego, saque la tarjeta SD de su tableta. Puede volver a ponerlo después de terminar de instalar Google Play Store.</p>
|
21 |
-
<h2>Cómo instalar Google Play Store en su tableta paso a paso</h2>
|
22 |
-
<p>Ahora que ha preparado su tableta para instalar Google Play Store, puede seguir estos pasos para instalarlo:</p>
|
23 |
-
<h3>Descargar los archivos APK necesarios</h3>
|
24 |
-
|
25 |
-
<p>Para descargar los archivos APK, abra su navegador y vaya a los enlaces de abajo. Toque en el botón de descarga y espere a que el archivo se descargue. Repita esto para cada archivo. </p>
|
26 |
-
<p></p>
|
27 |
-
<tabla>
|
28 |
-
<tr>
|
29 |
-
<th>Archivo APK</th>
|
30 |
-
<th>Enlace de descarga</th>
|
31 |
-
</tr>
|
32 |
-
<tr>
|
33 |
-
<td>Administrador de cuentas de Google</td>
|
34 |
-
<td><a href="></a></td>
|
35 |
-
</tr>
|
36 |
-
<tr>
|
37 |
-
<td>Marco de servicios de Google</td>
|
38 |
-
<td><a href="></a></td>
|
39 |
-
</tr>
|
40 |
-
<tr>
|
41 |
-
<td>Servicios de Google Play</td>
|
42 |
-
<td><a href="></a></td>
|
43 |
-
</tr>
|
44 |
-
<tr>
|
45 |
-
<td>Google Play Store</td>
|
46 |
-
<td><a href="></a></td>
|
47 |
-
</tr>
|
48 |
-
</tabla>
|
49 |
-
<h3>Instalar los archivos APK en orden</h3>
|
50 |
-
<p>El segundo paso para instalar Google Play Store en su tableta es instalar los archivos APK en orden. Esto es importante porque cada archivo depende del anterior. Para instalar los archivos APK, abra su aplicación de administrador de archivos y vaya a la carpeta Descargas. Pulse en cada archivo y siga las instrucciones para instalarlo. Es posible que necesite conceder algunos permisos o ignorar algunas advertencias durante el proceso de instalación. Asegúrate de instalar los archivos en este orden: Google Account Manager, Google Services Framework, Google Play Services y Google Play Store.</p>
|
51 |
-
<h3>Reinicie su tableta e inicie sesión en Google Play Store</h3>
|
52 |
-
<p>El paso final para instalar Google Play Store en su tableta es reiniciar su tableta e iniciar sesión en Google Play Store. Esto es necesario para activar los servicios y aplicaciones de Google en su dispositivo. Para reiniciar su tableta, mantenga pulsado el botón de encendido y toque en Reiniciar. Espere a que su tableta se reinicie y luego deslice hacia abajo desde la parte superior de la pantalla. Deberías ver una notificación que dice "Google Play Services no se ejecutará a menos que actualices Google Play Services". Toca esta notificación y luego toca Actualizar. Espera a que termine la actualización y luego abre Google Play Store. Se le pedirá que inicie sesión con su cuenta de Google o cree una nueva si no tiene una. Después de iniciar sesión, puede comenzar a usar Google Play Store en su tableta. </p>
|
53 |
-
|
54 |
-
<p>Si encuentra algún problema al instalar o usar Google Play Store en su tableta, aquí hay algunos consejos para solucionar problemas que podrían ayudar:</p>
|
55 |
-
<h3>Actualizar la versión del sistema operativo Fire</h3>
|
56 |
-
<p>Si tiene una versión antigua de Fire OS, es posible que tenga que actualizarlo antes de instalar Google Play Store en su tableta. La actualización de su versión de Fire OS puede solucionar algunos problemas de compatibilidad y mejorar el rendimiento de su dispositivo. Para actualizar la versión de Fire OS, vaya a Configuración > Opciones de dispositivo > Actualizaciones del sistema. Toque en Comprobar ahora y luego toque en Actualizar si hay una nueva versión disponible. Espere a que termine la actualización y luego intente instalar Google Play Store de nuevo. </p>
|
57 |
-
<h3>Borrar caché y datos de Google Apps</h3>
|
58 |
-
<h3>Borrar caché y datos de Google Apps</h3>
|
59 |
-
<p>Si tiene problemas para iniciar sesión en Google Play Store o el uso de aplicaciones de Google en su tableta, es posible que tenga que borrar la caché y los datos de estas aplicaciones. Limpiar la caché y los datos puede corregir algunos errores y fallas que pueden ocurrir debido a archivos dañados o desactualizados. Para borrar la caché y los datos de las aplicaciones de Google, ve a Configuración > Aplicaciones y notificaciones > Administrar todas las aplicaciones. Toque en cada aplicación de Google y luego toque en Almacenamiento. Toque en Borrar caché y luego toque en Borrar datos. Repita esto para cada aplicación de Google y luego intente usarlas de nuevo. </p>
|
60 |
-
<h3>Desinstalar y reinstalar Google Play Store</h3>
|
61 |
-
<p>Si ninguno de los consejos anteriores funciona, es posible que tenga que desinstalar y reinstalar Google Play Store en su tableta. Desinstalar y reinstalar Google Play Store puede restablecer sus ajustes y solucionar algunos problemas que pueden impedir que funcione correctamente. Para desinstalar Google Play Store, ve a Configuración > Aplicaciones y notificaciones > Administrar todas las aplicaciones. Toca en Google Play Store y luego toca en Desinstalar. Espere a que termine la desinstalación y luego descargue e instale Google Play Store nuevamente siguiendo los pasos anteriores. </p>
|
62 |
-
<h2>Conclusión</h2>
|
63 |
-
|
64 |
-
<h2>Preguntas frecuentes</h2>
|
65 |
-
<p>Aquí hay algunas preguntas frecuentes sobre la descarga de Google Play Store en su tableta:</p>
|
66 |
-
<h3>¿Es seguro instalar Google Play Store en mi tableta? </h3>
|
67 |
-
<p>Sí, es seguro instalar Google Play Store en su tableta, siempre y cuando descargue los archivos APK de una fuente de confianza, como APKMirror. También debe escanear los archivos APK con una aplicación de seguridad antes de instalarlos para asegurarse de que están libres de malware o virus. </p>
|
68 |
-
<h3>¿La instalación de Google Play Store anulará mi garantía o afectará mis servicios de Amazon? </h3>
|
69 |
-
<p>No, instalar Google Play Store no anulará su garantía ni afectará a sus servicios de Amazon. Todavía puede utilizar su cuenta de Amazon, membresía Prime, Alexa, Kindle, Audible, y otros servicios de Amazon en su tableta después de instalar Google Play Store.</p>
|
70 |
-
<h3>¿Puedo desinstalar Google Play Store si no me gusta o quiero volver a la configuración original? </h3>
|
71 |
-
<p>Sí, puedes desinstalar Google Play Store si no te gusta o quieres volver a la configuración original. Para desinstalar Google Play Store, siga los mismos pasos anteriores pero en orden inverso. Primero, desinstala Google Play Store, luego Google Play Services, luego Google Services Framework y luego Google Account Manager. También puede desactivar las aplicaciones de fuentes desconocidas e insertar la tarjeta SD de nuevo si se elimina. </p>
|
72 |
-
<h3>¿Cómo puedo actualizar las aplicaciones de Google Play Store y Google en mi tableta? </h3>
|
73 |
-
<p>Puede actualizar Google Play Store y las aplicaciones de Google en su tableta abriendo Google Play Store y tocando el icono del menú en la esquina superior izquierda. Luego, toca Mis aplicaciones y juegos y luego toca Actualizar todo. También puede comprobar las actualizaciones manualmente tocando en cada aplicación y luego tocando en Actualizar si hay una nueva versión disponible. </p>
|
74 |
-
<h3>¿Cuáles son algunas de las mejores aplicaciones y juegos que puedo descargar de Google Play Store en mi tableta? </h3> 64aa2da5cf<br />
|
75 |
-
<br />
|
76 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Como Hacer Un Disco Duro.md
DELETED
@@ -1,56 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Windows 10 USB DVD Herramienta de descarga: ¿Qué es y cómo usarlo</h1>
|
3 |
-
<h2>Introducción</h2>
|
4 |
-
<p>Si desea instalar Windows 10 en su computadora, tiene dos opciones: puede actualizar desde un sistema operativo existente o puede crear un medio de arranque (como una unidad flash USB o un DVD) e instalarlo desde cero. En este artículo, nos centraremos en la segunda opción y le mostraremos cómo usar la herramienta de descarga de DVD USB de Windows 10 para crear su propio medio de instalación. </p>
|
5 |
-
<h2>como hacer un disco duro</h2><br /><p><b><b>Download Zip</b> ✅ <a href="https://bltlly.com/2v6JtQ">https://bltlly.com/2v6JtQ</a></b></p><br /><br />
|
6 |
-
<h3>¿Qué es la herramienta de descarga de DVD USB de Windows 10? </h3>
|
7 |
-
<p>Windows 10 USB DVD Download Tool es un software gratuito que te permite crear un medio de arranque desde un archivo ISO. Un archivo ISO es un único archivo que contiene todos los archivos de instalación de Windows en un formato comprimido. Puede descargar un archivo ISO desde el sitio web de Microsoft o desde otras fuentes. La herramienta luego copiará el archivo ISO a su medio elegido y lo hará arrancable, para que pueda instalar Windows 10 en su computadora sin tener que ejecutar un sistema operativo existente. </p>
|
8 |
-
<h3>¿Por qué necesita la herramienta de descarga de DVD USB de Windows 10? </h3>
|
9 |
-
<p>Es posible que necesite Windows 10 USB DVD Download Tool por varias razones, tales como:</p>
|
10 |
-
<ul>
|
11 |
-
<li> Desea realizar una instalación limpia de Windows 10, lo que significa eliminar todos sus datos y configuraciones anteriores y comenzar de nuevo. </li>
|
12 |
-
<li> Desea instalar Windows 10 en un equipo diferente al que está utilizando actualmente. </li>
|
13 |
-
<li> Desea tener una copia de seguridad de Windows 10 en caso de que algo vaya mal con su computadora o su sistema operativo. </li>
|
14 |
-
<li> Desea probar Windows 10 antes de comprometerse con él. </li>
|
15 |
-
</ul>
|
16 |
-
<p>En cualquiera de estos casos, tener un medio de arranque le permitirá instalar Windows 10 fácil y rápidamente. </p>
|
17 |
-
<h2>Cómo descargar la herramienta de descarga de Windows 10 USB DVD</h2>
|
18 |
-
<p>Para descargar Windows 10 USB DVD Download Tool, siga estos pasos:</p>
|
19 |
-
<p></p>
|
20 |
-
<h3>Paso 1: Ir al sitio web de Microsoft</h3>
|
21 |
-
|
22 |
-
<h3>Paso 2: Haga clic en el botón de descarga</h3>
|
23 |
-
<p>Un archivo llamado "MediaCreationTool.exe" comenzará a descargarse. Guárdelo en su ubicación preferida en su computadora. Este archivo tiene un tamaño de unos 18 MB y debería tardar solo unos minutos en descargarse. </p>
|
24 |
-
<h3>Paso 3: Ejecute el archivo de configuración</h3>
|
25 |
-
<p>Una vez completada la descarga, haga doble clic en el archivo para ejecutarlo. Puede ver un aviso de Control de cuentas de usuario pidiendo permiso para realizar cambios en su dispositivo. Haga clic en "Sí" para continuar. La herramienta abrirá y le mostrará algunos términos de licencia. Léalos cuidadosamente y haga clic en "Aceptar" si está de acuerdo con ellos. </p>
|
26 |
-
<h2>Cómo usar la herramienta de descarga de DVD USB de Windows 10</h2>
|
27 |
-
<p>Para usar la herramienta de descarga de DVD USB de Windows 10, siga estos pasos:</p>
|
28 |
-
<h3>Paso 1: Inserte una unidad flash USB o un DVD</h3>
|
29 |
-
<p>Necesitará una unidad flash USB con al menos 8 GB de espacio o un DVD en blanco. Insértelo en el puerto o unidad de su computadora. Asegúrese de que ha realizado una copia de seguridad de los datos importantes en los medios, ya que se borrará durante el proceso. </p>
|
30 |
-
<h3>Paso 2: Inicie la herramienta y busque el archivo ISO</h3>
|
31 |
-
<p>Vuelve a la herramienta y haz clic en "Siguiente". La herramienta te preguntará qué quieres hacer. Elija la opción "Crear medios de instalación (unidad flash USB, DVD o archivo ISO) para otro PC" y haga clic en "Siguiente". La herramienta le pedirá que seleccione el idioma, la edición y la arquitectura de Windows 10 que desea instalar. Puede utilizar las opciones recomendadas en función de su PC actual, o puede cambiarlas según sus preferencias. Haga clic en "Siguiente" cuando haya terminado. La herramienta le pedirá que elija qué medio usar. Seleccione "archivo ISO" y haga clic en "Siguiente". La herramienta le pedirá que busque la ubicación donde desea guardar el archivo ISO. Elija una carpeta en su computadora y haga clic en "Guardar". La herramienta comenzará a descargar el archivo ISO de Windows 10, que es de aproximadamente 4 GB de tamaño y puede tomar algún tiempo dependiendo de su velocidad de Internet. </p>
|
32 |
-
|
33 |
-
<p>Una vez completada la descarga, la herramienta le pedirá que elija un tipo de medio. Seleccione "unidad flash USB" o "DVD" dependiendo de lo que haya insertado en el paso 1. La herramienta le mostrará una lista de unidades disponibles. Seleccione el que corresponda a su medio y haga clic en "Siguiente". La herramienta le advertirá que todo lo que esté en la unidad se eliminará. Haga clic en "OK" para confirmar. La herramienta comenzará a copiar el archivo ISO a su medio y lo hará arrancable. Esto también puede tomar algún tiempo dependiendo de la velocidad de sus medios. Cuando termine el proceso, la herramienta le mostrará un mensaje diciendo que su medio de arranque está listo. Haga clic en "Finalizar" para cerrar la herramienta. </p>
|
34 |
-
<h2>Conclusión</h2>
|
35 |
-
<p>Ha creado con éxito un medio de arranque utilizando Windows 10 USB DVD Download Tool. Ahora puede usarlo para instalar Windows 10 en su computadora u otro PC. Para ello, debe cambiar el orden de arranque en la configuración del BIOS y seleccionar el medio como primer dispositivo de arranque. Luego, siga las instrucciones en la pantalla para completar la instalación. </p>
|
36 |
-
<h3>Resumen de los puntos principales</h3>
|
37 |
-
<p>En este artículo, hemos explicado lo que es Windows 10 USB DVD Download Tool y por qué puede necesitarlo. También le hemos mostrado cómo descargarlo y usarlo para crear un medio de arranque desde un archivo ISO. Esperamos que este artículo haya sido útil e informativo para usted. </p>
|
38 |
-
<h3>Llamada a la acción y retroalimentación</h3>
|
39 |
-
<p>Si tiene alguna pregunta o comentario sobre Windows 10 USB DVD Download Tool o este artículo, no dude en dejarlos a continuación. Nos encantaría saber de ti y ayudarte. Además, si te gustó este artículo, por favor compártelo con tus amigos y familiares que puedan encontrarlo útil. ¡Gracias por leer! </p>
|
40 |
-
<h2>Preguntas frecuentes</h2>
|
41 |
-
<h4>Q: ¿Cuál es la diferencia entre un archivo ISO y un medio de arranque? </h4>
|
42 |
-
|
43 |
-
<h4>Q: ¿Dónde puedo descargar un archivo ISO para Windows 10? </h4>
|
44 |
-
<p>A: Puede descargar un archivo ISO para Windows 10 desde la página de descarga <a href="">software</a> en el sitio web de Microsoft o desde otras fuentes. Sin embargo, asegúrese de descargar un archivo ISO genuino y verificado de una fuente confiable, ya que algunos archivos ISO pueden contener virus o malware. </p>
|
45 |
-
<h4>Q: ¿Puedo usar la herramienta de descarga de DVD USB de Windows 10 para otras versiones de Windows? </h4>
|
46 |
-
<p>A: No, Windows 10 USB DVD Download Tool está diseñado específicamente para Windows 10. Si desea crear un medio de arranque para otras versiones de Windows, como Windows 7 o Windows 8.1, debe usar diferentes herramientas, como <a href="">Windows USB/DVD Download Tool</a> o <a href="">Rufus</a>. </p>
|
47 |
-
<h4>Q: ¿Puedo utilizar la herramienta de descarga de DVD USB de Windows 10 para otros fines que instalar Windows? </h4>
|
48 |
-
<p>A: Sí, puede usar la herramienta de descarga de DVD USB de Windows 10 para fines distintos de instalar Windows, como reparar o restaurar su sistema, acceder a opciones avanzadas o solucionar problemas. Para hacerlo, debe arrancar desde su medio y seleccionar la opción "Reparar su computadora" en la primera pantalla. Luego, puede elegir entre varias opciones, como "Reparación de inicio", "Restaurar sistema", "Recuperación de imagen del sistema", "Símbolo del sistema" o "Volver a la versión anterior". </p>
|
49 |
-
<h4>Q: ¿Cómo puedo eliminar el archivo ISO y los medios de arranque después de instalar Windows? </h4>
|
50 |
-
<p>A: Si desea eliminar el archivo ISO y los medios de arranque después de instalar Windows, puede hacerlo siguiendo estos pasos:</p>
|
51 |
-
<ul>
|
52 |
-
<li>Para eliminar el archivo ISO, simplemente busque en su computadora y bórrelo como cualquier otro archivo. También puede usar una herramienta de limpieza de discos para eliminar cualquier archivo temporal que se haya creado durante la descarga. </li>
|
53 |
-
|
54 |
-
</ul></p> 64aa2da5cf<br />
|
55 |
-
<br />
|
56 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/BetterAPI/BetterChat_new/src/lib/switchTheme.ts
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
export function switchTheme() {
|
2 |
-
const { classList } = document.querySelector("html") as HTMLElement;
|
3 |
-
if (classList.contains("dark")) {
|
4 |
-
classList.remove("dark");
|
5 |
-
localStorage.theme = "light";
|
6 |
-
} else {
|
7 |
-
classList.add("dark");
|
8 |
-
localStorage.theme = "dark";
|
9 |
-
}
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_internal/models/installation_report.py
DELETED
@@ -1,53 +0,0 @@
|
|
1 |
-
from typing import Any, Dict, Sequence
|
2 |
-
|
3 |
-
from pip._vendor.packaging.markers import default_environment
|
4 |
-
|
5 |
-
from pip import __version__
|
6 |
-
from pip._internal.req.req_install import InstallRequirement
|
7 |
-
|
8 |
-
|
9 |
-
class InstallationReport:
|
10 |
-
def __init__(self, install_requirements: Sequence[InstallRequirement]):
|
11 |
-
self._install_requirements = install_requirements
|
12 |
-
|
13 |
-
@classmethod
|
14 |
-
def _install_req_to_dict(cls, ireq: InstallRequirement) -> Dict[str, Any]:
|
15 |
-
assert ireq.download_info, f"No download_info for {ireq}"
|
16 |
-
res = {
|
17 |
-
# PEP 610 json for the download URL. download_info.archive_info.hashes may
|
18 |
-
# be absent when the requirement was installed from the wheel cache
|
19 |
-
# and the cache entry was populated by an older pip version that did not
|
20 |
-
# record origin.json.
|
21 |
-
"download_info": ireq.download_info.to_dict(),
|
22 |
-
# is_direct is true if the requirement was a direct URL reference (which
|
23 |
-
# includes editable requirements), and false if the requirement was
|
24 |
-
# downloaded from a PEP 503 index or --find-links.
|
25 |
-
"is_direct": bool(ireq.original_link),
|
26 |
-
# requested is true if the requirement was specified by the user (aka
|
27 |
-
# top level requirement), and false if it was installed as a dependency of a
|
28 |
-
# requirement. https://peps.python.org/pep-0376/#requested
|
29 |
-
"requested": ireq.user_supplied,
|
30 |
-
# PEP 566 json encoding for metadata
|
31 |
-
# https://www.python.org/dev/peps/pep-0566/#json-compatible-metadata
|
32 |
-
"metadata": ireq.get_dist().metadata_dict,
|
33 |
-
}
|
34 |
-
if ireq.user_supplied and ireq.extras:
|
35 |
-
# For top level requirements, the list of requested extras, if any.
|
36 |
-
res["requested_extras"] = list(sorted(ireq.extras))
|
37 |
-
return res
|
38 |
-
|
39 |
-
def to_dict(self) -> Dict[str, Any]:
|
40 |
-
return {
|
41 |
-
"version": "1",
|
42 |
-
"pip_version": __version__,
|
43 |
-
"install": [
|
44 |
-
self._install_req_to_dict(ireq) for ireq in self._install_requirements
|
45 |
-
],
|
46 |
-
# https://peps.python.org/pep-0508/#environment-markers
|
47 |
-
# TODO: currently, the resolver uses the default environment to evaluate
|
48 |
-
# environment markers, so that is what we report here. In the future, it
|
49 |
-
# should also take into account options such as --python-version or
|
50 |
-
# --platform, perhaps under the form of an environment_override field?
|
51 |
-
# https://github.com/pypa/pip/issues/11198
|
52 |
-
"environment": default_environment(),
|
53 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/pygments/formatters/groff.py
DELETED
@@ -1,170 +0,0 @@
|
|
1 |
-
"""
|
2 |
-
pygments.formatters.groff
|
3 |
-
~~~~~~~~~~~~~~~~~~~~~~~~~
|
4 |
-
|
5 |
-
Formatter for groff output.
|
6 |
-
|
7 |
-
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
|
8 |
-
:license: BSD, see LICENSE for details.
|
9 |
-
"""
|
10 |
-
|
11 |
-
import math
|
12 |
-
from pip._vendor.pygments.formatter import Formatter
|
13 |
-
from pip._vendor.pygments.util import get_bool_opt, get_int_opt
|
14 |
-
|
15 |
-
__all__ = ['GroffFormatter']
|
16 |
-
|
17 |
-
|
18 |
-
class GroffFormatter(Formatter):
|
19 |
-
"""
|
20 |
-
Format tokens with groff escapes to change their color and font style.
|
21 |
-
|
22 |
-
.. versionadded:: 2.11
|
23 |
-
|
24 |
-
Additional options accepted:
|
25 |
-
|
26 |
-
`style`
|
27 |
-
The style to use, can be a string or a Style subclass (default:
|
28 |
-
``'default'``).
|
29 |
-
|
30 |
-
`monospaced`
|
31 |
-
If set to true, monospace font will be used (default: ``true``).
|
32 |
-
|
33 |
-
`linenos`
|
34 |
-
If set to true, print the line numbers (default: ``false``).
|
35 |
-
|
36 |
-
`wrap`
|
37 |
-
Wrap lines to the specified number of characters. Disabled if set to 0
|
38 |
-
(default: ``0``).
|
39 |
-
"""
|
40 |
-
|
41 |
-
name = 'groff'
|
42 |
-
aliases = ['groff','troff','roff']
|
43 |
-
filenames = []
|
44 |
-
|
45 |
-
def __init__(self, **options):
|
46 |
-
Formatter.__init__(self, **options)
|
47 |
-
|
48 |
-
self.monospaced = get_bool_opt(options, 'monospaced', True)
|
49 |
-
self.linenos = get_bool_opt(options, 'linenos', False)
|
50 |
-
self._lineno = 0
|
51 |
-
self.wrap = get_int_opt(options, 'wrap', 0)
|
52 |
-
self._linelen = 0
|
53 |
-
|
54 |
-
self.styles = {}
|
55 |
-
self._make_styles()
|
56 |
-
|
57 |
-
|
58 |
-
def _make_styles(self):
|
59 |
-
regular = '\\f[CR]' if self.monospaced else '\\f[R]'
|
60 |
-
bold = '\\f[CB]' if self.monospaced else '\\f[B]'
|
61 |
-
italic = '\\f[CI]' if self.monospaced else '\\f[I]'
|
62 |
-
|
63 |
-
for ttype, ndef in self.style:
|
64 |
-
start = end = ''
|
65 |
-
if ndef['color']:
|
66 |
-
start += '\\m[%s]' % ndef['color']
|
67 |
-
end = '\\m[]' + end
|
68 |
-
if ndef['bold']:
|
69 |
-
start += bold
|
70 |
-
end = regular + end
|
71 |
-
if ndef['italic']:
|
72 |
-
start += italic
|
73 |
-
end = regular + end
|
74 |
-
if ndef['bgcolor']:
|
75 |
-
start += '\\M[%s]' % ndef['bgcolor']
|
76 |
-
end = '\\M[]' + end
|
77 |
-
|
78 |
-
self.styles[ttype] = start, end
|
79 |
-
|
80 |
-
|
81 |
-
def _define_colors(self, outfile):
|
82 |
-
colors = set()
|
83 |
-
for _, ndef in self.style:
|
84 |
-
if ndef['color'] is not None:
|
85 |
-
colors.add(ndef['color'])
|
86 |
-
|
87 |
-
for color in colors:
|
88 |
-
outfile.write('.defcolor ' + color + ' rgb #' + color + '\n')
|
89 |
-
|
90 |
-
|
91 |
-
def _write_lineno(self, outfile):
|
92 |
-
self._lineno += 1
|
93 |
-
outfile.write("%s% 4d " % (self._lineno != 1 and '\n' or '', self._lineno))
|
94 |
-
|
95 |
-
|
96 |
-
def _wrap_line(self, line):
|
97 |
-
length = len(line.rstrip('\n'))
|
98 |
-
space = ' ' if self.linenos else ''
|
99 |
-
newline = ''
|
100 |
-
|
101 |
-
if length > self.wrap:
|
102 |
-
for i in range(0, math.floor(length / self.wrap)):
|
103 |
-
chunk = line[i*self.wrap:i*self.wrap+self.wrap]
|
104 |
-
newline += (chunk + '\n' + space)
|
105 |
-
remainder = length % self.wrap
|
106 |
-
if remainder > 0:
|
107 |
-
newline += line[-remainder-1:]
|
108 |
-
self._linelen = remainder
|
109 |
-
elif self._linelen + length > self.wrap:
|
110 |
-
newline = ('\n' + space) + line
|
111 |
-
self._linelen = length
|
112 |
-
else:
|
113 |
-
newline = line
|
114 |
-
self._linelen += length
|
115 |
-
|
116 |
-
return newline
|
117 |
-
|
118 |
-
|
119 |
-
def _escape_chars(self, text):
|
120 |
-
text = text.replace('\\', '\\[u005C]'). \
|
121 |
-
replace('.', '\\[char46]'). \
|
122 |
-
replace('\'', '\\[u0027]'). \
|
123 |
-
replace('`', '\\[u0060]'). \
|
124 |
-
replace('~', '\\[u007E]')
|
125 |
-
copy = text
|
126 |
-
|
127 |
-
for char in copy:
|
128 |
-
if len(char) != len(char.encode()):
|
129 |
-
uni = char.encode('unicode_escape') \
|
130 |
-
.decode()[1:] \
|
131 |
-
.replace('x', 'u00') \
|
132 |
-
.upper()
|
133 |
-
text = text.replace(char, '\\[u' + uni[1:] + ']')
|
134 |
-
|
135 |
-
return text
|
136 |
-
|
137 |
-
|
138 |
-
def format_unencoded(self, tokensource, outfile):
|
139 |
-
self._define_colors(outfile)
|
140 |
-
|
141 |
-
outfile.write('.nf\n\\f[CR]\n')
|
142 |
-
|
143 |
-
if self.linenos:
|
144 |
-
self._write_lineno(outfile)
|
145 |
-
|
146 |
-
for ttype, value in tokensource:
|
147 |
-
while ttype not in self.styles:
|
148 |
-
ttype = ttype.parent
|
149 |
-
start, end = self.styles[ttype]
|
150 |
-
|
151 |
-
for line in value.splitlines(True):
|
152 |
-
if self.wrap > 0:
|
153 |
-
line = self._wrap_line(line)
|
154 |
-
|
155 |
-
if start and end:
|
156 |
-
text = self._escape_chars(line.rstrip('\n'))
|
157 |
-
if text != '':
|
158 |
-
outfile.write(''.join((start, text, end)))
|
159 |
-
else:
|
160 |
-
outfile.write(self._escape_chars(line.rstrip('\n')))
|
161 |
-
|
162 |
-
if line.endswith('\n'):
|
163 |
-
if self.linenos:
|
164 |
-
self._write_lineno(outfile)
|
165 |
-
self._linelen = 0
|
166 |
-
else:
|
167 |
-
outfile.write('\n')
|
168 |
-
self._linelen = 0
|
169 |
-
|
170 |
-
outfile.write('\n.fi')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/setuptools/_vendor/jaraco/functools.py
DELETED
@@ -1,525 +0,0 @@
|
|
1 |
-
import functools
|
2 |
-
import time
|
3 |
-
import inspect
|
4 |
-
import collections
|
5 |
-
import types
|
6 |
-
import itertools
|
7 |
-
|
8 |
-
import setuptools.extern.more_itertools
|
9 |
-
|
10 |
-
from typing import Callable, TypeVar
|
11 |
-
|
12 |
-
|
13 |
-
CallableT = TypeVar("CallableT", bound=Callable[..., object])
|
14 |
-
|
15 |
-
|
16 |
-
def compose(*funcs):
|
17 |
-
"""
|
18 |
-
Compose any number of unary functions into a single unary function.
|
19 |
-
|
20 |
-
>>> import textwrap
|
21 |
-
>>> expected = str.strip(textwrap.dedent(compose.__doc__))
|
22 |
-
>>> strip_and_dedent = compose(str.strip, textwrap.dedent)
|
23 |
-
>>> strip_and_dedent(compose.__doc__) == expected
|
24 |
-
True
|
25 |
-
|
26 |
-
Compose also allows the innermost function to take arbitrary arguments.
|
27 |
-
|
28 |
-
>>> round_three = lambda x: round(x, ndigits=3)
|
29 |
-
>>> f = compose(round_three, int.__truediv__)
|
30 |
-
>>> [f(3*x, x+1) for x in range(1,10)]
|
31 |
-
[1.5, 2.0, 2.25, 2.4, 2.5, 2.571, 2.625, 2.667, 2.7]
|
32 |
-
"""
|
33 |
-
|
34 |
-
def compose_two(f1, f2):
|
35 |
-
return lambda *args, **kwargs: f1(f2(*args, **kwargs))
|
36 |
-
|
37 |
-
return functools.reduce(compose_two, funcs)
|
38 |
-
|
39 |
-
|
40 |
-
def method_caller(method_name, *args, **kwargs):
|
41 |
-
"""
|
42 |
-
Return a function that will call a named method on the
|
43 |
-
target object with optional positional and keyword
|
44 |
-
arguments.
|
45 |
-
|
46 |
-
>>> lower = method_caller('lower')
|
47 |
-
>>> lower('MyString')
|
48 |
-
'mystring'
|
49 |
-
"""
|
50 |
-
|
51 |
-
def call_method(target):
|
52 |
-
func = getattr(target, method_name)
|
53 |
-
return func(*args, **kwargs)
|
54 |
-
|
55 |
-
return call_method
|
56 |
-
|
57 |
-
|
58 |
-
def once(func):
|
59 |
-
"""
|
60 |
-
Decorate func so it's only ever called the first time.
|
61 |
-
|
62 |
-
This decorator can ensure that an expensive or non-idempotent function
|
63 |
-
will not be expensive on subsequent calls and is idempotent.
|
64 |
-
|
65 |
-
>>> add_three = once(lambda a: a+3)
|
66 |
-
>>> add_three(3)
|
67 |
-
6
|
68 |
-
>>> add_three(9)
|
69 |
-
6
|
70 |
-
>>> add_three('12')
|
71 |
-
6
|
72 |
-
|
73 |
-
To reset the stored value, simply clear the property ``saved_result``.
|
74 |
-
|
75 |
-
>>> del add_three.saved_result
|
76 |
-
>>> add_three(9)
|
77 |
-
12
|
78 |
-
>>> add_three(8)
|
79 |
-
12
|
80 |
-
|
81 |
-
Or invoke 'reset()' on it.
|
82 |
-
|
83 |
-
>>> add_three.reset()
|
84 |
-
>>> add_three(-3)
|
85 |
-
0
|
86 |
-
>>> add_three(0)
|
87 |
-
0
|
88 |
-
"""
|
89 |
-
|
90 |
-
@functools.wraps(func)
|
91 |
-
def wrapper(*args, **kwargs):
|
92 |
-
if not hasattr(wrapper, 'saved_result'):
|
93 |
-
wrapper.saved_result = func(*args, **kwargs)
|
94 |
-
return wrapper.saved_result
|
95 |
-
|
96 |
-
wrapper.reset = lambda: vars(wrapper).__delitem__('saved_result')
|
97 |
-
return wrapper
|
98 |
-
|
99 |
-
|
100 |
-
def method_cache(
|
101 |
-
method: CallableT,
|
102 |
-
cache_wrapper: Callable[
|
103 |
-
[CallableT], CallableT
|
104 |
-
] = functools.lru_cache(), # type: ignore[assignment]
|
105 |
-
) -> CallableT:
|
106 |
-
"""
|
107 |
-
Wrap lru_cache to support storing the cache data in the object instances.
|
108 |
-
|
109 |
-
Abstracts the common paradigm where the method explicitly saves an
|
110 |
-
underscore-prefixed protected property on first call and returns that
|
111 |
-
subsequently.
|
112 |
-
|
113 |
-
>>> class MyClass:
|
114 |
-
... calls = 0
|
115 |
-
...
|
116 |
-
... @method_cache
|
117 |
-
... def method(self, value):
|
118 |
-
... self.calls += 1
|
119 |
-
... return value
|
120 |
-
|
121 |
-
>>> a = MyClass()
|
122 |
-
>>> a.method(3)
|
123 |
-
3
|
124 |
-
>>> for x in range(75):
|
125 |
-
... res = a.method(x)
|
126 |
-
>>> a.calls
|
127 |
-
75
|
128 |
-
|
129 |
-
Note that the apparent behavior will be exactly like that of lru_cache
|
130 |
-
except that the cache is stored on each instance, so values in one
|
131 |
-
instance will not flush values from another, and when an instance is
|
132 |
-
deleted, so are the cached values for that instance.
|
133 |
-
|
134 |
-
>>> b = MyClass()
|
135 |
-
>>> for x in range(35):
|
136 |
-
... res = b.method(x)
|
137 |
-
>>> b.calls
|
138 |
-
35
|
139 |
-
>>> a.method(0)
|
140 |
-
0
|
141 |
-
>>> a.calls
|
142 |
-
75
|
143 |
-
|
144 |
-
Note that if method had been decorated with ``functools.lru_cache()``,
|
145 |
-
a.calls would have been 76 (due to the cached value of 0 having been
|
146 |
-
flushed by the 'b' instance).
|
147 |
-
|
148 |
-
Clear the cache with ``.cache_clear()``
|
149 |
-
|
150 |
-
>>> a.method.cache_clear()
|
151 |
-
|
152 |
-
Same for a method that hasn't yet been called.
|
153 |
-
|
154 |
-
>>> c = MyClass()
|
155 |
-
>>> c.method.cache_clear()
|
156 |
-
|
157 |
-
Another cache wrapper may be supplied:
|
158 |
-
|
159 |
-
>>> cache = functools.lru_cache(maxsize=2)
|
160 |
-
>>> MyClass.method2 = method_cache(lambda self: 3, cache_wrapper=cache)
|
161 |
-
>>> a = MyClass()
|
162 |
-
>>> a.method2()
|
163 |
-
3
|
164 |
-
|
165 |
-
Caution - do not subsequently wrap the method with another decorator, such
|
166 |
-
as ``@property``, which changes the semantics of the function.
|
167 |
-
|
168 |
-
See also
|
169 |
-
http://code.activestate.com/recipes/577452-a-memoize-decorator-for-instance-methods/
|
170 |
-
for another implementation and additional justification.
|
171 |
-
"""
|
172 |
-
|
173 |
-
def wrapper(self: object, *args: object, **kwargs: object) -> object:
|
174 |
-
# it's the first call, replace the method with a cached, bound method
|
175 |
-
bound_method: CallableT = types.MethodType( # type: ignore[assignment]
|
176 |
-
method, self
|
177 |
-
)
|
178 |
-
cached_method = cache_wrapper(bound_method)
|
179 |
-
setattr(self, method.__name__, cached_method)
|
180 |
-
return cached_method(*args, **kwargs)
|
181 |
-
|
182 |
-
# Support cache clear even before cache has been created.
|
183 |
-
wrapper.cache_clear = lambda: None # type: ignore[attr-defined]
|
184 |
-
|
185 |
-
return ( # type: ignore[return-value]
|
186 |
-
_special_method_cache(method, cache_wrapper) or wrapper
|
187 |
-
)
|
188 |
-
|
189 |
-
|
190 |
-
def _special_method_cache(method, cache_wrapper):
|
191 |
-
"""
|
192 |
-
Because Python treats special methods differently, it's not
|
193 |
-
possible to use instance attributes to implement the cached
|
194 |
-
methods.
|
195 |
-
|
196 |
-
Instead, install the wrapper method under a different name
|
197 |
-
and return a simple proxy to that wrapper.
|
198 |
-
|
199 |
-
https://github.com/jaraco/jaraco.functools/issues/5
|
200 |
-
"""
|
201 |
-
name = method.__name__
|
202 |
-
special_names = '__getattr__', '__getitem__'
|
203 |
-
if name not in special_names:
|
204 |
-
return
|
205 |
-
|
206 |
-
wrapper_name = '__cached' + name
|
207 |
-
|
208 |
-
def proxy(self, *args, **kwargs):
|
209 |
-
if wrapper_name not in vars(self):
|
210 |
-
bound = types.MethodType(method, self)
|
211 |
-
cache = cache_wrapper(bound)
|
212 |
-
setattr(self, wrapper_name, cache)
|
213 |
-
else:
|
214 |
-
cache = getattr(self, wrapper_name)
|
215 |
-
return cache(*args, **kwargs)
|
216 |
-
|
217 |
-
return proxy
|
218 |
-
|
219 |
-
|
220 |
-
def apply(transform):
|
221 |
-
"""
|
222 |
-
Decorate a function with a transform function that is
|
223 |
-
invoked on results returned from the decorated function.
|
224 |
-
|
225 |
-
>>> @apply(reversed)
|
226 |
-
... def get_numbers(start):
|
227 |
-
... "doc for get_numbers"
|
228 |
-
... return range(start, start+3)
|
229 |
-
>>> list(get_numbers(4))
|
230 |
-
[6, 5, 4]
|
231 |
-
>>> get_numbers.__doc__
|
232 |
-
'doc for get_numbers'
|
233 |
-
"""
|
234 |
-
|
235 |
-
def wrap(func):
|
236 |
-
return functools.wraps(func)(compose(transform, func))
|
237 |
-
|
238 |
-
return wrap
|
239 |
-
|
240 |
-
|
241 |
-
def result_invoke(action):
|
242 |
-
r"""
|
243 |
-
Decorate a function with an action function that is
|
244 |
-
invoked on the results returned from the decorated
|
245 |
-
function (for its side-effect), then return the original
|
246 |
-
result.
|
247 |
-
|
248 |
-
>>> @result_invoke(print)
|
249 |
-
... def add_two(a, b):
|
250 |
-
... return a + b
|
251 |
-
>>> x = add_two(2, 3)
|
252 |
-
5
|
253 |
-
>>> x
|
254 |
-
5
|
255 |
-
"""
|
256 |
-
|
257 |
-
def wrap(func):
|
258 |
-
@functools.wraps(func)
|
259 |
-
def wrapper(*args, **kwargs):
|
260 |
-
result = func(*args, **kwargs)
|
261 |
-
action(result)
|
262 |
-
return result
|
263 |
-
|
264 |
-
return wrapper
|
265 |
-
|
266 |
-
return wrap
|
267 |
-
|
268 |
-
|
269 |
-
def call_aside(f, *args, **kwargs):
|
270 |
-
"""
|
271 |
-
Call a function for its side effect after initialization.
|
272 |
-
|
273 |
-
>>> @call_aside
|
274 |
-
... def func(): print("called")
|
275 |
-
called
|
276 |
-
>>> func()
|
277 |
-
called
|
278 |
-
|
279 |
-
Use functools.partial to pass parameters to the initial call
|
280 |
-
|
281 |
-
>>> @functools.partial(call_aside, name='bingo')
|
282 |
-
... def func(name): print("called with", name)
|
283 |
-
called with bingo
|
284 |
-
"""
|
285 |
-
f(*args, **kwargs)
|
286 |
-
return f
|
287 |
-
|
288 |
-
|
289 |
-
class Throttler:
|
290 |
-
"""
|
291 |
-
Rate-limit a function (or other callable)
|
292 |
-
"""
|
293 |
-
|
294 |
-
def __init__(self, func, max_rate=float('Inf')):
|
295 |
-
if isinstance(func, Throttler):
|
296 |
-
func = func.func
|
297 |
-
self.func = func
|
298 |
-
self.max_rate = max_rate
|
299 |
-
self.reset()
|
300 |
-
|
301 |
-
def reset(self):
|
302 |
-
self.last_called = 0
|
303 |
-
|
304 |
-
def __call__(self, *args, **kwargs):
|
305 |
-
self._wait()
|
306 |
-
return self.func(*args, **kwargs)
|
307 |
-
|
308 |
-
def _wait(self):
|
309 |
-
"ensure at least 1/max_rate seconds from last call"
|
310 |
-
elapsed = time.time() - self.last_called
|
311 |
-
must_wait = 1 / self.max_rate - elapsed
|
312 |
-
time.sleep(max(0, must_wait))
|
313 |
-
self.last_called = time.time()
|
314 |
-
|
315 |
-
def __get__(self, obj, type=None):
|
316 |
-
return first_invoke(self._wait, functools.partial(self.func, obj))
|
317 |
-
|
318 |
-
|
319 |
-
def first_invoke(func1, func2):
|
320 |
-
"""
|
321 |
-
Return a function that when invoked will invoke func1 without
|
322 |
-
any parameters (for its side-effect) and then invoke func2
|
323 |
-
with whatever parameters were passed, returning its result.
|
324 |
-
"""
|
325 |
-
|
326 |
-
def wrapper(*args, **kwargs):
|
327 |
-
func1()
|
328 |
-
return func2(*args, **kwargs)
|
329 |
-
|
330 |
-
return wrapper
|
331 |
-
|
332 |
-
|
333 |
-
def retry_call(func, cleanup=lambda: None, retries=0, trap=()):
|
334 |
-
"""
|
335 |
-
Given a callable func, trap the indicated exceptions
|
336 |
-
for up to 'retries' times, invoking cleanup on the
|
337 |
-
exception. On the final attempt, allow any exceptions
|
338 |
-
to propagate.
|
339 |
-
"""
|
340 |
-
attempts = itertools.count() if retries == float('inf') else range(retries)
|
341 |
-
for attempt in attempts:
|
342 |
-
try:
|
343 |
-
return func()
|
344 |
-
except trap:
|
345 |
-
cleanup()
|
346 |
-
|
347 |
-
return func()
|
348 |
-
|
349 |
-
|
350 |
-
def retry(*r_args, **r_kwargs):
|
351 |
-
"""
|
352 |
-
Decorator wrapper for retry_call. Accepts arguments to retry_call
|
353 |
-
except func and then returns a decorator for the decorated function.
|
354 |
-
|
355 |
-
Ex:
|
356 |
-
|
357 |
-
>>> @retry(retries=3)
|
358 |
-
... def my_func(a, b):
|
359 |
-
... "this is my funk"
|
360 |
-
... print(a, b)
|
361 |
-
>>> my_func.__doc__
|
362 |
-
'this is my funk'
|
363 |
-
"""
|
364 |
-
|
365 |
-
def decorate(func):
|
366 |
-
@functools.wraps(func)
|
367 |
-
def wrapper(*f_args, **f_kwargs):
|
368 |
-
bound = functools.partial(func, *f_args, **f_kwargs)
|
369 |
-
return retry_call(bound, *r_args, **r_kwargs)
|
370 |
-
|
371 |
-
return wrapper
|
372 |
-
|
373 |
-
return decorate
|
374 |
-
|
375 |
-
|
376 |
-
def print_yielded(func):
|
377 |
-
"""
|
378 |
-
Convert a generator into a function that prints all yielded elements
|
379 |
-
|
380 |
-
>>> @print_yielded
|
381 |
-
... def x():
|
382 |
-
... yield 3; yield None
|
383 |
-
>>> x()
|
384 |
-
3
|
385 |
-
None
|
386 |
-
"""
|
387 |
-
print_all = functools.partial(map, print)
|
388 |
-
print_results = compose(more_itertools.consume, print_all, func)
|
389 |
-
return functools.wraps(func)(print_results)
|
390 |
-
|
391 |
-
|
392 |
-
def pass_none(func):
|
393 |
-
"""
|
394 |
-
Wrap func so it's not called if its first param is None
|
395 |
-
|
396 |
-
>>> print_text = pass_none(print)
|
397 |
-
>>> print_text('text')
|
398 |
-
text
|
399 |
-
>>> print_text(None)
|
400 |
-
"""
|
401 |
-
|
402 |
-
@functools.wraps(func)
|
403 |
-
def wrapper(param, *args, **kwargs):
|
404 |
-
if param is not None:
|
405 |
-
return func(param, *args, **kwargs)
|
406 |
-
|
407 |
-
return wrapper
|
408 |
-
|
409 |
-
|
410 |
-
def assign_params(func, namespace):
|
411 |
-
"""
|
412 |
-
Assign parameters from namespace where func solicits.
|
413 |
-
|
414 |
-
>>> def func(x, y=3):
|
415 |
-
... print(x, y)
|
416 |
-
>>> assigned = assign_params(func, dict(x=2, z=4))
|
417 |
-
>>> assigned()
|
418 |
-
2 3
|
419 |
-
|
420 |
-
The usual errors are raised if a function doesn't receive
|
421 |
-
its required parameters:
|
422 |
-
|
423 |
-
>>> assigned = assign_params(func, dict(y=3, z=4))
|
424 |
-
>>> assigned()
|
425 |
-
Traceback (most recent call last):
|
426 |
-
TypeError: func() ...argument...
|
427 |
-
|
428 |
-
It even works on methods:
|
429 |
-
|
430 |
-
>>> class Handler:
|
431 |
-
... def meth(self, arg):
|
432 |
-
... print(arg)
|
433 |
-
>>> assign_params(Handler().meth, dict(arg='crystal', foo='clear'))()
|
434 |
-
crystal
|
435 |
-
"""
|
436 |
-
sig = inspect.signature(func)
|
437 |
-
params = sig.parameters.keys()
|
438 |
-
call_ns = {k: namespace[k] for k in params if k in namespace}
|
439 |
-
return functools.partial(func, **call_ns)
|
440 |
-
|
441 |
-
|
442 |
-
def save_method_args(method):
|
443 |
-
"""
|
444 |
-
Wrap a method such that when it is called, the args and kwargs are
|
445 |
-
saved on the method.
|
446 |
-
|
447 |
-
>>> class MyClass:
|
448 |
-
... @save_method_args
|
449 |
-
... def method(self, a, b):
|
450 |
-
... print(a, b)
|
451 |
-
>>> my_ob = MyClass()
|
452 |
-
>>> my_ob.method(1, 2)
|
453 |
-
1 2
|
454 |
-
>>> my_ob._saved_method.args
|
455 |
-
(1, 2)
|
456 |
-
>>> my_ob._saved_method.kwargs
|
457 |
-
{}
|
458 |
-
>>> my_ob.method(a=3, b='foo')
|
459 |
-
3 foo
|
460 |
-
>>> my_ob._saved_method.args
|
461 |
-
()
|
462 |
-
>>> my_ob._saved_method.kwargs == dict(a=3, b='foo')
|
463 |
-
True
|
464 |
-
|
465 |
-
The arguments are stored on the instance, allowing for
|
466 |
-
different instance to save different args.
|
467 |
-
|
468 |
-
>>> your_ob = MyClass()
|
469 |
-
>>> your_ob.method({str('x'): 3}, b=[4])
|
470 |
-
{'x': 3} [4]
|
471 |
-
>>> your_ob._saved_method.args
|
472 |
-
({'x': 3},)
|
473 |
-
>>> my_ob._saved_method.args
|
474 |
-
()
|
475 |
-
"""
|
476 |
-
args_and_kwargs = collections.namedtuple('args_and_kwargs', 'args kwargs')
|
477 |
-
|
478 |
-
@functools.wraps(method)
|
479 |
-
def wrapper(self, *args, **kwargs):
|
480 |
-
attr_name = '_saved_' + method.__name__
|
481 |
-
attr = args_and_kwargs(args, kwargs)
|
482 |
-
setattr(self, attr_name, attr)
|
483 |
-
return method(self, *args, **kwargs)
|
484 |
-
|
485 |
-
return wrapper
|
486 |
-
|
487 |
-
|
488 |
-
def except_(*exceptions, replace=None, use=None):
|
489 |
-
"""
|
490 |
-
Replace the indicated exceptions, if raised, with the indicated
|
491 |
-
literal replacement or evaluated expression (if present).
|
492 |
-
|
493 |
-
>>> safe_int = except_(ValueError)(int)
|
494 |
-
>>> safe_int('five')
|
495 |
-
>>> safe_int('5')
|
496 |
-
5
|
497 |
-
|
498 |
-
Specify a literal replacement with ``replace``.
|
499 |
-
|
500 |
-
>>> safe_int_r = except_(ValueError, replace=0)(int)
|
501 |
-
>>> safe_int_r('five')
|
502 |
-
0
|
503 |
-
|
504 |
-
Provide an expression to ``use`` to pass through particular parameters.
|
505 |
-
|
506 |
-
>>> safe_int_pt = except_(ValueError, use='args[0]')(int)
|
507 |
-
>>> safe_int_pt('five')
|
508 |
-
'five'
|
509 |
-
|
510 |
-
"""
|
511 |
-
|
512 |
-
def decorate(func):
|
513 |
-
@functools.wraps(func)
|
514 |
-
def wrapper(*args, **kwargs):
|
515 |
-
try:
|
516 |
-
return func(*args, **kwargs)
|
517 |
-
except exceptions:
|
518 |
-
try:
|
519 |
-
return eval(use)
|
520 |
-
except TypeError:
|
521 |
-
return replace
|
522 |
-
|
523 |
-
return wrapper
|
524 |
-
|
525 |
-
return decorate
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/detail/allocator/fill_construct_range.h
DELETED
@@ -1,36 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* Copyright 2008-2013 NVIDIA Corporation
|
3 |
-
*
|
4 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
* you may not use this file except in compliance with the License.
|
6 |
-
* You may obtain a copy of the License at
|
7 |
-
*
|
8 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
*
|
10 |
-
* Unless required by applicable law or agreed to in writing, software
|
11 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
* See the License for the specific language governing permissions and
|
14 |
-
* limitations under the License.
|
15 |
-
*/
|
16 |
-
|
17 |
-
#pragma once
|
18 |
-
|
19 |
-
#include <thrust/detail/config.h>
|
20 |
-
|
21 |
-
namespace thrust
|
22 |
-
{
|
23 |
-
namespace detail
|
24 |
-
{
|
25 |
-
|
26 |
-
|
27 |
-
template<typename Allocator, typename Pointer, typename Size, typename T>
|
28 |
-
__host__ __device__
|
29 |
-
inline void fill_construct_range(Allocator &a, Pointer p, Size n, const T &value);
|
30 |
-
|
31 |
-
|
32 |
-
} // end detail
|
33 |
-
} // end thrust
|
34 |
-
|
35 |
-
#include <thrust/detail/allocator/fill_construct_range.inl>
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/detail/functional/operators/relational_operators.h
DELETED
@@ -1,323 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* Copyright 2008-2013 NVIDIA Corporation
|
3 |
-
*
|
4 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
* you may not use this file except in compliance with the License.
|
6 |
-
* You may obtain a copy of the License at
|
7 |
-
*
|
8 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
*
|
10 |
-
* Unless required by applicable law or agreed to in writing, software
|
11 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
* See the License for the specific language governing permissions and
|
14 |
-
* limitations under the License.
|
15 |
-
*/
|
16 |
-
|
17 |
-
#pragma once
|
18 |
-
|
19 |
-
#include <thrust/detail/config.h>
|
20 |
-
#include <thrust/detail/functional/actor.h>
|
21 |
-
#include <thrust/detail/functional/composite.h>
|
22 |
-
#include <thrust/detail/functional/operators/operator_adaptors.h>
|
23 |
-
#include <thrust/functional.h>
|
24 |
-
|
25 |
-
namespace thrust
|
26 |
-
{
|
27 |
-
namespace detail
|
28 |
-
{
|
29 |
-
namespace functional
|
30 |
-
{
|
31 |
-
|
32 |
-
template<typename T1, typename T2>
|
33 |
-
__host__ __device__
|
34 |
-
actor<
|
35 |
-
composite<
|
36 |
-
transparent_binary_operator<thrust::equal_to<>>,
|
37 |
-
actor<T1>,
|
38 |
-
typename as_actor<T2>::type
|
39 |
-
>
|
40 |
-
>
|
41 |
-
operator==(const actor<T1> &_1, const T2 &_2)
|
42 |
-
{
|
43 |
-
return compose(transparent_binary_operator<thrust::equal_to<>>(),
|
44 |
-
make_actor(_1),
|
45 |
-
make_actor(_2));
|
46 |
-
} // end operator==()
|
47 |
-
|
48 |
-
template<typename T1, typename T2>
|
49 |
-
__host__ __device__
|
50 |
-
actor<
|
51 |
-
composite<
|
52 |
-
transparent_binary_operator<thrust::equal_to<>>,
|
53 |
-
typename as_actor<T1>::type,
|
54 |
-
actor<T2>
|
55 |
-
>
|
56 |
-
>
|
57 |
-
operator==(const T1 &_1, const actor<T2> &_2)
|
58 |
-
{
|
59 |
-
return compose(transparent_binary_operator<thrust::equal_to<>>(),
|
60 |
-
make_actor(_1),
|
61 |
-
make_actor(_2));
|
62 |
-
} // end operator==()
|
63 |
-
|
64 |
-
template<typename T1, typename T2>
|
65 |
-
__host__ __device__
|
66 |
-
actor<
|
67 |
-
composite<
|
68 |
-
transparent_binary_operator<thrust::equal_to<>>,
|
69 |
-
actor<T1>,
|
70 |
-
actor<T2>
|
71 |
-
>
|
72 |
-
>
|
73 |
-
operator==(const actor<T1> &_1, const actor<T2> &_2)
|
74 |
-
{
|
75 |
-
return compose(transparent_binary_operator<thrust::equal_to<>>(),
|
76 |
-
make_actor(_1),
|
77 |
-
make_actor(_2));
|
78 |
-
} // end operator==()
|
79 |
-
|
80 |
-
template<typename T1, typename T2>
|
81 |
-
__host__ __device__
|
82 |
-
actor<
|
83 |
-
composite<
|
84 |
-
transparent_binary_operator<thrust::not_equal_to<>>,
|
85 |
-
actor<T1>,
|
86 |
-
typename as_actor<T2>::type
|
87 |
-
>
|
88 |
-
>
|
89 |
-
operator!=(const actor<T1> &_1, const T2 &_2)
|
90 |
-
{
|
91 |
-
return compose(transparent_binary_operator<thrust::not_equal_to<>>(),
|
92 |
-
make_actor(_1),
|
93 |
-
make_actor(_2));
|
94 |
-
} // end operator!=()
|
95 |
-
|
96 |
-
template<typename T1, typename T2>
|
97 |
-
__host__ __device__
|
98 |
-
actor<
|
99 |
-
composite<
|
100 |
-
transparent_binary_operator<thrust::not_equal_to<>>,
|
101 |
-
typename as_actor<T1>::type,
|
102 |
-
actor<T2>
|
103 |
-
>
|
104 |
-
>
|
105 |
-
operator!=(const T1 &_1, const actor<T2> &_2)
|
106 |
-
{
|
107 |
-
return compose(transparent_binary_operator<thrust::not_equal_to<>>(),
|
108 |
-
make_actor(_1),
|
109 |
-
make_actor(_2));
|
110 |
-
} // end operator!=()
|
111 |
-
|
112 |
-
template<typename T1, typename T2>
|
113 |
-
__host__ __device__
|
114 |
-
actor<
|
115 |
-
composite<
|
116 |
-
transparent_binary_operator<thrust::not_equal_to<>>,
|
117 |
-
actor<T1>,
|
118 |
-
actor<T2>
|
119 |
-
>
|
120 |
-
>
|
121 |
-
operator!=(const actor<T1> &_1, const actor<T2> &_2)
|
122 |
-
{
|
123 |
-
return compose(transparent_binary_operator<thrust::not_equal_to<>>(),
|
124 |
-
make_actor(_1),
|
125 |
-
make_actor(_2));
|
126 |
-
} // end operator!=()
|
127 |
-
|
128 |
-
template<typename T1, typename T2>
|
129 |
-
__host__ __device__
|
130 |
-
actor<
|
131 |
-
composite<
|
132 |
-
transparent_binary_operator<thrust::greater<>>,
|
133 |
-
actor<T1>,
|
134 |
-
typename as_actor<T2>::type
|
135 |
-
>
|
136 |
-
>
|
137 |
-
operator>(const actor<T1> &_1, const T2 &_2)
|
138 |
-
{
|
139 |
-
return compose(transparent_binary_operator<thrust::greater<>>(),
|
140 |
-
make_actor(_1),
|
141 |
-
make_actor(_2));
|
142 |
-
} // end operator>()
|
143 |
-
|
144 |
-
template<typename T1, typename T2>
|
145 |
-
__host__ __device__
|
146 |
-
actor<
|
147 |
-
composite<
|
148 |
-
transparent_binary_operator<thrust::greater<>>,
|
149 |
-
typename as_actor<T1>::type,
|
150 |
-
actor<T2>
|
151 |
-
>
|
152 |
-
>
|
153 |
-
operator>(const T1 &_1, const actor<T2> &_2)
|
154 |
-
{
|
155 |
-
return compose(transparent_binary_operator<thrust::greater<>>(),
|
156 |
-
make_actor(_1),
|
157 |
-
make_actor(_2));
|
158 |
-
} // end operator>()
|
159 |
-
|
160 |
-
template<typename T1, typename T2>
|
161 |
-
__host__ __device__
|
162 |
-
actor<
|
163 |
-
composite<
|
164 |
-
transparent_binary_operator<thrust::greater<>>,
|
165 |
-
actor<T1>,
|
166 |
-
actor<T2>
|
167 |
-
>
|
168 |
-
>
|
169 |
-
operator>(const actor<T1> &_1, const actor<T2> &_2)
|
170 |
-
{
|
171 |
-
return compose(transparent_binary_operator<thrust::greater<>>(),
|
172 |
-
make_actor(_1),
|
173 |
-
make_actor(_2));
|
174 |
-
} // end operator>()
|
175 |
-
|
176 |
-
template<typename T1, typename T2>
|
177 |
-
__host__ __device__
|
178 |
-
actor<
|
179 |
-
composite<
|
180 |
-
transparent_binary_operator<thrust::less<>>,
|
181 |
-
actor<T1>,
|
182 |
-
typename as_actor<T2>::type
|
183 |
-
>
|
184 |
-
>
|
185 |
-
operator<(const actor<T1> &_1, const T2 &_2)
|
186 |
-
{
|
187 |
-
return compose(transparent_binary_operator<thrust::less<>>(),
|
188 |
-
make_actor(_1),
|
189 |
-
make_actor(_2));
|
190 |
-
} // end operator<()
|
191 |
-
|
192 |
-
template<typename T1, typename T2>
|
193 |
-
__host__ __device__
|
194 |
-
actor<
|
195 |
-
composite<
|
196 |
-
transparent_binary_operator<thrust::less<>>,
|
197 |
-
typename as_actor<T1>::type,
|
198 |
-
actor<T2>
|
199 |
-
>
|
200 |
-
>
|
201 |
-
operator<(const T1 &_1, const actor<T2> &_2)
|
202 |
-
{
|
203 |
-
return compose(transparent_binary_operator<thrust::less<>>(),
|
204 |
-
make_actor(_1),
|
205 |
-
make_actor(_2));
|
206 |
-
} // end operator<()
|
207 |
-
|
208 |
-
template<typename T1, typename T2>
|
209 |
-
__host__ __device__
|
210 |
-
actor<
|
211 |
-
composite<
|
212 |
-
transparent_binary_operator<thrust::less<>>,
|
213 |
-
actor<T1>,
|
214 |
-
actor<T2>
|
215 |
-
>
|
216 |
-
>
|
217 |
-
operator<(const actor<T1> &_1, const actor<T2> &_2)
|
218 |
-
{
|
219 |
-
return compose(transparent_binary_operator<thrust::less<>>(),
|
220 |
-
make_actor(_1),
|
221 |
-
make_actor(_2));
|
222 |
-
} // end operator<()
|
223 |
-
|
224 |
-
template<typename T1, typename T2>
|
225 |
-
__host__ __device__
|
226 |
-
actor<
|
227 |
-
composite<
|
228 |
-
transparent_binary_operator<thrust::greater_equal<>>,
|
229 |
-
actor<T1>,
|
230 |
-
typename as_actor<T2>::type
|
231 |
-
>
|
232 |
-
>
|
233 |
-
operator>=(const actor<T1> &_1, const T2 &_2)
|
234 |
-
{
|
235 |
-
return compose(transparent_binary_operator<thrust::greater_equal<>>(),
|
236 |
-
make_actor(_1),
|
237 |
-
make_actor(_2));
|
238 |
-
} // end operator>=()
|
239 |
-
|
240 |
-
template<typename T1, typename T2>
|
241 |
-
__host__ __device__
|
242 |
-
actor<
|
243 |
-
composite<
|
244 |
-
transparent_binary_operator<thrust::greater_equal<>>,
|
245 |
-
typename as_actor<T1>::type,
|
246 |
-
actor<T2>
|
247 |
-
>
|
248 |
-
>
|
249 |
-
operator>=(const T1 &_1, const actor<T2> &_2)
|
250 |
-
{
|
251 |
-
return compose(transparent_binary_operator<thrust::greater_equal<>>(),
|
252 |
-
make_actor(_1),
|
253 |
-
make_actor(_2));
|
254 |
-
} // end operator>=()
|
255 |
-
|
256 |
-
template<typename T1, typename T2>
|
257 |
-
__host__ __device__
|
258 |
-
actor<
|
259 |
-
composite<
|
260 |
-
transparent_binary_operator<thrust::greater_equal<>>,
|
261 |
-
actor<T1>,
|
262 |
-
actor<T2>
|
263 |
-
>
|
264 |
-
>
|
265 |
-
operator>=(const actor<T1> &_1, const actor<T2> &_2)
|
266 |
-
{
|
267 |
-
return compose(transparent_binary_operator<thrust::greater_equal<>>(),
|
268 |
-
make_actor(_1),
|
269 |
-
make_actor(_2));
|
270 |
-
} // end operator>=()
|
271 |
-
|
272 |
-
template<typename T1, typename T2>
|
273 |
-
__host__ __device__
|
274 |
-
actor<
|
275 |
-
composite<
|
276 |
-
transparent_binary_operator<thrust::less_equal<>>,
|
277 |
-
actor<T1>,
|
278 |
-
typename as_actor<T2>::type
|
279 |
-
>
|
280 |
-
>
|
281 |
-
operator<=(const actor<T1> &_1, const T2 &_2)
|
282 |
-
{
|
283 |
-
return compose(transparent_binary_operator<thrust::less_equal<>>(),
|
284 |
-
make_actor(_1),
|
285 |
-
make_actor(_2));
|
286 |
-
} // end operator<=()
|
287 |
-
|
288 |
-
template<typename T1, typename T2>
|
289 |
-
__host__ __device__
|
290 |
-
actor<
|
291 |
-
composite<
|
292 |
-
transparent_binary_operator<thrust::less_equal<>>,
|
293 |
-
typename as_actor<T1>::type,
|
294 |
-
actor<T2>
|
295 |
-
>
|
296 |
-
>
|
297 |
-
operator<=(const T1 &_1, const actor<T2> &_2)
|
298 |
-
{
|
299 |
-
return compose(transparent_binary_operator<thrust::less_equal<>>(),
|
300 |
-
make_actor(_1),
|
301 |
-
make_actor(_2));
|
302 |
-
} // end operator<=()
|
303 |
-
|
304 |
-
template<typename T1, typename T2>
|
305 |
-
__host__ __device__
|
306 |
-
actor<
|
307 |
-
composite<
|
308 |
-
transparent_binary_operator<thrust::less_equal<>>,
|
309 |
-
actor<T1>,
|
310 |
-
actor<T2>
|
311 |
-
>
|
312 |
-
>
|
313 |
-
operator<=(const actor<T1> &_1, const actor<T2> &_2)
|
314 |
-
{
|
315 |
-
return compose(transparent_binary_operator<thrust::less_equal<>>(),
|
316 |
-
make_actor(_1),
|
317 |
-
make_actor(_2));
|
318 |
-
} // end operator<=()
|
319 |
-
|
320 |
-
} // end functional
|
321 |
-
} // end detail
|
322 |
-
} // end thrust
|
323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/iterator/constant_iterator.h
DELETED
@@ -1,251 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* Copyright 2008-2013 NVIDIA Corporation
|
3 |
-
*
|
4 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
* you may not use this file except in compliance with the License.
|
6 |
-
* You may obtain a copy of the License at
|
7 |
-
*
|
8 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
*
|
10 |
-
* Unless required by applicable law or agreed to in writing, software
|
11 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
* See the License for the specific language governing permissions and
|
14 |
-
* limitations under the License.
|
15 |
-
*/
|
16 |
-
|
17 |
-
|
18 |
-
/*! \file thrust/iterator/constant_iterator.h
|
19 |
-
* \brief An iterator which returns a constant value when
|
20 |
-
* dereferenced
|
21 |
-
*/
|
22 |
-
|
23 |
-
#pragma once
|
24 |
-
|
25 |
-
#include <thrust/detail/config.h>
|
26 |
-
#include <thrust/iterator/detail/constant_iterator_base.h>
|
27 |
-
#include <thrust/iterator/iterator_facade.h>
|
28 |
-
|
29 |
-
namespace thrust
|
30 |
-
{
|
31 |
-
|
32 |
-
/*! \addtogroup iterators
|
33 |
-
* \{
|
34 |
-
*/
|
35 |
-
|
36 |
-
/*! \addtogroup fancyiterator Fancy Iterators
|
37 |
-
* \ingroup iterators
|
38 |
-
* \{
|
39 |
-
*/
|
40 |
-
|
41 |
-
/*! \p constant_iterator is an iterator which represents a pointer into a range
|
42 |
-
* of constant values. This iterator is useful for creating a range filled with the same
|
43 |
-
* value without explicitly storing it in memory. Using \p constant_iterator saves both
|
44 |
-
* memory capacity and bandwidth.
|
45 |
-
*
|
46 |
-
* The following code snippet demonstrates how to create a \p constant_iterator whose
|
47 |
-
* \c value_type is \c int and whose value is \c 10.
|
48 |
-
*
|
49 |
-
* \code
|
50 |
-
* #include <thrust/iterator/constant_iterator.h>
|
51 |
-
*
|
52 |
-
* thrust::constant_iterator<int> iter(10);
|
53 |
-
*
|
54 |
-
* *iter; // returns 10
|
55 |
-
* iter[0]; // returns 10
|
56 |
-
* iter[1]; // returns 10
|
57 |
-
* iter[13]; // returns 10
|
58 |
-
*
|
59 |
-
* // and so on...
|
60 |
-
* \endcode
|
61 |
-
*
|
62 |
-
* This next example demonstrates how to use a \p constant_iterator with the
|
63 |
-
* \p thrust::transform function to increment all elements of a sequence by the
|
64 |
-
* same value. We will create a temporary \p constant_iterator with the function
|
65 |
-
* \p make_constant_iterator function in order to avoid explicitly specifying
|
66 |
-
* its type:
|
67 |
-
*
|
68 |
-
* \code
|
69 |
-
* #include <thrust/iterator/constant_iterator.h>
|
70 |
-
* #include <thrust/transform.h>
|
71 |
-
* #include <thrust/functional.h>
|
72 |
-
* #include <thrust/device_vector.h>
|
73 |
-
*
|
74 |
-
* int main()
|
75 |
-
* {
|
76 |
-
* thrust::device_vector<int> data(4);
|
77 |
-
* data[0] = 3;
|
78 |
-
* data[1] = 7;
|
79 |
-
* data[2] = 2;
|
80 |
-
* data[3] = 5;
|
81 |
-
*
|
82 |
-
* // add 10 to all values in data
|
83 |
-
* thrust::transform(data.begin(), data.end(),
|
84 |
-
* thrust::make_constant_iterator(10),
|
85 |
-
* data.begin(),
|
86 |
-
* thrust::plus<int>());
|
87 |
-
*
|
88 |
-
* // data is now [13, 17, 12, 15]
|
89 |
-
*
|
90 |
-
* return 0;
|
91 |
-
* }
|
92 |
-
* \endcode
|
93 |
-
*
|
94 |
-
* \see make_constant_iterator
|
95 |
-
*/
|
96 |
-
template<typename Value,
|
97 |
-
typename Incrementable = use_default,
|
98 |
-
typename System = use_default>
|
99 |
-
class constant_iterator
|
100 |
-
: public detail::constant_iterator_base<Value, Incrementable, System>::type
|
101 |
-
{
|
102 |
-
/*! \cond
|
103 |
-
*/
|
104 |
-
friend class thrust::iterator_core_access;
|
105 |
-
typedef typename detail::constant_iterator_base<Value, Incrementable, System>::type super_t;
|
106 |
-
typedef typename detail::constant_iterator_base<Value, Incrementable, System>::incrementable incrementable;
|
107 |
-
typedef typename detail::constant_iterator_base<Value, Incrementable, System>::base_iterator base_iterator;
|
108 |
-
|
109 |
-
public:
|
110 |
-
typedef typename super_t::reference reference;
|
111 |
-
typedef typename super_t::value_type value_type;
|
112 |
-
|
113 |
-
/*! \endcond
|
114 |
-
*/
|
115 |
-
|
116 |
-
/*! Null constructor initializes this \p constant_iterator's constant using its
|
117 |
-
* null constructor.
|
118 |
-
*/
|
119 |
-
__host__ __device__
|
120 |
-
constant_iterator()
|
121 |
-
: super_t(), m_value() {}
|
122 |
-
|
123 |
-
/*! Copy constructor copies the value of another \p constant_iterator into this
|
124 |
-
* \p constant_iterator.
|
125 |
-
*
|
126 |
-
* \p rhs The constant_iterator to copy.
|
127 |
-
*/
|
128 |
-
__host__ __device__
|
129 |
-
constant_iterator(constant_iterator const &rhs)
|
130 |
-
: super_t(rhs.base()), m_value(rhs.m_value) {}
|
131 |
-
|
132 |
-
/*! Copy constructor copies the value of another \p constant_iterator with related
|
133 |
-
* System type.
|
134 |
-
*
|
135 |
-
* \param rhs The \p constant_iterator to copy.
|
136 |
-
*/
|
137 |
-
template<typename OtherSystem>
|
138 |
-
__host__ __device__
|
139 |
-
constant_iterator(constant_iterator<Value,Incrementable,OtherSystem> const &rhs,
|
140 |
-
typename thrust::detail::enable_if_convertible<
|
141 |
-
typename thrust::iterator_system<constant_iterator<Value,Incrementable,OtherSystem> >::type,
|
142 |
-
typename thrust::iterator_system<super_t>::type
|
143 |
-
>::type * = 0)
|
144 |
-
: super_t(rhs.base()), m_value(rhs.value()) {}
|
145 |
-
|
146 |
-
/*! This constructor receives a value to use as the constant value of this
|
147 |
-
* \p constant_iterator and an index specifying the location of this
|
148 |
-
* \p constant_iterator in a sequence.
|
149 |
-
*
|
150 |
-
* \p v The value of this \p constant_iterator's constant value.
|
151 |
-
* \p i The index of this \p constant_iterator in a sequence. Defaults to the
|
152 |
-
* value returned by \c Incrementable's null constructor. For example,
|
153 |
-
* when <tt>Incrementable == int</tt>, \c 0.
|
154 |
-
*/
|
155 |
-
__host__ __device__
|
156 |
-
constant_iterator(value_type const& v, incrementable const &i = incrementable())
|
157 |
-
: super_t(base_iterator(i)), m_value(v) {}
|
158 |
-
|
159 |
-
/*! This constructor is templated to allow construction from a value type and
|
160 |
-
* incrementable type related this this \p constant_iterator's respective types.
|
161 |
-
*
|
162 |
-
* \p v The value of this \p constant_iterator's constant value.
|
163 |
-
* \p i The index of this \p constant_iterator in a sequence. Defaults to the
|
164 |
-
* value returned by \c Incrementable's null constructor. For example,
|
165 |
-
* when <tt>Incrementable == int</tt>, \c 0.
|
166 |
-
*/
|
167 |
-
template<typename OtherValue, typename OtherIncrementable>
|
168 |
-
__host__ __device__
|
169 |
-
constant_iterator(OtherValue const& v, OtherIncrementable const& i = incrementable())
|
170 |
-
: super_t(base_iterator(i)), m_value(v) {}
|
171 |
-
|
172 |
-
/*! This method returns the value of this \p constant_iterator's constant value.
|
173 |
-
* \return A \c const reference to this \p constant_iterator's constant value.
|
174 |
-
*/
|
175 |
-
__host__ __device__
|
176 |
-
Value const& value() const
|
177 |
-
{ return m_value; }
|
178 |
-
|
179 |
-
/*! \cond
|
180 |
-
*/
|
181 |
-
|
182 |
-
protected:
|
183 |
-
__host__ __device__
|
184 |
-
Value const& value_reference() const
|
185 |
-
{ return m_value; }
|
186 |
-
|
187 |
-
__host__ __device__
|
188 |
-
Value & value_reference()
|
189 |
-
{ return m_value; }
|
190 |
-
|
191 |
-
private: // Core iterator interface
|
192 |
-
__host__ __device__
|
193 |
-
reference dereference() const
|
194 |
-
{
|
195 |
-
return m_value;
|
196 |
-
}
|
197 |
-
|
198 |
-
private:
|
199 |
-
Value m_value;
|
200 |
-
|
201 |
-
/*! \endcond
|
202 |
-
*/
|
203 |
-
}; // end constant_iterator
|
204 |
-
|
205 |
-
|
206 |
-
/*! This version of \p make_constant_iterator creates a \p constant_iterator
|
207 |
-
* from values given for both value and index. The type of \p constant_iterator
|
208 |
-
* may be inferred by the compiler from the types of its parameters.
|
209 |
-
*
|
210 |
-
* \param x The value of the returned \p constant_iterator's constant value.
|
211 |
-
* \param i The index of the returned \p constant_iterator within a sequence.
|
212 |
-
* The type of this parameter defaults to \c int. In the default case,
|
213 |
-
* the value of this parameter is \c 0.
|
214 |
-
*
|
215 |
-
* \return A new \p constant_iterator with constant value & index as given
|
216 |
-
* by \p x & \p i.
|
217 |
-
*
|
218 |
-
* \see constant_iterator
|
219 |
-
*/
|
220 |
-
template<typename V, typename I>
|
221 |
-
inline __host__ __device__
|
222 |
-
constant_iterator<V,I> make_constant_iterator(V x, I i = int())
|
223 |
-
{
|
224 |
-
return constant_iterator<V,I>(x, i);
|
225 |
-
} // end make_constant_iterator()
|
226 |
-
|
227 |
-
|
228 |
-
/*! This version of \p make_constant_iterator creates a \p constant_iterator
|
229 |
-
* using only a parameter for the desired constant value. The value of the
|
230 |
-
* returned \p constant_iterator's index is set to \c 0.
|
231 |
-
*
|
232 |
-
* \param x The value of the returned \p constant_iterator's constant value.
|
233 |
-
* \return A new \p constant_iterator with constant value equal to \p x and
|
234 |
-
* index equal to \c 0.
|
235 |
-
* \see constant_iterator
|
236 |
-
*/
|
237 |
-
template<typename V>
|
238 |
-
inline __host__ __device__
|
239 |
-
constant_iterator<V> make_constant_iterator(V x)
|
240 |
-
{
|
241 |
-
return constant_iterator<V>(x, 0);
|
242 |
-
} // end make_constant_iterator()
|
243 |
-
|
244 |
-
/*! \} // end fancyiterators
|
245 |
-
*/
|
246 |
-
|
247 |
-
/*! \} // end iterators
|
248 |
-
*/
|
249 |
-
|
250 |
-
} // end namespace thrust
|
251 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/MonoScene/monoscene/CRP3D.py
DELETED
@@ -1,97 +0,0 @@
|
|
1 |
-
import torch
|
2 |
-
import torch.nn as nn
|
3 |
-
from monoscene.modules import (
|
4 |
-
Process,
|
5 |
-
ASPP,
|
6 |
-
)
|
7 |
-
|
8 |
-
|
9 |
-
class CPMegaVoxels(nn.Module):
|
10 |
-
def __init__(self, feature, size, n_relations=4, bn_momentum=0.0003):
|
11 |
-
super().__init__()
|
12 |
-
self.size = size
|
13 |
-
self.n_relations = n_relations
|
14 |
-
print("n_relations", self.n_relations)
|
15 |
-
self.flatten_size = size[0] * size[1] * size[2]
|
16 |
-
self.feature = feature
|
17 |
-
self.context_feature = feature * 2
|
18 |
-
self.flatten_context_size = (size[0] // 2) * (size[1] // 2) * (size[2] // 2)
|
19 |
-
padding = ((size[0] + 1) % 2, (size[1] + 1) % 2, (size[2] + 1) % 2)
|
20 |
-
|
21 |
-
self.mega_context = nn.Sequential(
|
22 |
-
nn.Conv3d(
|
23 |
-
feature, self.context_feature, stride=2, padding=padding, kernel_size=3
|
24 |
-
),
|
25 |
-
)
|
26 |
-
self.flatten_context_size = (size[0] // 2) * (size[1] // 2) * (size[2] // 2)
|
27 |
-
|
28 |
-
self.context_prior_logits = nn.ModuleList(
|
29 |
-
[
|
30 |
-
nn.Sequential(
|
31 |
-
nn.Conv3d(
|
32 |
-
self.feature,
|
33 |
-
self.flatten_context_size,
|
34 |
-
padding=0,
|
35 |
-
kernel_size=1,
|
36 |
-
),
|
37 |
-
)
|
38 |
-
for i in range(n_relations)
|
39 |
-
]
|
40 |
-
)
|
41 |
-
self.aspp = ASPP(feature, [1, 2, 3])
|
42 |
-
|
43 |
-
self.resize = nn.Sequential(
|
44 |
-
nn.Conv3d(
|
45 |
-
self.context_feature * self.n_relations + feature,
|
46 |
-
feature,
|
47 |
-
kernel_size=1,
|
48 |
-
padding=0,
|
49 |
-
bias=False,
|
50 |
-
),
|
51 |
-
Process(feature, nn.BatchNorm3d, bn_momentum, dilations=[1]),
|
52 |
-
)
|
53 |
-
|
54 |
-
def forward(self, input):
|
55 |
-
ret = {}
|
56 |
-
bs = input.shape[0]
|
57 |
-
|
58 |
-
x_agg = self.aspp(input)
|
59 |
-
|
60 |
-
# get the mega context
|
61 |
-
x_mega_context_raw = self.mega_context(x_agg)
|
62 |
-
x_mega_context = x_mega_context_raw.reshape(bs, self.context_feature, -1)
|
63 |
-
x_mega_context = x_mega_context.permute(0, 2, 1)
|
64 |
-
|
65 |
-
# get context prior map
|
66 |
-
x_context_prior_logits = []
|
67 |
-
x_context_rels = []
|
68 |
-
for rel in range(self.n_relations):
|
69 |
-
|
70 |
-
# Compute the relation matrices
|
71 |
-
x_context_prior_logit = self.context_prior_logits[rel](x_agg)
|
72 |
-
x_context_prior_logit = x_context_prior_logit.reshape(
|
73 |
-
bs, self.flatten_context_size, self.flatten_size
|
74 |
-
)
|
75 |
-
x_context_prior_logits.append(x_context_prior_logit.unsqueeze(1))
|
76 |
-
|
77 |
-
x_context_prior_logit = x_context_prior_logit.permute(0, 2, 1)
|
78 |
-
x_context_prior = torch.sigmoid(x_context_prior_logit)
|
79 |
-
|
80 |
-
# Multiply the relation matrices with the mega context to gather context features
|
81 |
-
x_context_rel = torch.bmm(x_context_prior, x_mega_context) # bs, N, f
|
82 |
-
x_context_rels.append(x_context_rel)
|
83 |
-
|
84 |
-
x_context = torch.cat(x_context_rels, dim=2)
|
85 |
-
x_context = x_context.permute(0, 2, 1)
|
86 |
-
x_context = x_context.reshape(
|
87 |
-
bs, x_context.shape[1], self.size[0], self.size[1], self.size[2]
|
88 |
-
)
|
89 |
-
|
90 |
-
x = torch.cat([input, x_context], dim=1)
|
91 |
-
x = self.resize(x)
|
92 |
-
|
93 |
-
x_context_prior_logits = torch.cat(x_context_prior_logits, dim=1)
|
94 |
-
ret["P_logits"] = x_context_prior_logits
|
95 |
-
ret["x"] = x
|
96 |
-
|
97 |
-
return ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/WALT/mmdet/models/dense_heads/ld_head.py
DELETED
@@ -1,261 +0,0 @@
|
|
1 |
-
import torch
|
2 |
-
from mmcv.runner import force_fp32
|
3 |
-
|
4 |
-
from mmdet.core import (bbox2distance, bbox_overlaps, distance2bbox,
|
5 |
-
multi_apply, reduce_mean)
|
6 |
-
from ..builder import HEADS, build_loss
|
7 |
-
from .gfl_head import GFLHead
|
8 |
-
|
9 |
-
|
10 |
-
@HEADS.register_module()
|
11 |
-
class LDHead(GFLHead):
|
12 |
-
"""Localization distillation Head. (Short description)
|
13 |
-
|
14 |
-
It utilizes the learned bbox distributions to transfer the localization
|
15 |
-
dark knowledge from teacher to student. Original paper: `Localization
|
16 |
-
Distillation for Object Detection. <https://arxiv.org/abs/2102.12252>`_
|
17 |
-
|
18 |
-
Args:
|
19 |
-
num_classes (int): Number of categories excluding the background
|
20 |
-
category.
|
21 |
-
in_channels (int): Number of channels in the input feature map.
|
22 |
-
loss_ld (dict): Config of Localization Distillation Loss (LD),
|
23 |
-
T is the temperature for distillation.
|
24 |
-
"""
|
25 |
-
|
26 |
-
def __init__(self,
|
27 |
-
num_classes,
|
28 |
-
in_channels,
|
29 |
-
loss_ld=dict(
|
30 |
-
type='LocalizationDistillationLoss',
|
31 |
-
loss_weight=0.25,
|
32 |
-
T=10),
|
33 |
-
**kwargs):
|
34 |
-
|
35 |
-
super(LDHead, self).__init__(num_classes, in_channels, **kwargs)
|
36 |
-
self.loss_ld = build_loss(loss_ld)
|
37 |
-
|
38 |
-
def loss_single(self, anchors, cls_score, bbox_pred, labels, label_weights,
|
39 |
-
bbox_targets, stride, soft_targets, num_total_samples):
|
40 |
-
"""Compute loss of a single scale level.
|
41 |
-
|
42 |
-
Args:
|
43 |
-
anchors (Tensor): Box reference for each scale level with shape
|
44 |
-
(N, num_total_anchors, 4).
|
45 |
-
cls_score (Tensor): Cls and quality joint scores for each scale
|
46 |
-
level has shape (N, num_classes, H, W).
|
47 |
-
bbox_pred (Tensor): Box distribution logits for each scale
|
48 |
-
level with shape (N, 4*(n+1), H, W), n is max value of integral
|
49 |
-
set.
|
50 |
-
labels (Tensor): Labels of each anchors with shape
|
51 |
-
(N, num_total_anchors).
|
52 |
-
label_weights (Tensor): Label weights of each anchor with shape
|
53 |
-
(N, num_total_anchors)
|
54 |
-
bbox_targets (Tensor): BBox regression targets of each anchor wight
|
55 |
-
shape (N, num_total_anchors, 4).
|
56 |
-
stride (tuple): Stride in this scale level.
|
57 |
-
num_total_samples (int): Number of positive samples that is
|
58 |
-
reduced over all GPUs.
|
59 |
-
|
60 |
-
Returns:
|
61 |
-
dict[tuple, Tensor]: Loss components and weight targets.
|
62 |
-
"""
|
63 |
-
assert stride[0] == stride[1], 'h stride is not equal to w stride!'
|
64 |
-
anchors = anchors.reshape(-1, 4)
|
65 |
-
cls_score = cls_score.permute(0, 2, 3,
|
66 |
-
1).reshape(-1, self.cls_out_channels)
|
67 |
-
bbox_pred = bbox_pred.permute(0, 2, 3,
|
68 |
-
1).reshape(-1, 4 * (self.reg_max + 1))
|
69 |
-
soft_targets = soft_targets.permute(0, 2, 3,
|
70 |
-
1).reshape(-1,
|
71 |
-
4 * (self.reg_max + 1))
|
72 |
-
|
73 |
-
bbox_targets = bbox_targets.reshape(-1, 4)
|
74 |
-
labels = labels.reshape(-1)
|
75 |
-
label_weights = label_weights.reshape(-1)
|
76 |
-
|
77 |
-
# FG cat_id: [0, num_classes -1], BG cat_id: num_classes
|
78 |
-
bg_class_ind = self.num_classes
|
79 |
-
pos_inds = ((labels >= 0)
|
80 |
-
& (labels < bg_class_ind)).nonzero().squeeze(1)
|
81 |
-
score = label_weights.new_zeros(labels.shape)
|
82 |
-
|
83 |
-
if len(pos_inds) > 0:
|
84 |
-
pos_bbox_targets = bbox_targets[pos_inds]
|
85 |
-
pos_bbox_pred = bbox_pred[pos_inds]
|
86 |
-
pos_anchors = anchors[pos_inds]
|
87 |
-
pos_anchor_centers = self.anchor_center(pos_anchors) / stride[0]
|
88 |
-
|
89 |
-
weight_targets = cls_score.detach().sigmoid()
|
90 |
-
weight_targets = weight_targets.max(dim=1)[0][pos_inds]
|
91 |
-
pos_bbox_pred_corners = self.integral(pos_bbox_pred)
|
92 |
-
pos_decode_bbox_pred = distance2bbox(pos_anchor_centers,
|
93 |
-
pos_bbox_pred_corners)
|
94 |
-
pos_decode_bbox_targets = pos_bbox_targets / stride[0]
|
95 |
-
score[pos_inds] = bbox_overlaps(
|
96 |
-
pos_decode_bbox_pred.detach(),
|
97 |
-
pos_decode_bbox_targets,
|
98 |
-
is_aligned=True)
|
99 |
-
pred_corners = pos_bbox_pred.reshape(-1, self.reg_max + 1)
|
100 |
-
pos_soft_targets = soft_targets[pos_inds]
|
101 |
-
soft_corners = pos_soft_targets.reshape(-1, self.reg_max + 1)
|
102 |
-
|
103 |
-
target_corners = bbox2distance(pos_anchor_centers,
|
104 |
-
pos_decode_bbox_targets,
|
105 |
-
self.reg_max).reshape(-1)
|
106 |
-
|
107 |
-
# regression loss
|
108 |
-
loss_bbox = self.loss_bbox(
|
109 |
-
pos_decode_bbox_pred,
|
110 |
-
pos_decode_bbox_targets,
|
111 |
-
weight=weight_targets,
|
112 |
-
avg_factor=1.0)
|
113 |
-
|
114 |
-
# dfl loss
|
115 |
-
loss_dfl = self.loss_dfl(
|
116 |
-
pred_corners,
|
117 |
-
target_corners,
|
118 |
-
weight=weight_targets[:, None].expand(-1, 4).reshape(-1),
|
119 |
-
avg_factor=4.0)
|
120 |
-
|
121 |
-
# ld loss
|
122 |
-
loss_ld = self.loss_ld(
|
123 |
-
pred_corners,
|
124 |
-
soft_corners,
|
125 |
-
weight=weight_targets[:, None].expand(-1, 4).reshape(-1),
|
126 |
-
avg_factor=4.0)
|
127 |
-
|
128 |
-
else:
|
129 |
-
loss_ld = bbox_pred.sum() * 0
|
130 |
-
loss_bbox = bbox_pred.sum() * 0
|
131 |
-
loss_dfl = bbox_pred.sum() * 0
|
132 |
-
weight_targets = bbox_pred.new_tensor(0)
|
133 |
-
|
134 |
-
# cls (qfl) loss
|
135 |
-
loss_cls = self.loss_cls(
|
136 |
-
cls_score, (labels, score),
|
137 |
-
weight=label_weights,
|
138 |
-
avg_factor=num_total_samples)
|
139 |
-
|
140 |
-
return loss_cls, loss_bbox, loss_dfl, loss_ld, weight_targets.sum()
|
141 |
-
|
142 |
-
def forward_train(self,
|
143 |
-
x,
|
144 |
-
out_teacher,
|
145 |
-
img_metas,
|
146 |
-
gt_bboxes,
|
147 |
-
gt_labels=None,
|
148 |
-
gt_bboxes_ignore=None,
|
149 |
-
proposal_cfg=None,
|
150 |
-
**kwargs):
|
151 |
-
"""
|
152 |
-
Args:
|
153 |
-
x (list[Tensor]): Features from FPN.
|
154 |
-
img_metas (list[dict]): Meta information of each image, e.g.,
|
155 |
-
image size, scaling factor, etc.
|
156 |
-
gt_bboxes (Tensor): Ground truth bboxes of the image,
|
157 |
-
shape (num_gts, 4).
|
158 |
-
gt_labels (Tensor): Ground truth labels of each box,
|
159 |
-
shape (num_gts,).
|
160 |
-
gt_bboxes_ignore (Tensor): Ground truth bboxes to be
|
161 |
-
ignored, shape (num_ignored_gts, 4).
|
162 |
-
proposal_cfg (mmcv.Config): Test / postprocessing configuration,
|
163 |
-
if None, test_cfg would be used
|
164 |
-
|
165 |
-
Returns:
|
166 |
-
tuple[dict, list]: The loss components and proposals of each image.
|
167 |
-
|
168 |
-
- losses (dict[str, Tensor]): A dictionary of loss components.
|
169 |
-
- proposal_list (list[Tensor]): Proposals of each image.
|
170 |
-
"""
|
171 |
-
outs = self(x)
|
172 |
-
soft_target = out_teacher[1]
|
173 |
-
if gt_labels is None:
|
174 |
-
loss_inputs = outs + (gt_bboxes, soft_target, img_metas)
|
175 |
-
else:
|
176 |
-
loss_inputs = outs + (gt_bboxes, gt_labels, soft_target, img_metas)
|
177 |
-
losses = self.loss(*loss_inputs, gt_bboxes_ignore=gt_bboxes_ignore)
|
178 |
-
if proposal_cfg is None:
|
179 |
-
return losses
|
180 |
-
else:
|
181 |
-
proposal_list = self.get_bboxes(*outs, img_metas, cfg=proposal_cfg)
|
182 |
-
return losses, proposal_list
|
183 |
-
|
184 |
-
@force_fp32(apply_to=('cls_scores', 'bbox_preds'))
|
185 |
-
def loss(self,
|
186 |
-
cls_scores,
|
187 |
-
bbox_preds,
|
188 |
-
gt_bboxes,
|
189 |
-
gt_labels,
|
190 |
-
soft_target,
|
191 |
-
img_metas,
|
192 |
-
gt_bboxes_ignore=None):
|
193 |
-
"""Compute losses of the head.
|
194 |
-
|
195 |
-
Args:
|
196 |
-
cls_scores (list[Tensor]): Cls and quality scores for each scale
|
197 |
-
level has shape (N, num_classes, H, W).
|
198 |
-
bbox_preds (list[Tensor]): Box distribution logits for each scale
|
199 |
-
level with shape (N, 4*(n+1), H, W), n is max value of integral
|
200 |
-
set.
|
201 |
-
gt_bboxes (list[Tensor]): Ground truth bboxes for each image with
|
202 |
-
shape (num_gts, 4) in [tl_x, tl_y, br_x, br_y] format.
|
203 |
-
gt_labels (list[Tensor]): class indices corresponding to each box
|
204 |
-
img_metas (list[dict]): Meta information of each image, e.g.,
|
205 |
-
image size, scaling factor, etc.
|
206 |
-
gt_bboxes_ignore (list[Tensor] | None): specify which bounding
|
207 |
-
boxes can be ignored when computing the loss.
|
208 |
-
|
209 |
-
Returns:
|
210 |
-
dict[str, Tensor]: A dictionary of loss components.
|
211 |
-
"""
|
212 |
-
|
213 |
-
featmap_sizes = [featmap.size()[-2:] for featmap in cls_scores]
|
214 |
-
assert len(featmap_sizes) == self.anchor_generator.num_levels
|
215 |
-
|
216 |
-
device = cls_scores[0].device
|
217 |
-
anchor_list, valid_flag_list = self.get_anchors(
|
218 |
-
featmap_sizes, img_metas, device=device)
|
219 |
-
label_channels = self.cls_out_channels if self.use_sigmoid_cls else 1
|
220 |
-
|
221 |
-
cls_reg_targets = self.get_targets(
|
222 |
-
anchor_list,
|
223 |
-
valid_flag_list,
|
224 |
-
gt_bboxes,
|
225 |
-
img_metas,
|
226 |
-
gt_bboxes_ignore_list=gt_bboxes_ignore,
|
227 |
-
gt_labels_list=gt_labels,
|
228 |
-
label_channels=label_channels)
|
229 |
-
if cls_reg_targets is None:
|
230 |
-
return None
|
231 |
-
|
232 |
-
(anchor_list, labels_list, label_weights_list, bbox_targets_list,
|
233 |
-
bbox_weights_list, num_total_pos, num_total_neg) = cls_reg_targets
|
234 |
-
|
235 |
-
num_total_samples = reduce_mean(
|
236 |
-
torch.tensor(num_total_pos, dtype=torch.float,
|
237 |
-
device=device)).item()
|
238 |
-
num_total_samples = max(num_total_samples, 1.0)
|
239 |
-
|
240 |
-
losses_cls, losses_bbox, losses_dfl, losses_ld, \
|
241 |
-
avg_factor = multi_apply(
|
242 |
-
self.loss_single,
|
243 |
-
anchor_list,
|
244 |
-
cls_scores,
|
245 |
-
bbox_preds,
|
246 |
-
labels_list,
|
247 |
-
label_weights_list,
|
248 |
-
bbox_targets_list,
|
249 |
-
self.anchor_generator.strides,
|
250 |
-
soft_target,
|
251 |
-
num_total_samples=num_total_samples)
|
252 |
-
|
253 |
-
avg_factor = sum(avg_factor) + 1e-6
|
254 |
-
avg_factor = reduce_mean(avg_factor).item()
|
255 |
-
losses_bbox = [x / avg_factor for x in losses_bbox]
|
256 |
-
losses_dfl = [x / avg_factor for x in losses_dfl]
|
257 |
-
return dict(
|
258 |
-
loss_cls=losses_cls,
|
259 |
-
loss_bbox=losses_bbox,
|
260 |
-
loss_dfl=losses_dfl,
|
261 |
-
loss_ld=losses_ld)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/regionclip-demo/detectron2/modeling/box_regression.py
DELETED
@@ -1,270 +0,0 @@
|
|
1 |
-
# Copyright (c) Facebook, Inc. and its affiliates.
|
2 |
-
import math
|
3 |
-
from typing import List, Tuple
|
4 |
-
import torch
|
5 |
-
from fvcore.nn import giou_loss, smooth_l1_loss
|
6 |
-
|
7 |
-
from detectron2.layers import cat
|
8 |
-
from detectron2.structures import Boxes
|
9 |
-
|
10 |
-
# Value for clamping large dw and dh predictions. The heuristic is that we clamp
|
11 |
-
# such that dw and dh are no larger than what would transform a 16px box into a
|
12 |
-
# 1000px box (based on a small anchor, 16px, and a typical image size, 1000px).
|
13 |
-
_DEFAULT_SCALE_CLAMP = math.log(1000.0 / 16)
|
14 |
-
|
15 |
-
|
16 |
-
__all__ = ["Box2BoxTransform", "Box2BoxTransformRotated"]
|
17 |
-
|
18 |
-
|
19 |
-
@torch.jit.script
|
20 |
-
class Box2BoxTransform(object):
|
21 |
-
"""
|
22 |
-
The box-to-box transform defined in R-CNN. The transformation is parameterized
|
23 |
-
by 4 deltas: (dx, dy, dw, dh). The transformation scales the box's width and height
|
24 |
-
by exp(dw), exp(dh) and shifts a box's center by the offset (dx * width, dy * height).
|
25 |
-
"""
|
26 |
-
|
27 |
-
def __init__(
|
28 |
-
self, weights: Tuple[float, float, float, float], scale_clamp: float = _DEFAULT_SCALE_CLAMP
|
29 |
-
):
|
30 |
-
"""
|
31 |
-
Args:
|
32 |
-
weights (4-element tuple): Scaling factors that are applied to the
|
33 |
-
(dx, dy, dw, dh) deltas. In Fast R-CNN, these were originally set
|
34 |
-
such that the deltas have unit variance; now they are treated as
|
35 |
-
hyperparameters of the system.
|
36 |
-
scale_clamp (float): When predicting deltas, the predicted box scaling
|
37 |
-
factors (dw and dh) are clamped such that they are <= scale_clamp.
|
38 |
-
"""
|
39 |
-
self.weights = weights
|
40 |
-
self.scale_clamp = scale_clamp
|
41 |
-
|
42 |
-
def get_deltas(self, src_boxes, target_boxes):
|
43 |
-
"""
|
44 |
-
Get box regression transformation deltas (dx, dy, dw, dh) that can be used
|
45 |
-
to transform the `src_boxes` into the `target_boxes`. That is, the relation
|
46 |
-
``target_boxes == self.apply_deltas(deltas, src_boxes)`` is true (unless
|
47 |
-
any delta is too large and is clamped).
|
48 |
-
|
49 |
-
Args:
|
50 |
-
src_boxes (Tensor): source boxes, e.g., object proposals
|
51 |
-
target_boxes (Tensor): target of the transformation, e.g., ground-truth
|
52 |
-
boxes.
|
53 |
-
"""
|
54 |
-
assert isinstance(src_boxes, torch.Tensor), type(src_boxes)
|
55 |
-
assert isinstance(target_boxes, torch.Tensor), type(target_boxes)
|
56 |
-
|
57 |
-
src_widths = src_boxes[:, 2] - src_boxes[:, 0]
|
58 |
-
src_heights = src_boxes[:, 3] - src_boxes[:, 1]
|
59 |
-
src_ctr_x = src_boxes[:, 0] + 0.5 * src_widths
|
60 |
-
src_ctr_y = src_boxes[:, 1] + 0.5 * src_heights
|
61 |
-
|
62 |
-
target_widths = target_boxes[:, 2] - target_boxes[:, 0]
|
63 |
-
target_heights = target_boxes[:, 3] - target_boxes[:, 1]
|
64 |
-
target_ctr_x = target_boxes[:, 0] + 0.5 * target_widths
|
65 |
-
target_ctr_y = target_boxes[:, 1] + 0.5 * target_heights
|
66 |
-
|
67 |
-
wx, wy, ww, wh = self.weights
|
68 |
-
dx = wx * (target_ctr_x - src_ctr_x) / src_widths
|
69 |
-
dy = wy * (target_ctr_y - src_ctr_y) / src_heights
|
70 |
-
dw = ww * torch.log(target_widths / src_widths)
|
71 |
-
dh = wh * torch.log(target_heights / src_heights)
|
72 |
-
|
73 |
-
deltas = torch.stack((dx, dy, dw, dh), dim=1)
|
74 |
-
assert (src_widths > 0).all().item(), "Input boxes to Box2BoxTransform are not valid!"
|
75 |
-
return deltas
|
76 |
-
|
77 |
-
def apply_deltas(self, deltas, boxes):
|
78 |
-
"""
|
79 |
-
Apply transformation `deltas` (dx, dy, dw, dh) to `boxes`.
|
80 |
-
|
81 |
-
Args:
|
82 |
-
deltas (Tensor): transformation deltas of shape (N, k*4), where k >= 1.
|
83 |
-
deltas[i] represents k potentially different class-specific
|
84 |
-
box transformations for the single box boxes[i].
|
85 |
-
boxes (Tensor): boxes to transform, of shape (N, 4)
|
86 |
-
"""
|
87 |
-
deltas = deltas.float() # ensure fp32 for decoding precision
|
88 |
-
boxes = boxes.to(deltas.dtype)
|
89 |
-
|
90 |
-
widths = boxes[:, 2] - boxes[:, 0]
|
91 |
-
heights = boxes[:, 3] - boxes[:, 1]
|
92 |
-
ctr_x = boxes[:, 0] + 0.5 * widths
|
93 |
-
ctr_y = boxes[:, 1] + 0.5 * heights
|
94 |
-
|
95 |
-
wx, wy, ww, wh = self.weights
|
96 |
-
dx = deltas[:, 0::4] / wx
|
97 |
-
dy = deltas[:, 1::4] / wy
|
98 |
-
dw = deltas[:, 2::4] / ww
|
99 |
-
dh = deltas[:, 3::4] / wh
|
100 |
-
|
101 |
-
# Prevent sending too large values into torch.exp()
|
102 |
-
dw = torch.clamp(dw, max=self.scale_clamp)
|
103 |
-
dh = torch.clamp(dh, max=self.scale_clamp)
|
104 |
-
|
105 |
-
pred_ctr_x = dx * widths[:, None] + ctr_x[:, None]
|
106 |
-
pred_ctr_y = dy * heights[:, None] + ctr_y[:, None]
|
107 |
-
pred_w = torch.exp(dw) * widths[:, None]
|
108 |
-
pred_h = torch.exp(dh) * heights[:, None]
|
109 |
-
|
110 |
-
x1 = pred_ctr_x - 0.5 * pred_w
|
111 |
-
y1 = pred_ctr_y - 0.5 * pred_h
|
112 |
-
x2 = pred_ctr_x + 0.5 * pred_w
|
113 |
-
y2 = pred_ctr_y + 0.5 * pred_h
|
114 |
-
pred_boxes = torch.stack((x1, y1, x2, y2), dim=-1)
|
115 |
-
return pred_boxes.reshape(deltas.shape)
|
116 |
-
|
117 |
-
|
118 |
-
@torch.jit.script
|
119 |
-
class Box2BoxTransformRotated(object):
|
120 |
-
"""
|
121 |
-
The box-to-box transform defined in Rotated R-CNN. The transformation is parameterized
|
122 |
-
by 5 deltas: (dx, dy, dw, dh, da). The transformation scales the box's width and height
|
123 |
-
by exp(dw), exp(dh), shifts a box's center by the offset (dx * width, dy * height),
|
124 |
-
and rotate a box's angle by da (radians).
|
125 |
-
Note: angles of deltas are in radians while angles of boxes are in degrees.
|
126 |
-
"""
|
127 |
-
|
128 |
-
def __init__(
|
129 |
-
self,
|
130 |
-
weights: Tuple[float, float, float, float, float],
|
131 |
-
scale_clamp: float = _DEFAULT_SCALE_CLAMP,
|
132 |
-
):
|
133 |
-
"""
|
134 |
-
Args:
|
135 |
-
weights (5-element tuple): Scaling factors that are applied to the
|
136 |
-
(dx, dy, dw, dh, da) deltas. These are treated as
|
137 |
-
hyperparameters of the system.
|
138 |
-
scale_clamp (float): When predicting deltas, the predicted box scaling
|
139 |
-
factors (dw and dh) are clamped such that they are <= scale_clamp.
|
140 |
-
"""
|
141 |
-
self.weights = weights
|
142 |
-
self.scale_clamp = scale_clamp
|
143 |
-
|
144 |
-
def get_deltas(self, src_boxes, target_boxes):
|
145 |
-
"""
|
146 |
-
Get box regression transformation deltas (dx, dy, dw, dh, da) that can be used
|
147 |
-
to transform the `src_boxes` into the `target_boxes`. That is, the relation
|
148 |
-
``target_boxes == self.apply_deltas(deltas, src_boxes)`` is true (unless
|
149 |
-
any delta is too large and is clamped).
|
150 |
-
|
151 |
-
Args:
|
152 |
-
src_boxes (Tensor): Nx5 source boxes, e.g., object proposals
|
153 |
-
target_boxes (Tensor): Nx5 target of the transformation, e.g., ground-truth
|
154 |
-
boxes.
|
155 |
-
"""
|
156 |
-
assert isinstance(src_boxes, torch.Tensor), type(src_boxes)
|
157 |
-
assert isinstance(target_boxes, torch.Tensor), type(target_boxes)
|
158 |
-
|
159 |
-
src_ctr_x, src_ctr_y, src_widths, src_heights, src_angles = torch.unbind(src_boxes, dim=1)
|
160 |
-
|
161 |
-
target_ctr_x, target_ctr_y, target_widths, target_heights, target_angles = torch.unbind(
|
162 |
-
target_boxes, dim=1
|
163 |
-
)
|
164 |
-
|
165 |
-
wx, wy, ww, wh, wa = self.weights
|
166 |
-
dx = wx * (target_ctr_x - src_ctr_x) / src_widths
|
167 |
-
dy = wy * (target_ctr_y - src_ctr_y) / src_heights
|
168 |
-
dw = ww * torch.log(target_widths / src_widths)
|
169 |
-
dh = wh * torch.log(target_heights / src_heights)
|
170 |
-
# Angles of deltas are in radians while angles of boxes are in degrees.
|
171 |
-
# the conversion to radians serve as a way to normalize the values
|
172 |
-
da = target_angles - src_angles
|
173 |
-
da = (da + 180.0) % 360.0 - 180.0 # make it in [-180, 180)
|
174 |
-
da *= wa * math.pi / 180.0
|
175 |
-
|
176 |
-
deltas = torch.stack((dx, dy, dw, dh, da), dim=1)
|
177 |
-
assert (
|
178 |
-
(src_widths > 0).all().item()
|
179 |
-
), "Input boxes to Box2BoxTransformRotated are not valid!"
|
180 |
-
return deltas
|
181 |
-
|
182 |
-
def apply_deltas(self, deltas, boxes):
|
183 |
-
"""
|
184 |
-
Apply transformation `deltas` (dx, dy, dw, dh, da) to `boxes`.
|
185 |
-
|
186 |
-
Args:
|
187 |
-
deltas (Tensor): transformation deltas of shape (N, k*5).
|
188 |
-
deltas[i] represents box transformation for the single box boxes[i].
|
189 |
-
boxes (Tensor): boxes to transform, of shape (N, 5)
|
190 |
-
"""
|
191 |
-
assert deltas.shape[1] % 5 == 0 and boxes.shape[1] == 5
|
192 |
-
|
193 |
-
boxes = boxes.to(deltas.dtype).unsqueeze(2)
|
194 |
-
|
195 |
-
ctr_x = boxes[:, 0]
|
196 |
-
ctr_y = boxes[:, 1]
|
197 |
-
widths = boxes[:, 2]
|
198 |
-
heights = boxes[:, 3]
|
199 |
-
angles = boxes[:, 4]
|
200 |
-
|
201 |
-
wx, wy, ww, wh, wa = self.weights
|
202 |
-
|
203 |
-
dx = deltas[:, 0::5] / wx
|
204 |
-
dy = deltas[:, 1::5] / wy
|
205 |
-
dw = deltas[:, 2::5] / ww
|
206 |
-
dh = deltas[:, 3::5] / wh
|
207 |
-
da = deltas[:, 4::5] / wa
|
208 |
-
|
209 |
-
# Prevent sending too large values into torch.exp()
|
210 |
-
dw = torch.clamp(dw, max=self.scale_clamp)
|
211 |
-
dh = torch.clamp(dh, max=self.scale_clamp)
|
212 |
-
|
213 |
-
pred_boxes = torch.zeros_like(deltas)
|
214 |
-
pred_boxes[:, 0::5] = dx * widths + ctr_x # x_ctr
|
215 |
-
pred_boxes[:, 1::5] = dy * heights + ctr_y # y_ctr
|
216 |
-
pred_boxes[:, 2::5] = torch.exp(dw) * widths # width
|
217 |
-
pred_boxes[:, 3::5] = torch.exp(dh) * heights # height
|
218 |
-
|
219 |
-
# Following original RRPN implementation,
|
220 |
-
# angles of deltas are in radians while angles of boxes are in degrees.
|
221 |
-
pred_angle = da * 180.0 / math.pi + angles
|
222 |
-
pred_angle = (pred_angle + 180.0) % 360.0 - 180.0 # make it in [-180, 180)
|
223 |
-
|
224 |
-
pred_boxes[:, 4::5] = pred_angle
|
225 |
-
|
226 |
-
return pred_boxes
|
227 |
-
|
228 |
-
|
229 |
-
def _dense_box_regression_loss(
|
230 |
-
anchors: List[Boxes],
|
231 |
-
box2box_transform: Box2BoxTransform,
|
232 |
-
pred_anchor_deltas: List[torch.Tensor],
|
233 |
-
gt_boxes: List[torch.Tensor],
|
234 |
-
fg_mask: torch.Tensor,
|
235 |
-
box_reg_loss_type="smooth_l1",
|
236 |
-
smooth_l1_beta=0.0,
|
237 |
-
):
|
238 |
-
"""
|
239 |
-
Compute loss for dense multi-level box regression.
|
240 |
-
Loss is accumulated over ``fg_mask``.
|
241 |
-
|
242 |
-
Args:
|
243 |
-
anchors: #lvl anchor boxes, each is (HixWixA, 4)
|
244 |
-
pred_anchor_deltas: #lvl predictions, each is (N, HixWixA, 4)
|
245 |
-
gt_boxes: N ground truth boxes, each has shape (R, 4) (R = sum(Hi * Wi * A))
|
246 |
-
fg_mask: the foreground boolean mask of shape (N, R) to compute loss on
|
247 |
-
box_reg_loss_type (str): Loss type to use. Supported losses: "smooth_l1", "giou".
|
248 |
-
smooth_l1_beta (float): beta parameter for the smooth L1 regression loss. Default to
|
249 |
-
use L1 loss. Only used when `box_reg_loss_type` is "smooth_l1"
|
250 |
-
"""
|
251 |
-
anchors = type(anchors[0]).cat(anchors).tensor # (R, 4)
|
252 |
-
if box_reg_loss_type == "smooth_l1":
|
253 |
-
gt_anchor_deltas = [box2box_transform.get_deltas(anchors, k) for k in gt_boxes]
|
254 |
-
gt_anchor_deltas = torch.stack(gt_anchor_deltas) # (N, R, 4)
|
255 |
-
loss_box_reg = smooth_l1_loss(
|
256 |
-
cat(pred_anchor_deltas, dim=1)[fg_mask],
|
257 |
-
gt_anchor_deltas[fg_mask],
|
258 |
-
beta=smooth_l1_beta,
|
259 |
-
reduction="sum",
|
260 |
-
)
|
261 |
-
elif box_reg_loss_type == "giou":
|
262 |
-
pred_boxes = [
|
263 |
-
box2box_transform.apply_deltas(k, anchors) for k in cat(pred_anchor_deltas, dim=1)
|
264 |
-
]
|
265 |
-
loss_box_reg = giou_loss(
|
266 |
-
torch.stack(pred_boxes)[fg_mask], torch.stack(gt_boxes)[fg_mask], reduction="sum"
|
267 |
-
)
|
268 |
-
else:
|
269 |
-
raise ValueError(f"Invalid dense box regression loss type '{box_reg_loss_type}'")
|
270 |
-
return loss_box_reg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Catmeow/Text_Generation_Fine_Tune/app.py
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
from transformers import pipeline
|
3 |
-
|
4 |
-
def generate(text,the_model,max_length,temperature,num_beams,top_k,top_p,repetition_penalty):
|
5 |
-
generator = pipeline('text-generation', model=the_model)
|
6 |
-
result = generator(text, num_return_sequences=3,
|
7 |
-
max_length=max_length,
|
8 |
-
temperature=temperature,
|
9 |
-
num_beams=num_beams,
|
10 |
-
top_k=top_k,
|
11 |
-
top_p=top_p,
|
12 |
-
repetition_penalty = repetition_penalty,
|
13 |
-
no_repeat_ngram_size=2,early_stopping=False)
|
14 |
-
return result[0]["generated_text"],result[1]["generated_text"],result[2]["generated_text"]
|
15 |
-
|
16 |
-
demo = gr.Interface(
|
17 |
-
fn=generate,
|
18 |
-
inputs=[
|
19 |
-
gr.Textbox(lines=5, label="Input Text"),
|
20 |
-
gr.Dropdown(choices=['gpt2','gpt2-medium','gpt2-large','gpt2-xl'],value = 'gpt2',label="Choose model"),
|
21 |
-
gr.Slider(value=50,label="Max Length",minimum=1,maximum=1000),
|
22 |
-
gr.Slider(value=1.0,label="Temperature",minimum=0.0,maximum=1.0,step=0.05),
|
23 |
-
gr.Slider(value=4,label="Num Beams",minimum=2,maximum=6,step=1),
|
24 |
-
gr.Slider(value=90,label="Top-k",minimum=0,maximum=100),
|
25 |
-
gr.Slider(value=0.9,label="Top-p",minimum=0.1,maximum=1,step=0.05),
|
26 |
-
gr.Slider(value=1.1,label="Repetition penalty",minimum=0.2,maximum=2,step=0.1)
|
27 |
-
|
28 |
-
],
|
29 |
-
outputs=[
|
30 |
-
gr.Textbox(label="Generated Text 1"),
|
31 |
-
gr.Textbox(label="Generated Text 2"),
|
32 |
-
gr.Textbox(label="Generated Text 3")],
|
33 |
-
title = "Text Generator GPT2 Pipeline",
|
34 |
-
description = "Text Generator. \n Temperature control randomness, lowering results in less random completions. As approach the zero, the model becomes more repetitive."
|
35 |
-
)
|
36 |
-
|
37 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|