Commit
·
96931f1
1
Parent(s):
317bf2b
Update parquet files (step 114 of 121)
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- spaces/101-5/gpt4free/g4f/typing.py +0 -3
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/ArcSoft TotalMedia 3.5 Serial 45k Download and Install Guide.md +0 -193
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Charly 2007 2007 Xvid A Movie That Will Touch Your Heart.md +0 -86
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Fslabs concorde x crack straight How to fly the supersonic jet in FSX and P3D.md +0 -79
- spaces/1gistliPinn/ChatGPT4/Examples/Adobe Photoshop Lightroom CC 6.12 Portable Crack !NEW!ed [crack !NEW!sNow] Full Version.md +0 -6
- spaces/1gistliPinn/ChatGPT4/Examples/American Ninja 5 Full ((EXCLUSIVE)) Movie Kick.md +0 -6
- spaces/1gistliPinn/ChatGPT4/Examples/CRACK Ableton Live 10.0.2 Full NEWy Cracked - Detailed Instructions.md +0 -9
- spaces/1gistliPinn/ChatGPT4/Examples/Dhamaal 720p Movie Kickass Download VERIFIED.md +0 -95
- spaces/1phancelerku/anime-remove-background/Cricket League New Mod APK - The Best Cricket Game for Android Users.md +0 -132
- spaces/1toTree/lora_test/ppdiffusers/pipeline_utils.py +0 -659
- spaces/A00001/bingothoo/src/components/chat-image.tsx +0 -170
- spaces/AISuperheroes/08GR-KitchenSink-AIUIUX/demos/kitchen_sink/run.py +0 -146
- spaces/AIWaves/SOP_Generation-single/Agent/Agent.py +0 -243
- spaces/AP123/Upside-Down-Diffusion/user_history.py +0 -524
- spaces/AgentVerse/agentVerse/agentverse/memory/chat_history.py +0 -77
- spaces/Agusbs98/automatic-ecg-diagnosis/libs.py +0 -31
- spaces/Akmyradov/TurkmenTTSweSTT/vits/text/__init__.py +0 -54
- spaces/AlexWang/lama/bin/calc_dataset_stats.py +0 -88
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/docs/source/ko/optimization/fp16.md +0 -410
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/pipelines/stable_diffusion/test_onnx_stable_diffusion_img2img.py +0 -245
- spaces/Andy1621/uniformer_image_detection/configs/grid_rcnn/grid_rcnn_r101_fpn_gn-head_2x_coco.py +0 -3
- spaces/Andy1621/uniformer_image_detection/configs/vfnet/vfnet_r101_fpn_mdconv_c3-c5_mstrain_2x_coco.py +0 -14
- spaces/Andy1621/uniformer_image_detection/mmdet/core/bbox/samplers/__init__.py +0 -15
- spaces/Andy1621/uniformer_image_segmentation/configs/_base_/models/pspnet_unet_s5-d16.py +0 -50
- spaces/Andy1621/uniformer_image_segmentation/configs/pspnet/pspnet_r18-d8_769x769_80k_cityscapes.py +0 -9
- spaces/AnishKumbhar/ChatBot/text-generation-webui-main/docs/Docker.md +0 -203
- spaces/AnishKumbhar/ChatBot/text-generation-webui-main/modules/ui_parameters.py +0 -106
- spaces/Anthony7906/MengHuiMXD_GPT/locale/extract_locale.py +0 -26
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_internal/utils/entrypoints.py +0 -84
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/cachecontrol/adapter.py +0 -137
- spaces/Audio-AGI/AudioSep/models/CLAP/training/zero_shot.py +0 -95
- spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cpu.cpp +0 -522
- spaces/Benson/text-generation/Examples/Arena Of Global Value Apk.md +0 -80
- spaces/Benson/text-generation/Examples/Camino De Los Titanes Mac Descargar.md +0 -96
- spaces/Benson/text-generation/Examples/Coc Apk.md +0 -77
- spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py +0 -33
- spaces/Big-Web/MMSD/env/Lib/site-packages/pkg_resources/_vendor/packaging/requirements.py +0 -146
- spaces/CVPR/Dual-Key_Backdoor_Attacks/openvqa/data/gqa/gqa_feat_preproc.py +0 -126
- spaces/CVPR/Dual-Key_Backdoor_Attacks/openvqa/openvqa/datasets/gqa/eval/gqa_eval.py +0 -307
- spaces/CVPR/Text2Human/Text2Human/sample_from_pose.py +0 -52
- spaces/CVPR/WALT/mmdet/models/roi_heads/bbox_heads/__init__.py +0 -13
- spaces/CVPR/regionclip-demo/detectron2/modeling/backbone/__init__.py +0 -19
- spaces/Caoyunkang/Segment-Any-Anomaly/SAM/segment_anything/modeling/common.py +0 -43
- spaces/ChrisCaviar/ControlNet-v1-1/utils.py +0 -7
- spaces/ChrisPreston/diff-svc_minato_aqua/utils/audio.py +0 -56
- spaces/Christyyu/textgenerator/README.md +0 -12
- spaces/CikeyQI/meme-api/meme_generator/memes/crawl/__init__.py +0 -43
- spaces/Cpp4App/Cpp4App/CDM/detect_compo/lib_ip/ip_draw.py +0 -139
- spaces/Cristiants/captiongeneration/README.md +0 -12
- spaces/Cropinky/esrgan/realesrgan/version.py +0 -5
spaces/101-5/gpt4free/g4f/typing.py
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
from typing import Dict, NewType, Union, Optional, List, get_type_hints
|
2 |
-
|
3 |
-
sha256 = NewType('sha_256_hash', str)
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/ArcSoft TotalMedia 3.5 Serial 45k Download and Install Guide.md
DELETED
@@ -1,193 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Arcsoft TotalMedia 3.5 Serial 45k: A Complete Guide</h1>
|
3 |
-
<p>If you are looking for a powerful and versatile software that can handle all your media needs, you might have heard of Arcsoft TotalMedia 3.5. This software is a comprehensive solution that allows you to play, record, edit, enhance, convert, and burn media files with ease. But how can you get this software and use it to its full potential? In this article, we will answer all your questions about Arcsoft TotalMedia 3.5 Serial 45k, including what it is, how to get it, how to install and activate it, and how to use it.</p>
|
4 |
-
<h2>arcsoft totalmedia 3.5 serial 45k</h2><br /><p><b><b>DOWNLOAD</b> ☑ <a href="https://byltly.com/2uKvbe">https://byltly.com/2uKvbe</a></b></p><br /><br />
|
5 |
-
<h2>What is Arcsoft TotalMedia 3.5?</h2>
|
6 |
-
<p>Arcsoft TotalMedia 3.5 is a multimedia application that was developed by Arcsoft, a leading software company that specializes in digital imaging and video technologies. It was released in 2009 and has since been updated with several patches and fixes.</p>
|
7 |
-
<p>Arcsoft TotalMedia 3.5 is designed to be an all-in-one media center that can handle various types of media files, such as audio, video, photos, DVDs, Blu-rays, TV shows, and more. It has a user-friendly interface that lets you access all the functions and features with a few clicks.</p>
|
8 |
-
<h3>A brief overview of the software and its features</h3>
|
9 |
-
<p>Some of the main features of Arcsoft TotalMedia 3.5 are:</p>
|
10 |
-
<ul>
|
11 |
-
<li><b>Playback:</b> You can play any media file on your computer or external device with high-quality sound and picture. You can also enjoy online streaming services such as YouTube, Netflix, Hulu, etc.</li>
|
12 |
-
<li><b>Recording:</b> You can record TV shows or movies from your TV tuner card or webcam with various options such as time-shifting, scheduled recording, etc. You can also capture screenshots or videos from your desktop or webcam.</li>
|
13 |
-
<li><b>Editing:</b> You can edit your media files with basic or advanced tools such as trimming, cropping, rotating, adding effects, transitions, subtitles, etc. You can also create slideshows or movies with your photos and videos.</li>
|
14 |
-
<li><b>Enhancing:</b> You can enhance your media files with features such as noise reduction, color correction, brightness adjustment, etc. You can also apply filters or presets to improve the quality of your media files.</li>
|
15 |
-
<li><b>Converting:</b> You can convert your media files to different formats or resolutions according to your needs or preferences. You can also optimize your media files for various devices such as iPhone, iPad, Android, PSP, etc.</li>
|
16 |
-
<li><b>Burning:</b> You can burn your media files to CDs or DVDs with customized menus and labels. You can also create ISO files or disc images from your media files.</li>
|
17 |
-
</ul>
|
18 |
-
<h3>The benefits of using Arcsoft TotalMedia 3.5</h3>
|
19 |
-
<p>Some of the benefits of using Arcsoft TotalMedia 3.5 are:</p>
|
20 |
-
<p>arcsoft totalmedia 3.5 license key 45k<br />
|
21 |
-
arcsoft totalmedia 3.5 activation code 45k<br />
|
22 |
-
arcsoft totalmedia 3.5 crack download 45k<br />
|
23 |
-
arcsoft totalmedia 3.5 full version 45k<br />
|
24 |
-
arcsoft totalmedia 3.5 keygen free 45k<br />
|
25 |
-
arcsoft totalmedia 3.5 serial number 45k<br />
|
26 |
-
arcsoft totalmedia 3.5 product key 45k<br />
|
27 |
-
arcsoft totalmedia 3.5 registration code 45k<br />
|
28 |
-
arcsoft totalmedia 3.5 patch 45k<br />
|
29 |
-
arcsoft totalmedia 3.5 torrent 45k<br />
|
30 |
-
arcsoft totalmedia 3.5 free download 45k<br />
|
31 |
-
arcsoft totalmedia 3.5 software 45k<br />
|
32 |
-
arcsoft totalmedia 3.5 update 45k<br />
|
33 |
-
arcsoft totalmedia 3.5 manual 45k<br />
|
34 |
-
arcsoft totalmedia 3.5 user guide 45k<br />
|
35 |
-
arcsoft totalmedia 3.5 review 45k<br />
|
36 |
-
arcsoft totalmedia 3.5 features 45k<br />
|
37 |
-
arcsoft totalmedia 3.5 system requirements 45k<br />
|
38 |
-
arcsoft totalmedia 3.5 installation guide 45k<br />
|
39 |
-
arcsoft totalmedia 3.5 troubleshooting 45k<br />
|
40 |
-
arcsoft totalmedia 3.5 alternative 45k<br />
|
41 |
-
arcsoft totalmedia 3.5 comparison 45k<br />
|
42 |
-
arcsoft totalmedia 3.5 price 45k<br />
|
43 |
-
arcsoft totalmedia 3.5 discount code 45k<br />
|
44 |
-
arcsoft totalmedia 3.5 coupon code 45k<br />
|
45 |
-
arcsoft totalmedia 3.5 buy online 45k<br />
|
46 |
-
arcsoft totalmedia 3.5 official website 45k<br />
|
47 |
-
arcsoft totalmedia 3.5 customer service number 45k<br />
|
48 |
-
arcsoft totalmedia 3.5 technical support number 45k<br />
|
49 |
-
arcsoft totalmedia 3.5 refund policy 45k<br />
|
50 |
-
arcsoft totalmedia extreme vs ultimate vs suite vs pro vs standard vs lite vs basic vs express vs home edition vs personal edition vs business edition vs enterprise edition vs premium edition vs deluxe edition vs gold edition vs platinum edition vs diamond edition vs titanium edition vs ultimate plus edition vs suite plus edition vs pro plus edition vs standard plus edition vs lite plus edition vs basic plus edition vs express plus edition vs home plus edition vs personal plus edition vs business plus edition vs enterprise plus edition vs premium plus edition vs deluxe plus edition vs gold plus edition vs platinum plus edition vs diamond plus edition vs titanium plus edition (all with serial number or license key or activation code or crack or keygen or product key or registration code or patch or torrent or free download or software or update or manual or user guide or review or features or system requirements or installation guide or troubleshooting or alternative or comparison or price or discount code or coupon code or buy online or official website or customer service number or technical support number or refund policy)</p>
|
51 |
-
<ul>
|
52 |
-
<li><b>Versatility:</b> You can use one software for all your media needs instead of switching between different applications.</li>
|
53 |
-
<li><b>Compatibility:</b> You can use any type of media file regardless of its format or source.</li>
|
54 |
-
<li><b>Ease of use:</b> You can use the software with simple steps and intuitive controls.</li>
|
55 |
-
<li><b>Performance:</b> You can use the software with fast speed and smooth operation.</li>
|
56 |
-
<li><b>Quality:</b> You can use the software with high-quality output and results.</li>
|
57 |
-
</ul>
|
58 |
-
<h2>How to get Arcsoft TotalMedia 3.5 Serial 45k?</h2>
|
59 |
-
<p>If you want to use Arcsoft TotalMedia 3.5 Serial 45k on your computer, you need to get two things: the software itself and the serial number that activates it. There are two ways to get these things: the official way and the alternative way.</p>
|
60 |
-
<h3>The official way: buying the software from Arcsoft website</h3>
|
61 |
-
<p>The official way to get Arcsoft TotalMedia 3.5 Serial 45k is to buy it from the Arcsoft website (https://www.arcsoft.com/totalmedia-theatre/). This is the safest and most reliable way to get the software as you will get the latest version with full support and updates from the developer.</p>
|
62 |
-
<p>The price of Arcsoft TotalMedia 3.5 Serial 45k is $99.99 USD for a single license that can be used on one computer only. You can pay with various methods such as credit card, PayPal, etc. After you complete the payment process, you will receive an email with a download link for the software and a serial number for activation.</p>
|
63 |
-
<h3>The alternative way: downloading the software from third-party sources</h3>
|
64 |
-
<p>The alternative way to get Arcsoft TotalMedia 3.5 Serial 45k is to download it from third-party sources such as torrent sites or file-sharing platforms. This is a risky and illegal way to get the software as you may encounter viruses, malware, spyware, or other threats that may harm your computer or compromise your privacy.</p>
|
65 |
-
<h4>The pros and cons of using third-party sources</h4>
|
66 |
-
<p>Some of the pros of using third-party sources are:</p>
|
67 |
-
<ul>
|
68 |
-
<li><b>Cheaper:</b> You can get the software for free or at a lower price than the official source.</li>
|
69 |
-
<li><b>Faster:</b> You can get the software faster than waiting for the email confirmation from the official source.</li>
|
70 |
-
<li><b>Easier:</b> You can get the software easier than going through the payment process from the official source.</li>
|
71 |
-
</ul>
|
72 |
-
<p>Some of the cons of using third-party sources are:</p>
|
73 |
-
<ul>
|
74 |
-
<li><b>Dangerous:</b> You may expose your computer or personal information to viruses, malware, spyware, or other threats that may damage your system or steal your data.</li>
|
75 |
-
<li><b>Illegal:</b> You may violate the intellectual property rights of Arcsoft or other parties by downloading or using pirated software without permission or license.</li>
|
76 |
-
<li><b>Ineffective:</b> You may not be able to use all the functions or features of the software as some of them may be disabled or corrupted by cracks or patches.</li>
|
77 |
-
<li><b>Insecure:</b> You may not be able to update or upgrade the software as some of them may be blocked or detected by anti-virus programs or online servers.</li>
|
78 |
-
</ul>
|
79 |
-
<h4>The risks and precautions of using third-party sources</h4>
|
80 |
-
<p>If you decide to use third-party sources despite their drawbacks, you should be aware of the risks and take some precautions to minimize them.</p>
|
81 |
-
<p>Some of the risks are:</p>
|
82 |
-
<ul>
|
83 |
-
<li><b>Virus infection:</b> Your computer may be infected by viruses that may slow down your system performance or delete your important files.</li>
|
84 |
-
<li><b>Data theft:</b> Your personal information such as passwords, bank accounts, credit cards, etc., may be stolen by hackers who may use them for fraudulent purposes.</li>
|
85 |
-
<li><b>Lawsuit threat:</b> Your IP address may be traced by authorities who may sue you for copyright infringement or piracy charges.</li>
|
86 |
-
</ul>
|
87 |
-
<p>Some of the precautions are:</p>
|
88 |
-
<ul>
|
89 |
-
<li><b>Virus scan:</b> You should scan any downloaded file with a reliable anti-virus program before opening or installing it on your computer.</li>
|
90 |
-
<h2>How to install and activate Arcsoft TotalMedia 3.5 Serial 45k?</h2>
|
91 |
-
<p>After you get the software and the serial number, you need to install and activate it on your computer. The installation and activation process may vary depending on the source of the software.</p>
|
92 |
-
<h3>The steps for installing the software from the official source</h3>
|
93 |
-
<p>If you bought the software from the Arcsoft website, you can follow these steps to install and activate it:</p>
|
94 |
-
<ol>
|
95 |
-
<li>Click on the download link in the email that you received from Arcsoft and save the file to your computer.</li>
|
96 |
-
<li>Double-click on the file and follow the instructions to install the software on your computer.</li>
|
97 |
-
<li>Launch the software and enter the serial number that you received from Arcsoft in the activation window.</li>
|
98 |
-
<li>Click on Activate and wait for the confirmation message.</li>
|
99 |
-
<li>Enjoy using Arcsoft TotalMedia 3.5 Serial 45k on your computer.</li>
|
100 |
-
</ol>
|
101 |
-
<h3>The steps for installing the software from a third-party source</h3>
|
102 |
-
<p>If you downloaded the software from a third-party source, you can follow these steps to install and activate it:</p>
|
103 |
-
<ol>
|
104 |
-
<li>Scan the downloaded file with an anti-virus program and make sure it is safe to open.</li>
|
105 |
-
<li>Extract the file to a folder on your computer using a program such as WinRAR or 7-Zip.</li>
|
106 |
-
<li>Open the folder and look for a file named Setup.exe or Install.exe and double-click on it.</li>
|
107 |
-
<li>Follow the instructions to install the software on your computer. You may need to uncheck some options or decline some offers that may come with the software.</li>
|
108 |
-
<li>Look for a file named Crack.exe or Patch.exe in the folder and double-click on it. You may need to copy and paste it to the installation directory of the software.</li>
|
109 |
-
<li>Run the crack or patch and wait for it to finish. It may modify some files or registry entries of the software.</li>
|
110 |
-
<li>Launch the software and check if it is activated. You may not need to enter a serial number as the crack or patch may have done it for you.</li>
|
111 |
-
<li>Enjoy using Arcsoft TotalMedia 3.5 Serial 45k on your computer.</li>
|
112 |
-
</ol>
|
113 |
-
<h4>How to find and enter the serial number</h4>
|
114 |
-
<p>If you need to enter a serial number to activate the software, you can find it in different ways depending on the source of the software.</p>
|
115 |
-
<p>If you bought the software from the Arcsoft website, you can find the serial number in:</p>
|
116 |
-
<ul>
|
117 |
-
<li>The email that you received from Arcsoft after completing the payment process.</li>
|
118 |
-
<li>The order confirmation page on the Arcsoft website after completing the payment process.</li>
|
119 |
-
<li>The My Account section on the Arcsoft website after logging in with your email and password.</li>
|
120 |
-
</ul>
|
121 |
-
<p>If you downloaded the software from a third-party source, you can find the serial number in:</p>
|
122 |
-
<ul>
|
123 |
-
<li>The folder where you extracted the downloaded file. There may be a file named Serial.txt or Key.txt that contains the serial number.</li>
|
124 |
-
<li>The crack or patch that came with the downloaded file. There may be a button or option that generates or shows a serial number for you.</li>
|
125 |
-
<li>The internet. You can search for Arcsoft TotalMedia 3.5 Serial 45k on Google or other search engines and look for websites that provide serial numbers for free. However, this is not recommended as some of these websites may be unsafe or unreliable.</li>
|
126 |
-
</ul>
|
127 |
-
<p>To enter the serial number, you can follow these steps:</p>
|
128 |
-
<ol>
|
129 |
-
<li>Launch the software and look for an activation window that asks for a serial number.</li>
|
130 |
-
<li>Copy and paste or type in the serial number in the designated field.</li>
|
131 |
-
<li>Click on Activate and wait for a confirmation message.</li>
|
132 |
-
</ol>
|
133 |
-
<h4>How to verify and troubleshoot the activation process</h4>
|
134 |
-
<p>To verify if your software is activated, you can follow these steps:</p>
|
135 |
-
<ol>
|
136 |
-
<li>Launch the software and look for an About or Help menu at the top or bottom of the screen.</li>
|
137 |
-
<li>Select About or Help and look for a window that shows information about the software version, license, status, etc.</li>
|
138 |
-
<li>Check if there is a message that says "Activated" or "Registered" next to the status or license field. If there is, then your software is activated. If there is not, then your software is not activated.</li>
|
139 |
-
</ol>
|
140 |
-
<p>To troubleshoot if your software is not activated, you can try these steps:</p>
|
141 |
-
<ul>
|
142 |
-
<li>Make sure you entered the correct serial number without any typos or spaces.</li>
|
143 |
-
<li>Make sure you have an internet connection as some activation processes may require online verification.</li>
|
144 |
-
<li>Make sure you have disabled any anti-virus programs or firewalls that may block or interfere with the activation process.</li>
|
145 |
-
<li>Make sure you have run the crack or patch as administrator if you downloaded the software from a third-party source.</li>
|
146 |
-
<li>Contact Arcsoft customer support (https://www.arcsoft.com/support/) if you bought the software from the official source and still have problems with activation.</li>
|
147 |
-
<h2>How to use Arcsoft TotalMedia 3.5 Serial 45k?</h2>
|
148 |
-
<p>After you install and activate Arcsoft TotalMedia 3.5 Serial 45k on your computer, you can start using it for all your media needs. The software has a simple and intuitive interface that lets you access all its functions and features with ease. Here are some of the main functions and features of the software and how to use them:</p>
|
149 |
-
<h3>The main functions and features of the software</h3>
|
150 |
-
<p>Arcsoft TotalMedia 3.5 Serial 45k has four main tabs at the top of the screen: Home, Play, Edit, and Data. Each tab has different sub-tabs that correspond to different functions and features of the software. Here is a table that summarizes what each tab and sub-tab does:</p>
|
151 |
-
| Tab | Sub-tab | Function | | --- | --- | --- | | Home | Media Library | Allows you to browse, organize, and manage your media files on your computer or external device | | Home | Online Media | Allows you to access online streaming services such as YouTube, Netflix, Hulu, etc | | Home | TV | Allows you to watch TV shows or movies from your TV tuner card | | Home | Capture | Allows you to capture screenshots or videos from your desktop or webcam | | Play | Video | Allows you to play video files with various options such as subtitles, audio tracks, aspect ratio, etc | | Play | Music | Allows you to play audio files with various options such as playlists, equalizer, visualizer, etc | | Play | Photo | Allows you to view photo files with various options such as slideshow, zoom, rotate, etc | | Play | DVD/BD | Allows you to play DVD or Blu-ray discs with various options such as menus, chapters, angles, etc | | Edit | Video Editor | Allows you to edit video files with basic or advanced tools such as trimming, cropping, rotating, adding effects, transitions, subtitles, etc | | Edit | Photo Editor | Allows you to edit photo files with basic or advanced tools such as cropping, rotating, resizing, adding effects, filters, presets, etc | | Edit | Movie Maker | Allows you to create movies with your photos and videos with various options such as themes, music, titles, credits, etc | | Edit | Slideshow Maker | Allows you to create slideshows with your photos with various options such as transitions, music, titles, credits, etc | | Data | Converter | Allows you to convert media files to different formats or resolutions according to your needs or preferences | | Data | Device Transfer | Allows you to transfer media files to different devices such as iPhone, iPad, Android, PSP, etc | | Data | Disc Burner | Allows you to burn media files to CDs or DVDs with customized menus and labels | | Data | Disc Creator | Allows you to create ISO files or disc images from media files | <h4>How to play and record media files</h4>
|
152 |
-
<p>To play media files with Arcsoft TotalMedia 3.5 Serial 45k, you can follow these steps:</p>
|
153 |
-
<ol><li>Select the Play tab at the top of the screen</li><li>Select the sub-tab that corresponds to the type of media file that you want to play (Video, Music, Photo, or DVD/BD)</li><li>Browse your computer or external device for the media file that you want to play</li><li>Double-click on the media file or drag-and-drop it onto the player window</li><li>Use the controls at the bottom of the player window to adjust volume, playback speed, fullscreen mode, etc</li></ol>
|
154 |
-
<p>To record media files with Arcsoft TotalMedia 3.5 Serial 45k, you can follow these steps:</p>
|
155 |
-
<ol><li>Select the Home tab at the top of the screen</li><li>Select sub-tab that corresponds to the source of the media file that you want to record (TV or Capture)</li>
|
156 |
-
<li>Choose the TV tuner card or webcam that you want to use for recording</li>
|
157 |
-
<li>Use the controls at the bottom of the recorder window to adjust channel, resolution, quality, etc</li>
|
158 |
-
<li>Click on the Record button to start recording</li>
|
159 |
-
<li>Click on the Stop button to stop recording</li>
|
160 |
-
<li>Find the recorded file in the Media Library or the folder that you specified for saving</li>
|
161 |
-
</ol>
|
162 |
-
<h4>How to edit and enhance media files</h4>
|
163 |
-
<p>To edit media files with Arcsoft TotalMedia 3.5 Serial 45k, you can follow these steps:</p>
|
164 |
-
<ol><li>Select the Edit tab at the top of the screen</li><li>Select the sub-tab that corresponds to the type of media file that you want to edit (Video Editor, Photo Editor, Movie Maker, or Slideshow Maker)</li><li>Browse your computer or external device for the media file that you want to edit</li><li>Double-click on the media file or drag-and-drop it onto the editor window</li><li>Use the tools at the left or right side of the editor window to trim, crop, rotate, add effects, transitions, subtitles, etc</li><li>Use the preview window at the center of the editor window to check your changes</li><li>Click on the Save or Export button to save or export your edited file</li></ol>
|
165 |
-
<p>To enhance media files with Arcsoft TotalMedia 3.5 Serial 45k, you can follow these steps:</p>
|
166 |
-
<ol><li>Select the Edit tab at the top of the screen</li><li>Select the sub-tab that corresponds to the type of media file that you want to enhance (Video Editor or Photo Editor)</li><li>Browse your computer or external device for the media file that you want to enhance</li><li>Double-click on the media file or drag-and-drop it onto the editor window</li><li>Use the tools at the left or right side of the editor window to adjust noise reduction, color correction, brightness, contrast, etc</li><li>Use the preview window at the center of the editor window to check your changes</li><li>Click on the Save or Export button to save or export your enhanced file</li></ol>
|
167 |
-
<h4>How to convert and burn media files</h4>
|
168 |
-
<p>To convert media files with Arcsoft TotalMedia 3.5 Serial 45k, you can follow these steps:</p>
|
169 |
-
<ol><li>Select the Data tab at the top of the screen</li><li>Select the Converter sub-tab</li><li>Browse your computer or external device for the media file that you want to convert</li><li>Double-click on the media file or drag-and-drop it onto the converter window</li><li>Select the output format and resolution that you want from the drop-down menu at the bottom of the converter window</li><li>Click on the Start button to start converting</li>
|
170 |
-
<li>Find the converted file in the folder that you specified for saving</li>
|
171 |
-
</ol>
|
172 |
-
<p>To burn media files with Arcsoft TotalMedia 3.5 Serial 45k, you can follow these steps:</p>
|
173 |
-
<ol><li>Select the Data tab at the top of the screen</li>
|
174 |
-
<li>Select the Disc Burner sub-tab</li>
|
175 |
-
<li>Browse your computer or external device for the media file that you want to burn</li>
|
176 |
-
<li>Double-click on the media file or drag-and-drop it onto the burner window</li>
|
177 |
-
<li>Select the disc type and label that you want from the drop-down menu at the bottom of the burner window</li>
|
178 |
-
<li>Insert a blank CD or DVD into your disc drive and click on the Burn button to start burning</li>
|
179 |
-
<li>Eject the disc when the burning process is completed</li>
|
180 |
-
</ol>
|
181 |
-
<h2>Conclusion</h2>
|
182 |
-
<p>Arcsoft TotalMedia 3.5 Serial 45k is a great software that can help you with all your media needs. It can play, record, edit, enhance, convert, and burn any type of media file with ease and quality. However, you need to be careful when getting this software as there are two ways to get it: the official way and the alternative way. The official way is safer and more reliable but more expensive and slower. The alternative way is cheaper and faster but more dangerous and illegal. You also need to know how to install and activate this software as well as how to use its main functions and features. We hope this article has given you a complete guide on Arcsoft TotalMedia 3.5 Serial 45k and helped you make an informed decision.</p>
|
183 |
-
<h2>Frequently Asked Questions (FAQs)</h2>
|
184 |
-
<p>Here are some of the most common questions that people ask about Arcsoft TotalMedia 3.5 Serial 45k:</p>
|
185 |
-
<ol>
|
186 |
-
<li><b>What are the system requirements for Arcsoft TotalMedia 3.5 Serial 45k?</b></br>The minimum system requirements for Arcsoft TotalMedia 3.5 Serial 45k are:</br>- Windows XP/Vista/7/8/10 (32-bit or 64-bit)</br>- Intel Pentium IV 2.4 GHz or equivalent processor</br>- 512 MB RAM (1 GB recommended)</br>- 300 MB free hard disk space (1 GB recommended)</br>- DirectX 9.0c compatible graphics card with 64 MB VRAM (128 MB recommended)</br>- DirectX compatible sound card </br>- DVD-ROM drive </br>- Internet connection for activation and updates </br></br>The recommended system requirements for Arcsoft TotalMedia 3.5 Serial 45k are:</br>- Windows XP/Vista/7/8/10 (32-bit or 64-bit)</br>- Intel Core 2 Duo E6400 or equivalent processor </br>- 2 GB RAM </br>- 1 GB free hard disk space </br>- DirectX 9.0c compatible graphics card with 256 MB VRAM </br>- DirectX compatible sound card </br>- DVD-ROM drive </br>- Internet connection for activation and updates </br></br></p></p></p></p></p></p></p></p></p></p></p></p></p>
|
187 |
-
<li><b>Is Arcsoft TotalMedia 3.5 Serial 45k compatible with Windows 10?</b></br>Yes, Arcsoft TotalMedia 3.5 Serial 45k is compatible with Windows 10 as long as you have installed all the latest updates and patches from Microsoft and Arcsoft.</br></br>
|
188 |
-
<li><b>How can I update Arcsoft TotalMedia 3.5 Serial 45k?</b></br>You can update Arcsoft TotalMedia 3.5 Serial 45k by following these steps:</br>- Launch the software and click on Help menu at the top of the screen.</br>- Select Check for Updates and wait for a window that shows if there are any available updates.</br>- Click on Download and Install if there are any available updates.</br>- Follow the instructions to complete the update process.</br>- Restart your computer if prompted.</br></br>
|
189 |
-
<li><b>How can I contact Arcsoft customer support?</b></br>You can contact Arcsoft customer support by following these steps:</br>- Visit https://www.arcsoft.com/support/ and select your product from the drop-down menu.</br>- Select your issue category from another drop-down menu.</br>- Fill in your name, email address, subject, description, attachment (optional), and verification code.</br>- Click on Submit and wait for a reply from Arcsoft customer support.</br></br>
|
190 |
-
<li><b>How can I uninstall Arcsoft TotalMedia 3.5 Serial 45k?</b></br>You can uninstall Arcsoft TotalMedia 3.5 Serial 45k by following these steps:</br>- Go to Start menu and select Control Panel.</br>- Select Programs and Features or Add/Remove Programs.</br>- Find Arcsoft TotalMedia 3.5 Serial 45k in the list of installed programs and click on Uninstall/Change.</br>- Follow the instructions to complete the uninstallation process.</br>- Restart your computer if prompted.</br></ol>
|
191 |
-
</p> 0a6ba089eb<br />
|
192 |
-
<br />
|
193 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Charly 2007 2007 Xvid A Movie That Will Touch Your Heart.md
DELETED
@@ -1,86 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Charly 2007 2007 Xvid: A French Drama Film by Isild Le Besco</h1>
|
3 |
-
<p>If you are looking for a different and unconventional film to watch, you might want to check out <strong>Charly 2007 2007 Xvid</strong>, a French drama film directed by Isild Le Besco. This film tells the story of Nicolas, a troubled teenager who runs away from home and meets Charly, a mysterious and seductive woman who takes him on a road trip across France. Along the way, they develop a complex and intense relationship that challenges their identities and their destinies. In this article, we will explore the plot, the reception, and the technical aspects of this film, and why you should watch it.</p>
|
4 |
-
<h2>Charly 2007 2007 Xvid</h2><br /><p><b><b>Download</b> → <a href="https://byltly.com/2uKxeU">https://byltly.com/2uKxeU</a></b></p><br /><br />
|
5 |
-
<h2>The Plot of Charly 2007 2007 Xvid</h2>
|
6 |
-
<p>The film begins with Nicolas (Kolia Litscher), a 14-year-old boy who lives in a foster home with his younger sister. He is unhappy and bored with his life, and he often gets into trouble at school and with the police. One day, he decides to run away from home and hitchhike to Brittany, where he hopes to find his biological father. On his way, he meets Charly (Julie-Marie Parmentier), a red-haired woman in her twenties who offers him a ride. She claims to be a photographer who travels around France taking pictures of landscapes and people. She also says that she has a terminal illness and that she wants to enjoy her life as much as possible.</p>
|
7 |
-
<p>Nicolas is intrigued by Charly's personality and appearance, and he agrees to go with her. They start a journey across France, stopping at various places such as hotels, motels, campsites, forests, beaches, and cities. They also encounter different people along the way, such as truck drivers, farmers, hippies, bikers, and tourists. Nicolas and Charly share intimate moments of conversation, laughter, sex, and violence. They also reveal secrets about their pasts and their dreams for the future. Nicolas gradually falls in love with Charly, but he also realizes that she is not who she seems to be. She is unpredictable, manipulative, and dangerous. She often lies to him about her identity, her motives, and her feelings. She also has a dark side that involves drugs, theft, prostitution, and murder.</p>
|
8 |
-
<p>The film ends with a shocking twist that reveals the true nature of Charly's illness and her relationship with Nicolas. The film explores themes such as adolescence, sexuality, identity, freedom, love, death, and fate.</p>
|
9 |
-
<h2>The Reception of Charly 2007 2007 Xvid</h2>
|
10 |
-
<p>The film received mixed reviews from critics and audiences when it was released in France in 2007. Some praised it for its originality, its realism, its cinematography, its acting performances, and its daring portrayal of sexuality and violence. Others criticized it for its lack of coherence, its implausibility, its moral ambiguity, its excessive nudity and gore, and its exploitation of underage actors. The film was nominated for two César Awards (the French equivalent of the Oscars) for Best First Feature Film and Most Promising Actress (Julie-Marie Parmentier). However, it did not win any awards.</p>
|
11 |
-
<p>Charly 2007 movie download Xvid<br />
|
12 |
-
Watch Charly 2007 online free Xvid<br />
|
13 |
-
Charly 2007 film review Xvid<br />
|
14 |
-
Charly 2007 full movie Xvid<br />
|
15 |
-
Charly 2007 subtitles Xvid<br />
|
16 |
-
Charly 2007 trailer Xvid<br />
|
17 |
-
Charly 2007 cast and crew Xvid<br />
|
18 |
-
Charly 2007 DVD release date Xvid<br />
|
19 |
-
Charly 2007 streaming Xvid<br />
|
20 |
-
Charly 2007 plot summary Xvid<br />
|
21 |
-
Charly 2007 soundtrack Xvid<br />
|
22 |
-
Charly 2007 awards and nominations Xvid<br />
|
23 |
-
Charly 2007 box office Xvid<br />
|
24 |
-
Charly 2007 behind the scenes Xvid<br />
|
25 |
-
Charly 2007 director's cut Xvid<br />
|
26 |
-
Charly 2007 trivia and facts Xvid<br />
|
27 |
-
Charly 2007 quotes and dialogues Xvid<br />
|
28 |
-
Charly 2007 genre and rating Xvid<br />
|
29 |
-
Charly 2007 based on a true story Xvid<br />
|
30 |
-
Charly 2007 remake or sequel Xvid<br />
|
31 |
-
Charly 2007 torrent magnet link Xvid<br />
|
32 |
-
Charly 2007 Blu-ray quality Xvid<br />
|
33 |
-
Charly 2007 runtime and language Xvid<br />
|
34 |
-
Charly 2007 deleted scenes Xvid<br />
|
35 |
-
Charly 2007 bloopers and outtakes Xvid<br />
|
36 |
-
Charly 2007 fan art and memes Xvid<br />
|
37 |
-
Charly 2007 analysis and interpretation Xvid<br />
|
38 |
-
Charly 2007 comparison with other movies Xvid<br />
|
39 |
-
Charly 2007 best scenes and moments Xvid<br />
|
40 |
-
Charly 2007 worst scenes and mistakes Xvid<br />
|
41 |
-
Charly 2007 easter eggs and references Xvid<br />
|
42 |
-
Charly 2007 alternate endings and theories Xvid<br />
|
43 |
-
Charly 2007 making of and production details Xvid<br />
|
44 |
-
Charly 2007 location and setting Xvid<br />
|
45 |
-
Charly 2007 costumes and makeup Xvid<br />
|
46 |
-
Charly 2007 special effects and CGI Xvid<br />
|
47 |
-
Charly 2007 score and music Xvid<br />
|
48 |
-
Charly 2007 themes and messages Xvid<br />
|
49 |
-
Charly 2007 characters and relationships Xvid<br />
|
50 |
-
Charly 2007 controversy and criticism Xvid<br />
|
51 |
-
Charly 2007 history and background Xvid<br />
|
52 |
-
Charly 2007 inspiration and influence Xvid<br />
|
53 |
-
Charly 2007 adaptation and source material Xvid<br />
|
54 |
-
Charly 2007 legal issues and lawsuits Xvid<br />
|
55 |
-
Charly 2007 merchandise and collectibles Xvid<br />
|
56 |
-
Charly 2007 interviews and podcasts Xvid<br />
|
57 |
-
Charly 2007 articles and blogs Xvid<br />
|
58 |
-
Charly 2007 books and comics Xvid<br />
|
59 |
-
Charly 2007 games and apps Xvid<br />
|
60 |
-
Charly 2007 spin-offs and prequels Xvid</p>
|
61 |
-
<p>The film also caused controversy and censorship issues in some countries where it was distributed. For example, in Australia, the film was banned for its depiction of child pornography and sexual abuse. In Germany, the film was cut by 16 minutes to remove some scenes of graphic violence and sex involving minors. In Italy, the film was rated VM18 (forbidden for minors under 18) for its explicit content. In Spain, the film was rated X (restricted to adult theaters) for its extreme scenes of sex and violence.</p>
|
62 |
-
<h2>The Technical Aspects of Charly 2007 2007 Xvid</h2>
|
63 |
-
<p>The film was directed by Isild Le Besco, a French actress and filmmaker who made her debut as a director with this film. She also wrote the screenplay and co-produced the film. She was inspired by her own experiences as a runaway teenager and by her fascination with the character of Charly, whom she met in real life. She wanted to make a film that was raw, honest, and spontaneous, without following any conventional rules or genres. She also wanted to explore the emotions and sensations of being young, free, and in love.</p>
|
64 |
-
<p>The film was shot in digital video with a handheld camera, giving it a documentary-like feel and a sense of immediacy and intimacy. The camera follows the characters closely, capturing their expressions, movements, and interactions. The film also uses natural lighting, ambient sound, and improvised dialogue, creating a realistic and immersive atmosphere. The film has a nonlinear and fragmented structure, with frequent flashbacks, flash-forwards, and jump cuts. The film also mixes different styles and tones, such as drama, comedy, romance, thriller, and horror.</p>
|
65 |
-
<p>The film has a minimalistic and eclectic soundtrack that consists of various songs and music genres that reflect the mood and the personality of the characters. Some of the songs and artists featured in the film are: "L'Amour à la Plage" by Niagara, "La Vie en Rose" by Edith Piaf, "I Wanna Be Your Dog" by The Stooges, "Killing in the Name" by Rage Against the Machine, "La Bamba" by Ritchie Valens, "Hallelujah" by Leonard Cohen, "The End" by The Doors, and "Charly" by Isild Le Besco.</p>
|
66 |
-
<p>The film was released on DVD in France in 2008 with English subtitles. The DVD also includes some bonus features such as interviews with the director and the actors, behind-the-scenes footage, deleted scenes, and a photo gallery.</p>
|
67 |
-
<h1>Conclusion: Why You Should Watch Charly 2007 2007 Xvid</h1>
|
68 |
-
<p>In conclusion, <strong>Charly 2007 2007 Xvid</strong> is a film that is not for everyone. It is a challenging and provocative film that explores themes that are controversial and disturbing. It is also a film that is original and unconventional, that breaks the boundaries of cinema and storytelling. It is a film that is realistic and immersive, that shows the beauty and the ugliness of life and love. It is a film that is emotional and sensual, that makes you feel and think. It is a film that is unforgettable and unique.</p>
|
69 |
-
<p>If you are looking for a different and unconventional film to watch, you might want to give <strong>Charly 2007 2007 Xvid</strong> a try. You might love it or hate it, but you will not be indifferent to it.</p>
|
70 |
-
<h2>FAQs</h2>
|
71 |
-
<p>Here are some frequently asked questions and answers about the film:</p>
|
72 |
-
<ul>
|
73 |
-
<li><strong>Q: Is Charly 2007 2007 Xvid based on a true story?</strong></li>
|
74 |
-
<li>A: The film is partly based on the director's own experiences as a runaway teenager and partly inspired by a real person named Charly whom she met in real life. However, the film is not a biographical or documentary film. It is a fictional and artistic interpretation of reality.</li>
|
75 |
-
<li><strong>Q: How old were the actors who played Nicolas and Charly?</strong></li>
|
76 |
-
<li>A: Kolia Litscher was 14 years old and Julie-Marie Parmentier was 26 years old when they filmed the movie. They were both professional actors who had previous experience in cinema and theater.</li>
|
77 |
-
<li><strong>Q: How did they film the sex scenes involving minors?</strong></li>
|
78 |
-
<li>A: The sex scenes involving minors were filmed with the consent of the actors and their parents or legal guardians. They were also filmed with the supervision of a child protection officer and a psychologist. The sex scenes were simulated and not real. They were also edited in a way that did not show any explicit nudity or penetration.</li>
|
79 |
-
<li><strong>Q: What is the meaning of the title Charly 2007 2007 Xvid?</strong></li>
|
80 |
-
<li>A: The title Charly 2007 2007 Xvid has multiple meanings. It refers to the name of the main character (Charly), the year of release of the film (2007), the format of the video file (Xvid), and the director's initials (Isild Le Besco).</li>
|
81 |
-
<li><strong>Q: What is the message or moral of the film?</strong></li>
|
82 |
-
<li>A: The film does not have a clear or definitive message or moral. It is open to interpretation and discussion. It invites the viewers to form their own opinions and judgments about the characters and their actions. It also challenges the viewers to question their own values and beliefs about life and love.</li>
|
83 |
-
</ul>
|
84 |
-
</p> 0a6ba089eb<br />
|
85 |
-
<br />
|
86 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Fslabs concorde x crack straight How to fly the supersonic jet in FSX and P3D.md
DELETED
@@ -1,79 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Fslabs Concorde X Crack Straight: How to Fly the Legendary Supersonic Jet in FSX</h1>
|
3 |
-
<h2>Introduction</h2>
|
4 |
-
<p>If you are a fan of flight simulation, you probably have heard of <strong>Fslabs Concorde X</strong>, one of the most realistic and detailed add-ons for Microsoft Flight Simulator X (FSX). This product recreates the iconic Concorde, the only supersonic passenger airliner that ever flew commercially, with stunning graphics, accurate flight dynamics, complex systems, and immersive sound effects.</p>
|
5 |
-
<h2>fslabs concorde x crack straight</h2><br /><p><b><b>Download Zip</b> ❤ <a href="https://byltly.com/2uKwnv">https://byltly.com/2uKwnv</a></b></p><br /><br />
|
6 |
-
<p>However, Fslabs Concorde X is not a cheap product. It costs $99.95 for FSX and $139.95 for Prepar3D (P3D), which is a lot of money for some people. That's why some people resort to using a <strong>crack</strong>, which is a modified file that bypasses the activation process and allows them to use the product without paying for it.</p>
|
7 |
-
<p>But is using a crack worth it? What are the risks and drawbacks of doing so? And what are the benefits and features of buying the official product instead? In this article, we will answer these questions and show you how to fly Fslabs Concorde X Crack Straight in FSX.</p>
|
8 |
-
<h2>How to Install Fslabs Concorde X Crack Straight</h2>
|
9 |
-
<p>The first step to fly Fslabs Concorde X Crack Straight is to install it on your computer. To do that, you will need to find and download the crack file from a website that offers it. There are many websites that claim to have working cracks for Fslabs Concorde X, but most of them are fake or malicious. They may contain viruses, malware, spyware, or adware that can harm your computer or steal your personal information.</p>
|
10 |
-
<p>One of the websites that seems to have a working crack for Fslabs Concorde X is <a href="https://lexcliq.com/fslabs-concorde-x-__link__-crack-straight/">LexCliq</a>. However, we do not recommend or endorse this website or any other website that provides cracks. Use them at your own risk and discretion.</p>
|
11 |
-
<p>Once you have downloaded the crack file from LexCliq or another website, you will need to extract it using a program like WinRAR or 7-Zip. You will get a folder called "FSLabs_Concorde_X_Crack_Straight" that contains two files: "FSL_ConcX.dll" and "readme.txt". You will need to copy these files to your FSX folder, which is usually located at "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X".</p>
|
12 |
-
<p>After copying the files, you can run FSX and select Concorde X as your aircraft. You should see a message saying "FSLABS CONCORDE-X ACTIVATED" on the top left corner of your screen. This means that the crack worked and you can use Fslabs Concorde X without activation.</p>
|
13 |
-
<p>fslabs concorde x free download full version<br />
|
14 |
-
fslabs concorde x serial key generator<br />
|
15 |
-
fslabs concorde x activation code crack<br />
|
16 |
-
fslabs concorde x cracked by skidrow<br />
|
17 |
-
fslabs concorde x torrent download link<br />
|
18 |
-
fslabs concorde x license key crack<br />
|
19 |
-
fslabs concorde x patch v1.41 crack<br />
|
20 |
-
fslabs concorde x crack only download<br />
|
21 |
-
fslabs concorde x full game crack<br />
|
22 |
-
fslabs concorde x crack fix error<br />
|
23 |
-
fslabs concorde x crack no survey no password<br />
|
24 |
-
fslabs concorde x crack for windows 10<br />
|
25 |
-
fslabs concorde x crack without virus<br />
|
26 |
-
fslabs concorde x crack working 100%<br />
|
27 |
-
fslabs concorde x crack updated version<br />
|
28 |
-
fslabs concorde x crack with all liveries<br />
|
29 |
-
fslabs concorde x crack for fsx steam edition<br />
|
30 |
-
fslabs concorde x crack for prepar3d v4<br />
|
31 |
-
fslabs concorde x crack for prepar3d v5<br />
|
32 |
-
fslabs concorde x crack for microsoft flight simulator 2020<br />
|
33 |
-
fslabs concorde x crack instructions guide<br />
|
34 |
-
fslabs concorde x crack installation video tutorial<br />
|
35 |
-
fslabs concorde x crack review and gameplay<br />
|
36 |
-
fslabs concorde x crack features and benefits<br />
|
37 |
-
fslabs concorde x crack system requirements and compatibility<br />
|
38 |
-
fslabs concorde x crack support and customer service<br />
|
39 |
-
fslabs concorde x crack feedback and testimonials<br />
|
40 |
-
fslabs concorde x crack comparison and alternatives<br />
|
41 |
-
fslabs concorde x crack tips and tricks<br />
|
42 |
-
fslabs concorde x crack best practices and recommendations<br />
|
43 |
-
fslabs concorde x crack pros and cons<br />
|
44 |
-
fslabs concorde x crack advantages and disadvantages<br />
|
45 |
-
fslabs concorde x crack facts and myths<br />
|
46 |
-
fslabs concorde x crack dos and don'ts<br />
|
47 |
-
fslabs concorde x crack faqs and answers<br />
|
48 |
-
fslabs concorde x crack problems and solutions<br />
|
49 |
-
fslabs concorde x crack issues and fixes<br />
|
50 |
-
fslabs concorde x crack bugs and glitches<br />
|
51 |
-
fslabs concorde x crack updates and news<br />
|
52 |
-
fslabs concorde x crack forum and community<br />
|
53 |
-
fslabs concorde x crack online and offline mode<br />
|
54 |
-
fslabs concorde x crack multiplayer and co-op mode<br />
|
55 |
-
fslabs concorde x crack mods and addons<br />
|
56 |
-
fslabs concorde x crack cheats and hacks<br />
|
57 |
-
fslabs concorde x crack codes and keys<br />
|
58 |
-
fslabs concorde x crack tools and utilities<br />
|
59 |
-
fslabs concorde x crack resources and links<br />
|
60 |
-
fslabs concorde x crack deals and discounts<br />
|
61 |
-
fslabs concorde x crack offers and promotions</p>
|
62 |
-
<p>If you don't see this message or you see an error message instead, it means that the crack didn't work or it was detected by Fslabs. In that case, you will need to delete the files you copied and try another crack or buy the official product.</p>
|
63 |
-
<h2>How to Fly Fslabs Concorde X Crack Straight</h2>
|
64 |
-
<p>Now that you have installed Fslabs Concorde X Crack Straight on your computer, you can start flying it in FSX. However, flying Concorde is not easy. It requires a lot of skill, knowledge, and practice. You will need to follow a detailed checklist, set up various systems, monitor multiple gauges, adjust fuel balance, manage engine thrust, control speed and altitude, and more.</p>
|
65 |
-
<p>To help you fly Fslabs Concorde X Crack Straight successfully, we will give you a brief overview of how to do it. However, this is not a comprehensive tutorial or manual. For more information and guidance, we recommend reading the official documentation that comes with Fslabs Concorde X or watching some videos on YouTube.</p>
|
66 |
-
<p>Here are some basic steps on how to fly Fslabs Concorde X Crack Straight:</p>
|
67 |
-
<ul>
|
68 |
-
<li><strong>Set up the cockpit</strong>: Before starting your flight, you will need to set up the cockpit according to your preferences and flight plan. You will need to adjust your seat position, set your views, configure your displays, tune your radios, enter your waypoints, set your fuel load, check your weight and balance, etc.</li>
|
69 |
-
<li><strong>Configure the systems</strong>: After setting up the cockpit, you will need to configure various systems on Concorde such as electrical power, hydraulics, air conditioning, pressurization, fuel pumps, anti-ice, etc. You will also need to perform some tests on your engines, brakes, flight controls, instruments, etc.</li>
|
70 |
-
<li><strong>Take off and climb</strong>: When you are ready to take off, you will need to request clearance from ATC (if enabled), taxi to the runway (preferably one that is long enough for Concorde), line up with the centerline (using nosewheel steering), apply full throttle (using afterburners), release brakes (using toe brakes), accelerate (using rudder pedals), rotate (using yoke), retract landing gear (using G key), retract flaps (using F6 key), turn off afterburners (using Shift+F4 keys), climb (using yoke), engage autopilot (using Z key), etc.</li>
|
71 |
-
<li><strong>Cruise at Mach 2</strong>: When you reach about 28,000 feet (FL280), you will need to accelerate again using afterburners until you reach Mach 1 (the speed of sound). Then you will need to climb further until you reach about 50,000 feet (FL500), where you will reach Mach 2 (twice the speed of sound). You will also need to adjust your fuel balance using transfer pumps and trim tanks during cruise.</li>
|
72 |
-
<li><strong>Descend and land</strong>: When you approach your destination airport (about 200 miles away), you will need to request descent clearance from ATC (if enabled), reduce speed using airbrakes (using / key), descend using autopilot or manually (using yoke), turn off afterburners (using Shift+F4 keys), extend landing gear (using G key), extend flaps (using F7 key), align with runway using ILS or visually (using yoke), flare (using yoke), touch down gently (using yoke), apply reverse thrust (using F2 key), apply brakes (using . key), exit runway (using rudder pedals), taxi to gate (using nosewheel steering), etc.</li>
|
73 |
-
</ul>
|
74 |
-
<h2>Conclusion</h2>
|
75 |
-
folder of your FSX installation.</strong></li>
|
76 |
-
</ul>
|
77 |
-
</p> 0a6ba089eb<br />
|
78 |
-
<br />
|
79 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Adobe Photoshop Lightroom CC 6.12 Portable Crack !NEW!ed [crack !NEW!sNow] Full Version.md
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<h2>Adobe Photoshop Lightroom CC 6.12 Portable Cracked [CracksNow] Full Version</h2><br /><p><b><b>Download</b> ———>>> <a href="https://imgfil.com/2uxYJw">https://imgfil.com/2uxYJw</a></b></p><br /><br />
|
2 |
-
<br />
|
3 |
-
adobe photoshop lightroom cc 6.12 portable ed [snow] adobe photoshop lightroom cc 6.12 portable ed [snow] 8a78ff9644<br />
|
4 |
-
<br />
|
5 |
-
<br />
|
6 |
-
<p></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/American Ninja 5 Full ((EXCLUSIVE)) Movie Kick.md
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
|
2 |
-
<p>Theres a cat and mouse format to the ninjas in the film that reminds me of <em>The Karate Kid</em>, with ninjas crawling in through the kitchen window, ninjas in the bathroom window, and so on. Its also a lot more barebones than the other films in the series, relying almost solely on fistfights and the like to sell the story, but this works well enough for the most part. The climactic battle is one of the low points, but thats true of most of them by now. The ninjas themselves are a rather bland lineup of Zatoichi type guys with a smattering of ludicrously-dressed bad guys that would have been more effective before the gag had worn off, and Sam Firstenberg just keeps showing up, a little too much even by ninjas-films standards. And it goes without saying that Bradleys best scene here is the one where he flails around wildly like Royce Gracie in the octagon.</p>
|
3 |
-
<p>At this point, everyone has entered into the franchise with a certain amount of baggage. <strong>Sam Firstenberg</strong> cant win them all. And he makes a lot of rookie errors here. The most egregious of which comes in the final battle, when the ninjas have their hi-tech army drop on the terrorists and Bradley gets totally caught out with a relatively minor mistake. On one hand, this highlights why the ninjas arent as dangerous as the marines are in the other films, because Zito doesnt want to go too nuts with it all. But on the other hand, this combat goes on for far too long and is rather unappealing. On top of that, the final battle also provides the one good battle sequence in the film, and it ends up going the way it did because it wasnt good enough. It still looks amazing and the right amount of tension is generated by the action, but it never satisfied my desire to see the ninjas do something more.</p>
|
4 |
-
<h2>American Ninja 5 Full Movie Kick</h2><br /><p><b><b>Download</b> ⚹⚹⚹ <a href="https://imgfil.com/2uy1m9">https://imgfil.com/2uy1m9</a></b></p><br /><br /> 899543212b<br />
|
5 |
-
<br />
|
6 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/CRACK Ableton Live 10.0.2 Full NEWy Cracked - Detailed Instructions.md
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<h2>CRACK Ableton Live 10.0.2 Fully Cracked - Detailed Instructions</h2><br /><p><b><b>Download Zip</b> » <a href="https://imgfil.com/2uxXua">https://imgfil.com/2uxXua</a></b></p><br /><br />
|
2 |
-
<br />
|
3 |
-
ableton live 10.0.2 y ed - detailed instructions for installing desktop software on windows and mac operating systems.
|
4 |
-
The desktop software is the main operating system that is used to play and record your music.
|
5 |
-
Its goal is to run as a desktop application but it is not a complete, stand-alone package.
|
6 |
-
It still requires the software on the hard 8a78ff9644<br />
|
7 |
-
<br />
|
8 |
-
<br />
|
9 |
-
<p></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Dhamaal 720p Movie Kickass Download VERIFIED.md
DELETED
@@ -1,95 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Dhamaal 720p Movie Kickass Download - A Guide for Bollywood Comedy Lovers</h1>
|
3 |
-
|
4 |
-
<p>If you are a fan of Bollywood comedy movies, you must have heard of Dhamaal, a hilarious film that was released in 2007. Dhamaal is a story of four lazy and broke friends who embark on a crazy adventure to find a hidden treasure of 10 crore rupees. Along the way, they encounter various obstacles and challenges, as well as a ruthless cop who is after the same treasure. Dhamaal is a laugh riot that will keep you entertained from start to finish.</p>
|
5 |
-
<h2>Dhamaal 720p movie kickass download</h2><br /><p><b><b>Download File</b> 🗸 <a href="https://imgfil.com/2uy0h7">https://imgfil.com/2uy0h7</a></b></p><br /><br />
|
6 |
-
|
7 |
-
<p>But how can you watch Dhamaal if you don't have access to a DVD or a streaming service? Well, there is a way to download Dhamaal 720p movie from kickass torrents, one of the most popular torrent sites on the internet. Kickass torrents is a platform where you can find and download various files, including movies, TV shows, music, games, software and more. All you need is a torrent client, such as uTorrent or BitTorrent, and a stable internet connection.</p>
|
8 |
-
|
9 |
-
<h2>How to Download Dhamaal 720p Movie from Kickass Torrents</h2>
|
10 |
-
|
11 |
-
<p>Here are the steps to download Dhamaal 720p movie from kickass torrents:</p>
|
12 |
-
|
13 |
-
<ol>
|
14 |
-
<li>Go to <a href="https://kickass.sx/">https://kickass.sx/</a>, the official website of kickass torrents. You can also use other mirror sites or proxy sites if the main site is blocked in your region.</li>
|
15 |
-
<li>In the search bar, type <strong>Dhamaal 720p movie</strong> and hit enter. You will see a list of results that match your query.</li>
|
16 |
-
<li>Choose the result that has the most seeders and leechers. Seeders are the users who have the complete file and are sharing it with others. Leechers are the users who are downloading the file from the seeders. The more seeders and leechers a torrent has, the faster and more reliable the download will be.</li>
|
17 |
-
<li>Click on the result and you will be taken to a page with more details about the torrent, such as file size, quality, format, language, subtitles and more. You can also read the comments and reviews from other users who have downloaded the torrent.</li>
|
18 |
-
<li>Click on the <strong>Download Torrent</strong> button or the <strong>Magnet Link</strong> icon. A torrent file or a magnet link will be downloaded to your device.</li>
|
19 |
-
<li>Open the torrent file or the magnet link with your torrent client. The download will start automatically.</li>
|
20 |
-
<li>Wait for the download to finish. It may take some time depending on your internet speed and the number of seeders and leechers available.</li>
|
21 |
-
<li>Once the download is complete, you can enjoy watching Dhamaal 720p movie on your device.</li>
|
22 |
-
</ol>
|
23 |
-
|
24 |
-
<h2>Tips and Warnings for Downloading Dhamaal 720p Movie from Kickass Torrents</h2>
|
25 |
-
|
26 |
-
<p>Here are some tips and warnings for downloading Dhamaal 720p movie from kickass torrents:</p>
|
27 |
-
<p></p>
|
28 |
-
|
29 |
-
<ul>
|
30 |
-
<li>Make sure you have enough space on your device to store the downloaded file. Dhamaal 720p movie is about 1 GB in size.</li>
|
31 |
-
<li>Make sure you have a good antivirus software on your device to protect it from any malware or viruses that may come with the torrent file or the magnet link.</li>
|
32 |
-
<li>Make sure you are using a VPN service to hide your IP address and encrypt your online activity. Downloading torrents may be illegal in some countries and regions, and you may face legal consequences if you are caught by authorities or ISPs.</li>
|
33 |
-
<li>Make sure you are downloading Dhamaal 720p movie from a trusted and verified source. Some torrents may be fake or corrupted, and may not work properly or contain harmful content.</li>
|
34 |
-
<li>Make sure you are downloading Dhamaal 720p movie for personal use only. Do not distribute or share it with others without permission from the original creators or owners.</li>
|
35 |
-
</ul>
|
36 |
-
|
37 |
-
<h2>Conclusion</h2>
|
38 |
-
|
39 |
-
<p>Dhamaal 720p movie kickass download is a great option for Bollywood comedy lovers who want to watch this hilarious film on their devices. By following the steps above, you can easily download Dhamaal 720p movie from kickass torrents and enjoy it anytime and anywhere. However, you should also be aware of the risks and responsibilities involved in downloading torrents, and take precautions to protect yourself and respect others' rights.</p>
|
40 |
-
<h2>Why You Should Watch Dhamaal 720p Movie</h2>
|
41 |
-
|
42 |
-
<p>Dhamaal 720p movie is not only a fun and easy way to download and watch this film, but also a great way to enjoy its many features and benefits. Here are some of the reasons why you should watch Dhamaal 720p movie:</p>
|
43 |
-
|
44 |
-
<ul>
|
45 |
-
<li>You can watch Dhamaal 720p movie in high definition quality, which enhances the visual and audio effects of the film. You can see the details and colors of the scenes and characters, and hear the sounds and dialogues clearly and loudly.</li>
|
46 |
-
<li>You can watch Dhamaal 720p movie on any device that supports this format, such as laptops, tablets, smartphones, smart TVs and more. You can also connect your device to a larger screen or a speaker system for a better viewing experience.</li>
|
47 |
-
<li>You can watch Dhamaal 720p movie anytime and anywhere you want, as long as you have the downloaded file on your device. You don't need an internet connection or a subscription service to watch it. You can also pause, rewind, fast forward or skip any part of the film as you wish.</li>
|
48 |
-
<li>You can watch Dhamaal 720p movie with your friends and family, and share the laughter and joy of this film. You can also discuss the plot, the characters, the jokes and the messages of the film with them.</li>
|
49 |
-
<li>You can watch Dhamaal 720p movie as many times as you want, without getting bored or tired of it. You can discover new things and appreciate different aspects of the film every time you watch it.</li>
|
50 |
-
</ul>
|
51 |
-
|
52 |
-
<p>Dhamaal 720p movie is a wonderful way to enjoy this Bollywood comedy masterpiece. By downloading it from kickass torrents, you can have access to this film anytime and anywhere you want. However, you should also respect the rights of the creators and owners of this film, and use it for personal use only.</p>
|
53 |
-
<h2>What is Dhamaal 720p Movie About</h2>
|
54 |
-
|
55 |
-
<p>Dhamaal 720p movie is a comedy film that revolves around four friends who are in search of a hidden treasure. The film is a remake of the 1963 Hollywood film It's a Mad, Mad, Mad, Mad World. The film stars Sanjay Dutt, Riteish Deshmukh, Arshad Warsi, Javed Jaffrey and Aashish Chaudhary in the lead roles. The film also features Asrani, Vijay Raaz, Manoj Pahwa and Prem Chopra in supporting roles.</p>
|
56 |
-
|
57 |
-
<p>The film begins with a dying thief named Bose (Prem Chopra) who reveals the location of his loot of 10 crore rupees to four strangers: Roy (Riteish Deshmukh), Adi (Arshad Warsi), Manav (Javed Jaffrey) and Boman (Aashish Chaudhary). The four friends decide to split the money equally and head to Goa where the treasure is buried. However, they are unaware that Bose's partner Kabir (Sanjay Dutt), a corrupt police inspector, is also after the same treasure. Kabir follows them and tries to sabotage their plans.</p>
|
58 |
-
|
59 |
-
<p>On their way to Goa, the four friends encounter various obstacles and challenges, such as a plane crash, a car chase, a monkey attack, a bridge collapse and more. They also meet various characters who either help them or hinder them, such as a blind couple (Asrani and Tiku Talsania), a dacoit leader (Sanjay Mishra), a hotel manager (Vijay Raaz), a garage owner (Manoj Pahwa) and more. The film is full of hilarious situations and dialogues that will make you laugh out loud.</p>
|
60 |
-
|
61 |
-
<h2>Why Dhamaal 720p Movie is a Must-Watch for Comedy Lovers</h2>
|
62 |
-
|
63 |
-
<p>Dhamaal 720p movie is a must-watch for comedy lovers because it has everything that makes a comedy film great. Here are some of the reasons why Dhamaal 720p movie is a must-watch for comedy lovers:</p>
|
64 |
-
|
65 |
-
<ul>
|
66 |
-
<li>The film has a simple and engaging plot that keeps you hooked till the end. The film has a fast-paced and unpredictable storyline that keeps you guessing what will happen next. The film has a satisfying and surprising climax that will leave you amazed.</li>
|
67 |
-
<li>The film has a talented and charismatic cast that delivers brilliant performances. The film has a perfect chemistry and timing between the actors that makes their scenes more enjoyable. The film has memorable and funny characters that will make you laugh and relate to them.</li>
|
68 |
-
<li>The film has a witty and hilarious script that makes you laugh at every dialogue. The film has clever and humorous dialogues that are full of puns, sarcasm, irony and references. The film has witty and hilarious situations that are full of slapstick, parody and satire.</li>
|
69 |
-
<li>The film has a catchy and upbeat soundtrack that adds to the fun and mood of the film. The film has catchy and upbeat songs that are composed by Adnan Sami and sung by various singers. The film has catchy and upbeat background music that enhances the comedy scenes.</li>
|
70 |
-
<li>The film has a colorful and vibrant cinematography that makes the film more appealing and attractive. The film has colorful and vibrant scenes that are shot in various locations such as Mumbai, Goa, Lonavala and more. The film has colorful and vibrant costumes and props that add to the charm and style of the film.</li>
|
71 |
-
</ul>
|
72 |
-
|
73 |
-
<p>Dhamaal 720p movie is a comedy masterpiece that will make you laugh till your stomach hurts. By downloading it from kickass torrents, you can enjoy this film in high quality on your device. However, you should also respect the rights of the creators and owners of this film, and use it for personal use only.</p>
|
74 |
-
<h2>How to Enjoy Dhamaal 720p Movie with Your Friends and Family</h2>
|
75 |
-
|
76 |
-
<p>Dhamaal 720p movie is not only a great film to watch by yourself, but also a great film to watch with your friends and family. Here are some tips on how to enjoy Dhamaal 720p movie with your friends and family:</p>
|
77 |
-
|
78 |
-
<ul>
|
79 |
-
<li>Plan a movie night with your friends and family. Choose a date and time that is convenient for everyone. Invite them to your place or go to their place. Make sure you have enough space and seating for everyone.</li>
|
80 |
-
<li>Prepare some snacks and drinks for the movie night. Choose some snacks and drinks that are easy to make and eat, such as popcorn, chips, cookies, soda, juice and more. You can also order some pizza, burgers, sandwiches or other food items that everyone likes.</li>
|
81 |
-
<li>Download Dhamaal 720p movie from kickass torrents and transfer it to your device. Make sure you have a good torrent client and a VPN service to download the film safely and securely. Transfer the downloaded file to your device that you will use to watch the film.</li>
|
82 |
-
<li>Connect your device to a larger screen or a speaker system for a better viewing experience. You can use an HDMI cable, a Chromecast, a Bluetooth speaker or any other device that can connect your device to a larger screen or a speaker system. Adjust the volume and brightness as per your preference.</li>
|
83 |
-
<li>Enjoy watching Dhamaal 720p movie with your friends and family. Laugh along with the hilarious scenes and dialogues of the film. Share your opinions and thoughts on the film with them. Have fun and make some memories with them.</li>
|
84 |
-
</ul>
|
85 |
-
|
86 |
-
<p>Dhamaal 720p movie is a perfect film to watch with your friends and family. By following these tips, you can have a wonderful movie night with them. However, you should also respect the rights of the creators and owners of this film, and use it for personal use only.</p>
|
87 |
-
|
88 |
-
<h2>Conclusion</h2>
|
89 |
-
|
90 |
-
<p>Dhamaal 720p movie kickass download is an amazing option for comedy lovers who want to download and watch this hilarious film on their devices. By following the steps above, you can easily download Dhamaal 720p movie from kickass torrents and enjoy it anytime and anywhere you want. However, you should also be aware of the risks and responsibilities involved in downloading torrents, and take precautions to protect yourself and respect others' rights.</p>
|
91 |
-
<h2>Conclusion</h2>
|
92 |
-
|
93 |
-
<p>Dhamaal 720p movie kickass download is a great way to enjoy this Bollywood comedy masterpiece on your devices. By downloading it from kickass torrents, you can have access to this film anytime and anywhere you want. However, you should also respect the rights of the creators and owners of this film, and use it for personal use only. Dhamaal 720p movie is a film that will make you laugh till your stomach hurts. By following the tips above, you can also enjoy this film with your friends and family, and have a wonderful movie night with them. Dhamaal 720p movie is a film that has something for everyone, and can enrich your mind and soul. If you have not watched Dhamaal 720p movie yet, you should do it now and discover the wonders of this film.</p> 3cee63e6c2<br />
|
94 |
-
<br />
|
95 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Cricket League New Mod APK - The Best Cricket Game for Android Users.md
DELETED
@@ -1,132 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Cricket League New Mod APK: How to Download and Play</h1>
|
3 |
-
<p>Do you love cricket and want to play it on your mobile device? If yes, then you should try Cricket League, a fast, fun, exciting and authentic 3D real-time multiplayer cricket game. And if you want to enjoy the game with unlimited resources and features, then you should download Cricket League Mod APK, a modified version of the original game that gives you access to everything for free. In this article, we will tell you what Cricket League is, how to download and install Cricket League Mod APK, why you should use it, how to play it, and some tips and tricks to help you win more matches.</p>
|
4 |
-
<h2>cricket league new mod apk</h2><br /><p><b><b>Download File</b> · <a href="https://jinyurl.com/2uNP3B">https://jinyurl.com/2uNP3B</a></b></p><br /><br />
|
5 |
-
<h2>What is Cricket League?</h2>
|
6 |
-
<p>Cricket League is a 3D real-time multiplayer cricket game developed by Miniclip, a popular gaming company that also created games like 8 Ball Pool, Soccer Stars, and Agar.io. Cricket League lets you bat, bowl and field your way to the top of the league in various modes, such as T20, ODI, Test, and Super Over. You can choose from 16 different teams, each with their own strengths and weaknesses, and customize your players and equipment. You can also compete with other players online in ranked matches or friendly matches, or play offline against the AI. Cricket League has realistic graphics, animations, physics, and sounds that make you feel like you are playing in a real stadium.</p>
|
7 |
-
<h3>Features of Cricket League</h3>
|
8 |
-
<p>Some of the features of Cricket League are:</p>
|
9 |
-
<ul>
|
10 |
-
<li>Realistic 3D graphics and animations</li>
|
11 |
-
<li>Authentic cricket physics and sounds</li>
|
12 |
-
<li>16 different teams to choose from</li>
|
13 |
-
<li>4 different modes to play: T20, ODI, Test, and Super Over</li>
|
14 |
-
<li>Online multiplayer mode with ranked matches and friendly matches</li>
|
15 |
-
<li>Offline mode with AI opponents</li>
|
16 |
-
<li>Customizable players and equipment</li>
|
17 |
-
<li>Power-ups and special abilities to boost your performance</li>
|
18 |
-
<li>Leaderboards and achievements to track your progress</li>
|
19 |
-
<li>Daily rewards and missions to earn coins and gems</li>
|
20 |
-
</ul>
|
21 |
-
<h3>How to download Cricket League Mod APK</h3>
|
22 |
-
<p>If you want to download Cricket League Mod APK, you need to follow these steps:</p>
|
23 |
-
<ol>
|
24 |
-
<li>Go to [Cricket League Mod apk download - HappyMod](^1^), a website that provides modded versions of various games.</li>
|
25 |
-
<li>Click on the "Download APK" button and wait for the file to be downloaded on your device.</li>
|
26 |
-
<li>Go to your device's settings and enable "Unknown Sources" to allow installation of apps from sources other than the Google Play Store.</li>
|
27 |
-
<li>Locate the downloaded file in your file manager and tap on it to install it.</li>
|
28 |
-
<li>Launch the game and enjoy playing with unlimited resources and features.</li>
|
29 |
-
</ol>
|
30 |
-
<h2>Why use Cricket League Mod APK?</h2>
|
31 |
-
<p>You might be wondering why you should use Cricket League Mod APK instead of the original game. Well, there are some benefits and risks of using Cricket League Mod APK that you should know before deciding whether to use it or not.</p>
|
32 |
-
<h3>Benefits of Cricket League Mod APK</h3>
|
33 |
-
<p>Some of the benefits of using Cricket League Mod APK are:</p>
|
34 |
-
<ul>
|
35 |
-
<li>You get unlimited coins and gems that you can use to buy or upgrade anything in the game.</li>
|
36 |
-
<li>You get all the teams unlocked so you can choose any team you want.</li>
|
37 |
-
<li>You get all the modes unlocked so you can play any mode you want.</li>
|
38 |
-
<li>You get all the power-ups and special abilities unlocked so you can use them anytime you need.</li>
|
39 |
-
<li>You get unlimited lives and retries so you can play as long as you want without worrying about losing.</li>
|
40 |
-
</ul>
|
41 |
-
<h3>Risks of Cricket League Mod APK</h3>
|
42 |
-
<p>Some of the risks of using Cricket League Mod APK are:</p>
|
43 |
-
<ul>
|
44 |
-
<li>You might face some compatibility issues or bugs while playing the game.</li>
|
45 |
-
<li>You might get banned from the online mode if the game detects that you are using a modded version.</li>
|
46 |
-
<li>You might lose your progress or data if the game updates or crashes.</li>
|
47 |
-
<li>You might expose your device to malware or viruses if you download the modded version from an untrusted source.</li>
|
48 |
-
</ul>
|
49 |
-
<h2>How to play Cricket League Mod APK</h2>
|
50 |
-
<p>Playing Cricket League Mod APK is similar to playing the original game, except that you have access to unlimited resources and features. Here are some basic steps to help you play the game:</p>
|
51 |
-
<p>Cricket League 2023 Mod APK Download<br />
|
52 |
-
How to Install Cricket League Mod APK on Android<br />
|
53 |
-
Cricket League Mod APK Unlimited Coins and Gems<br />
|
54 |
-
Cricket League Mod APK Latest Version Free Download<br />
|
55 |
-
Cricket League Mod APK Hack with All Teams Unlocked<br />
|
56 |
-
Cricket League Mod APK Online Multiplayer Mode<br />
|
57 |
-
Cricket League Mod APK No Root Required<br />
|
58 |
-
Cricket League Mod APK for PC Windows 10/8/7<br />
|
59 |
-
Cricket League Mod APK with Realistic Graphics and Physics<br />
|
60 |
-
Cricket League Mod APK with Customizable Players and Stadiums<br />
|
61 |
-
Cricket League Mod APK with Commentary and Sound Effects<br />
|
62 |
-
Cricket League Mod APK with New Features and Updates<br />
|
63 |
-
Cricket League Mod APK with Offline Mode and Data Saving<br />
|
64 |
-
Cricket League Mod APK with Easy Controls and Gameplay<br />
|
65 |
-
Cricket League Mod APK with Different Game Modes and Levels<br />
|
66 |
-
Cricket League Mod APK with Achievements and Leaderboards<br />
|
67 |
-
Cricket League Mod APK with In-app Purchases and Ads Removed<br />
|
68 |
-
Cricket League Mod APK with Anti-ban and Anti-virus Protection<br />
|
69 |
-
Cricket League Mod APK with Bug Fixes and Performance Improvements<br />
|
70 |
-
Cricket League Mod APK Review and Rating<br />
|
71 |
-
Best Sites to Download Cricket League Mod APK for Free<br />
|
72 |
-
How to Backup and Restore Cricket League Mod APK Data<br />
|
73 |
-
How to Uninstall and Reinstall Cricket League Mod APK<br />
|
74 |
-
How to Update Cricket League Mod APK to the Latest Version<br />
|
75 |
-
How to Play Cricket League Mod APK on iOS Devices<br />
|
76 |
-
How to Play Cricket League Mod APK on Mac OS X<br />
|
77 |
-
How to Play Cricket League Mod APK on Linux OS<br />
|
78 |
-
How to Play Cricket League Mod APK on Chrome OS<br />
|
79 |
-
How to Play Cricket League Mod APK on Fire TV Stick<br />
|
80 |
-
How to Play Cricket League Mod APK on Smart TV<br />
|
81 |
-
How to Play Cricket League Mod APK on Xbox One/360<br />
|
82 |
-
How to Play Cricket League Mod APK on PlayStation 4/5<br />
|
83 |
-
How to Play Cricket League Mod APK on Nintendo Switch<br />
|
84 |
-
How to Play Cricket League Mod APK on VR Headset<br />
|
85 |
-
How to Play Cricket League Mod APK with Friends and Family<br />
|
86 |
-
How to Play Cricket League Mod APK with Keyboard and Mouse<br />
|
87 |
-
How to Play Cricket League Mod APK with Gamepad and Controller<br />
|
88 |
-
How to Play Cricket League Mod APK with Voice Chat and Messaging<br />
|
89 |
-
How to Play Cricket League Mod APK with Live Streaming and Recording<br />
|
90 |
-
How to Play Cricket League Mod APK with Tips and Tricks<br />
|
91 |
-
How to Play Cricket League Mod APK with Cheats and Hacks<br />
|
92 |
-
How to Play Cricket League Mod APK with Mods and Customizations<br />
|
93 |
-
How to Play Cricket League Mod APK with Challenges and Rewards<br />
|
94 |
-
How to Play Cricket League Mod APK with Fun and Entertainment<br />
|
95 |
-
How to Solve Common Problems and Errors in Cricket League Mod APK <br />
|
96 |
-
How to Contact Customer Support and Feedback for Cricket League Mod APK <br />
|
97 |
-
How to Join Community and Forum for Cricket League Mod APK <br />
|
98 |
-
How to Learn More About Cricket Rules and History from Cricket League Mod APK</p>
|
99 |
-
<h3>Choose your team and mode</h3>
|
100 |
-
<p>When you launch the game, you can choose your team from 16 different options, such as India, Australia, England, Pakistan, etc. You can also customize your players and equipment by using the coins and gems that you have. Then, you can choose the mode that you want to play, such as T20, ODI, Test, or Super Over. Each mode has different rules and objectives that you need to follow.</p>
|
101 |
-
<h3>Bat, bowl and field your way to the top</h3>
|
102 |
-
<p>Once you start the match, you can either bat or bowl first depending on the toss. When you bat, you need to swipe on the screen to hit the ball in different directions. You can also use power-ups and special abilities to boost your shots. When you bowl, you need to tap on the screen to select the type, speed, and direction of your delivery. You can also use power-ups and special abilities to make your balls more effective. When you field, you need to swipe on the screen to catch or throw the ball. You can also use power-ups and special abilities to improve your fielding skills.</p>
|
103 |
-
<h3>Compete with other players online</h3>
|
104 |
-
<p>If you want to test your skills against other players, you can join the online multiplayer mode. You can either play ranked matches or friendly matches with other players from around the world. You can also chat with them and send them emojis during the match. You can earn trophies and coins by winning matches and climb up the leaderboards. You can also unlock achievements and rewards by completing various challenges.</p>
|
105 |
-
<h2>Tips and tricks for Cricket League Mod APK</h2>
|
106 |
-
<p>If you want to improve your performance and win more matches in Cricket League Mod APK, here are some tips and tricks that you should follow:</p>
|
107 |
-
<h3>Practice your skills in training mode</h3>
|
108 |
-
<p>If you are new to the game or want to hone your skills, you should try the training mode. This mode allows you to practice batting, bowling, and fielding without any pressure or time limit. You can also adjust the difficulty level and settings according to your preference. This mode will help you learn the basics and master the controls of the game.</p>
|
109 |
-
<h3>Upgrade your players and equipment</h3>
|
110 |
-
<p>If you want to make your team stronger and more competitive, you should upgrade your players and equipment regularly. You can use the coins and gems that you have to buy or upgrade various items, such as bats, balls, helmets, gloves, pads, shoes, etc. Each item has different stats and effects that can enhance your performance in different aspects of the game. You can also upgrade your players' skills and abilities by using coins and gems.</p>
|
111 |
-
<h3>Use power-ups and special abilities</h3>
|
112 |
-
<p>If you want to gain an edge over your opponents, you should use power-ups and special abilities wisely. Power-ups are items that can boost your performance temporarily, such as extra runs, extra wickets, extra overs, etc. Special abilities are skills that can change the outcome of the game dramatically, such as super sixes, super fours, super catches, super throws, etc. You can use power-ups and special abilities by tapping on their icons on the screen during the match. However, you should use them sparingly as they have limited uses and cooldowns.</p>
|
113 |
-
<h2>Conclusion</h2>
|
114 |
-
<p>Cricket League is a 3D real-time multiplayer cricket game that lets you bat, bowl and field your way to the top of the league in various modes, such as T20, ODI, Test, and Super Over. You can choose from 16 different teams, customize your players and equipment, and compete with other players online or offline. Cricket League has realistic graphics, physics, and sounds that make you feel like you are playing in a real stadium.</p>
|
115 |
-
<p>If you want to enjoy the game with unlimited resources and features, you can download Cricket League Mod APK, a modified version of the original game that gives you access to everything for free. However, you should also be aware of the risks of using Cricket League Mod APK, such as compatibility issues, bugs, bans, data loss, or malware. You should also download the modded version from a trusted source and use it at your own discretion.</p>
|
116 |
-
<p>Cricket League Mod APK is a fun and exciting game that will keep you hooked for hours. Whether you are a cricket fan or not, you will love playing this game and challenging yourself and others. So, what are you waiting for? Download Cricket League Mod APK today and start playing!</p>
|
117 |
-
<h3>FAQs</h3>
|
118 |
-
<p>Here are some frequently asked questions about Cricket League Mod APK:</p>
|
119 |
-
<ul>
|
120 |
-
<li>Q: Is Cricket League Mod APK safe to use?</li>
|
121 |
-
<li>A: Cricket League Mod APK is safe to use if you download it from a trusted source and scan it with an antivirus before installing it. However, you should also be careful about the risks of using a modded version of the game, such as compatibility issues, bugs, bans, data loss, or malware.</li>
|
122 |
-
<li>Q: How can I update Cricket League Mod APK?</li>
|
123 |
-
<li>A: You can update Cricket League Mod APK by downloading the latest version from the same source that you downloaded the previous version. You should also uninstall the old version before installing the new one to avoid any errors or conflicts.</li>
|
124 |
-
<li>Q: How can I restore my progress or data in Cricket League Mod APK?</li>
|
125 |
-
<li>A: You can restore your progress or data in Cricket League Mod APK by using a backup app or tool that can save your game data on your device or cloud. You should also backup your data regularly to avoid losing it in case of any issues or crashes.</li>
|
126 |
-
<li>Q: How can I contact the developers of Cricket League Mod APK?</li>
|
127 |
-
<li>A: You can contact the developers of Cricket League Mod APK by visiting their website [HappyMod] or their social media pages on Facebook, Twitter, Instagram, etc. You can also leave a comment or feedback on their website or app page.</li>
|
128 |
-
<li>Q: How can I support the developers of Cricket League Mod APK?</li>
|
129 |
-
<li>A: You can support the developers of Cricket League Mod APK by rating and reviewing their app on their website or app page. You can also share their app with your friends and family and encourage them to download it.</li>
|
130 |
-
</ul></p> 401be4b1e0<br />
|
131 |
-
<br />
|
132 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1toTree/lora_test/ppdiffusers/pipeline_utils.py
DELETED
@@ -1,659 +0,0 @@
|
|
1 |
-
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
|
2 |
-
# Copyright 2022 The HuggingFace Team. All rights reserved.
|
3 |
-
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
|
4 |
-
#
|
5 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
# you may not use this file except in compliance with the License.
|
7 |
-
# You may obtain a copy of the License at
|
8 |
-
#
|
9 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
#
|
11 |
-
# Unless required by applicable law or agreed to in writing, software
|
12 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
# See the License for the specific language governing permissions and
|
15 |
-
# limitations under the License.
|
16 |
-
|
17 |
-
import importlib
|
18 |
-
import inspect
|
19 |
-
import os
|
20 |
-
import tempfile
|
21 |
-
from dataclasses import dataclass
|
22 |
-
from typing import Any, Dict, List, Optional, Union
|
23 |
-
|
24 |
-
import numpy as np
|
25 |
-
import paddle
|
26 |
-
import paddle.nn as nn
|
27 |
-
import PIL
|
28 |
-
from huggingface_hub import (
|
29 |
-
create_repo,
|
30 |
-
get_hf_file_metadata,
|
31 |
-
hf_hub_url,
|
32 |
-
repo_type_and_id_from_hf_id,
|
33 |
-
upload_folder,
|
34 |
-
)
|
35 |
-
from huggingface_hub.utils import EntryNotFoundError
|
36 |
-
from packaging import version
|
37 |
-
from PIL import Image
|
38 |
-
from tqdm.auto import tqdm
|
39 |
-
|
40 |
-
from . import FastDeployRuntimeModel
|
41 |
-
from .configuration_utils import ConfigMixin
|
42 |
-
from .utils import PPDIFFUSERS_CACHE, BaseOutput, deprecate, logging
|
43 |
-
|
44 |
-
INDEX_FILE = "model_state.pdparams"
|
45 |
-
CUSTOM_PIPELINE_FILE_NAME = "pipeline.py"
|
46 |
-
DUMMY_MODULES_FOLDER = "ppdiffusers.utils"
|
47 |
-
PADDLENLP_DUMMY_MODULES_FOLDER = "paddlenlp.transformers.utils"
|
48 |
-
|
49 |
-
logger = logging.get_logger(__name__)
|
50 |
-
|
51 |
-
LOADABLE_CLASSES = {
|
52 |
-
"ppdiffusers": {
|
53 |
-
"ModelMixin": ["save_pretrained", "from_pretrained"],
|
54 |
-
"SchedulerMixin": ["save_pretrained", "from_pretrained"],
|
55 |
-
"DiffusionPipeline": ["save_pretrained", "from_pretrained"],
|
56 |
-
"FastDeployRuntimeModel": ["save_pretrained", "from_pretrained"],
|
57 |
-
},
|
58 |
-
"paddlenlp.transformers": {
|
59 |
-
"PretrainedTokenizer": ["save_pretrained", "from_pretrained"],
|
60 |
-
"PretrainedModel": ["save_pretrained", "from_pretrained"],
|
61 |
-
"FeatureExtractionMixin": ["save_pretrained", "from_pretrained"],
|
62 |
-
"ProcessorMixin": ["save_pretrained", "from_pretrained"],
|
63 |
-
"ImageProcessingMixin": ["save_pretrained", "from_pretrained"],
|
64 |
-
},
|
65 |
-
}
|
66 |
-
|
67 |
-
ALL_IMPORTABLE_CLASSES = {}
|
68 |
-
for library in LOADABLE_CLASSES:
|
69 |
-
ALL_IMPORTABLE_CLASSES.update(LOADABLE_CLASSES[library])
|
70 |
-
|
71 |
-
|
72 |
-
@dataclass
|
73 |
-
class ImagePipelineOutput(BaseOutput):
|
74 |
-
"""
|
75 |
-
Output class for image pipelines.
|
76 |
-
|
77 |
-
Args:
|
78 |
-
images (`List[PIL.Image.Image]` or `np.ndarray`)
|
79 |
-
List of denoised PIL images of length `batch_size` or numpy array of shape `(batch_size, height, width,
|
80 |
-
num_channels)`. PIL images or numpy array present the denoised images of the diffusion pipeline.
|
81 |
-
"""
|
82 |
-
|
83 |
-
images: Union[List[PIL.Image.Image], np.ndarray]
|
84 |
-
|
85 |
-
|
86 |
-
@dataclass
|
87 |
-
class AudioPipelineOutput(BaseOutput):
|
88 |
-
"""
|
89 |
-
Output class for audio pipelines.
|
90 |
-
|
91 |
-
Args:
|
92 |
-
audios (`np.ndarray`)
|
93 |
-
List of denoised samples of shape `(batch_size, num_channels, sample_rate)`. Numpy array present the
|
94 |
-
denoised audio samples of the diffusion pipeline.
|
95 |
-
"""
|
96 |
-
|
97 |
-
audios: np.ndarray
|
98 |
-
|
99 |
-
|
100 |
-
class DiffusionPipeline(ConfigMixin):
|
101 |
-
r"""
|
102 |
-
Base class for all models.
|
103 |
-
|
104 |
-
[`DiffusionPipeline`] takes care of storing all components (models, schedulers, processors) for diffusion pipelines
|
105 |
-
and handles methods for loading, downloading and saving models as well as a few methods common to all pipelines to:
|
106 |
-
|
107 |
-
- move all Paddle modules to the device of your choice
|
108 |
-
- enabling/disabling the progress bar for the denoising iteration
|
109 |
-
|
110 |
-
Class attributes:
|
111 |
-
|
112 |
-
- **config_name** (`str`) -- name of the config file that will store the class and module names of all
|
113 |
-
- **_optional_components** (List[`str`]) -- list of all components that are optional so they don't have to be
|
114 |
-
passed for the pipeline to function (should be overridden by subclasses).
|
115 |
-
"""
|
116 |
-
config_name = "model_index.json"
|
117 |
-
_optional_components = []
|
118 |
-
|
119 |
-
def register_modules(self, **kwargs):
|
120 |
-
# import it here to avoid circular import
|
121 |
-
from . import pipelines
|
122 |
-
|
123 |
-
for name, module in kwargs.items():
|
124 |
-
# retrieve library
|
125 |
-
if module is None:
|
126 |
-
register_dict = {name: (None, None)}
|
127 |
-
else:
|
128 |
-
# TODO (junnyu) support paddlenlp.transformers
|
129 |
-
if "paddlenlp" in module.__module__.split(".") or "ppnlp_patch_utils" in module.__module__.split("."):
|
130 |
-
library = "paddlenlp.transformers"
|
131 |
-
else:
|
132 |
-
library = module.__module__.split(".")[0]
|
133 |
-
|
134 |
-
# check if the module is a pipeline module
|
135 |
-
pipeline_dir = module.__module__.split(".")[-2] if len(module.__module__.split(".")) > 2 else None
|
136 |
-
path = module.__module__.split(".")
|
137 |
-
is_pipeline_module = pipeline_dir in path and hasattr(pipelines, pipeline_dir)
|
138 |
-
|
139 |
-
# if library is not in LOADABLE_CLASSES, then it is a custom module.
|
140 |
-
# Or if it's a pipeline module, then the module is inside the pipeline
|
141 |
-
# folder so we set the library to module name.
|
142 |
-
if library not in LOADABLE_CLASSES or is_pipeline_module:
|
143 |
-
library = pipeline_dir
|
144 |
-
|
145 |
-
# retrieve class_name
|
146 |
-
class_name = module.__class__.__name__
|
147 |
-
|
148 |
-
register_dict = {name: (library, class_name)}
|
149 |
-
|
150 |
-
# save model index config
|
151 |
-
self.register_to_config(**register_dict)
|
152 |
-
|
153 |
-
# set models
|
154 |
-
setattr(self, name, module)
|
155 |
-
|
156 |
-
def save_pretrained(self, save_directory: Union[str, os.PathLike]):
|
157 |
-
"""
|
158 |
-
Save all variables of the pipeline that can be saved and loaded as well as the pipelines configuration file to
|
159 |
-
a directory. A pipeline variable can be saved and loaded if its class implements both a save and loading
|
160 |
-
method. The pipeline can easily be re-loaded using the `[`~DiffusionPipeline.from_pretrained`]` class method.
|
161 |
-
|
162 |
-
Arguments:
|
163 |
-
save_directory (`str` or `os.PathLike`):
|
164 |
-
Directory to which to save. Will be created if it doesn't exist.
|
165 |
-
"""
|
166 |
-
self.save_config(save_directory)
|
167 |
-
|
168 |
-
model_index_dict = dict(self.config)
|
169 |
-
model_index_dict.pop("_class_name")
|
170 |
-
# TODO (junnyu) support old version
|
171 |
-
model_index_dict.pop("_diffusers_paddle_version", None)
|
172 |
-
model_index_dict.pop("_diffusers_version", None)
|
173 |
-
model_index_dict.pop("_ppdiffusers_version", None)
|
174 |
-
model_index_dict.pop("_module", None)
|
175 |
-
|
176 |
-
expected_modules, optional_kwargs = self._get_signature_keys(self)
|
177 |
-
|
178 |
-
def is_saveable_module(name, value):
|
179 |
-
if name not in expected_modules:
|
180 |
-
return False
|
181 |
-
if name in self._optional_components and value[0] is None:
|
182 |
-
return False
|
183 |
-
return True
|
184 |
-
|
185 |
-
model_index_dict = {k: v for k, v in model_index_dict.items() if is_saveable_module(k, v)}
|
186 |
-
|
187 |
-
for pipeline_component_name in model_index_dict.keys():
|
188 |
-
sub_model = getattr(self, pipeline_component_name)
|
189 |
-
|
190 |
-
model_cls = sub_model.__class__
|
191 |
-
|
192 |
-
save_method_name = None
|
193 |
-
# search for the model's base class in LOADABLE_CLASSES
|
194 |
-
for library_name, library_classes in LOADABLE_CLASSES.items():
|
195 |
-
library = importlib.import_module(library_name)
|
196 |
-
for base_class, save_load_methods in library_classes.items():
|
197 |
-
class_candidate = getattr(library, base_class, None)
|
198 |
-
if class_candidate is not None and issubclass(model_cls, class_candidate):
|
199 |
-
# if we found a suitable base class in LOADABLE_CLASSES then grab its save method
|
200 |
-
save_method_name = save_load_methods[0]
|
201 |
-
break
|
202 |
-
if save_method_name is not None:
|
203 |
-
break
|
204 |
-
|
205 |
-
save_method = getattr(sub_model, save_method_name)
|
206 |
-
save_method(os.path.join(save_directory, pipeline_component_name))
|
207 |
-
|
208 |
-
def save_to_hf_hub(
|
209 |
-
self,
|
210 |
-
repo_id: str,
|
211 |
-
private: Optional[bool] = None,
|
212 |
-
commit_message: Optional[str] = None,
|
213 |
-
revision: Optional[str] = None,
|
214 |
-
create_pr: bool = False,
|
215 |
-
):
|
216 |
-
"""
|
217 |
-
Uploads all elements of this pipeline to a new HuggingFace Hub repository.
|
218 |
-
Args:
|
219 |
-
repo_id (str): Repository name for your model/tokenizer in the Hub.
|
220 |
-
private (bool, optional): Whether the model/tokenizer is set to private
|
221 |
-
commit_message (str, optional) — The summary / title / first line of the generated commit. Defaults to: f"Upload {path_in_repo} with huggingface_hub"
|
222 |
-
revision (str, optional) — The git revision to commit from. Defaults to the head of the "main" branch.
|
223 |
-
create_pr (boolean, optional) — Whether or not to create a Pull Request with that commit. Defaults to False.
|
224 |
-
If revision is not set, PR is opened against the "main" branch. If revision is set and is a branch, PR is opened against this branch.
|
225 |
-
If revision is set and is not a branch name (example: a commit oid), an RevisionNotFoundError is returned by the server.
|
226 |
-
|
227 |
-
Returns: The url of the commit of your model in the given repository.
|
228 |
-
"""
|
229 |
-
repo_url = create_repo(repo_id, private=private, exist_ok=True)
|
230 |
-
|
231 |
-
# Infer complete repo_id from repo_url
|
232 |
-
# Can be different from the input `repo_id` if repo_owner was implicit
|
233 |
-
_, repo_owner, repo_name = repo_type_and_id_from_hf_id(repo_url)
|
234 |
-
|
235 |
-
repo_id = f"{repo_owner}/{repo_name}"
|
236 |
-
|
237 |
-
# Check if README file already exist in repo
|
238 |
-
try:
|
239 |
-
get_hf_file_metadata(hf_hub_url(repo_id=repo_id, filename="README.md", revision=revision))
|
240 |
-
has_readme = True
|
241 |
-
except EntryNotFoundError:
|
242 |
-
has_readme = False
|
243 |
-
|
244 |
-
with tempfile.TemporaryDirectory() as tmp_dir:
|
245 |
-
# save model
|
246 |
-
self.save_pretrained(tmp_dir)
|
247 |
-
# Add readme if does not exist
|
248 |
-
logger.info("README.md not found, adding the default README.md")
|
249 |
-
if not has_readme:
|
250 |
-
with open(os.path.join(tmp_dir, "README.md"), "w") as f:
|
251 |
-
f.write(f"---\nlibrary_name: ppdiffusers\n---\n# {repo_id}")
|
252 |
-
|
253 |
-
# Upload model and return
|
254 |
-
logger.info(f"Pushing to the {repo_id}. This might take a while")
|
255 |
-
return upload_folder(
|
256 |
-
repo_id=repo_id,
|
257 |
-
repo_type="model",
|
258 |
-
folder_path=tmp_dir,
|
259 |
-
commit_message=commit_message,
|
260 |
-
revision=revision,
|
261 |
-
create_pr=create_pr,
|
262 |
-
)
|
263 |
-
|
264 |
-
def to(self, paddle_device: Optional[str] = None):
|
265 |
-
if paddle_device is None:
|
266 |
-
return self
|
267 |
-
|
268 |
-
module_names, _, _ = self.extract_init_dict(dict(self.config))
|
269 |
-
for name in module_names.keys():
|
270 |
-
module = getattr(self, name)
|
271 |
-
if isinstance(module, nn.Layer):
|
272 |
-
if module.dtype == paddle.float16 and str(paddle_device) in ["cpu"]:
|
273 |
-
logger.warning(
|
274 |
-
"Pipelines loaded with `paddle_dtype=paddle.float16` cannot run with `cpu` device. It"
|
275 |
-
" is not recommended to move them to `cpu` as running them will fail. Please make"
|
276 |
-
" sure to use an accelerator to run the pipeline in inference, due to the lack of"
|
277 |
-
" support for`float16` operations on this device in Paddle. Please, remove the"
|
278 |
-
" `paddle_dtype=paddle.float16` argument, or use another device for inference."
|
279 |
-
)
|
280 |
-
module.to(paddle_device)
|
281 |
-
return self
|
282 |
-
|
283 |
-
@property
|
284 |
-
def device(self):
|
285 |
-
r"""
|
286 |
-
Returns:
|
287 |
-
`paddle.device`: The paddle device on which the pipeline is located.
|
288 |
-
"""
|
289 |
-
module_names, _, _ = self.extract_init_dict(dict(self.config))
|
290 |
-
for name in module_names.keys():
|
291 |
-
module = getattr(self, name)
|
292 |
-
if isinstance(module, nn.Layer):
|
293 |
-
return module.place
|
294 |
-
return "cpu"
|
295 |
-
|
296 |
-
@classmethod
|
297 |
-
def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.PathLike]], **kwargs):
|
298 |
-
r"""
|
299 |
-
Instantiate a Paddle diffusion pipeline from pre-trained pipeline weights.
|
300 |
-
|
301 |
-
The pipeline is set in evaluation mode by default using `model.eval()` (Dropout modules are deactivated).
|
302 |
-
|
303 |
-
The warning *Weights from XXX not initialized from pretrained model* means that the weights of XXX do not come
|
304 |
-
pretrained with the rest of the model. It is up to you to train those weights with a downstream fine-tuning
|
305 |
-
task.
|
306 |
-
|
307 |
-
The warning *Weights from XXX not used in YYY* means that the layer XXX is not used by YYY, therefore those
|
308 |
-
weights are discarded.
|
309 |
-
|
310 |
-
Parameters:
|
311 |
-
pretrained_model_name_or_path (`str` or `os.PathLike`, *optional*):
|
312 |
-
Can be either:
|
313 |
-
|
314 |
-
- A string, the *model id* of a pretrained pipeline hosted inside in `https://bj.bcebos.com/paddlenlp/models/community`.
|
315 |
-
like `CompVis/stable-diffusion-v1-4`, `CompVis/ldm-text2im-large-256`.
|
316 |
-
- A path to a *directory* containing pipeline weights saved using
|
317 |
-
[`~DiffusionPipeline.save_pretrained`], e.g., `./my_pipeline_directory/`.
|
318 |
-
paddle_dtype (`str` or `paddle.dtype`, *optional*):
|
319 |
-
Override the default `paddle.dtype` and load the model under this dtype. If `"auto"` is passed the dtype
|
320 |
-
will be automatically derived from the model's weights.
|
321 |
-
output_loading_info(`bool`, *optional*, defaults to `False`):
|
322 |
-
Whether or not to also return a dictionary containing missing keys, unexpected keys and error messages.
|
323 |
-
from_hf_hub (bool, *optional*):
|
324 |
-
Whether to load from Hugging Face Hub. Defaults to False
|
325 |
-
kwargs (remaining dictionary of keyword arguments, *optional*):
|
326 |
-
Can be used to overwrite load - and saveable variables - *i.e.* the pipeline components - of the
|
327 |
-
specific pipeline class. The overwritten components are then directly passed to the pipelines
|
328 |
-
`__init__` method. See example below for more information.
|
329 |
-
|
330 |
-
Examples:
|
331 |
-
|
332 |
-
```py
|
333 |
-
>>> from ppdiffusers import DiffusionPipeline
|
334 |
-
|
335 |
-
>>> # Download pipeline from bos and cache.
|
336 |
-
>>> pipeline = DiffusionPipeline.from_pretrained("CompVis/ldm-text2im-large-256")
|
337 |
-
|
338 |
-
>>> # Download pipeline that requires an authorization token
|
339 |
-
>>> # For more information on access tokens, please refer to this section
|
340 |
-
>>> # of the documentation](https://huggingface.co/docs/hub/security-tokens)
|
341 |
-
>>> pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
|
342 |
-
|
343 |
-
>>> # Use a different scheduler
|
344 |
-
>>> from ppdiffusers import LMSDiscreteScheduler
|
345 |
-
|
346 |
-
>>> scheduler = LMSDiscreteScheduler.from_config(pipeline.scheduler.config)
|
347 |
-
>>> pipeline.scheduler = scheduler
|
348 |
-
```
|
349 |
-
"""
|
350 |
-
cache_dir = kwargs.pop("cache_dir", PPDIFFUSERS_CACHE)
|
351 |
-
paddle_dtype = kwargs.pop("paddle_dtype", None)
|
352 |
-
# (TODO junnyu, we donot suuport this.)
|
353 |
-
# custom_pipeline = kwargs.pop("custom_pipeline", None)
|
354 |
-
# for fastdeploy model
|
355 |
-
runtime_options = kwargs.pop("runtime_options", None)
|
356 |
-
from_hf_hub = kwargs.pop("from_hf_hub", False)
|
357 |
-
|
358 |
-
# 1. Download the checkpoints and configs
|
359 |
-
if not os.path.isdir(pretrained_model_name_or_path):
|
360 |
-
config_dict = cls.load_config(
|
361 |
-
pretrained_model_name_or_path,
|
362 |
-
cache_dir=cache_dir,
|
363 |
-
from_hf_hub=from_hf_hub,
|
364 |
-
)
|
365 |
-
else:
|
366 |
-
config_dict = cls.load_config(pretrained_model_name_or_path)
|
367 |
-
|
368 |
-
# 2. Load the pipeline class
|
369 |
-
if cls != DiffusionPipeline:
|
370 |
-
pipeline_class = cls
|
371 |
-
else:
|
372 |
-
diffusers_module = importlib.import_module(cls.__module__.split(".")[0])
|
373 |
-
pipeline_class = getattr(diffusers_module, config_dict["_class_name"])
|
374 |
-
|
375 |
-
# To be removed in 1.0.0
|
376 |
-
# TODO (junnyu) support old version
|
377 |
-
_ppdiffusers_version = (
|
378 |
-
config_dict["_diffusers_paddle_version"]
|
379 |
-
if "_diffusers_paddle_version" in config_dict
|
380 |
-
else config_dict["_ppdiffusers_version"]
|
381 |
-
)
|
382 |
-
if pipeline_class.__name__ == "StableDiffusionInpaintPipeline" and version.parse(
|
383 |
-
version.parse(_ppdiffusers_version).base_version
|
384 |
-
) <= version.parse("0.5.1"):
|
385 |
-
from . import (
|
386 |
-
StableDiffusionInpaintPipeline,
|
387 |
-
StableDiffusionInpaintPipelineLegacy,
|
388 |
-
)
|
389 |
-
|
390 |
-
pipeline_class = StableDiffusionInpaintPipelineLegacy
|
391 |
-
|
392 |
-
deprecation_message = (
|
393 |
-
"You are using a legacy checkpoint for inpainting with Stable Diffusion, therefore we are loading the"
|
394 |
-
f" {StableDiffusionInpaintPipelineLegacy} class instead of {StableDiffusionInpaintPipeline}. For"
|
395 |
-
" better inpainting results, we strongly suggest using Stable Diffusion's official inpainting"
|
396 |
-
" checkpoint: https://huggingface.co/runwayml/stable-diffusion-inpainting instead or adapting your"
|
397 |
-
f" checkpoint {pretrained_model_name_or_path} to the format of"
|
398 |
-
" https://huggingface.co/runwayml/stable-diffusion-inpainting. Note that we do not actively maintain"
|
399 |
-
" the {StableDiffusionInpaintPipelineLegacy} class and will likely remove it in version 1.0.0."
|
400 |
-
)
|
401 |
-
deprecate("StableDiffusionInpaintPipelineLegacy", "1.0.0", deprecation_message, standard_warn=False)
|
402 |
-
|
403 |
-
# some modules can be passed directly to the init
|
404 |
-
# in this case they are already instantiated in `kwargs`
|
405 |
-
# extract them here
|
406 |
-
expected_modules, optional_kwargs = cls._get_signature_keys(pipeline_class)
|
407 |
-
|
408 |
-
passed_class_obj = {k: kwargs.pop(k) for k in expected_modules if k in kwargs}
|
409 |
-
passed_pipe_kwargs = {k: kwargs.pop(k) for k in optional_kwargs if k in kwargs}
|
410 |
-
|
411 |
-
init_dict, unused_kwargs, _ = pipeline_class.extract_init_dict(config_dict, **kwargs)
|
412 |
-
|
413 |
-
# define init kwargs
|
414 |
-
init_kwargs = {k: init_dict.pop(k) for k in optional_kwargs if k in init_dict}
|
415 |
-
init_kwargs = {**init_kwargs, **passed_pipe_kwargs}
|
416 |
-
|
417 |
-
# remove `null` components
|
418 |
-
def load_module(name, value):
|
419 |
-
if value[0] is None:
|
420 |
-
return False
|
421 |
-
if name in passed_class_obj and passed_class_obj[name] is None:
|
422 |
-
return False
|
423 |
-
return True
|
424 |
-
|
425 |
-
init_dict = {k: v for k, v in init_dict.items() if load_module(k, v)}
|
426 |
-
|
427 |
-
if len(unused_kwargs) > 0:
|
428 |
-
logger.warning(
|
429 |
-
f"Keyword arguments {unused_kwargs} are not expected by {pipeline_class.__name__} and will be ignored."
|
430 |
-
)
|
431 |
-
# import it here to avoid circular import
|
432 |
-
from . import pipelines
|
433 |
-
|
434 |
-
# 3. Load each module in the pipeline
|
435 |
-
for name, (library_name, class_name) in init_dict.items():
|
436 |
-
# TODO (junnyu) support old model_index.json
|
437 |
-
if library_name == "diffusers_paddle":
|
438 |
-
library_name = "ppdiffusers"
|
439 |
-
|
440 |
-
is_pipeline_module = hasattr(pipelines, library_name)
|
441 |
-
loaded_sub_model = None
|
442 |
-
|
443 |
-
# if the model is in a pipeline module, then we load it from the pipeline
|
444 |
-
if name in passed_class_obj:
|
445 |
-
# 1. check that passed_class_obj has correct parent class
|
446 |
-
if not is_pipeline_module:
|
447 |
-
library = importlib.import_module(library_name)
|
448 |
-
class_obj = getattr(library, class_name)
|
449 |
-
importable_classes = LOADABLE_CLASSES[library_name]
|
450 |
-
class_candidates = {c: getattr(library, c, None) for c in importable_classes.keys()}
|
451 |
-
|
452 |
-
expected_class_obj = None
|
453 |
-
for class_name, class_candidate in class_candidates.items():
|
454 |
-
if class_candidate is not None and issubclass(class_obj, class_candidate):
|
455 |
-
expected_class_obj = class_candidate
|
456 |
-
|
457 |
-
if not issubclass(passed_class_obj[name].__class__, expected_class_obj):
|
458 |
-
raise ValueError(
|
459 |
-
f"{passed_class_obj[name]} is of type: {type(passed_class_obj[name])}, but should be"
|
460 |
-
f" {expected_class_obj}"
|
461 |
-
)
|
462 |
-
else:
|
463 |
-
logger.warning(
|
464 |
-
f"You have passed a non-standard module {passed_class_obj[name]}. We cannot verify whether it"
|
465 |
-
" has the correct type"
|
466 |
-
)
|
467 |
-
|
468 |
-
# set passed class object
|
469 |
-
loaded_sub_model = passed_class_obj[name]
|
470 |
-
elif is_pipeline_module:
|
471 |
-
pipeline_module = getattr(pipelines, library_name)
|
472 |
-
class_obj = getattr(pipeline_module, class_name)
|
473 |
-
importable_classes = ALL_IMPORTABLE_CLASSES
|
474 |
-
class_candidates = {c: class_obj for c in importable_classes.keys()}
|
475 |
-
else:
|
476 |
-
# else we just import it from the library.
|
477 |
-
library = importlib.import_module(library_name)
|
478 |
-
|
479 |
-
class_obj = getattr(library, class_name)
|
480 |
-
importable_classes = LOADABLE_CLASSES[library_name]
|
481 |
-
class_candidates = {c: getattr(library, c, None) for c in importable_classes.keys()}
|
482 |
-
|
483 |
-
if loaded_sub_model is None:
|
484 |
-
load_method_name = None
|
485 |
-
for class_name, class_candidate in class_candidates.items():
|
486 |
-
if class_candidate is not None and issubclass(class_obj, class_candidate):
|
487 |
-
load_method_name = importable_classes[class_name][1]
|
488 |
-
|
489 |
-
if load_method_name is None:
|
490 |
-
none_module = class_obj.__module__
|
491 |
-
is_dummy_path = none_module.startswith(DUMMY_MODULES_FOLDER) or none_module.startswith(
|
492 |
-
PADDLENLP_DUMMY_MODULES_FOLDER
|
493 |
-
)
|
494 |
-
if is_dummy_path and "dummy" in none_module:
|
495 |
-
# call class_obj for nice error message of missing requirements
|
496 |
-
class_obj()
|
497 |
-
|
498 |
-
raise ValueError(
|
499 |
-
f"The component {class_obj} of {pipeline_class} cannot be loaded as it does not seem to have"
|
500 |
-
f" any of the loading methods defined in {ALL_IMPORTABLE_CLASSES}."
|
501 |
-
)
|
502 |
-
|
503 |
-
load_method = getattr(class_obj, load_method_name)
|
504 |
-
loading_kwargs = {
|
505 |
-
"from_hf_hub": from_hf_hub,
|
506 |
-
"cache_dir": cache_dir,
|
507 |
-
}
|
508 |
-
|
509 |
-
if issubclass(class_obj, FastDeployRuntimeModel):
|
510 |
-
if isinstance(runtime_options, dict):
|
511 |
-
options = runtime_options.get(name, None)
|
512 |
-
else:
|
513 |
-
options = runtime_options
|
514 |
-
loading_kwargs["runtime_options"] = options
|
515 |
-
|
516 |
-
if os.path.isdir(pretrained_model_name_or_path):
|
517 |
-
model_path_dir = os.path.join(pretrained_model_name_or_path, name)
|
518 |
-
elif from_hf_hub:
|
519 |
-
model_path_dir = pretrained_model_name_or_path
|
520 |
-
loading_kwargs["subfolder"] = name
|
521 |
-
else:
|
522 |
-
# BOS does not require 'subfolder'. We simpy concat the model name with the subfolder
|
523 |
-
model_path_dir = pretrained_model_name_or_path + "/" + name
|
524 |
-
|
525 |
-
loaded_sub_model = load_method(model_path_dir, **loading_kwargs)
|
526 |
-
|
527 |
-
# TODO junnyu find a better way to covert to float16
|
528 |
-
if isinstance(loaded_sub_model, nn.Layer):
|
529 |
-
if paddle_dtype is not None and next(loaded_sub_model.named_parameters())[1].dtype != paddle_dtype:
|
530 |
-
loaded_sub_model = loaded_sub_model.to(dtype=paddle_dtype)
|
531 |
-
# paddlenlp model is training mode not eval mode
|
532 |
-
loaded_sub_model.eval()
|
533 |
-
|
534 |
-
init_kwargs[name] = loaded_sub_model # UNet(...), # DiffusionScheduler(...)
|
535 |
-
|
536 |
-
# 4. Potentially add passed objects if expected
|
537 |
-
missing_modules = set(expected_modules) - set(init_kwargs.keys())
|
538 |
-
passed_modules = list(passed_class_obj.keys())
|
539 |
-
optional_modules = pipeline_class._optional_components
|
540 |
-
if len(missing_modules) > 0 and missing_modules <= set(passed_modules + optional_modules):
|
541 |
-
for module in missing_modules:
|
542 |
-
init_kwargs[module] = passed_class_obj.get(module, None)
|
543 |
-
elif len(missing_modules) > 0:
|
544 |
-
passed_modules = set(list(init_kwargs.keys()) + list(passed_class_obj.keys())) - optional_kwargs
|
545 |
-
raise ValueError(
|
546 |
-
f"Pipeline {pipeline_class} expected {expected_modules}, but only {passed_modules} were passed."
|
547 |
-
)
|
548 |
-
|
549 |
-
# 5. Instantiate the pipeline
|
550 |
-
model = pipeline_class(**init_kwargs)
|
551 |
-
return model
|
552 |
-
|
553 |
-
def enable_attention_slicing(self, slice_size: Optional[Union[str, int]] = "auto"):
|
554 |
-
r"""
|
555 |
-
Enable sliced attention computation.
|
556 |
-
When this option is enabled, the attention module will split the input tensor in slices, to compute attention
|
557 |
-
in several steps. This is useful to save some memory in exchange for a small speed decrease.
|
558 |
-
Args:
|
559 |
-
slice_size (`str` or `int`, *optional*, defaults to `"auto"`):
|
560 |
-
When `"auto"`, halves the input to the attention heads, so attention will be computed in two steps. If
|
561 |
-
`"max"`, maxium amount of memory will be saved by running only one slice at a time. If a number is
|
562 |
-
provided, uses as many slices as `attention_head_dim // slice_size`. In this case, `attention_head_dim`
|
563 |
-
must be a multiple of `slice_size`.
|
564 |
-
"""
|
565 |
-
self.set_attention_slice(slice_size)
|
566 |
-
|
567 |
-
def disable_attention_slicing(self):
|
568 |
-
r"""
|
569 |
-
Disable sliced attention computation. If `enable_attention_slicing` was previously invoked, this method will go
|
570 |
-
back to computing attention in one step.
|
571 |
-
"""
|
572 |
-
# set slice_size = `None` to disable `attention slicing`
|
573 |
-
self.enable_attention_slicing(None)
|
574 |
-
|
575 |
-
def set_attention_slice(self, slice_size: Optional[int]):
|
576 |
-
module_names, _, _ = self.extract_init_dict(dict(self.config))
|
577 |
-
for module_name in module_names:
|
578 |
-
module = getattr(self, module_name)
|
579 |
-
if isinstance(module, nn.Layer) and hasattr(module, "set_attention_slice"):
|
580 |
-
module.set_attention_slice(slice_size)
|
581 |
-
|
582 |
-
@staticmethod
|
583 |
-
def _get_signature_keys(obj):
|
584 |
-
parameters = inspect.signature(obj.__init__).parameters
|
585 |
-
required_parameters = {k: v for k, v in parameters.items() if v.default == inspect._empty}
|
586 |
-
optional_parameters = set({k for k, v in parameters.items() if v.default != inspect._empty})
|
587 |
-
expected_modules = set(required_parameters.keys()) - set(["self"])
|
588 |
-
return expected_modules, optional_parameters
|
589 |
-
|
590 |
-
@property
|
591 |
-
def components(self) -> Dict[str, Any]:
|
592 |
-
r"""
|
593 |
-
|
594 |
-
The `self.components` property can be useful to run different pipelines with the same weights and
|
595 |
-
configurations to not have to re-allocate memory.
|
596 |
-
|
597 |
-
Examples:
|
598 |
-
|
599 |
-
```py
|
600 |
-
>>> from ppdiffusers import (
|
601 |
-
... StableDiffusionPipeline,
|
602 |
-
... StableDiffusionImg2ImgPipeline,
|
603 |
-
... StableDiffusionInpaintPipeline,
|
604 |
-
... )
|
605 |
-
|
606 |
-
>>> text2img = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
|
607 |
-
>>> img2img = StableDiffusionImg2ImgPipeline(**text2img.components)
|
608 |
-
>>> inpaint = StableDiffusionInpaintPipeline(**text2img.components)
|
609 |
-
```
|
610 |
-
|
611 |
-
Returns:
|
612 |
-
A dictionaly containing all the modules needed to initialize the pipeline.
|
613 |
-
"""
|
614 |
-
expected_modules, optional_parameters = self._get_signature_keys(self)
|
615 |
-
components = {
|
616 |
-
k: getattr(self, k) for k in self.config.keys() if not k.startswith("_") and k not in optional_parameters
|
617 |
-
}
|
618 |
-
|
619 |
-
if set(components.keys()) != expected_modules:
|
620 |
-
raise ValueError(
|
621 |
-
f"{self} has been incorrectly initialized or {self.__class__} is incorrectly implemented. Expected"
|
622 |
-
f" {expected_modules} to be defined, but {components} are defined."
|
623 |
-
)
|
624 |
-
|
625 |
-
return components
|
626 |
-
|
627 |
-
@staticmethod
|
628 |
-
def numpy_to_pil(images):
|
629 |
-
"""
|
630 |
-
Convert a numpy image or a batch of images to a PIL image.
|
631 |
-
"""
|
632 |
-
if images.ndim == 3:
|
633 |
-
images = images[None, ...]
|
634 |
-
images = (images * 255).round().astype("uint8")
|
635 |
-
if images.shape[-1] == 1:
|
636 |
-
# special case for grayscale (single channel) images
|
637 |
-
pil_images = [Image.fromarray(image.squeeze(), mode="L") for image in images]
|
638 |
-
else:
|
639 |
-
pil_images = [Image.fromarray(image) for image in images]
|
640 |
-
|
641 |
-
return pil_images
|
642 |
-
|
643 |
-
def progress_bar(self, iterable=None, total=None):
|
644 |
-
if not hasattr(self, "_progress_bar_config"):
|
645 |
-
self._progress_bar_config = {}
|
646 |
-
elif not isinstance(self._progress_bar_config, dict):
|
647 |
-
raise ValueError(
|
648 |
-
f"`self._progress_bar_config` should be of type `dict`, but is {type(self._progress_bar_config)}."
|
649 |
-
)
|
650 |
-
|
651 |
-
if iterable is not None:
|
652 |
-
return tqdm(iterable, **self._progress_bar_config)
|
653 |
-
elif total is not None:
|
654 |
-
return tqdm(total=total, **self._progress_bar_config)
|
655 |
-
else:
|
656 |
-
raise ValueError("Either `total` or `iterable` has to be defined.")
|
657 |
-
|
658 |
-
def set_progress_bar_config(self, **kwargs):
|
659 |
-
self._progress_bar_config = kwargs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/A00001/bingothoo/src/components/chat-image.tsx
DELETED
@@ -1,170 +0,0 @@
|
|
1 |
-
import {
|
2 |
-
useEffect,
|
3 |
-
useState,
|
4 |
-
useCallback,
|
5 |
-
ChangeEvent,
|
6 |
-
ClipboardEvent,
|
7 |
-
MouseEventHandler,
|
8 |
-
FormEvent,
|
9 |
-
useRef
|
10 |
-
} from "react"
|
11 |
-
import Image from 'next/image'
|
12 |
-
import PasteIcon from '@/assets/images/paste.svg'
|
13 |
-
import UploadIcon from '@/assets/images/upload.svg'
|
14 |
-
import CameraIcon from '@/assets/images/camera.svg'
|
15 |
-
import { useBing } from '@/lib/hooks/use-bing'
|
16 |
-
import { cn } from '@/lib/utils'
|
17 |
-
|
18 |
-
interface ChatImageProps extends Pick<ReturnType<typeof useBing>, 'uploadImage'> {}
|
19 |
-
|
20 |
-
const preventDefault: MouseEventHandler<HTMLDivElement> = (event) => {
|
21 |
-
event.nativeEvent.stopImmediatePropagation()
|
22 |
-
}
|
23 |
-
|
24 |
-
const toBase64 = (file: File): Promise<string> => new Promise((resolve, reject) => {
|
25 |
-
const reader = new FileReader()
|
26 |
-
reader.readAsDataURL(file)
|
27 |
-
reader.onload = () => resolve(reader.result as string)
|
28 |
-
reader.onerror = reject
|
29 |
-
})
|
30 |
-
|
31 |
-
export function ChatImage({ children, uploadImage }: React.PropsWithChildren<ChatImageProps>) {
|
32 |
-
const videoRef = useRef<HTMLVideoElement>(null)
|
33 |
-
const canvasRef = useRef<HTMLCanvasElement>(null)
|
34 |
-
const mediaStream = useRef<MediaStream>()
|
35 |
-
const [panel, setPanel] = useState('none')
|
36 |
-
|
37 |
-
const upload = useCallback((url: string) => {
|
38 |
-
if (url) {
|
39 |
-
uploadImage(url)
|
40 |
-
}
|
41 |
-
setPanel('none')
|
42 |
-
}, [panel])
|
43 |
-
|
44 |
-
const onUpload = useCallback(async (event: ChangeEvent<HTMLInputElement>) => {
|
45 |
-
const file = event.target.files?.[0]
|
46 |
-
if (file) {
|
47 |
-
const fileDataUrl = await toBase64(file)
|
48 |
-
if (fileDataUrl) {
|
49 |
-
upload(fileDataUrl)
|
50 |
-
}
|
51 |
-
}
|
52 |
-
}, [])
|
53 |
-
|
54 |
-
const onPaste = useCallback((event: ClipboardEvent<HTMLInputElement>) => {
|
55 |
-
const pasteUrl = event.clipboardData.getData('text') ?? ''
|
56 |
-
upload(pasteUrl)
|
57 |
-
}, [])
|
58 |
-
|
59 |
-
const onEnter = useCallback((event: FormEvent<HTMLFormElement>) => {
|
60 |
-
event.preventDefault()
|
61 |
-
event.stopPropagation()
|
62 |
-
// @ts-ignore
|
63 |
-
const inputUrl = event.target.elements.image.value
|
64 |
-
if (inputUrl) {
|
65 |
-
upload(inputUrl)
|
66 |
-
}
|
67 |
-
}, [])
|
68 |
-
|
69 |
-
const openVideo: MouseEventHandler<HTMLButtonElement> = async (event) => {
|
70 |
-
event.stopPropagation()
|
71 |
-
setPanel('camera-mode')
|
72 |
-
}
|
73 |
-
|
74 |
-
const onCapture = () => {
|
75 |
-
if (canvasRef.current && videoRef.current) {
|
76 |
-
const canvas = canvasRef.current
|
77 |
-
canvas.width = videoRef.current!.videoWidth
|
78 |
-
canvas.height = videoRef.current!.videoHeight
|
79 |
-
canvas.getContext('2d')?.drawImage(videoRef.current, 0, 0, canvas.width, canvas.height)
|
80 |
-
const cameraUrl = canvas.toDataURL('image/jpeg')
|
81 |
-
upload(cameraUrl)
|
82 |
-
}
|
83 |
-
}
|
84 |
-
|
85 |
-
useEffect(() => {
|
86 |
-
const handleBlur = () => {
|
87 |
-
if (panel !== 'none') {
|
88 |
-
setPanel('none')
|
89 |
-
}
|
90 |
-
}
|
91 |
-
document.addEventListener('click', handleBlur)
|
92 |
-
return () => {
|
93 |
-
document.removeEventListener('click', handleBlur)
|
94 |
-
}
|
95 |
-
}, [panel])
|
96 |
-
|
97 |
-
useEffect(() => {
|
98 |
-
if (panel === 'camera-mode') {
|
99 |
-
navigator.mediaDevices.getUserMedia({ video: true, audio: false })
|
100 |
-
.then(videoStream => {
|
101 |
-
mediaStream.current = videoStream
|
102 |
-
if (videoRef.current) {
|
103 |
-
videoRef.current.srcObject = videoStream
|
104 |
-
}
|
105 |
-
})
|
106 |
-
} else {
|
107 |
-
if (mediaStream.current) {
|
108 |
-
mediaStream.current.getTracks().forEach(function(track) {
|
109 |
-
track.stop()
|
110 |
-
})
|
111 |
-
mediaStream.current = undefined
|
112 |
-
}
|
113 |
-
}
|
114 |
-
}, [panel])
|
115 |
-
|
116 |
-
return (
|
117 |
-
<div className="visual-search-container">
|
118 |
-
<div onClick={() => panel === 'none' ? setPanel('normal') : setPanel('none')}>{children}</div>
|
119 |
-
<div className={cn('visual-search', panel)} onClick={preventDefault}>
|
120 |
-
<div className="normal-content">
|
121 |
-
<div className="header">
|
122 |
-
<h4>添加图像</h4>
|
123 |
-
</div>
|
124 |
-
<div className="paste">
|
125 |
-
<Image alt="paste" src={PasteIcon} width={24} />
|
126 |
-
<form onSubmitCapture={onEnter}>
|
127 |
-
<input
|
128 |
-
className="paste-input"
|
129 |
-
id="sb_imgpst"
|
130 |
-
type="text"
|
131 |
-
name="image"
|
132 |
-
placeholder="粘贴图像 URL"
|
133 |
-
aria-label="粘贴图像 URL"
|
134 |
-
onPaste={onPaste}
|
135 |
-
onClickCapture={(e) => e.stopPropagation()}
|
136 |
-
/>
|
137 |
-
</form>
|
138 |
-
</div>
|
139 |
-
<div className="buttons">
|
140 |
-
<button type="button" aria-label="从此设备上传">
|
141 |
-
<input
|
142 |
-
id="vs_fileinput"
|
143 |
-
className="fileinput"
|
144 |
-
type="file"
|
145 |
-
accept="image/gif, image/jpeg, image/png, image/webp"
|
146 |
-
onChange={onUpload}
|
147 |
-
/>
|
148 |
-
<Image alt="uplaod" src={UploadIcon} width={20} />
|
149 |
-
从此设备上传
|
150 |
-
</button>
|
151 |
-
<button type="button" aria-label="拍照" onClick={openVideo}>
|
152 |
-
<Image alt="camera" src={CameraIcon} width={20} />
|
153 |
-
拍照
|
154 |
-
</button>
|
155 |
-
</div>
|
156 |
-
</div>
|
157 |
-
{panel === 'camera-mode' && <div className="cam-content">
|
158 |
-
<div className="webvideo-container">
|
159 |
-
<video className="webvideo" autoPlay muted playsInline ref={videoRef} />
|
160 |
-
<canvas className="webcanvas" ref={canvasRef} />
|
161 |
-
</div>
|
162 |
-
<div className="cambtn" role="button" aria-label="拍照" onClick={onCapture}>
|
163 |
-
<div className="cam-btn-circle-large"></div>
|
164 |
-
<div className="cam-btn-circle-small"></div>
|
165 |
-
</div>
|
166 |
-
</div>}
|
167 |
-
</div>
|
168 |
-
</div>
|
169 |
-
)
|
170 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AISuperheroes/08GR-KitchenSink-AIUIUX/demos/kitchen_sink/run.py
DELETED
@@ -1,146 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
import json
|
3 |
-
import numpy as np
|
4 |
-
import gradio as gr
|
5 |
-
|
6 |
-
CHOICES = ["foo", "bar", "baz"]
|
7 |
-
JSONOBJ = """{"items":{"item":[{"id": "0001","type": null,"is_good": false,"ppu": 0.55,"batters":{"batter":[{ "id": "1001", "type": "Regular" },{ "id": "1002", "type": "Chocolate" },{ "id": "1003", "type": "Blueberry" },{ "id": "1004", "type": "Devil's Food" }]},"topping":[{ "id": "5001", "type": "None" },{ "id": "5002", "type": "Glazed" },{ "id": "5005", "type": "Sugar" },{ "id": "5007", "type": "Powdered Sugar" },{ "id": "5006", "type": "Chocolate with Sprinkles" },{ "id": "5003", "type": "Chocolate" },{ "id": "5004", "type": "Maple" }]}]}}"""
|
8 |
-
|
9 |
-
def fn(
|
10 |
-
text1,
|
11 |
-
text2,
|
12 |
-
num,
|
13 |
-
slider1,
|
14 |
-
slider2,
|
15 |
-
single_checkbox,
|
16 |
-
checkboxes,
|
17 |
-
radio,
|
18 |
-
dropdown,
|
19 |
-
im1,
|
20 |
-
im2,
|
21 |
-
im3,
|
22 |
-
im4,
|
23 |
-
video,
|
24 |
-
audio1,
|
25 |
-
audio2,
|
26 |
-
file,
|
27 |
-
df1,
|
28 |
-
df2,
|
29 |
-
):
|
30 |
-
return (
|
31 |
-
(text1 if single_checkbox else text2)
|
32 |
-
+ ", selected:"
|
33 |
-
+ ", ".join(checkboxes), # Text
|
34 |
-
{
|
35 |
-
"positive": num / (num + slider1 + slider2),
|
36 |
-
"negative": slider1 / (num + slider1 + slider2),
|
37 |
-
"neutral": slider2 / (num + slider1 + slider2),
|
38 |
-
}, # Label
|
39 |
-
(audio1[0], np.flipud(audio1[1]))
|
40 |
-
if audio1 is not None else os.path.join(os.path.dirname(__file__), "files/cantina.wav"), # Audio
|
41 |
-
np.flipud(im1)
|
42 |
-
if im1 is not None else os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"), # Image
|
43 |
-
video
|
44 |
-
if video is not None else os.path.join(os.path.dirname(__file__), "files/world.mp4"), # Video
|
45 |
-
[
|
46 |
-
("The", "art"),
|
47 |
-
("quick brown", "adj"),
|
48 |
-
("fox", "nn"),
|
49 |
-
("jumped", "vrb"),
|
50 |
-
("testing testing testing", None),
|
51 |
-
("over", "prp"),
|
52 |
-
("the", "art"),
|
53 |
-
("testing", None),
|
54 |
-
("lazy", "adj"),
|
55 |
-
("dogs", "nn"),
|
56 |
-
(".", "punc"),
|
57 |
-
] + [(f"test {x}", f"test {x}") for x in range(10)], # HighlightedText
|
58 |
-
[
|
59 |
-
("The testing testing testing", None),
|
60 |
-
("over", 0.6),
|
61 |
-
("the", 0.2),
|
62 |
-
("testing", None),
|
63 |
-
("lazy", -0.1),
|
64 |
-
("dogs", 0.4),
|
65 |
-
(".", 0),
|
66 |
-
] + [(f"test", x / 10) for x in range(-10, 10)], # HighlightedText
|
67 |
-
json.loads(JSONOBJ), # JSON
|
68 |
-
"<button style='background-color: red'>Click Me: " + radio + "</button>", # HTML
|
69 |
-
os.path.join(os.path.dirname(__file__), "files/titanic.csv"),
|
70 |
-
df1, # Dataframe
|
71 |
-
np.random.randint(0, 10, (4, 4)), # Dataframe
|
72 |
-
df2, # Timeseries
|
73 |
-
)
|
74 |
-
|
75 |
-
|
76 |
-
demo = gr.Interface(
|
77 |
-
fn,
|
78 |
-
inputs=[
|
79 |
-
gr.Textbox(value="Lorem ipsum", label="Textbox"),
|
80 |
-
gr.Textbox(lines=3, placeholder="Type here..", label="Textbox 2"),
|
81 |
-
gr.Number(label="Number", value=42),
|
82 |
-
gr.Slider(10, 20, value=15, label="Slider: 10 - 20"),
|
83 |
-
gr.Slider(maximum=20, step=0.04, label="Slider: step @ 0.04"),
|
84 |
-
gr.Checkbox(label="Checkbox"),
|
85 |
-
gr.CheckboxGroup(label="CheckboxGroup", choices=CHOICES, value=CHOICES[0:2]),
|
86 |
-
gr.Radio(label="Radio", choices=CHOICES, value=CHOICES[2]),
|
87 |
-
gr.Dropdown(label="Dropdown", choices=CHOICES),
|
88 |
-
gr.Image(label="Image"),
|
89 |
-
gr.Image(label="Image w/ Cropper", tool="select"),
|
90 |
-
gr.Image(label="Sketchpad", source="canvas"),
|
91 |
-
gr.Image(label="Webcam", source="webcam"),
|
92 |
-
gr.Video(label="Video"),
|
93 |
-
gr.Audio(label="Audio"),
|
94 |
-
gr.Audio(label="Microphone", source="microphone"),
|
95 |
-
gr.File(label="File"),
|
96 |
-
gr.Dataframe(label="Dataframe", headers=["Name", "Age", "Gender"]),
|
97 |
-
gr.Timeseries(x="time", y=["price", "value"], colors=["pink", "purple"]),
|
98 |
-
],
|
99 |
-
outputs=[
|
100 |
-
gr.Textbox(label="Textbox"),
|
101 |
-
gr.Label(label="Label"),
|
102 |
-
gr.Audio(label="Audio"),
|
103 |
-
gr.Image(label="Image"),
|
104 |
-
gr.Video(label="Video"),
|
105 |
-
gr.HighlightedText(label="HighlightedText", color_map={"punc": "pink", "test 0": "blue"}),
|
106 |
-
gr.HighlightedText(label="HighlightedText", show_legend=True),
|
107 |
-
gr.JSON(label="JSON"),
|
108 |
-
gr.HTML(label="HTML"),
|
109 |
-
gr.File(label="File"),
|
110 |
-
gr.Dataframe(label="Dataframe"),
|
111 |
-
gr.Dataframe(label="Numpy"),
|
112 |
-
gr.Timeseries(x="time", y=["price", "value"], label="Timeseries"),
|
113 |
-
],
|
114 |
-
examples=[
|
115 |
-
[
|
116 |
-
"the quick brown fox",
|
117 |
-
"jumps over the lazy dog",
|
118 |
-
10,
|
119 |
-
12,
|
120 |
-
4,
|
121 |
-
True,
|
122 |
-
["foo", "baz"],
|
123 |
-
"baz",
|
124 |
-
"bar",
|
125 |
-
os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"),
|
126 |
-
os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"),
|
127 |
-
os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"),
|
128 |
-
os.path.join(os.path.dirname(__file__), "files/cheetah1.jpg"),
|
129 |
-
os.path.join(os.path.dirname(__file__), "files/world.mp4"),
|
130 |
-
os.path.join(os.path.dirname(__file__), "files/cantina.wav"),
|
131 |
-
os.path.join(os.path.dirname(__file__), "files/cantina.wav"),
|
132 |
-
os.path.join(os.path.dirname(__file__), "files/titanic.csv"),
|
133 |
-
[[1, 2, 3], [3, 4, 5]],
|
134 |
-
os.path.join(os.path.dirname(__file__), "files/time.csv"),
|
135 |
-
]
|
136 |
-
]
|
137 |
-
* 3,
|
138 |
-
theme="default",
|
139 |
-
title="Gradio AI UI UX",
|
140 |
-
cache_examples=False,
|
141 |
-
description="Try out all the components!",
|
142 |
-
article="Learn more about [Gradio](http://gradio.app)",
|
143 |
-
)
|
144 |
-
|
145 |
-
if __name__ == "__main__":
|
146 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIWaves/SOP_Generation-single/Agent/Agent.py
DELETED
@@ -1,243 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
# Copyright 2023 The AIWaves Inc. team.
|
3 |
-
|
4 |
-
#
|
5 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
# you may not use this file except in compliance with the License.
|
7 |
-
# You may obtain a copy of the License at
|
8 |
-
#
|
9 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
#
|
11 |
-
# Unless required by applicable law or agreed to in writing, software
|
12 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
# See the License for the specific language governing permissions and
|
15 |
-
# limitations under the License.
|
16 |
-
"""LLM autonoumous agent"""
|
17 |
-
from LLM.base_LLM import *
|
18 |
-
from Component import *
|
19 |
-
from Action import Action
|
20 |
-
from Prompt import *
|
21 |
-
|
22 |
-
headers = {
|
23 |
-
"Content-Type": "text/event-stream",
|
24 |
-
"Cache-Control": "no-cache",
|
25 |
-
"X-Accel-Buffering": "no",
|
26 |
-
}
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
class Agent:
|
32 |
-
"""
|
33 |
-
Auto agent, input the JSON of SOP.
|
34 |
-
"""
|
35 |
-
|
36 |
-
# Agent should have args: agents,states
|
37 |
-
def __init__(self, name, agent_state_roles, **kwargs) -> None:
|
38 |
-
self.state_roles = agent_state_roles
|
39 |
-
self.name = name
|
40 |
-
|
41 |
-
self.style = kwargs["style"]
|
42 |
-
self.LLMs = kwargs["LLMs"]
|
43 |
-
self.LLM = None
|
44 |
-
self.is_user = kwargs["is_user"]
|
45 |
-
self.begins = kwargs["begins"] if "begins" in kwargs else False
|
46 |
-
self.current_role = ""
|
47 |
-
self.long_term_memory = []
|
48 |
-
self.short_term_memory = ""
|
49 |
-
self.current_state = None
|
50 |
-
self.first_speak = True
|
51 |
-
self.environment = None
|
52 |
-
|
53 |
-
|
54 |
-
@classmethod
|
55 |
-
def from_config(cls, config_path):
|
56 |
-
"""
|
57 |
-
Initialize agents based on json file
|
58 |
-
Return:
|
59 |
-
agents(dict) : key:agent_name;value:class(Agent)
|
60 |
-
names_to_roles(dict) : key:state_name value:(dict; (key:agent_name ; value:agent_role))
|
61 |
-
roles_to_names(dict) : key:state_name value:(dict; (key:agent_role ; value:agent_name))
|
62 |
-
"""
|
63 |
-
with open(config_path) as f:
|
64 |
-
config = json.load(f)
|
65 |
-
|
66 |
-
roles_to_names = {}
|
67 |
-
names_to_roles = {}
|
68 |
-
agents = {}
|
69 |
-
user_names = json.loads(os.environ["User_Names"]) if "User_Names" in os.environ else []
|
70 |
-
for agent_name, agent_dict in config["agents"].items():
|
71 |
-
agent_state_roles = {}
|
72 |
-
agent_LLMs = {}
|
73 |
-
agent_begins = {}
|
74 |
-
for state_name, agent_role in agent_dict["roles"].items():
|
75 |
-
|
76 |
-
agent_begins[state_name] = {}
|
77 |
-
|
78 |
-
if state_name not in roles_to_names:
|
79 |
-
roles_to_names[state_name] = {}
|
80 |
-
if state_name not in names_to_roles:
|
81 |
-
names_to_roles[state_name] = {}
|
82 |
-
roles_to_names[state_name][agent_role] = agent_name
|
83 |
-
names_to_roles[state_name][agent_name] = agent_role
|
84 |
-
agent_state_roles[state_name] = agent_role
|
85 |
-
current_state = config["states"][state_name]
|
86 |
-
current_state["roles"] = list(current_state["agent_states"].keys()) if "roles" not in current_state else current_state["roles"]
|
87 |
-
current_state_begin_role = current_state["begin_role"] if "begin_role" in current_state else current_state["roles"][0]
|
88 |
-
agent_begins[state_name]["is_begin"] = current_state_begin_role==agent_role if "begin_role" in current_state else False
|
89 |
-
agent_begins[state_name]["begin_query"] = current_state["begin_query"] if "begin_query" in current_state else " "
|
90 |
-
agent_LLMs[state_name] = init_LLM("logs"+os.sep+f"{agent_name}",**current_state["agent_states"][agent_role])
|
91 |
-
agents[agent_name] = cls(
|
92 |
-
agent_name,
|
93 |
-
agent_state_roles,
|
94 |
-
LLMs=agent_LLMs,
|
95 |
-
is_user=agent_name in user_names,
|
96 |
-
style = agent_dict["style"],
|
97 |
-
begins = agent_begins
|
98 |
-
)
|
99 |
-
assert len(config["agents"].keys()) != 2 or (roles_to_names[config["root"]][config["states"][config["root"]]["begin_role"]] not in user_names and "begin_query" in config["states"][config["root"]]),"In a single-agent scenario, there must be an opening statement and it must be the agent"
|
100 |
-
return agents, roles_to_names, names_to_roles
|
101 |
-
|
102 |
-
def step(self, current_state,input=""):
|
103 |
-
"""
|
104 |
-
return actions by current state and environment
|
105 |
-
Return: action(Action)
|
106 |
-
"""
|
107 |
-
|
108 |
-
current_state.chat_nums +=1
|
109 |
-
state_begin = current_state.is_begin
|
110 |
-
agent_begin = self.begins[current_state.name]["is_begin"]
|
111 |
-
self.begins[current_state.name]["is_begin"] = False
|
112 |
-
current_state.is_begin = False
|
113 |
-
environment = self.environment
|
114 |
-
|
115 |
-
self.current_state = current_state
|
116 |
-
# 先根据当前环境更新信息
|
117 |
-
# First update the information according to the current environment
|
118 |
-
|
119 |
-
response = " "
|
120 |
-
res_dict = {}
|
121 |
-
|
122 |
-
if self.is_user:
|
123 |
-
response = f"{self.name}:{input}"
|
124 |
-
else:
|
125 |
-
if len(environment.shared_memory["long_term_memory"])>0:
|
126 |
-
current_history = self.observe()
|
127 |
-
self.long_term_memory.append(current_history)
|
128 |
-
if agent_begin:
|
129 |
-
response = (char for char in self.begins[current_state.name]["begin_query"])
|
130 |
-
else:
|
131 |
-
response,res_dict = self.act()
|
132 |
-
|
133 |
-
|
134 |
-
action_dict = {
|
135 |
-
"response": response,
|
136 |
-
"res_dict": res_dict,
|
137 |
-
"role": self.state_roles[current_state.name],
|
138 |
-
"name": self.name,
|
139 |
-
"state_begin" : state_begin,
|
140 |
-
"agent_begin" : agent_begin,
|
141 |
-
"is_user" : self.is_user
|
142 |
-
}
|
143 |
-
return Action(**action_dict)
|
144 |
-
|
145 |
-
def act(self):
|
146 |
-
"""
|
147 |
-
return actions by the current state
|
148 |
-
"""
|
149 |
-
current_state = self.current_state
|
150 |
-
chat_history = self.long_term_memory
|
151 |
-
current_LLM = self.LLMs[current_state.name]
|
152 |
-
|
153 |
-
system_prompt, last_prompt, res_dict = self.compile()
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
response = current_LLM.get_response(
|
158 |
-
chat_history, system_prompt, last_prompt, stream=True
|
159 |
-
)
|
160 |
-
return response,res_dict
|
161 |
-
|
162 |
-
def update_memory(self, memory):
|
163 |
-
self.long_term_memory.append(
|
164 |
-
{"role": "assistant", "content": memory.content}
|
165 |
-
)
|
166 |
-
|
167 |
-
MAX_CHAT_HISTORY = eval(os.environ["MAX_CHAT_HISTORY"])
|
168 |
-
environment = self.environment
|
169 |
-
current_chat_history_idx = environment.current_chat_history_idx if environment.environment_type == "competive" else 0
|
170 |
-
|
171 |
-
current_long_term_memory = environment.shared_memory["long_term_memory"][current_chat_history_idx:]
|
172 |
-
last_conversation_idx = environment._get_agent_last_conversation_idx(self,current_long_term_memory)
|
173 |
-
if len(current_long_term_memory)-last_conversation_idx >= MAX_CHAT_HISTORY:
|
174 |
-
current_state = self.current_state
|
175 |
-
current_role = self.state_roles[current_state.name]
|
176 |
-
current_component_dict = current_state.components[current_role]
|
177 |
-
|
178 |
-
# get chat history from new conversation
|
179 |
-
conversations = environment._get_agent_new_memory(self,current_long_term_memory)
|
180 |
-
|
181 |
-
# get summary
|
182 |
-
summary_prompt = (
|
183 |
-
current_state.summary_prompt[current_role]
|
184 |
-
if current_state.summary_prompt
|
185 |
-
else f"""your name is {self.name},your role is{current_component_dict["style"].role},your task is {current_component_dict["task"].task}.\n"""
|
186 |
-
)
|
187 |
-
summary_prompt =eval(Agent_summary_system_prompt)
|
188 |
-
summary = self.LLMs[current_state.name].get_response(None, summary_prompt,stream = False)
|
189 |
-
self.short_term_memory = summary
|
190 |
-
|
191 |
-
|
192 |
-
def compile(self):
|
193 |
-
"""
|
194 |
-
get prompt from state depend on your role
|
195 |
-
Return:
|
196 |
-
system_prompt:system_prompt for agents's LLM
|
197 |
-
last_prompt:last_prompt for agents's LLM
|
198 |
-
res_dict(dict): Other return from tool component.For example: search engine results
|
199 |
-
"""
|
200 |
-
current_state = self.current_state
|
201 |
-
self.current_roles = self.state_roles[current_state.name]
|
202 |
-
current_state_name = current_state.name
|
203 |
-
self.LLM = self.LLMs[current_state_name]
|
204 |
-
components = current_state.components[self.state_roles[current_state_name]]
|
205 |
-
|
206 |
-
system_prompt = self.current_state.environment_prompt
|
207 |
-
last_prompt = ""
|
208 |
-
|
209 |
-
res_dict = {}
|
210 |
-
for component in components.values():
|
211 |
-
if isinstance(component, (OutputComponent, LastComponent)):
|
212 |
-
last_prompt = last_prompt + "\n" + component.get_prompt(self)
|
213 |
-
elif isinstance(component, PromptComponent):
|
214 |
-
system_prompt = (
|
215 |
-
system_prompt + "\n" + component.get_prompt(self)
|
216 |
-
)
|
217 |
-
elif isinstance(component, ToolComponent):
|
218 |
-
response = component.func(self)
|
219 |
-
if "prompt" in response and response["prompt"]:
|
220 |
-
last_prompt = last_prompt + "\n" + response["prompt"]
|
221 |
-
res_dict.update(response)
|
222 |
-
|
223 |
-
name = self.name
|
224 |
-
query = self.environment.shared_memory["long_term_memory"][-1] if len(self.environment.shared_memory["long_term_memory"]) else ""
|
225 |
-
last_prompt = eval(Agent_last_prompt)
|
226 |
-
system_prompt = eval(Agent_system_prompt)
|
227 |
-
return system_prompt, last_prompt, res_dict
|
228 |
-
|
229 |
-
|
230 |
-
def observe(self):
|
231 |
-
"""
|
232 |
-
Update one's own memory according to the current environment, including: updating short-term memory; updating long-term memory
|
233 |
-
"""
|
234 |
-
return self.environment._observe(self)
|
235 |
-
|
236 |
-
|
237 |
-
def generate_sop(self):
|
238 |
-
pass
|
239 |
-
|
240 |
-
def reflection(self):
|
241 |
-
pass
|
242 |
-
|
243 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AP123/Upside-Down-Diffusion/user_history.py
DELETED
@@ -1,524 +0,0 @@
|
|
1 |
-
"""
|
2 |
-
User History is a plugin that you can add to your Spaces to cache generated images for your users.
|
3 |
-
|
4 |
-
Key features:
|
5 |
-
- 🤗 Sign in with Hugging Face
|
6 |
-
- Save generated images with their metadata: prompts, timestamp, hyper-parameters, etc.
|
7 |
-
- Export your history as zip.
|
8 |
-
- Delete your history to respect privacy.
|
9 |
-
- Compatible with Persistent Storage for long-term storage.
|
10 |
-
- Admin panel to check configuration and disk usage .
|
11 |
-
|
12 |
-
Useful links:
|
13 |
-
- Demo: https://huggingface.co/spaces/Wauplin/gradio-user-history
|
14 |
-
- README: https://huggingface.co/spaces/Wauplin/gradio-user-history/blob/main/README.md
|
15 |
-
- Source file: https://huggingface.co/spaces/Wauplin/gradio-user-history/blob/main/user_history.py
|
16 |
-
- Discussions: https://huggingface.co/spaces/Wauplin/gradio-user-history/discussions
|
17 |
-
"""
|
18 |
-
import json
|
19 |
-
import os
|
20 |
-
import shutil
|
21 |
-
import warnings
|
22 |
-
from datetime import datetime
|
23 |
-
from functools import cache
|
24 |
-
from pathlib import Path
|
25 |
-
from typing import Callable, Dict, List, Tuple
|
26 |
-
from uuid import uuid4
|
27 |
-
|
28 |
-
import gradio as gr
|
29 |
-
import numpy as np
|
30 |
-
import requests
|
31 |
-
from filelock import FileLock
|
32 |
-
from PIL.Image import Image
|
33 |
-
|
34 |
-
|
35 |
-
def setup(folder_path: str | Path | None = None) -> None:
|
36 |
-
user_history = _UserHistory()
|
37 |
-
user_history.folder_path = _resolve_folder_path(folder_path)
|
38 |
-
user_history.initialized = True
|
39 |
-
|
40 |
-
# TODO: remove this section once all Spaces have migrated
|
41 |
-
_migrate_history()
|
42 |
-
|
43 |
-
|
44 |
-
def render() -> None:
|
45 |
-
user_history = _UserHistory()
|
46 |
-
|
47 |
-
# initialize with default config
|
48 |
-
if not user_history.initialized:
|
49 |
-
print(
|
50 |
-
"Initializing user history with default config. Use `user_history.setup(...)` to customize folder_path."
|
51 |
-
)
|
52 |
-
setup()
|
53 |
-
|
54 |
-
# Render user history tab
|
55 |
-
gr.Markdown(
|
56 |
-
"## Your past generations\n\nLog in to keep a gallery of your previous generations. Your history will be saved"
|
57 |
-
" and available on your next visit. Make sure to export your images from time to time as this gallery may be"
|
58 |
-
" deleted in the future."
|
59 |
-
)
|
60 |
-
|
61 |
-
if os.getenv("SYSTEM") == "spaces" and not os.path.exists("/data"):
|
62 |
-
gr.Markdown(
|
63 |
-
"**⚠️ Persistent storage is disabled, meaning your history will be lost if the Space gets restarted."
|
64 |
-
" Only the Space owner can setup a Persistent Storage. If you are not the Space owner, consider"
|
65 |
-
" duplicating this Space to set your own storage.⚠️**"
|
66 |
-
)
|
67 |
-
|
68 |
-
with gr.Row():
|
69 |
-
gr.LoginButton(min_width=250)
|
70 |
-
gr.LogoutButton(min_width=250)
|
71 |
-
refresh_button = gr.Button(
|
72 |
-
"Refresh",
|
73 |
-
icon="https://huggingface.co/spaces/Wauplin/gradio-user-history/resolve/main/assets/icon_refresh.png",
|
74 |
-
)
|
75 |
-
export_button = gr.Button(
|
76 |
-
"Export",
|
77 |
-
icon="https://huggingface.co/spaces/Wauplin/gradio-user-history/resolve/main/assets/icon_download.png",
|
78 |
-
)
|
79 |
-
delete_button = gr.Button(
|
80 |
-
"Delete history",
|
81 |
-
icon="https://huggingface.co/spaces/Wauplin/gradio-user-history/resolve/main/assets/icon_delete.png",
|
82 |
-
)
|
83 |
-
|
84 |
-
# "Export zip" row (hidden by default)
|
85 |
-
with gr.Row():
|
86 |
-
export_file = gr.File(
|
87 |
-
file_count="single",
|
88 |
-
file_types=[".zip"],
|
89 |
-
label="Exported history",
|
90 |
-
visible=False,
|
91 |
-
)
|
92 |
-
|
93 |
-
# "Config deletion" row (hidden by default)
|
94 |
-
with gr.Row():
|
95 |
-
confirm_button = gr.Button(
|
96 |
-
"Confirm delete all history", variant="stop", visible=False
|
97 |
-
)
|
98 |
-
cancel_button = gr.Button("Cancel", visible=False)
|
99 |
-
|
100 |
-
# Gallery
|
101 |
-
gallery = gr.Gallery(
|
102 |
-
label="Past images",
|
103 |
-
show_label=True,
|
104 |
-
elem_id="gallery",
|
105 |
-
object_fit="contain",
|
106 |
-
columns=5,
|
107 |
-
height=600,
|
108 |
-
preview=False,
|
109 |
-
show_share_button=False,
|
110 |
-
show_download_button=False,
|
111 |
-
)
|
112 |
-
gr.Markdown(
|
113 |
-
"User history is powered by"
|
114 |
-
" [Wauplin/gradio-user-history](https://huggingface.co/spaces/Wauplin/gradio-user-history). Integrate it to"
|
115 |
-
" your own Space in just a few lines of code!"
|
116 |
-
)
|
117 |
-
gallery.attach_load_event(_fetch_user_history, every=None)
|
118 |
-
|
119 |
-
# Interactions
|
120 |
-
refresh_button.click(
|
121 |
-
fn=_fetch_user_history, inputs=[], outputs=[gallery], queue=False
|
122 |
-
)
|
123 |
-
export_button.click(
|
124 |
-
fn=_export_user_history, inputs=[], outputs=[export_file], queue=False
|
125 |
-
)
|
126 |
-
|
127 |
-
# Taken from https://github.com/gradio-app/gradio/issues/3324#issuecomment-1446382045
|
128 |
-
delete_button.click(
|
129 |
-
lambda: [gr.update(visible=True), gr.update(visible=True)],
|
130 |
-
outputs=[confirm_button, cancel_button],
|
131 |
-
queue=False,
|
132 |
-
)
|
133 |
-
cancel_button.click(
|
134 |
-
lambda: [gr.update(visible=False), gr.update(visible=False)],
|
135 |
-
outputs=[confirm_button, cancel_button],
|
136 |
-
queue=False,
|
137 |
-
)
|
138 |
-
confirm_button.click(_delete_user_history).then(
|
139 |
-
lambda: [gr.update(visible=False), gr.update(visible=False)],
|
140 |
-
outputs=[confirm_button, cancel_button],
|
141 |
-
queue=False,
|
142 |
-
)
|
143 |
-
|
144 |
-
# Admin section (only shown locally or when logged in as Space owner)
|
145 |
-
_admin_section()
|
146 |
-
|
147 |
-
|
148 |
-
def save_image(
|
149 |
-
profile: gr.OAuthProfile | None,
|
150 |
-
image: Image | np.ndarray | str | Path,
|
151 |
-
label: str | None = None,
|
152 |
-
metadata: Dict | None = None,
|
153 |
-
):
|
154 |
-
# Ignore images from logged out users
|
155 |
-
if profile is None:
|
156 |
-
return
|
157 |
-
username = profile["preferred_username"]
|
158 |
-
|
159 |
-
# Ignore images if user history not used
|
160 |
-
user_history = _UserHistory()
|
161 |
-
if not user_history.initialized:
|
162 |
-
warnings.warn(
|
163 |
-
"User history is not set in Gradio demo. Saving image is ignored. You must use `user_history.render(...)`"
|
164 |
-
" first."
|
165 |
-
)
|
166 |
-
return
|
167 |
-
|
168 |
-
# Copy image to storage
|
169 |
-
image_path = _copy_image(image, dst_folder=user_history._user_images_path(username))
|
170 |
-
|
171 |
-
# Save new image + metadata
|
172 |
-
if metadata is None:
|
173 |
-
metadata = {}
|
174 |
-
if "datetime" not in metadata:
|
175 |
-
metadata["datetime"] = str(datetime.now())
|
176 |
-
data = {"path": str(image_path), "label": label, "metadata": metadata}
|
177 |
-
with user_history._user_lock(username):
|
178 |
-
with user_history._user_jsonl_path(username).open("a") as f:
|
179 |
-
f.write(json.dumps(data) + "\n")
|
180 |
-
|
181 |
-
|
182 |
-
#############
|
183 |
-
# Internals #
|
184 |
-
#############
|
185 |
-
|
186 |
-
|
187 |
-
class _UserHistory(object):
|
188 |
-
_instance = None
|
189 |
-
initialized: bool = False
|
190 |
-
folder_path: Path
|
191 |
-
|
192 |
-
def __new__(cls):
|
193 |
-
# Using singleton pattern => we don't want to expose an object (more complex to use) but still want to keep
|
194 |
-
# state between `render` and `save_image` calls.
|
195 |
-
if cls._instance is None:
|
196 |
-
cls._instance = super(_UserHistory, cls).__new__(cls)
|
197 |
-
return cls._instance
|
198 |
-
|
199 |
-
def _user_path(self, username: str) -> Path:
|
200 |
-
path = self.folder_path / username
|
201 |
-
path.mkdir(parents=True, exist_ok=True)
|
202 |
-
return path
|
203 |
-
|
204 |
-
def _user_lock(self, username: str) -> FileLock:
|
205 |
-
"""Ensure history is not corrupted if concurrent calls."""
|
206 |
-
return FileLock(
|
207 |
-
self.folder_path / f"{username}.lock"
|
208 |
-
) # lock outside of folder => better when exporting ZIP
|
209 |
-
|
210 |
-
def _user_jsonl_path(self, username: str) -> Path:
|
211 |
-
return self._user_path(username) / "history.jsonl"
|
212 |
-
|
213 |
-
def _user_images_path(self, username: str) -> Path:
|
214 |
-
path = self._user_path(username) / "images"
|
215 |
-
path.mkdir(parents=True, exist_ok=True)
|
216 |
-
return path
|
217 |
-
|
218 |
-
|
219 |
-
def _fetch_user_history(profile: gr.OAuthProfile | None) -> List[Tuple[str, str]]:
|
220 |
-
"""Return saved history for that user, if it exists."""
|
221 |
-
# Cannot load history for logged out users
|
222 |
-
if profile is None:
|
223 |
-
return []
|
224 |
-
username = profile["preferred_username"]
|
225 |
-
|
226 |
-
user_history = _UserHistory()
|
227 |
-
if not user_history.initialized:
|
228 |
-
warnings.warn(
|
229 |
-
"User history is not set in Gradio demo. You must use `user_history.render(...)` first."
|
230 |
-
)
|
231 |
-
return []
|
232 |
-
|
233 |
-
with user_history._user_lock(username):
|
234 |
-
# No file => no history saved yet
|
235 |
-
jsonl_path = user_history._user_jsonl_path(username)
|
236 |
-
if not jsonl_path.is_file():
|
237 |
-
return []
|
238 |
-
|
239 |
-
# Read history
|
240 |
-
images = []
|
241 |
-
for line in jsonl_path.read_text().splitlines():
|
242 |
-
data = json.loads(line)
|
243 |
-
images.append((data["path"], data["label"] or ""))
|
244 |
-
return list(reversed(images))
|
245 |
-
|
246 |
-
|
247 |
-
def _export_user_history(profile: gr.OAuthProfile | None) -> Dict | None:
|
248 |
-
"""Zip all history for that user, if it exists and return it as a downloadable file."""
|
249 |
-
# Cannot load history for logged out users
|
250 |
-
if profile is None:
|
251 |
-
return None
|
252 |
-
username = profile["preferred_username"]
|
253 |
-
|
254 |
-
user_history = _UserHistory()
|
255 |
-
if not user_history.initialized:
|
256 |
-
warnings.warn(
|
257 |
-
"User history is not set in Gradio demo. You must use `user_history.render(...)` first."
|
258 |
-
)
|
259 |
-
return None
|
260 |
-
|
261 |
-
# Zip history
|
262 |
-
with user_history._user_lock(username):
|
263 |
-
path = shutil.make_archive(
|
264 |
-
str(_archives_path() / f"history_{username}"),
|
265 |
-
"zip",
|
266 |
-
user_history._user_path(username),
|
267 |
-
)
|
268 |
-
|
269 |
-
return gr.update(visible=True, value=path)
|
270 |
-
|
271 |
-
|
272 |
-
def _delete_user_history(profile: gr.OAuthProfile | None) -> None:
|
273 |
-
"""Delete all history for that user."""
|
274 |
-
# Cannot load history for logged out users
|
275 |
-
if profile is None:
|
276 |
-
return
|
277 |
-
username = profile["preferred_username"]
|
278 |
-
|
279 |
-
user_history = _UserHistory()
|
280 |
-
if not user_history.initialized:
|
281 |
-
warnings.warn(
|
282 |
-
"User history is not set in Gradio demo. You must use `user_history.render(...)` first."
|
283 |
-
)
|
284 |
-
return
|
285 |
-
|
286 |
-
with user_history._user_lock(username):
|
287 |
-
shutil.rmtree(user_history._user_path(username))
|
288 |
-
|
289 |
-
|
290 |
-
####################
|
291 |
-
# Internal helpers #
|
292 |
-
####################
|
293 |
-
|
294 |
-
|
295 |
-
def _copy_image(image: Image | np.ndarray | str | Path, dst_folder: Path) -> Path:
|
296 |
-
"""Copy image to the images folder."""
|
297 |
-
# Already a path => copy it
|
298 |
-
if isinstance(image, str):
|
299 |
-
image = Path(image)
|
300 |
-
if isinstance(image, Path):
|
301 |
-
dst = dst_folder / f"{uuid4().hex}_{Path(image).name}" # keep file ext
|
302 |
-
shutil.copyfile(image, dst)
|
303 |
-
return dst
|
304 |
-
|
305 |
-
# Still a Python object => serialize it
|
306 |
-
if isinstance(image, np.ndarray):
|
307 |
-
image = Image.fromarray(image)
|
308 |
-
if isinstance(image, Image):
|
309 |
-
dst = dst_folder / f"{uuid4().hex}.png"
|
310 |
-
image.save(dst)
|
311 |
-
return dst
|
312 |
-
|
313 |
-
raise ValueError(f"Unsupported image type: {type(image)}")
|
314 |
-
|
315 |
-
|
316 |
-
def _resolve_folder_path(folder_path: str | Path | None) -> Path:
|
317 |
-
if folder_path is not None:
|
318 |
-
return Path(folder_path).expanduser().resolve()
|
319 |
-
|
320 |
-
if os.getenv("SYSTEM") == "spaces" and os.path.exists(
|
321 |
-
"/data"
|
322 |
-
): # Persistent storage is enabled!
|
323 |
-
return Path("/data") / "_user_history"
|
324 |
-
|
325 |
-
# Not in a Space or Persistent storage not enabled => local folder
|
326 |
-
return Path(__file__).parent / "_user_history"
|
327 |
-
|
328 |
-
|
329 |
-
def _archives_path() -> Path:
|
330 |
-
# Doesn't have to be on persistent storage as it's only used for download
|
331 |
-
path = Path(__file__).parent / "_user_history_exports"
|
332 |
-
path.mkdir(parents=True, exist_ok=True)
|
333 |
-
return path
|
334 |
-
|
335 |
-
|
336 |
-
#################
|
337 |
-
# Admin section #
|
338 |
-
#################
|
339 |
-
|
340 |
-
|
341 |
-
def _admin_section() -> None:
|
342 |
-
title = gr.Markdown()
|
343 |
-
title.attach_load_event(_display_if_admin(), every=None)
|
344 |
-
|
345 |
-
|
346 |
-
def _display_if_admin() -> Callable:
|
347 |
-
def _inner(profile: gr.OAuthProfile | None) -> str:
|
348 |
-
if profile is None:
|
349 |
-
return ""
|
350 |
-
if profile["preferred_username"] in _fetch_admins():
|
351 |
-
return _admin_content()
|
352 |
-
return ""
|
353 |
-
|
354 |
-
return _inner
|
355 |
-
|
356 |
-
|
357 |
-
def _admin_content() -> str:
|
358 |
-
return f"""
|
359 |
-
## Admin section
|
360 |
-
|
361 |
-
Running on **{os.getenv("SYSTEM", "local")}** (id: {os.getenv("SPACE_ID")}). {_get_msg_is_persistent_storage_enabled()}
|
362 |
-
|
363 |
-
Admins: {', '.join(_fetch_admins())}
|
364 |
-
|
365 |
-
{_get_nb_users()} user(s), {_get_nb_images()} image(s)
|
366 |
-
|
367 |
-
### Configuration
|
368 |
-
|
369 |
-
History folder: *{_UserHistory().folder_path}*
|
370 |
-
|
371 |
-
Exports folder: *{_archives_path()}*
|
372 |
-
|
373 |
-
### Disk usage
|
374 |
-
|
375 |
-
{_disk_space_warning_message()}
|
376 |
-
"""
|
377 |
-
|
378 |
-
|
379 |
-
def _get_nb_users() -> int:
|
380 |
-
user_history = _UserHistory()
|
381 |
-
if not user_history.initialized:
|
382 |
-
return 0
|
383 |
-
if user_history.folder_path is not None:
|
384 |
-
return len(
|
385 |
-
[path for path in user_history.folder_path.iterdir() if path.is_dir()]
|
386 |
-
)
|
387 |
-
return 0
|
388 |
-
|
389 |
-
|
390 |
-
def _get_nb_images() -> int:
|
391 |
-
user_history = _UserHistory()
|
392 |
-
if not user_history.initialized:
|
393 |
-
return 0
|
394 |
-
if user_history.folder_path is not None:
|
395 |
-
return len([path for path in user_history.folder_path.glob("*/images/*")])
|
396 |
-
return 0
|
397 |
-
|
398 |
-
|
399 |
-
def _get_msg_is_persistent_storage_enabled() -> str:
|
400 |
-
if os.getenv("SYSTEM") == "spaces":
|
401 |
-
if os.path.exists("/data"):
|
402 |
-
return "Persistent storage is enabled."
|
403 |
-
else:
|
404 |
-
return (
|
405 |
-
"Persistent storage is not enabled. This means that user histories will be deleted when the Space is"
|
406 |
-
" restarted. Consider adding a Persistent Storage in your Space settings."
|
407 |
-
)
|
408 |
-
return ""
|
409 |
-
|
410 |
-
|
411 |
-
def _disk_space_warning_message() -> str:
|
412 |
-
user_history = _UserHistory()
|
413 |
-
if not user_history.initialized:
|
414 |
-
return ""
|
415 |
-
|
416 |
-
message = ""
|
417 |
-
if user_history.folder_path is not None:
|
418 |
-
total, used, _ = _get_disk_usage(user_history.folder_path)
|
419 |
-
message += f"History folder: **{used / 1e9 :.0f}/{total / 1e9 :.0f}GB** used ({100*used/total :.0f}%)."
|
420 |
-
|
421 |
-
total, used, _ = _get_disk_usage(_archives_path())
|
422 |
-
message += f"\n\nExports folder: **{used / 1e9 :.0f}/{total / 1e9 :.0f}GB** used ({100*used/total :.0f}%)."
|
423 |
-
|
424 |
-
return f"{message.strip()}"
|
425 |
-
|
426 |
-
|
427 |
-
def _get_disk_usage(path: Path) -> Tuple[int, int, int]:
|
428 |
-
for path in [path] + list(
|
429 |
-
path.parents
|
430 |
-
): # first check target_dir, then each parents one by one
|
431 |
-
try:
|
432 |
-
return shutil.disk_usage(path)
|
433 |
-
except (
|
434 |
-
OSError
|
435 |
-
): # if doesn't exist or can't read => fail silently and try parent one
|
436 |
-
pass
|
437 |
-
return 0, 0, 0
|
438 |
-
|
439 |
-
|
440 |
-
@cache
|
441 |
-
def _fetch_admins() -> List[str]:
|
442 |
-
# Running locally => fake user is admin
|
443 |
-
if os.getenv("SYSTEM") != "spaces":
|
444 |
-
return ["FakeGradioUser"]
|
445 |
-
|
446 |
-
# Running in Space but no space_id => ???
|
447 |
-
space_id = os.getenv("SPACE_ID")
|
448 |
-
if space_id is None:
|
449 |
-
return ["Unknown"]
|
450 |
-
|
451 |
-
# Running in Space => try to fetch organization members
|
452 |
-
# Otherwise, it's not an organization => namespace is the user
|
453 |
-
namespace = space_id.split("/")[0]
|
454 |
-
response = requests.get(
|
455 |
-
f"https://huggingface.co/api/organizations/{namespace}/members"
|
456 |
-
)
|
457 |
-
if response.status_code == 200:
|
458 |
-
return sorted(
|
459 |
-
(member["user"] for member in response.json()), key=lambda x: x.lower()
|
460 |
-
)
|
461 |
-
return [namespace]
|
462 |
-
|
463 |
-
|
464 |
-
################################################################
|
465 |
-
# Legacy helpers to migrate image structure to new data format #
|
466 |
-
################################################################
|
467 |
-
# TODO: remove this section once all Spaces have migrated
|
468 |
-
|
469 |
-
|
470 |
-
def _migrate_history():
|
471 |
-
"""Script to migrate user history from v0 to v1."""
|
472 |
-
legacy_history_path = _legacy_get_history_folder_path()
|
473 |
-
if not legacy_history_path.exists():
|
474 |
-
return
|
475 |
-
|
476 |
-
error_count = 0
|
477 |
-
for json_path in legacy_history_path.glob("*.json"):
|
478 |
-
username = json_path.stem
|
479 |
-
print(f"Migrating history for user {username}...")
|
480 |
-
error_count += _legacy_move_user_history(username)
|
481 |
-
print("Done.")
|
482 |
-
print(f"Migration complete. {error_count} error(s) happened.")
|
483 |
-
|
484 |
-
if error_count == 0:
|
485 |
-
shutil.rmtree(legacy_history_path, ignore_errors=True)
|
486 |
-
|
487 |
-
|
488 |
-
def _legacy_move_user_history(username: str) -> int:
|
489 |
-
history = _legacy_read_user_history(username)
|
490 |
-
error_count = 0
|
491 |
-
for image, prompt in reversed(history):
|
492 |
-
try:
|
493 |
-
save_image(
|
494 |
-
label=prompt, image=image, profile={"preferred_username": username}
|
495 |
-
)
|
496 |
-
except Exception as e:
|
497 |
-
print("Issue while migrating image:", e)
|
498 |
-
error_count += 1
|
499 |
-
return error_count
|
500 |
-
|
501 |
-
|
502 |
-
def _legacy_get_history_folder_path() -> Path:
|
503 |
-
_folder = os.environ.get("HISTORY_FOLDER")
|
504 |
-
if _folder is None:
|
505 |
-
_folder = Path(__file__).parent / "history"
|
506 |
-
return Path(_folder)
|
507 |
-
|
508 |
-
|
509 |
-
def _legacy_read_user_history(username: str) -> List[Tuple[str, str]]:
|
510 |
-
"""Return saved history for that user."""
|
511 |
-
with _legacy_user_lock(username):
|
512 |
-
path = _legacy_user_history_path(username)
|
513 |
-
if path.exists():
|
514 |
-
return json.loads(path.read_text())
|
515 |
-
return [] # No history yet
|
516 |
-
|
517 |
-
|
518 |
-
def _legacy_user_history_path(username: str) -> Path:
|
519 |
-
return _legacy_get_history_folder_path() / f"{username}.json"
|
520 |
-
|
521 |
-
|
522 |
-
def _legacy_user_lock(username: str) -> FileLock:
|
523 |
-
"""Ensure history is not corrupted if concurrent calls."""
|
524 |
-
return FileLock(f"{_legacy_user_history_path(username)}.lock")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/agentverse/memory/chat_history.py
DELETED
@@ -1,77 +0,0 @@
|
|
1 |
-
import json
|
2 |
-
from typing import List
|
3 |
-
|
4 |
-
from pydantic import Field
|
5 |
-
|
6 |
-
from agentverse.message import Message, ExecutorMessage
|
7 |
-
|
8 |
-
from . import memory_registry
|
9 |
-
from .base import BaseMemory
|
10 |
-
|
11 |
-
|
12 |
-
@memory_registry.register("chat_history")
|
13 |
-
class ChatHistoryMemory(BaseMemory):
|
14 |
-
messages: List[Message] = Field(default=[])
|
15 |
-
|
16 |
-
def add_message(self, messages: List[Message]) -> None:
|
17 |
-
for message in messages:
|
18 |
-
self.messages.append(message)
|
19 |
-
|
20 |
-
def to_string(self, add_sender_prefix: bool = False) -> str:
|
21 |
-
if add_sender_prefix:
|
22 |
-
return "\n".join(
|
23 |
-
[
|
24 |
-
f"[{message.sender}]: {message.content}"
|
25 |
-
if message.sender != ""
|
26 |
-
else message.content
|
27 |
-
for message in self.messages
|
28 |
-
]
|
29 |
-
)
|
30 |
-
else:
|
31 |
-
return "\n".join([message.content for message in self.messages])
|
32 |
-
|
33 |
-
def to_messages(self, my_name: str = "", start_index: int = 0) -> List[dict]:
|
34 |
-
messages = []
|
35 |
-
for message in self.messages[start_index:]:
|
36 |
-
if message.sender == my_name:
|
37 |
-
if isinstance(message, ExecutorMessage):
|
38 |
-
if message.tool_name != "":
|
39 |
-
messages.append(
|
40 |
-
{
|
41 |
-
"role": "assistant",
|
42 |
-
"content": f"[{message.sender}]: {message.content}"
|
43 |
-
if message.content != ""
|
44 |
-
else "",
|
45 |
-
"function_call": {
|
46 |
-
"name": message.tool_name,
|
47 |
-
"arguments": json.dumps(message.tool_input),
|
48 |
-
},
|
49 |
-
}
|
50 |
-
)
|
51 |
-
continue
|
52 |
-
messages.append(
|
53 |
-
{
|
54 |
-
"role": "assistant",
|
55 |
-
"content": f"[{message.sender}]: {message.content}",
|
56 |
-
}
|
57 |
-
)
|
58 |
-
continue
|
59 |
-
if message.sender == "function":
|
60 |
-
messages.append(
|
61 |
-
{
|
62 |
-
"role": "function",
|
63 |
-
"content": message.content,
|
64 |
-
"name": message.tool_name,
|
65 |
-
}
|
66 |
-
)
|
67 |
-
continue
|
68 |
-
messages.append(
|
69 |
-
{
|
70 |
-
"role": "assistant",
|
71 |
-
"content": f"[{message.sender}]: {message.content}",
|
72 |
-
}
|
73 |
-
)
|
74 |
-
return messages
|
75 |
-
|
76 |
-
def reset(self) -> None:
|
77 |
-
self.messages = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Agusbs98/automatic-ecg-diagnosis/libs.py
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
import os, sys
|
2 |
-
import warnings; warnings.filterwarnings("ignore")
|
3 |
-
|
4 |
-
|
5 |
-
import pandas, numpy as np
|
6 |
-
import pandas as pd
|
7 |
-
import gradio as gr
|
8 |
-
#import argparse
|
9 |
-
#import random
|
10 |
-
#import neurokit2 as nk
|
11 |
-
import torch
|
12 |
-
import torch.nn as nn, torch.optim as optim
|
13 |
-
import torch.nn.functional as F
|
14 |
-
import torch.nn.utils.prune as prune
|
15 |
-
#import captum.attr as attr
|
16 |
-
#import matplotlib.pyplot as pyplot
|
17 |
-
#from sklearn.metrics import f1_score
|
18 |
-
from tensorflow.keras.models import load_model
|
19 |
-
from tensorflow.keras.optimizers import Adam
|
20 |
-
from tensorflow.keras.preprocessing.sequence import pad_sequences
|
21 |
-
import h5py
|
22 |
-
import scipy.signal as sgn
|
23 |
-
from sierraecg import read_file
|
24 |
-
import ecg_plot
|
25 |
-
|
26 |
-
|
27 |
-
#!pip install pandas
|
28 |
-
#!pip install torch
|
29 |
-
#!pip install gradio
|
30 |
-
#!pip install tesorflow
|
31 |
-
#!pip install sierraecg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Akmyradov/TurkmenTTSweSTT/vits/text/__init__.py
DELETED
@@ -1,54 +0,0 @@
|
|
1 |
-
""" from https://github.com/keithito/tacotron """
|
2 |
-
from text import cleaners
|
3 |
-
from text.symbols import symbols
|
4 |
-
|
5 |
-
|
6 |
-
# Mappings from symbol to numeric ID and vice versa:
|
7 |
-
_symbol_to_id = {s: i for i, s in enumerate(symbols)}
|
8 |
-
_id_to_symbol = {i: s for i, s in enumerate(symbols)}
|
9 |
-
|
10 |
-
|
11 |
-
def text_to_sequence(text, cleaner_names):
|
12 |
-
'''Converts a string of text to a sequence of IDs corresponding to the symbols in the text.
|
13 |
-
Args:
|
14 |
-
text: string to convert to a sequence
|
15 |
-
cleaner_names: names of the cleaner functions to run the text through
|
16 |
-
Returns:
|
17 |
-
List of integers corresponding to the symbols in the text
|
18 |
-
'''
|
19 |
-
sequence = []
|
20 |
-
|
21 |
-
clean_text = _clean_text(text, cleaner_names)
|
22 |
-
for symbol in clean_text:
|
23 |
-
symbol_id = _symbol_to_id[symbol]
|
24 |
-
sequence += [symbol_id]
|
25 |
-
return sequence
|
26 |
-
|
27 |
-
|
28 |
-
def cleaned_text_to_sequence(cleaned_text):
|
29 |
-
'''Converts a string of text to a sequence of IDs corresponding to the symbols in the text.
|
30 |
-
Args:
|
31 |
-
text: string to convert to a sequence
|
32 |
-
Returns:
|
33 |
-
List of integers corresponding to the symbols in the text
|
34 |
-
'''
|
35 |
-
sequence = [_symbol_to_id[symbol] for symbol in cleaned_text]
|
36 |
-
return sequence
|
37 |
-
|
38 |
-
|
39 |
-
def sequence_to_text(sequence):
|
40 |
-
'''Converts a sequence of IDs back to a string'''
|
41 |
-
result = ''
|
42 |
-
for symbol_id in sequence:
|
43 |
-
s = _id_to_symbol[symbol_id]
|
44 |
-
result += s
|
45 |
-
return result
|
46 |
-
|
47 |
-
|
48 |
-
def _clean_text(text, cleaner_names):
|
49 |
-
for name in cleaner_names:
|
50 |
-
cleaner = getattr(cleaners, name)
|
51 |
-
if not cleaner:
|
52 |
-
raise Exception('Unknown cleaner: %s' % name)
|
53 |
-
text = cleaner(text)
|
54 |
-
return text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AlexWang/lama/bin/calc_dataset_stats.py
DELETED
@@ -1,88 +0,0 @@
|
|
1 |
-
#!/usr/bin/env python3
|
2 |
-
|
3 |
-
import os
|
4 |
-
|
5 |
-
import numpy as np
|
6 |
-
import tqdm
|
7 |
-
from scipy.ndimage.morphology import distance_transform_edt
|
8 |
-
|
9 |
-
from saicinpainting.evaluation.data import InpaintingDataset
|
10 |
-
from saicinpainting.evaluation.vis import save_item_for_vis
|
11 |
-
|
12 |
-
|
13 |
-
def main(args):
|
14 |
-
dataset = InpaintingDataset(args.datadir, img_suffix='.png')
|
15 |
-
|
16 |
-
area_bins = np.linspace(0, 1, args.area_bins + 1)
|
17 |
-
|
18 |
-
heights = []
|
19 |
-
widths = []
|
20 |
-
image_areas = []
|
21 |
-
hole_areas = []
|
22 |
-
hole_area_percents = []
|
23 |
-
known_pixel_distances = []
|
24 |
-
|
25 |
-
area_bins_count = np.zeros(args.area_bins)
|
26 |
-
area_bin_titles = [f'{area_bins[i] * 100:.0f}-{area_bins[i + 1] * 100:.0f}' for i in range(args.area_bins)]
|
27 |
-
|
28 |
-
bin2i = [[] for _ in range(args.area_bins)]
|
29 |
-
|
30 |
-
for i, item in enumerate(tqdm.tqdm(dataset)):
|
31 |
-
h, w = item['image'].shape[1:]
|
32 |
-
heights.append(h)
|
33 |
-
widths.append(w)
|
34 |
-
full_area = h * w
|
35 |
-
image_areas.append(full_area)
|
36 |
-
bin_mask = item['mask'] > 0.5
|
37 |
-
hole_area = bin_mask.sum()
|
38 |
-
hole_areas.append(hole_area)
|
39 |
-
hole_percent = hole_area / full_area
|
40 |
-
hole_area_percents.append(hole_percent)
|
41 |
-
bin_i = np.clip(np.searchsorted(area_bins, hole_percent) - 1, 0, len(area_bins_count) - 1)
|
42 |
-
area_bins_count[bin_i] += 1
|
43 |
-
bin2i[bin_i].append(i)
|
44 |
-
|
45 |
-
cur_dist = distance_transform_edt(bin_mask)
|
46 |
-
cur_dist_inside_mask = cur_dist[bin_mask]
|
47 |
-
known_pixel_distances.append(cur_dist_inside_mask.mean())
|
48 |
-
|
49 |
-
os.makedirs(args.outdir, exist_ok=True)
|
50 |
-
with open(os.path.join(args.outdir, 'summary.txt'), 'w') as f:
|
51 |
-
f.write(f'''Location: {args.datadir}
|
52 |
-
|
53 |
-
Number of samples: {len(dataset)}
|
54 |
-
|
55 |
-
Image height: min {min(heights):5d} max {max(heights):5d} mean {np.mean(heights):.2f}
|
56 |
-
Image width: min {min(widths):5d} max {max(widths):5d} mean {np.mean(widths):.2f}
|
57 |
-
Image area: min {min(image_areas):7d} max {max(image_areas):7d} mean {np.mean(image_areas):.2f}
|
58 |
-
Hole area: min {min(hole_areas):7d} max {max(hole_areas):7d} mean {np.mean(hole_areas):.2f}
|
59 |
-
Hole area %: min {min(hole_area_percents) * 100:2.2f} max {max(hole_area_percents) * 100:2.2f} mean {np.mean(hole_area_percents) * 100:2.2f}
|
60 |
-
Dist 2known: min {min(known_pixel_distances):2.2f} max {max(known_pixel_distances):2.2f} mean {np.mean(known_pixel_distances):2.2f} median {np.median(known_pixel_distances):2.2f}
|
61 |
-
|
62 |
-
Stats by hole area %:
|
63 |
-
''')
|
64 |
-
for bin_i in range(args.area_bins):
|
65 |
-
f.write(f'{area_bin_titles[bin_i]}%: '
|
66 |
-
f'samples number {area_bins_count[bin_i]}, '
|
67 |
-
f'{area_bins_count[bin_i] / len(dataset) * 100:.1f}%\n')
|
68 |
-
|
69 |
-
for bin_i in range(args.area_bins):
|
70 |
-
bindir = os.path.join(args.outdir, 'samples', area_bin_titles[bin_i])
|
71 |
-
os.makedirs(bindir, exist_ok=True)
|
72 |
-
bin_idx = bin2i[bin_i]
|
73 |
-
for sample_i in np.random.choice(bin_idx, size=min(len(bin_idx), args.samples_n), replace=False):
|
74 |
-
save_item_for_vis(dataset[sample_i], os.path.join(bindir, f'{sample_i}.png'))
|
75 |
-
|
76 |
-
|
77 |
-
if __name__ == '__main__':
|
78 |
-
import argparse
|
79 |
-
|
80 |
-
aparser = argparse.ArgumentParser()
|
81 |
-
aparser.add_argument('datadir', type=str,
|
82 |
-
help='Path to folder with images and masks (output of gen_mask_dataset.py)')
|
83 |
-
aparser.add_argument('outdir', type=str, help='Where to put results')
|
84 |
-
aparser.add_argument('--samples-n', type=int, default=10,
|
85 |
-
help='Number of sample images with masks to copy for visualization for each area bin')
|
86 |
-
aparser.add_argument('--area-bins', type=int, default=10, help='How many area bins to have')
|
87 |
-
|
88 |
-
main(aparser.parse_args())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/docs/source/ko/optimization/fp16.md
DELETED
@@ -1,410 +0,0 @@
|
|
1 |
-
<!--Copyright 2023 The HuggingFace Team. All rights reserved.
|
2 |
-
|
3 |
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
4 |
-
the License. You may obtain a copy of the License at
|
5 |
-
|
6 |
-
http://www.apache.org/licenses/LICENSE-2.0
|
7 |
-
|
8 |
-
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
9 |
-
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
10 |
-
specific language governing permissions and limitations under the License.
|
11 |
-
-->
|
12 |
-
|
13 |
-
# 메모리와 속도
|
14 |
-
|
15 |
-
메모리 또는 속도에 대해 🤗 Diffusers *추론*을 최적화하기 위한 몇 가지 기술과 아이디어를 제시합니다.
|
16 |
-
일반적으로, memory-efficient attention을 위해 [xFormers](https://github.com/facebookresearch/xformers) 사용을 추천하기 때문에, 추천하는 [설치 방법](xformers)을 보고 설치해 보세요.
|
17 |
-
|
18 |
-
다음 설정이 성능과 메모리에 미치는 영향에 대해 설명합니다.
|
19 |
-
|
20 |
-
| | 지연시간 | 속도 향상 |
|
21 |
-
| ---------------- | ------- | ------- |
|
22 |
-
| 별도 설정 없음 | 9.50s | x1 |
|
23 |
-
| cuDNN auto-tuner | 9.37s | x1.01 |
|
24 |
-
| fp16 | 3.61s | x2.63 |
|
25 |
-
| Channels Last 메모리 형식 | 3.30s | x2.88 |
|
26 |
-
| traced UNet | 3.21s | x2.96 |
|
27 |
-
| memory-efficient attention | 2.63s | x3.61 |
|
28 |
-
|
29 |
-
<em>
|
30 |
-
NVIDIA TITAN RTX에서 50 DDIM 스텝의 "a photo of an astronaut riding a horse on mars" 프롬프트로 512x512 크기의 단일 이미지를 생성하였습니다.
|
31 |
-
</em>
|
32 |
-
|
33 |
-
## cuDNN auto-tuner 활성화하기
|
34 |
-
|
35 |
-
[NVIDIA cuDNN](https://developer.nvidia.com/cudnn)은 컨볼루션을 계산하는 많은 알고리즘을 지원합니다. Autotuner는 짧은 벤치마크를 실행하고 주어진 입력 크기에 대해 주어진 하드웨어에서 최고의 성능을 가진 커널을 선택합니다.
|
36 |
-
|
37 |
-
**컨볼루션 네트워크**를 활용하고 있기 때문에 (다른 유형들은 현재 지원되지 않음), 다음 설정을 통해 추론 전에 cuDNN autotuner를 활성화할 수 있습니다:
|
38 |
-
|
39 |
-
```python
|
40 |
-
import torch
|
41 |
-
|
42 |
-
torch.backends.cudnn.benchmark = True
|
43 |
-
```
|
44 |
-
|
45 |
-
### fp32 대신 tf32 사용하기 (Ampere 및 이후 CUDA 장치들에서)
|
46 |
-
|
47 |
-
Ampere 및 이후 CUDA 장치에서 행렬곱 및 컨볼루션은 TensorFloat32(TF32) 모드를 사용하여 더 빠르지만 약간 덜 정확할 수 있습니다.
|
48 |
-
기본적으로 PyTorch는 컨볼루션에 대해 TF32 모드를 활성화하지만 행렬 곱셈은 활성화하지 않습니다.
|
49 |
-
네트워크에 완전한 float32 정밀도가 필요한 경우가 아니면 행렬 곱셈에 대해서도 이 설정을 활성화하는 것이 좋습니다.
|
50 |
-
이는 일반적으로 무시할 수 있는 수치의 정확도 손실이 있지만, 계산 속도를 크게 높일 수 있습니다.
|
51 |
-
그것에 대해 [여기](https://huggingface.co/docs/transformers/v4.18.0/en/performance#tf32)서 더 읽을 수 있습니다.
|
52 |
-
추론하기 전에 다음을 추가하기만 하면 됩니다:
|
53 |
-
|
54 |
-
```python
|
55 |
-
import torch
|
56 |
-
|
57 |
-
torch.backends.cuda.matmul.allow_tf32 = True
|
58 |
-
```
|
59 |
-
|
60 |
-
## 반정밀도 가중치
|
61 |
-
|
62 |
-
더 많은 GPU 메모리를 절약하고 더 빠른 속도를 얻기 위해 모델 가중치를 반정밀도(half precision)로 직접 불러오고 실행할 수 있습니다.
|
63 |
-
여기에는 `fp16`이라는 브랜치에 저장된 float16 버전의 가중치를 불러오고, 그 때 `float16` 유형을 사용하도록 PyTorch에 지시하는 작업이 포함됩니다.
|
64 |
-
|
65 |
-
```Python
|
66 |
-
pipe = StableDiffusionPipeline.from_pretrained(
|
67 |
-
"runwayml/stable-diffusion-v1-5",
|
68 |
-
|
69 |
-
torch_dtype=torch.float16,
|
70 |
-
)
|
71 |
-
pipe = pipe.to("cuda")
|
72 |
-
|
73 |
-
prompt = "a photo of an astronaut riding a horse on mars"
|
74 |
-
image = pipe(prompt).images[0]
|
75 |
-
```
|
76 |
-
|
77 |
-
<Tip warning={true}>
|
78 |
-
어떤 파이프라인에서도 [`torch.autocast`](https://pytorch.org/docs/stable/amp.html#torch.autocast) 를 사용하는 것은 검은색 이미지를 생성할 수 있고, 순수한 float16 정밀도를 사용하는 것보다 항상 느리기 때문에 사용하지 않는 것이 좋습니다.
|
79 |
-
</Tip>
|
80 |
-
|
81 |
-
## 추가 메모리 절약을 위한 슬라이스 어텐션
|
82 |
-
|
83 |
-
추가 메모리 절약을 위해, 한 번에 모두 계산하는 대신 단계적으로 계산을 수행하는 슬라이스 버전의 어텐션(attention)을 사용할 수 있습니다.
|
84 |
-
|
85 |
-
<Tip>
|
86 |
-
Attention slicing은 모델이 하나 이상의 어텐션 헤드를 사용하는 한, 배치 크기가 1인 경우에도 유용합니다.
|
87 |
-
하나 이상의 어텐션 헤드가 있는 경우 *QK^T* 어텐션 매트릭스는 상당한 양의 메모리를 절약할 수 있는 각 헤드에 대해 순차적으로 계산될 수 있습니다.
|
88 |
-
</Tip>
|
89 |
-
|
90 |
-
각 헤드에 대해 순차적으로 어텐션 계산을 수행하려면, 다음과 같이 추론 전에 파이프라인에서 [`~StableDiffusionPipeline.enable_attention_slicing`]를 호출하면 됩니다:
|
91 |
-
|
92 |
-
```Python
|
93 |
-
import torch
|
94 |
-
from diffusers import StableDiffusionPipeline
|
95 |
-
|
96 |
-
pipe = StableDiffusionPipeline.from_pretrained(
|
97 |
-
"runwayml/stable-diffusion-v1-5",
|
98 |
-
|
99 |
-
torch_dtype=torch.float16,
|
100 |
-
)
|
101 |
-
pipe = pipe.to("cuda")
|
102 |
-
|
103 |
-
prompt = "a photo of an astronaut riding a horse on mars"
|
104 |
-
pipe.enable_attention_slicing()
|
105 |
-
image = pipe(prompt).images[0]
|
106 |
-
```
|
107 |
-
|
108 |
-
추론 시간이 약 10% 느려지는 약간의 성능 저하가 있지만 이 방법을 사용하면 3.2GB 정도의 작은 VRAM으로도 Stable Diffusion을 사용할 수 있습니다!
|
109 |
-
|
110 |
-
|
111 |
-
## 더 큰 배치를 위한 sliced VAE 디코드
|
112 |
-
|
113 |
-
제한된 VRAM에서 대규모 이미지 배치를 디코딩하거나 32개 이상의 이미지가 포함된 배치를 활성화하기 위해, 배치의 latent 이미지를 한 번에 하나씩 디코딩하는 슬라이스 VAE 디코드를 사용할 수 있습니다.
|
114 |
-
|
115 |
-
이를 [`~StableDiffusionPipeline.enable_attention_slicing`] 또는 [`~StableDiffusionPipeline.enable_xformers_memory_efficient_attention`]과 결합하여 메모리 사용을 추가로 최소화할 수 있습니다.
|
116 |
-
|
117 |
-
VAE 디코드를 한 번에 하나씩 수행하려면 추론 전에 파이프라인에서 [`~StableDiffusionPipeline.enable_vae_slicing`]을 호출합니다. 예를 들어:
|
118 |
-
|
119 |
-
```Python
|
120 |
-
import torch
|
121 |
-
from diffusers import StableDiffusionPipeline
|
122 |
-
|
123 |
-
pipe = StableDiffusionPipeline.from_pretrained(
|
124 |
-
"runwayml/stable-diffusion-v1-5",
|
125 |
-
|
126 |
-
torch_dtype=torch.float16,
|
127 |
-
)
|
128 |
-
pipe = pipe.to("cuda")
|
129 |
-
|
130 |
-
prompt = "a photo of an astronaut riding a horse on mars"
|
131 |
-
pipe.enable_vae_slicing()
|
132 |
-
images = pipe([prompt] * 32).images
|
133 |
-
```
|
134 |
-
|
135 |
-
다중 이미지 배치에서 VAE 디코드가 약간의 성능 향상이 이루어집니다. 단일 이미지 배치에서는 성능 영향은 없습니다.
|
136 |
-
|
137 |
-
|
138 |
-
<a name="sequential_offloading"></a>
|
139 |
-
## 메모리 절약을 위해 가속 기능을 사용하여 CPU로 오프로딩
|
140 |
-
|
141 |
-
추가 메모리 절약을 위해 가중치를 CPU로 오프로드하고 순방향 전달을 수행할 때만 GPU로 로드할 수 있습니다.
|
142 |
-
|
143 |
-
CPU 오프로딩을 수행하려면 [`~StableDiffusionPipeline.enable_sequential_cpu_offload`]를 호출하기만 하면 됩니다:
|
144 |
-
|
145 |
-
```Python
|
146 |
-
import torch
|
147 |
-
from diffusers import StableDiffusionPipeline
|
148 |
-
|
149 |
-
pipe = StableDiffusionPipeline.from_pretrained(
|
150 |
-
"runwayml/stable-diffusion-v1-5",
|
151 |
-
|
152 |
-
torch_dtype=torch.float16,
|
153 |
-
)
|
154 |
-
|
155 |
-
prompt = "a photo of an astronaut riding a horse on mars"
|
156 |
-
pipe.enable_sequential_cpu_offload()
|
157 |
-
image = pipe(prompt).images[0]
|
158 |
-
```
|
159 |
-
|
160 |
-
그러면 메모리 소비를 3GB 미만으로 줄일 수 있습니다.
|
161 |
-
|
162 |
-
참고로 이 방법은 전체 모델이 아닌 서브모듈 수준에서 작동합니다. 이는 메모리 소비를 최소화하는 가장 좋은 방법이지만 프로세스의 반복적 특성으로 인해 추론 속도가 훨씬 느립니다. 파이프라인의 UNet 구성 요소는 여러 번 실행됩니다('num_inference_steps' 만큼). 매번 UNet의 서로 다른 서브모듈이 순차적으로 온로드된 다음 필요에 따라 오프로드되므로 메모리 이동 횟수가 많습니다.
|
163 |
-
|
164 |
-
<Tip>
|
165 |
-
또 다른 최적화 방법인 <a href="#model_offloading">모델 오프로딩</a>을 사용하는 것을 고려하십시오. 이는 훨씬 빠르지만 메모리 절약이 크지는 않습니다.
|
166 |
-
</Tip>
|
167 |
-
|
168 |
-
또한 ttention slicing과 연결해서 최소 메모리(< 2GB)로도 동작할 수 있습니다.
|
169 |
-
|
170 |
-
|
171 |
-
```Python
|
172 |
-
import torch
|
173 |
-
from diffusers import StableDiffusionPipeline
|
174 |
-
|
175 |
-
pipe = StableDiffusionPipeline.from_pretrained(
|
176 |
-
"runwayml/stable-diffusion-v1-5",
|
177 |
-
|
178 |
-
torch_dtype=torch.float16,
|
179 |
-
)
|
180 |
-
|
181 |
-
prompt = "a photo of an astronaut riding a horse on mars"
|
182 |
-
pipe.enable_sequential_cpu_offload()
|
183 |
-
pipe.enable_attention_slicing(1)
|
184 |
-
|
185 |
-
image = pipe(prompt).images[0]
|
186 |
-
```
|
187 |
-
|
188 |
-
**참고**: 'enable_sequential_cpu_offload()'를 사용할 때, 미리 파이프라인을 CUDA로 이동하지 **않는** 것이 중요합니다.그렇지 않으면 메모리 소비의 이득이 최소화됩니다. 더 많은 정보를 위해 [이 이슈](https://github.com/huggingface/diffusers/issues/1934)를 보세요.
|
189 |
-
|
190 |
-
<a name="model_offloading"></a>
|
191 |
-
## 빠른 추론과 메모리 메모리 절약을 위한 모델 오프로딩
|
192 |
-
|
193 |
-
[순차적 CPU 오프로딩](#sequential_offloading)은 이전 섹션에서 설명한 것처럼 많은 메모리를 보존하지만 필요에 따라 서브모듈을 GPU로 이동하고 새 모듈이 실행될 때 즉시 CPU로 반환되기 때문에 추론 속도가 느려집니다.
|
194 |
-
|
195 |
-
전체 모델 오프로딩은 각 모델의 구성 요소인 _modules_을 처리하는 대신, 전체 모델을 GPU로 이동하는 대안입니다. 이로 인해 추론 시간에 미치는 영향은 미미하지만(파이프라인을 'cuda'로 이동하는 것과 비교하여) 여전히 약간의 메모리를 절약할 수 있습니다.
|
196 |
-
|
197 |
-
이 시나리오에서는 파이프라인의 주요 구성 요소 중 하나만(일반적으로 텍스트 인코더, unet 및 vae) GPU에 있고, 나머지는 CPU에서 대기할 것입니다.
|
198 |
-
여러 반복을 위해 실행되는 UNet과 같은 구성 요소는 더 이상 필요하지 않을 때까�� GPU에 남아 있습니다.
|
199 |
-
|
200 |
-
이 기능은 아래와 같이 파이프라인에서 `enable_model_cpu_offload()`를 호출하여 활성화할 수 있습니다.
|
201 |
-
|
202 |
-
```Python
|
203 |
-
import torch
|
204 |
-
from diffusers import StableDiffusionPipeline
|
205 |
-
|
206 |
-
pipe = StableDiffusionPipeline.from_pretrained(
|
207 |
-
"runwayml/stable-diffusion-v1-5",
|
208 |
-
torch_dtype=torch.float16,
|
209 |
-
)
|
210 |
-
|
211 |
-
prompt = "a photo of an astronaut riding a horse on mars"
|
212 |
-
pipe.enable_model_cpu_offload()
|
213 |
-
image = pipe(prompt).images[0]
|
214 |
-
```
|
215 |
-
|
216 |
-
이는 추가적인 메모리 절약을 위한 attention slicing과도 호환됩니다.
|
217 |
-
|
218 |
-
```Python
|
219 |
-
import torch
|
220 |
-
from diffusers import StableDiffusionPipeline
|
221 |
-
|
222 |
-
pipe = StableDiffusionPipeline.from_pretrained(
|
223 |
-
"runwayml/stable-diffusion-v1-5",
|
224 |
-
torch_dtype=torch.float16,
|
225 |
-
)
|
226 |
-
|
227 |
-
prompt = "a photo of an astronaut riding a horse on mars"
|
228 |
-
pipe.enable_model_cpu_offload()
|
229 |
-
pipe.enable_attention_slicing(1)
|
230 |
-
|
231 |
-
image = pipe(prompt).images[0]
|
232 |
-
```
|
233 |
-
|
234 |
-
<Tip>
|
235 |
-
이 기능을 사용하려면 'accelerate' 버전 0.17.0 이상이 필요합니다.
|
236 |
-
</Tip>
|
237 |
-
|
238 |
-
## Channels Last 메모리 형식 사용하기
|
239 |
-
|
240 |
-
Channels Last 메모리 형식은 차원 순서를 보존하는 메모리에서 NCHW 텐서 배열을 대체하는 방법입니다.
|
241 |
-
Channels Last 텐서는 채널이 가장 조밀한 차원이 되는 방식으로 정렬됩니다(일명 픽셀당 이미지를 저장).
|
242 |
-
현재 모든 연산자 Channels Last 형식을 지원하는 것은 아니라 성능이 저하될 수 있으므로, 사용해보고 모델에 잘 작동하는지 확인하는 것이 좋습니다.
|
243 |
-
|
244 |
-
|
245 |
-
예를 들어 파이프라인의 UNet 모델이 channels Last 형식을 사용하도록 설정하려면 다음을 사용할 수 있습니다:
|
246 |
-
|
247 |
-
```python
|
248 |
-
print(pipe.unet.conv_out.state_dict()["weight"].stride()) # (2880, 9, 3, 1)
|
249 |
-
pipe.unet.to(memory_format=torch.channels_last) # in-place 연산
|
250 |
-
# 2번째 차원에서 스트라이드 1을 가지는 (2880, 1, 960, 320)로, 연산이 작동함을 증명합니다.
|
251 |
-
print(pipe.unet.conv_out.state_dict()["weight"].stride())
|
252 |
-
```
|
253 |
-
|
254 |
-
## 추적(tracing)
|
255 |
-
|
256 |
-
추적은 모델을 통해 예제 입력 텐서를 통해 실행되는데, 해당 입력이 모델의 레이어를 통과할 때 호출되는 작업을 캡처하여 실행 파일 또는 'ScriptFunction'이 반환되도록 하고, 이는 just-in-time 컴파일로 최적화됩니다.
|
257 |
-
|
258 |
-
UNet 모델을 추적하기 위해 다음을 사용할 수 있습니다:
|
259 |
-
|
260 |
-
```python
|
261 |
-
import time
|
262 |
-
import torch
|
263 |
-
from diffusers import StableDiffusionPipeline
|
264 |
-
import functools
|
265 |
-
|
266 |
-
# torch 기울기 비활성화
|
267 |
-
torch.set_grad_enabled(False)
|
268 |
-
|
269 |
-
# 변수 설정
|
270 |
-
n_experiments = 2
|
271 |
-
unet_runs_per_experiment = 50
|
272 |
-
|
273 |
-
|
274 |
-
# 입력 불러오기
|
275 |
-
def generate_inputs():
|
276 |
-
sample = torch.randn(2, 4, 64, 64).half().cuda()
|
277 |
-
timestep = torch.rand(1).half().cuda() * 999
|
278 |
-
encoder_hidden_states = torch.randn(2, 77, 768).half().cuda()
|
279 |
-
return sample, timestep, encoder_hidden_states
|
280 |
-
|
281 |
-
|
282 |
-
pipe = StableDiffusionPipeline.from_pretrained(
|
283 |
-
"runwayml/stable-diffusion-v1-5",
|
284 |
-
torch_dtype=torch.float16,
|
285 |
-
).to("cuda")
|
286 |
-
unet = pipe.unet
|
287 |
-
unet.eval()
|
288 |
-
unet.to(memory_format=torch.channels_last) # Channels Last 메모리 형식 사용
|
289 |
-
unet.forward = functools.partial(unet.forward, return_dict=False) # return_dict=False을 기본값으로 설정
|
290 |
-
|
291 |
-
# 워밍업
|
292 |
-
for _ in range(3):
|
293 |
-
with torch.inference_mode():
|
294 |
-
inputs = generate_inputs()
|
295 |
-
orig_output = unet(*inputs)
|
296 |
-
|
297 |
-
# 추적
|
298 |
-
print("tracing..")
|
299 |
-
unet_traced = torch.jit.trace(unet, inputs)
|
300 |
-
unet_traced.eval()
|
301 |
-
print("done tracing")
|
302 |
-
|
303 |
-
|
304 |
-
# 워밍업 및 그래프 최적화
|
305 |
-
for _ in range(5):
|
306 |
-
with torch.inference_mode():
|
307 |
-
inputs = generate_inputs()
|
308 |
-
orig_output = unet_traced(*inputs)
|
309 |
-
|
310 |
-
|
311 |
-
# 벤치마킹
|
312 |
-
with torch.inference_mode():
|
313 |
-
for _ in range(n_experiments):
|
314 |
-
torch.cuda.synchronize()
|
315 |
-
start_time = time.time()
|
316 |
-
for _ in range(unet_runs_per_experiment):
|
317 |
-
orig_output = unet_traced(*inputs)
|
318 |
-
torch.cuda.synchronize()
|
319 |
-
print(f"unet traced inference took {time.time() - start_time:.2f} seconds")
|
320 |
-
for _ in range(n_experiments):
|
321 |
-
torch.cuda.synchronize()
|
322 |
-
start_time = time.time()
|
323 |
-
for _ in range(unet_runs_per_experiment):
|
324 |
-
orig_output = unet(*inputs)
|
325 |
-
torch.cuda.synchronize()
|
326 |
-
print(f"unet inference took {time.time() - start_time:.2f} seconds")
|
327 |
-
|
328 |
-
# 모델 저장
|
329 |
-
unet_traced.save("unet_traced.pt")
|
330 |
-
```
|
331 |
-
|
332 |
-
그 다음, 파이프라인의 `unet` 특성을 다음과 같이 추적된 모델로 바꿀 수 있습니다.
|
333 |
-
|
334 |
-
```python
|
335 |
-
from diffusers import StableDiffusionPipeline
|
336 |
-
import torch
|
337 |
-
from dataclasses import dataclass
|
338 |
-
|
339 |
-
|
340 |
-
@dataclass
|
341 |
-
class UNet2DConditionOutput:
|
342 |
-
sample: torch.FloatTensor
|
343 |
-
|
344 |
-
|
345 |
-
pipe = StableDiffusionPipeline.from_pretrained(
|
346 |
-
"runwayml/stable-diffusion-v1-5",
|
347 |
-
torch_dtype=torch.float16,
|
348 |
-
).to("cuda")
|
349 |
-
|
350 |
-
# jitted unet 사용
|
351 |
-
unet_traced = torch.jit.load("unet_traced.pt")
|
352 |
-
|
353 |
-
|
354 |
-
# pipe.unet 삭제
|
355 |
-
class TracedUNet(torch.nn.Module):
|
356 |
-
def __init__(self):
|
357 |
-
super().__init__()
|
358 |
-
self.in_channels = pipe.unet.in_channels
|
359 |
-
self.device = pipe.unet.device
|
360 |
-
|
361 |
-
def forward(self, latent_model_input, t, encoder_hidden_states):
|
362 |
-
sample = unet_traced(latent_model_input, t, encoder_hidden_states)[0]
|
363 |
-
return UNet2DConditionOutput(sample=sample)
|
364 |
-
|
365 |
-
|
366 |
-
pipe.unet = TracedUNet()
|
367 |
-
|
368 |
-
with torch.inference_mode():
|
369 |
-
image = pipe([prompt] * 1, num_inference_steps=50).images[0]
|
370 |
-
```
|
371 |
-
|
372 |
-
|
373 |
-
## Memory-efficient attention
|
374 |
-
|
375 |
-
어텐션 블록의 대역폭을 최적화하는 최근 작업으로 GPU 메모리 사용량이 크게 향상되고 향상되었습니다.
|
376 |
-
@tridao의 가장 최근의 플래시 어텐션: [code](https://github.com/HazyResearch/flash-attention), [paper](https://arxiv.org/pdf/2205.14135.pdf).
|
377 |
-
|
378 |
-
배치 크기 1(프롬프트 1개)의 512x512 크기로 추론을 실행할 때 몇 가지 Nvidia GPU에서 얻은 속도 향상은 다음과 같습니다:
|
379 |
-
|
380 |
-
| GPU | 기준 어텐션 FP16 | 메모리 효율적인 어텐션 FP16 |
|
381 |
-
|------------------ |--------------------- |--------------------------------- |
|
382 |
-
| NVIDIA Tesla T4 | 3.5it/s | 5.5it/s |
|
383 |
-
| NVIDIA 3060 RTX | 4.6it/s | 7.8it/s |
|
384 |
-
| NVIDIA A10G | 8.88it/s | 15.6it/s |
|
385 |
-
| NVIDIA RTX A6000 | 11.7it/s | 21.09it/s |
|
386 |
-
| NVIDIA TITAN RTX | 12.51it/s | 18.22it/s |
|
387 |
-
| A100-SXM4-40GB | 18.6it/s | 29.it/s |
|
388 |
-
| A100-SXM-80GB | 18.7it/s | 29.5it/s |
|
389 |
-
|
390 |
-
이를 활용하려면 다음을 만족해야 합니다:
|
391 |
-
- PyTorch > 1.12
|
392 |
-
- Cuda 사용 가능
|
393 |
-
- [xformers 라이브러리를 설치함](xformers)
|
394 |
-
```python
|
395 |
-
from diffusers import StableDiffusionPipeline
|
396 |
-
import torch
|
397 |
-
|
398 |
-
pipe = StableDiffusionPipeline.from_pretrained(
|
399 |
-
"runwayml/stable-diffusion-v1-5",
|
400 |
-
torch_dtype=torch.float16,
|
401 |
-
).to("cuda")
|
402 |
-
|
403 |
-
pipe.enable_xformers_memory_efficient_attention()
|
404 |
-
|
405 |
-
with torch.inference_mode():
|
406 |
-
sample = pipe("a small cat")
|
407 |
-
|
408 |
-
# 선택: 이를 비활성화 하기 위해 다음을 사용할 수 있습니다.
|
409 |
-
# pipe.disable_xformers_memory_efficient_attention()
|
410 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/pipelines/stable_diffusion/test_onnx_stable_diffusion_img2img.py
DELETED
@@ -1,245 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
# Copyright 2023 HuggingFace Inc.
|
3 |
-
#
|
4 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
# you may not use this file except in compliance with the License.
|
6 |
-
# You may obtain a copy of the License at
|
7 |
-
#
|
8 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
#
|
10 |
-
# Unless required by applicable law or agreed to in writing, software
|
11 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
# See the License for the specific language governing permissions and
|
14 |
-
# limitations under the License.
|
15 |
-
|
16 |
-
import random
|
17 |
-
import unittest
|
18 |
-
|
19 |
-
import numpy as np
|
20 |
-
|
21 |
-
from diffusers import (
|
22 |
-
DPMSolverMultistepScheduler,
|
23 |
-
EulerAncestralDiscreteScheduler,
|
24 |
-
EulerDiscreteScheduler,
|
25 |
-
LMSDiscreteScheduler,
|
26 |
-
OnnxStableDiffusionImg2ImgPipeline,
|
27 |
-
PNDMScheduler,
|
28 |
-
)
|
29 |
-
from diffusers.utils import floats_tensor
|
30 |
-
from diffusers.utils.testing_utils import (
|
31 |
-
is_onnx_available,
|
32 |
-
load_image,
|
33 |
-
nightly,
|
34 |
-
require_onnxruntime,
|
35 |
-
require_torch_gpu,
|
36 |
-
)
|
37 |
-
|
38 |
-
from ..test_pipelines_onnx_common import OnnxPipelineTesterMixin
|
39 |
-
|
40 |
-
|
41 |
-
if is_onnx_available():
|
42 |
-
import onnxruntime as ort
|
43 |
-
|
44 |
-
|
45 |
-
class OnnxStableDiffusionImg2ImgPipelineFastTests(OnnxPipelineTesterMixin, unittest.TestCase):
|
46 |
-
hub_checkpoint = "hf-internal-testing/tiny-random-OnnxStableDiffusionPipeline"
|
47 |
-
|
48 |
-
def get_dummy_inputs(self, seed=0):
|
49 |
-
image = floats_tensor((1, 3, 128, 128), rng=random.Random(seed))
|
50 |
-
generator = np.random.RandomState(seed)
|
51 |
-
inputs = {
|
52 |
-
"prompt": "A painting of a squirrel eating a burger",
|
53 |
-
"image": image,
|
54 |
-
"generator": generator,
|
55 |
-
"num_inference_steps": 3,
|
56 |
-
"strength": 0.75,
|
57 |
-
"guidance_scale": 7.5,
|
58 |
-
"output_type": "numpy",
|
59 |
-
}
|
60 |
-
return inputs
|
61 |
-
|
62 |
-
def test_pipeline_default_ddim(self):
|
63 |
-
pipe = OnnxStableDiffusionImg2ImgPipeline.from_pretrained(self.hub_checkpoint, provider="CPUExecutionProvider")
|
64 |
-
pipe.set_progress_bar_config(disable=None)
|
65 |
-
|
66 |
-
inputs = self.get_dummy_inputs()
|
67 |
-
image = pipe(**inputs).images
|
68 |
-
image_slice = image[0, -3:, -3:, -1].flatten()
|
69 |
-
|
70 |
-
assert image.shape == (1, 128, 128, 3)
|
71 |
-
expected_slice = np.array([0.69643, 0.58484, 0.50314, 0.58760, 0.55368, 0.59643, 0.51529, 0.41217, 0.49087])
|
72 |
-
assert np.abs(image_slice - expected_slice).max() < 1e-1
|
73 |
-
|
74 |
-
def test_pipeline_pndm(self):
|
75 |
-
pipe = OnnxStableDiffusionImg2ImgPipeline.from_pretrained(self.hub_checkpoint, provider="CPUExecutionProvider")
|
76 |
-
pipe.scheduler = PNDMScheduler.from_config(pipe.scheduler.config, skip_prk_steps=True)
|
77 |
-
pipe.set_progress_bar_config(disable=None)
|
78 |
-
|
79 |
-
inputs = self.get_dummy_inputs()
|
80 |
-
image = pipe(**inputs).images
|
81 |
-
image_slice = image[0, -3:, -3:, -1]
|
82 |
-
|
83 |
-
assert image.shape == (1, 128, 128, 3)
|
84 |
-
expected_slice = np.array([0.61737, 0.54642, 0.53183, 0.54465, 0.52742, 0.60525, 0.49969, 0.40655, 0.48154])
|
85 |
-
|
86 |
-
assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-1
|
87 |
-
|
88 |
-
def test_pipeline_lms(self):
|
89 |
-
pipe = OnnxStableDiffusionImg2ImgPipeline.from_pretrained(self.hub_checkpoint, provider="CPUExecutionProvider")
|
90 |
-
pipe.scheduler = LMSDiscreteScheduler.from_config(pipe.scheduler.config)
|
91 |
-
pipe.set_progress_bar_config(disable=None)
|
92 |
-
|
93 |
-
# warmup pass to apply optimizations
|
94 |
-
_ = pipe(**self.get_dummy_inputs())
|
95 |
-
|
96 |
-
inputs = self.get_dummy_inputs()
|
97 |
-
image = pipe(**inputs).images
|
98 |
-
image_slice = image[0, -3:, -3:, -1]
|
99 |
-
|
100 |
-
assert image.shape == (1, 128, 128, 3)
|
101 |
-
expected_slice = np.array([0.52761, 0.59977, 0.49033, 0.49619, 0.54282, 0.50311, 0.47600, 0.40918, 0.45203])
|
102 |
-
|
103 |
-
assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-1
|
104 |
-
|
105 |
-
def test_pipeline_euler(self):
|
106 |
-
pipe = OnnxStableDiffusionImg2ImgPipeline.from_pretrained(self.hub_checkpoint, provider="CPUExecutionProvider")
|
107 |
-
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config)
|
108 |
-
pipe.set_progress_bar_config(disable=None)
|
109 |
-
|
110 |
-
inputs = self.get_dummy_inputs()
|
111 |
-
image = pipe(**inputs).images
|
112 |
-
image_slice = image[0, -3:, -3:, -1]
|
113 |
-
|
114 |
-
assert image.shape == (1, 128, 128, 3)
|
115 |
-
expected_slice = np.array([0.52911, 0.60004, 0.49229, 0.49805, 0.54502, 0.50680, 0.47777, 0.41028, 0.45304])
|
116 |
-
|
117 |
-
assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-1
|
118 |
-
|
119 |
-
def test_pipeline_euler_ancestral(self):
|
120 |
-
pipe = OnnxStableDiffusionImg2ImgPipeline.from_pretrained(self.hub_checkpoint, provider="CPUExecutionProvider")
|
121 |
-
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
122 |
-
pipe.set_progress_bar_config(disable=None)
|
123 |
-
|
124 |
-
inputs = self.get_dummy_inputs()
|
125 |
-
image = pipe(**inputs).images
|
126 |
-
image_slice = image[0, -3:, -3:, -1]
|
127 |
-
|
128 |
-
assert image.shape == (1, 128, 128, 3)
|
129 |
-
expected_slice = np.array([0.52911, 0.60004, 0.49229, 0.49805, 0.54502, 0.50680, 0.47777, 0.41028, 0.45304])
|
130 |
-
|
131 |
-
assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-1
|
132 |
-
|
133 |
-
def test_pipeline_dpm_multistep(self):
|
134 |
-
pipe = OnnxStableDiffusionImg2ImgPipeline.from_pretrained(self.hub_checkpoint, provider="CPUExecutionProvider")
|
135 |
-
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
|
136 |
-
pipe.set_progress_bar_config(disable=None)
|
137 |
-
|
138 |
-
inputs = self.get_dummy_inputs()
|
139 |
-
image = pipe(**inputs).images
|
140 |
-
image_slice = image[0, -3:, -3:, -1]
|
141 |
-
|
142 |
-
assert image.shape == (1, 128, 128, 3)
|
143 |
-
expected_slice = np.array([0.65331, 0.58277, 0.48204, 0.56059, 0.53665, 0.56235, 0.50969, 0.40009, 0.46552])
|
144 |
-
|
145 |
-
assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-1
|
146 |
-
|
147 |
-
|
148 |
-
@nightly
|
149 |
-
@require_onnxruntime
|
150 |
-
@require_torch_gpu
|
151 |
-
class OnnxStableDiffusionImg2ImgPipelineIntegrationTests(unittest.TestCase):
|
152 |
-
@property
|
153 |
-
def gpu_provider(self):
|
154 |
-
return (
|
155 |
-
"CUDAExecutionProvider",
|
156 |
-
{
|
157 |
-
"gpu_mem_limit": "15000000000", # 15GB
|
158 |
-
"arena_extend_strategy": "kSameAsRequested",
|
159 |
-
},
|
160 |
-
)
|
161 |
-
|
162 |
-
@property
|
163 |
-
def gpu_options(self):
|
164 |
-
options = ort.SessionOptions()
|
165 |
-
options.enable_mem_pattern = False
|
166 |
-
return options
|
167 |
-
|
168 |
-
def test_inference_default_pndm(self):
|
169 |
-
init_image = load_image(
|
170 |
-
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main"
|
171 |
-
"/img2img/sketch-mountains-input.jpg"
|
172 |
-
)
|
173 |
-
init_image = init_image.resize((768, 512))
|
174 |
-
# using the PNDM scheduler by default
|
175 |
-
pipe = OnnxStableDiffusionImg2ImgPipeline.from_pretrained(
|
176 |
-
"CompVis/stable-diffusion-v1-4",
|
177 |
-
revision="onnx",
|
178 |
-
safety_checker=None,
|
179 |
-
feature_extractor=None,
|
180 |
-
provider=self.gpu_provider,
|
181 |
-
sess_options=self.gpu_options,
|
182 |
-
)
|
183 |
-
pipe.set_progress_bar_config(disable=None)
|
184 |
-
|
185 |
-
prompt = "A fantasy landscape, trending on artstation"
|
186 |
-
|
187 |
-
generator = np.random.RandomState(0)
|
188 |
-
output = pipe(
|
189 |
-
prompt=prompt,
|
190 |
-
image=init_image,
|
191 |
-
strength=0.75,
|
192 |
-
guidance_scale=7.5,
|
193 |
-
num_inference_steps=10,
|
194 |
-
generator=generator,
|
195 |
-
output_type="np",
|
196 |
-
)
|
197 |
-
images = output.images
|
198 |
-
image_slice = images[0, 255:258, 383:386, -1]
|
199 |
-
|
200 |
-
assert images.shape == (1, 512, 768, 3)
|
201 |
-
expected_slice = np.array([0.4909, 0.5059, 0.5372, 0.4623, 0.4876, 0.5049, 0.4820, 0.4956, 0.5019])
|
202 |
-
# TODO: lower the tolerance after finding the cause of onnxruntime reproducibility issues
|
203 |
-
|
204 |
-
assert np.abs(image_slice.flatten() - expected_slice).max() < 2e-2
|
205 |
-
|
206 |
-
def test_inference_k_lms(self):
|
207 |
-
init_image = load_image(
|
208 |
-
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main"
|
209 |
-
"/img2img/sketch-mountains-input.jpg"
|
210 |
-
)
|
211 |
-
init_image = init_image.resize((768, 512))
|
212 |
-
lms_scheduler = LMSDiscreteScheduler.from_pretrained(
|
213 |
-
"runwayml/stable-diffusion-v1-5", subfolder="scheduler", revision="onnx"
|
214 |
-
)
|
215 |
-
pipe = OnnxStableDiffusionImg2ImgPipeline.from_pretrained(
|
216 |
-
"runwayml/stable-diffusion-v1-5",
|
217 |
-
revision="onnx",
|
218 |
-
scheduler=lms_scheduler,
|
219 |
-
safety_checker=None,
|
220 |
-
feature_extractor=None,
|
221 |
-
provider=self.gpu_provider,
|
222 |
-
sess_options=self.gpu_options,
|
223 |
-
)
|
224 |
-
pipe.set_progress_bar_config(disable=None)
|
225 |
-
|
226 |
-
prompt = "A fantasy landscape, trending on artstation"
|
227 |
-
|
228 |
-
generator = np.random.RandomState(0)
|
229 |
-
output = pipe(
|
230 |
-
prompt=prompt,
|
231 |
-
image=init_image,
|
232 |
-
strength=0.75,
|
233 |
-
guidance_scale=7.5,
|
234 |
-
num_inference_steps=20,
|
235 |
-
generator=generator,
|
236 |
-
output_type="np",
|
237 |
-
)
|
238 |
-
images = output.images
|
239 |
-
image_slice = images[0, 255:258, 383:386, -1]
|
240 |
-
|
241 |
-
assert images.shape == (1, 512, 768, 3)
|
242 |
-
expected_slice = np.array([0.8043, 0.926, 0.9581, 0.8119, 0.8954, 0.913, 0.7209, 0.7463, 0.7431])
|
243 |
-
# TODO: lower the tolerance after finding the cause of onnxruntime reproducibility issues
|
244 |
-
|
245 |
-
assert np.abs(image_slice.flatten() - expected_slice).max() < 2e-2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/grid_rcnn/grid_rcnn_r101_fpn_gn-head_2x_coco.py
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
_base_ = './grid_rcnn_r50_fpn_gn-head_2x_coco.py'
|
2 |
-
|
3 |
-
model = dict(pretrained='torchvision://resnet101', backbone=dict(depth=101))
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/vfnet/vfnet_r101_fpn_mdconv_c3-c5_mstrain_2x_coco.py
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
_base_ = './vfnet_r50_fpn_mdconv_c3-c5_mstrain_2x_coco.py'
|
2 |
-
model = dict(
|
3 |
-
pretrained='torchvision://resnet101',
|
4 |
-
backbone=dict(
|
5 |
-
type='ResNet',
|
6 |
-
depth=101,
|
7 |
-
num_stages=4,
|
8 |
-
out_indices=(0, 1, 2, 3),
|
9 |
-
frozen_stages=1,
|
10 |
-
norm_cfg=dict(type='BN', requires_grad=True),
|
11 |
-
norm_eval=True,
|
12 |
-
style='pytorch',
|
13 |
-
dcn=dict(type='DCNv2', deform_groups=1, fallback_on_stride=False),
|
14 |
-
stage_with_dcn=(False, True, True, True)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/mmdet/core/bbox/samplers/__init__.py
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
from .base_sampler import BaseSampler
|
2 |
-
from .combined_sampler import CombinedSampler
|
3 |
-
from .instance_balanced_pos_sampler import InstanceBalancedPosSampler
|
4 |
-
from .iou_balanced_neg_sampler import IoUBalancedNegSampler
|
5 |
-
from .ohem_sampler import OHEMSampler
|
6 |
-
from .pseudo_sampler import PseudoSampler
|
7 |
-
from .random_sampler import RandomSampler
|
8 |
-
from .sampling_result import SamplingResult
|
9 |
-
from .score_hlr_sampler import ScoreHLRSampler
|
10 |
-
|
11 |
-
__all__ = [
|
12 |
-
'BaseSampler', 'PseudoSampler', 'RandomSampler',
|
13 |
-
'InstanceBalancedPosSampler', 'IoUBalancedNegSampler', 'CombinedSampler',
|
14 |
-
'OHEMSampler', 'SamplingResult', 'ScoreHLRSampler'
|
15 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_segmentation/configs/_base_/models/pspnet_unet_s5-d16.py
DELETED
@@ -1,50 +0,0 @@
|
|
1 |
-
# model settings
|
2 |
-
norm_cfg = dict(type='SyncBN', requires_grad=True)
|
3 |
-
model = dict(
|
4 |
-
type='EncoderDecoder',
|
5 |
-
pretrained=None,
|
6 |
-
backbone=dict(
|
7 |
-
type='UNet',
|
8 |
-
in_channels=3,
|
9 |
-
base_channels=64,
|
10 |
-
num_stages=5,
|
11 |
-
strides=(1, 1, 1, 1, 1),
|
12 |
-
enc_num_convs=(2, 2, 2, 2, 2),
|
13 |
-
dec_num_convs=(2, 2, 2, 2),
|
14 |
-
downsamples=(True, True, True, True),
|
15 |
-
enc_dilations=(1, 1, 1, 1, 1),
|
16 |
-
dec_dilations=(1, 1, 1, 1),
|
17 |
-
with_cp=False,
|
18 |
-
conv_cfg=None,
|
19 |
-
norm_cfg=norm_cfg,
|
20 |
-
act_cfg=dict(type='ReLU'),
|
21 |
-
upsample_cfg=dict(type='InterpConv'),
|
22 |
-
norm_eval=False),
|
23 |
-
decode_head=dict(
|
24 |
-
type='PSPHead',
|
25 |
-
in_channels=64,
|
26 |
-
in_index=4,
|
27 |
-
channels=16,
|
28 |
-
pool_scales=(1, 2, 3, 6),
|
29 |
-
dropout_ratio=0.1,
|
30 |
-
num_classes=2,
|
31 |
-
norm_cfg=norm_cfg,
|
32 |
-
align_corners=False,
|
33 |
-
loss_decode=dict(
|
34 |
-
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)),
|
35 |
-
auxiliary_head=dict(
|
36 |
-
type='FCNHead',
|
37 |
-
in_channels=128,
|
38 |
-
in_index=3,
|
39 |
-
channels=64,
|
40 |
-
num_convs=1,
|
41 |
-
concat_input=False,
|
42 |
-
dropout_ratio=0.1,
|
43 |
-
num_classes=2,
|
44 |
-
norm_cfg=norm_cfg,
|
45 |
-
align_corners=False,
|
46 |
-
loss_decode=dict(
|
47 |
-
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
|
48 |
-
# model training and testing settings
|
49 |
-
train_cfg=dict(),
|
50 |
-
test_cfg=dict(mode='slide', crop_size=256, stride=170))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_segmentation/configs/pspnet/pspnet_r18-d8_769x769_80k_cityscapes.py
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
_base_ = './pspnet_r50-d8_769x769_80k_cityscapes.py'
|
2 |
-
model = dict(
|
3 |
-
pretrained='open-mmlab://resnet18_v1c',
|
4 |
-
backbone=dict(depth=18),
|
5 |
-
decode_head=dict(
|
6 |
-
in_channels=512,
|
7 |
-
channels=128,
|
8 |
-
),
|
9 |
-
auxiliary_head=dict(in_channels=256, channels=64))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AnishKumbhar/ChatBot/text-generation-webui-main/docs/Docker.md
DELETED
@@ -1,203 +0,0 @@
|
|
1 |
-
Docker Compose is a way of installing and launching the web UI in an isolated Ubuntu image using only a few commands.
|
2 |
-
|
3 |
-
In order to create the image as described in the main README, you must have docker compose 2.17 or higher:
|
4 |
-
|
5 |
-
```
|
6 |
-
~$ docker compose version
|
7 |
-
Docker Compose version v2.17.2
|
8 |
-
```
|
9 |
-
|
10 |
-
Make sure to also create the necessary symbolic links:
|
11 |
-
|
12 |
-
```
|
13 |
-
cd text-generation-webui
|
14 |
-
ln -s docker/{Dockerfile,docker-compose.yml,.dockerignore} .
|
15 |
-
cp docker/.env.example .env
|
16 |
-
# Edit .env and set TORCH_CUDA_ARCH_LIST based on your GPU model
|
17 |
-
docker compose up --build
|
18 |
-
```
|
19 |
-
|
20 |
-
# Table of contents
|
21 |
-
|
22 |
-
* [Docker Compose installation instructions](#docker-compose-installation-instructions)
|
23 |
-
* [Repository with additional Docker files](#dedicated-docker-repository)
|
24 |
-
|
25 |
-
# Docker Compose installation instructions
|
26 |
-
|
27 |
-
By [@loeken](https://github.com/loeken).
|
28 |
-
|
29 |
-
- [Ubuntu 22.04](#ubuntu-2204)
|
30 |
-
- [0. youtube video](#0-youtube-video)
|
31 |
-
- [1. update the drivers](#1-update-the-drivers)
|
32 |
-
- [2. reboot](#2-reboot)
|
33 |
-
- [3. install docker](#3-install-docker)
|
34 |
-
- [4. docker \& container toolkit](#4-docker--container-toolkit)
|
35 |
-
- [5. clone the repo](#5-clone-the-repo)
|
36 |
-
- [6. prepare models](#6-prepare-models)
|
37 |
-
- [7. prepare .env file](#7-prepare-env-file)
|
38 |
-
- [8. startup docker container](#8-startup-docker-container)
|
39 |
-
- [Manjaro](#manjaro)
|
40 |
-
- [update the drivers](#update-the-drivers)
|
41 |
-
- [reboot](#reboot)
|
42 |
-
- [docker \& container toolkit](#docker--container-toolkit)
|
43 |
-
- [continue with ubuntu task](#continue-with-ubuntu-task)
|
44 |
-
- [Windows](#windows)
|
45 |
-
- [0. youtube video](#0-youtube-video-1)
|
46 |
-
- [1. choco package manager](#1-choco-package-manager)
|
47 |
-
- [2. install drivers/dependencies](#2-install-driversdependencies)
|
48 |
-
- [3. install wsl](#3-install-wsl)
|
49 |
-
- [4. reboot](#4-reboot)
|
50 |
-
- [5. git clone \&\& startup](#5-git-clone--startup)
|
51 |
-
- [6. prepare models](#6-prepare-models-1)
|
52 |
-
- [7. startup](#7-startup)
|
53 |
-
- [notes](#notes)
|
54 |
-
|
55 |
-
## Ubuntu 22.04
|
56 |
-
|
57 |
-
### 0. youtube video
|
58 |
-
A video walking you through the setup can be found here:
|
59 |
-
|
60 |
-
[](https://www.youtube.com/watch?v=ELkKWYh8qOk)
|
61 |
-
|
62 |
-
|
63 |
-
### 1. update the drivers
|
64 |
-
in the the “software updater” update drivers to the last version of the prop driver.
|
65 |
-
|
66 |
-
### 2. reboot
|
67 |
-
to switch using to new driver
|
68 |
-
|
69 |
-
### 3. install docker
|
70 |
-
```bash
|
71 |
-
sudo apt update
|
72 |
-
sudo apt-get install curl
|
73 |
-
sudo mkdir -m 0755 -p /etc/apt/keyrings
|
74 |
-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
75 |
-
echo \
|
76 |
-
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
|
77 |
-
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
|
78 |
-
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
79 |
-
sudo apt update
|
80 |
-
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-compose -y
|
81 |
-
sudo usermod -aG docker $USER
|
82 |
-
newgrp docker
|
83 |
-
```
|
84 |
-
|
85 |
-
### 4. docker & container toolkit
|
86 |
-
```bash
|
87 |
-
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
|
88 |
-
echo "deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://nvidia.github.io/libnvidia-container/stable/ubuntu22.04/amd64 /" | \
|
89 |
-
sudo tee /etc/apt/sources.list.d/nvidia.list > /dev/null
|
90 |
-
sudo apt update
|
91 |
-
sudo apt install nvidia-docker2 nvidia-container-runtime -y
|
92 |
-
sudo systemctl restart docker
|
93 |
-
```
|
94 |
-
|
95 |
-
### 5. clone the repo
|
96 |
-
```
|
97 |
-
git clone https://github.com/oobabooga/text-generation-webui
|
98 |
-
cd text-generation-webui
|
99 |
-
```
|
100 |
-
|
101 |
-
### 6. prepare models
|
102 |
-
download and place the models inside the models folder. tested with:
|
103 |
-
|
104 |
-
4bit
|
105 |
-
https://github.com/oobabooga/text-generation-webui/pull/530#issuecomment-1483891617
|
106 |
-
https://github.com/oobabooga/text-generation-webui/pull/530#issuecomment-1483941105
|
107 |
-
|
108 |
-
8bit:
|
109 |
-
https://github.com/oobabooga/text-generation-webui/pull/530#issuecomment-1484235789
|
110 |
-
|
111 |
-
### 7. prepare .env file
|
112 |
-
edit .env values to your needs.
|
113 |
-
```bash
|
114 |
-
cp .env.example .env
|
115 |
-
nano .env
|
116 |
-
```
|
117 |
-
|
118 |
-
### 8. startup docker container
|
119 |
-
```bash
|
120 |
-
docker compose up --build
|
121 |
-
```
|
122 |
-
|
123 |
-
## Manjaro
|
124 |
-
manjaro/arch is similar to ubuntu just the dependency installation is more convenient
|
125 |
-
|
126 |
-
### update the drivers
|
127 |
-
```bash
|
128 |
-
sudo mhwd -a pci nonfree 0300
|
129 |
-
```
|
130 |
-
### reboot
|
131 |
-
```bash
|
132 |
-
reboot
|
133 |
-
```
|
134 |
-
### docker & container toolkit
|
135 |
-
```bash
|
136 |
-
yay -S docker docker-compose buildkit gcc nvidia-docker
|
137 |
-
sudo usermod -aG docker $USER
|
138 |
-
newgrp docker
|
139 |
-
sudo systemctl restart docker # required by nvidia-container-runtime
|
140 |
-
```
|
141 |
-
|
142 |
-
### continue with ubuntu task
|
143 |
-
continue at [5. clone the repo](#5-clone-the-repo)
|
144 |
-
|
145 |
-
## Windows
|
146 |
-
### 0. youtube video
|
147 |
-
A video walking you through the setup can be found here:
|
148 |
-
[](https://www.youtube.com/watch?v=ejH4w5b5kFQ)
|
149 |
-
|
150 |
-
### 1. choco package manager
|
151 |
-
install package manager (https://chocolatey.org/ )
|
152 |
-
```
|
153 |
-
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
154 |
-
```
|
155 |
-
|
156 |
-
### 2. install drivers/dependencies
|
157 |
-
```
|
158 |
-
choco install nvidia-display-driver cuda git docker-desktop
|
159 |
-
```
|
160 |
-
|
161 |
-
### 3. install wsl
|
162 |
-
wsl --install
|
163 |
-
|
164 |
-
### 4. reboot
|
165 |
-
after reboot enter username/password in wsl
|
166 |
-
|
167 |
-
### 5. git clone && startup
|
168 |
-
clone the repo and edit .env values to your needs.
|
169 |
-
```
|
170 |
-
cd Desktop
|
171 |
-
git clone https://github.com/oobabooga/text-generation-webui
|
172 |
-
cd text-generation-webui
|
173 |
-
COPY .env.example .env
|
174 |
-
notepad .env
|
175 |
-
```
|
176 |
-
|
177 |
-
### 6. prepare models
|
178 |
-
download and place the models inside the models folder. tested with:
|
179 |
-
|
180 |
-
4bit https://github.com/oobabooga/text-generation-webui/pull/530#issuecomment-1483891617 https://github.com/oobabooga/text-generation-webui/pull/530#issuecomment-1483941105
|
181 |
-
|
182 |
-
8bit: https://github.com/oobabooga/text-generation-webui/pull/530#issuecomment-1484235789
|
183 |
-
|
184 |
-
### 7. startup
|
185 |
-
```
|
186 |
-
docker compose up
|
187 |
-
```
|
188 |
-
|
189 |
-
## notes
|
190 |
-
|
191 |
-
on older ubuntus you can manually install the docker compose plugin like this:
|
192 |
-
```
|
193 |
-
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
|
194 |
-
mkdir -p $DOCKER_CONFIG/cli-plugins
|
195 |
-
curl -SL https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
|
196 |
-
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
|
197 |
-
export PATH="$HOME/.docker/cli-plugins:$PATH"
|
198 |
-
```
|
199 |
-
|
200 |
-
# Dedicated docker repository
|
201 |
-
|
202 |
-
An external repository maintains a docker wrapper for this project as well as several pre-configured 'one-click' `docker compose` variants (e.g., updated branches of GPTQ). It can be found at: [Atinoda/text-generation-webui-docker](https://github.com/Atinoda/text-generation-webui-docker).
|
203 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AnishKumbhar/ChatBot/text-generation-webui-main/modules/ui_parameters.py
DELETED
@@ -1,106 +0,0 @@
|
|
1 |
-
from pathlib import Path
|
2 |
-
|
3 |
-
import gradio as gr
|
4 |
-
|
5 |
-
from modules import loaders, presets, shared, ui, ui_chat, utils
|
6 |
-
from modules.utils import gradio
|
7 |
-
|
8 |
-
|
9 |
-
def create_ui(default_preset):
|
10 |
-
mu = shared.args.multi_user
|
11 |
-
generate_params = presets.load_preset(default_preset)
|
12 |
-
with gr.Tab("Parameters", elem_id="parameters"):
|
13 |
-
with gr.Tab("Generation"):
|
14 |
-
with gr.Row():
|
15 |
-
with gr.Column():
|
16 |
-
with gr.Row():
|
17 |
-
shared.gradio['preset_menu'] = gr.Dropdown(choices=utils.get_available_presets(), value=default_preset, label='Preset', elem_classes='slim-dropdown')
|
18 |
-
ui.create_refresh_button(shared.gradio['preset_menu'], lambda: None, lambda: {'choices': utils.get_available_presets()}, 'refresh-button', interactive=not mu)
|
19 |
-
shared.gradio['save_preset'] = gr.Button('💾', elem_classes='refresh-button', interactive=not mu)
|
20 |
-
shared.gradio['delete_preset'] = gr.Button('🗑️', elem_classes='refresh-button', interactive=not mu)
|
21 |
-
|
22 |
-
with gr.Column():
|
23 |
-
shared.gradio['filter_by_loader'] = gr.Dropdown(label="Filter by loader", choices=["All"] + list(loaders.loaders_and_params.keys()), value="All", elem_classes='slim-dropdown')
|
24 |
-
|
25 |
-
with gr.Row():
|
26 |
-
with gr.Column():
|
27 |
-
with gr.Row():
|
28 |
-
with gr.Column():
|
29 |
-
shared.gradio['max_new_tokens'] = gr.Slider(minimum=shared.settings['max_new_tokens_min'], maximum=shared.settings['max_new_tokens_max'], step=1, label='max_new_tokens', value=shared.settings['max_new_tokens'])
|
30 |
-
shared.gradio['temperature'] = gr.Slider(0.01, 1.99, value=generate_params['temperature'], step=0.01, label='temperature')
|
31 |
-
shared.gradio['top_p'] = gr.Slider(0.0, 1.0, value=generate_params['top_p'], step=0.01, label='top_p')
|
32 |
-
shared.gradio['top_k'] = gr.Slider(0, 200, value=generate_params['top_k'], step=1, label='top_k')
|
33 |
-
shared.gradio['repetition_penalty'] = gr.Slider(1.0, 1.5, value=generate_params['repetition_penalty'], step=0.01, label='repetition_penalty')
|
34 |
-
shared.gradio['repetition_penalty_range'] = gr.Slider(0, 4096, step=64, value=generate_params['repetition_penalty_range'], label='repetition_penalty_range')
|
35 |
-
shared.gradio['typical_p'] = gr.Slider(0.0, 1.0, value=generate_params['typical_p'], step=0.01, label='typical_p')
|
36 |
-
shared.gradio['tfs'] = gr.Slider(0.0, 1.0, value=generate_params['tfs'], step=0.01, label='tfs')
|
37 |
-
shared.gradio['top_a'] = gr.Slider(0.0, 1.0, value=generate_params['top_a'], step=0.01, label='top_a')
|
38 |
-
shared.gradio['epsilon_cutoff'] = gr.Slider(0, 9, value=generate_params['epsilon_cutoff'], step=0.01, label='epsilon_cutoff')
|
39 |
-
shared.gradio['eta_cutoff'] = gr.Slider(0, 20, value=generate_params['eta_cutoff'], step=0.01, label='eta_cutoff')
|
40 |
-
|
41 |
-
with gr.Column():
|
42 |
-
shared.gradio['guidance_scale'] = gr.Slider(-0.5, 2.5, step=0.05, value=generate_params['guidance_scale'], label='guidance_scale', info='For CFG. 1.5 is a good value.')
|
43 |
-
shared.gradio['negative_prompt'] = gr.Textbox(value=shared.settings['negative_prompt'], label='Negative prompt', lines=3, elem_classes=['add_scrollbar'])
|
44 |
-
shared.gradio['penalty_alpha'] = gr.Slider(0, 5, value=generate_params['penalty_alpha'], label='penalty_alpha', info='For Contrastive Search. do_sample must be unchecked.')
|
45 |
-
shared.gradio['mirostat_mode'] = gr.Slider(0, 2, step=1, value=generate_params['mirostat_mode'], label='mirostat_mode', info='mode=1 is for llama.cpp only.')
|
46 |
-
shared.gradio['mirostat_tau'] = gr.Slider(0, 10, step=0.01, value=generate_params['mirostat_tau'], label='mirostat_tau')
|
47 |
-
shared.gradio['mirostat_eta'] = gr.Slider(0, 1, step=0.01, value=generate_params['mirostat_eta'], label='mirostat_eta')
|
48 |
-
shared.gradio['do_sample'] = gr.Checkbox(value=generate_params['do_sample'], label='do_sample')
|
49 |
-
shared.gradio['seed'] = gr.Number(value=shared.settings['seed'], label='Seed (-1 for random)')
|
50 |
-
with gr.Accordion('Other parameters', open=False):
|
51 |
-
shared.gradio['encoder_repetition_penalty'] = gr.Slider(0.8, 1.5, value=generate_params['encoder_repetition_penalty'], step=0.01, label='encoder_repetition_penalty')
|
52 |
-
shared.gradio['no_repeat_ngram_size'] = gr.Slider(0, 20, step=1, value=generate_params['no_repeat_ngram_size'], label='no_repeat_ngram_size')
|
53 |
-
shared.gradio['min_length'] = gr.Slider(0, 2000, step=1, value=generate_params['min_length'], label='min_length')
|
54 |
-
shared.gradio['num_beams'] = gr.Slider(1, 20, step=1, value=generate_params['num_beams'], label='num_beams', info='For Beam Search, along with length_penalty and early_stopping.')
|
55 |
-
shared.gradio['length_penalty'] = gr.Slider(-5, 5, value=generate_params['length_penalty'], label='length_penalty')
|
56 |
-
shared.gradio['early_stopping'] = gr.Checkbox(value=generate_params['early_stopping'], label='early_stopping')
|
57 |
-
|
58 |
-
gr.Markdown("[Learn more](https://github.com/oobabooga/text-generation-webui/blob/main/docs/Generation-Parameters.md)")
|
59 |
-
|
60 |
-
with gr.Column():
|
61 |
-
with gr.Row():
|
62 |
-
with gr.Column():
|
63 |
-
shared.gradio['truncation_length'] = gr.Slider(value=get_truncation_length(), minimum=shared.settings['truncation_length_min'], maximum=shared.settings['truncation_length_max'], step=256, label='Truncate the prompt up to this length', info='The leftmost tokens are removed if the prompt exceeds this length. Most models require this to be at most 2048.')
|
64 |
-
shared.gradio['max_tokens_second'] = gr.Slider(value=shared.settings['max_tokens_second'], minimum=0, maximum=20, step=1, label='Maximum number of tokens/second', info='To make text readable in real time.')
|
65 |
-
shared.gradio['custom_stopping_strings'] = gr.Textbox(lines=1, value=shared.settings["custom_stopping_strings"] or None, label='Custom stopping strings', info='In addition to the defaults. Written between "" and separated by commas.', placeholder='"\\n", "\\nYou:"')
|
66 |
-
shared.gradio['custom_token_bans'] = gr.Textbox(value=shared.settings['custom_token_bans'] or None, label='Custom token bans', info='Specific token IDs to ban from generating, comma-separated. The IDs can be found in the Default or Notebook tab.')
|
67 |
-
|
68 |
-
with gr.Column():
|
69 |
-
shared.gradio['auto_max_new_tokens'] = gr.Checkbox(value=shared.settings['auto_max_new_tokens'], label='auto_max_new_tokens', info='Expand max_new_tokens to the available context length.')
|
70 |
-
shared.gradio['ban_eos_token'] = gr.Checkbox(value=shared.settings['ban_eos_token'], label='Ban the eos_token', info='Forces the model to never end the generation prematurely.')
|
71 |
-
shared.gradio['add_bos_token'] = gr.Checkbox(value=shared.settings['add_bos_token'], label='Add the bos_token to the beginning of prompts', info='Disabling this can make the replies more creative.')
|
72 |
-
shared.gradio['skip_special_tokens'] = gr.Checkbox(value=shared.settings['skip_special_tokens'], label='Skip special tokens', info='Some specific models need this unset.')
|
73 |
-
shared.gradio['stream'] = gr.Checkbox(value=shared.settings['stream'], label='Activate text streaming')
|
74 |
-
|
75 |
-
with gr.Row() as shared.gradio['grammar_file_row']:
|
76 |
-
shared.gradio['grammar_file'] = gr.Dropdown(value='None', choices=utils.get_available_grammars(), label='Load grammar from file (.gbnf)', elem_classes='slim-dropdown')
|
77 |
-
ui.create_refresh_button(shared.gradio['grammar_file'], lambda: None, lambda: {'choices': utils.get_available_grammars()}, 'refresh-button', interactive=not mu)
|
78 |
-
shared.gradio['save_grammar'] = gr.Button('💾', elem_classes='refresh-button', interactive=not mu)
|
79 |
-
shared.gradio['delete_grammar'] = gr.Button('🗑️ ', elem_classes='refresh-button', interactive=not mu)
|
80 |
-
|
81 |
-
shared.gradio['grammar_string'] = gr.Textbox(value='', label='Grammar', lines=16, elem_classes=['add_scrollbar', 'monospace'])
|
82 |
-
|
83 |
-
ui_chat.create_chat_settings_ui()
|
84 |
-
|
85 |
-
|
86 |
-
def create_event_handlers():
|
87 |
-
shared.gradio['filter_by_loader'].change(loaders.blacklist_samplers, gradio('filter_by_loader'), gradio(loaders.list_all_samplers()), show_progress=False)
|
88 |
-
shared.gradio['preset_menu'].change(presets.load_preset_for_ui, gradio('preset_menu', 'interface_state'), gradio('interface_state') + gradio(presets.presets_params()))
|
89 |
-
shared.gradio['grammar_file'].change(load_grammar, gradio('grammar_file'), gradio('grammar_string'))
|
90 |
-
|
91 |
-
|
92 |
-
def get_truncation_length():
|
93 |
-
if shared.args.max_seq_len != shared.args_defaults.max_seq_len:
|
94 |
-
return shared.args.max_seq_len
|
95 |
-
if shared.args.n_ctx != shared.args_defaults.n_ctx:
|
96 |
-
return shared.args.n_ctx
|
97 |
-
else:
|
98 |
-
return shared.settings['truncation_length']
|
99 |
-
|
100 |
-
|
101 |
-
def load_grammar(name):
|
102 |
-
p = Path(f'grammars/{name}')
|
103 |
-
if p.exists():
|
104 |
-
return open(p, 'r').read()
|
105 |
-
else:
|
106 |
-
return ''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Anthony7906/MengHuiMXD_GPT/locale/extract_locale.py
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
import json
|
3 |
-
import re
|
4 |
-
|
5 |
-
# Define regular expression patterns
|
6 |
-
pattern = r'i18n\((\"{3}.*?\"{3}|\".*?\")\)'
|
7 |
-
|
8 |
-
# Load the .py file
|
9 |
-
with open('ChuanhuChatbot.py', 'r', encoding='utf-8') as f:
|
10 |
-
contents = f.read()
|
11 |
-
|
12 |
-
# Load the .py files in the modules folder
|
13 |
-
for filename in os.listdir("modules"):
|
14 |
-
if filename.endswith(".py"):
|
15 |
-
with open(os.path.join("modules", filename), "r", encoding="utf-8") as f:
|
16 |
-
contents += f.read()
|
17 |
-
|
18 |
-
# Matching with regular expressions
|
19 |
-
matches = re.findall(pattern, contents, re.DOTALL)
|
20 |
-
|
21 |
-
# Convert to key/value pairs
|
22 |
-
data = {match.strip('()"'): '' for match in matches}
|
23 |
-
|
24 |
-
# Save as a JSON file
|
25 |
-
with open('labels.json', 'w', encoding='utf-8') as f:
|
26 |
-
json.dump(data, f, ensure_ascii=False, indent=4)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_internal/utils/entrypoints.py
DELETED
@@ -1,84 +0,0 @@
|
|
1 |
-
import itertools
|
2 |
-
import os
|
3 |
-
import shutil
|
4 |
-
import sys
|
5 |
-
from typing import List, Optional
|
6 |
-
|
7 |
-
from pip._internal.cli.main import main
|
8 |
-
from pip._internal.utils.compat import WINDOWS
|
9 |
-
|
10 |
-
_EXECUTABLE_NAMES = [
|
11 |
-
"pip",
|
12 |
-
f"pip{sys.version_info.major}",
|
13 |
-
f"pip{sys.version_info.major}.{sys.version_info.minor}",
|
14 |
-
]
|
15 |
-
if WINDOWS:
|
16 |
-
_allowed_extensions = {"", ".exe"}
|
17 |
-
_EXECUTABLE_NAMES = [
|
18 |
-
"".join(parts)
|
19 |
-
for parts in itertools.product(_EXECUTABLE_NAMES, _allowed_extensions)
|
20 |
-
]
|
21 |
-
|
22 |
-
|
23 |
-
def _wrapper(args: Optional[List[str]] = None) -> int:
|
24 |
-
"""Central wrapper for all old entrypoints.
|
25 |
-
|
26 |
-
Historically pip has had several entrypoints defined. Because of issues
|
27 |
-
arising from PATH, sys.path, multiple Pythons, their interactions, and most
|
28 |
-
of them having a pip installed, users suffer every time an entrypoint gets
|
29 |
-
moved.
|
30 |
-
|
31 |
-
To alleviate this pain, and provide a mechanism for warning users and
|
32 |
-
directing them to an appropriate place for help, we now define all of
|
33 |
-
our old entrypoints as wrappers for the current one.
|
34 |
-
"""
|
35 |
-
sys.stderr.write(
|
36 |
-
"WARNING: pip is being invoked by an old script wrapper. This will "
|
37 |
-
"fail in a future version of pip.\n"
|
38 |
-
"Please see https://github.com/pypa/pip/issues/5599 for advice on "
|
39 |
-
"fixing the underlying issue.\n"
|
40 |
-
"To avoid this problem you can invoke Python with '-m pip' instead of "
|
41 |
-
"running pip directly.\n"
|
42 |
-
)
|
43 |
-
return main(args)
|
44 |
-
|
45 |
-
|
46 |
-
def get_best_invocation_for_this_pip() -> str:
|
47 |
-
"""Try to figure out the best way to invoke pip in the current environment."""
|
48 |
-
binary_directory = "Scripts" if WINDOWS else "bin"
|
49 |
-
binary_prefix = os.path.join(sys.prefix, binary_directory)
|
50 |
-
|
51 |
-
# Try to use pip[X[.Y]] names, if those executables for this environment are
|
52 |
-
# the first on PATH with that name.
|
53 |
-
path_parts = os.path.normcase(os.environ.get("PATH", "")).split(os.pathsep)
|
54 |
-
exe_are_in_PATH = os.path.normcase(binary_prefix) in path_parts
|
55 |
-
if exe_are_in_PATH:
|
56 |
-
for exe_name in _EXECUTABLE_NAMES:
|
57 |
-
found_executable = shutil.which(exe_name)
|
58 |
-
binary_executable = os.path.join(binary_prefix, exe_name)
|
59 |
-
if (
|
60 |
-
found_executable
|
61 |
-
and os.path.exists(binary_executable)
|
62 |
-
and os.path.samefile(
|
63 |
-
found_executable,
|
64 |
-
binary_executable,
|
65 |
-
)
|
66 |
-
):
|
67 |
-
return exe_name
|
68 |
-
|
69 |
-
# Use the `-m` invocation, if there's no "nice" invocation.
|
70 |
-
return f"{get_best_invocation_for_this_python()} -m pip"
|
71 |
-
|
72 |
-
|
73 |
-
def get_best_invocation_for_this_python() -> str:
|
74 |
-
"""Try to figure out the best way to invoke the current Python."""
|
75 |
-
exe = sys.executable
|
76 |
-
exe_name = os.path.basename(exe)
|
77 |
-
|
78 |
-
# Try to use the basename, if it's the first executable.
|
79 |
-
found_executable = shutil.which(exe_name)
|
80 |
-
if found_executable and os.path.samefile(found_executable, exe):
|
81 |
-
return exe_name
|
82 |
-
|
83 |
-
# Use the full executable name, because we couldn't find something simpler.
|
84 |
-
return exe
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/cachecontrol/adapter.py
DELETED
@@ -1,137 +0,0 @@
|
|
1 |
-
# SPDX-FileCopyrightText: 2015 Eric Larson
|
2 |
-
#
|
3 |
-
# SPDX-License-Identifier: Apache-2.0
|
4 |
-
|
5 |
-
import types
|
6 |
-
import functools
|
7 |
-
import zlib
|
8 |
-
|
9 |
-
from pip._vendor.requests.adapters import HTTPAdapter
|
10 |
-
|
11 |
-
from .controller import CacheController, PERMANENT_REDIRECT_STATUSES
|
12 |
-
from .cache import DictCache
|
13 |
-
from .filewrapper import CallbackFileWrapper
|
14 |
-
|
15 |
-
|
16 |
-
class CacheControlAdapter(HTTPAdapter):
|
17 |
-
invalidating_methods = {"PUT", "PATCH", "DELETE"}
|
18 |
-
|
19 |
-
def __init__(
|
20 |
-
self,
|
21 |
-
cache=None,
|
22 |
-
cache_etags=True,
|
23 |
-
controller_class=None,
|
24 |
-
serializer=None,
|
25 |
-
heuristic=None,
|
26 |
-
cacheable_methods=None,
|
27 |
-
*args,
|
28 |
-
**kw
|
29 |
-
):
|
30 |
-
super(CacheControlAdapter, self).__init__(*args, **kw)
|
31 |
-
self.cache = DictCache() if cache is None else cache
|
32 |
-
self.heuristic = heuristic
|
33 |
-
self.cacheable_methods = cacheable_methods or ("GET",)
|
34 |
-
|
35 |
-
controller_factory = controller_class or CacheController
|
36 |
-
self.controller = controller_factory(
|
37 |
-
self.cache, cache_etags=cache_etags, serializer=serializer
|
38 |
-
)
|
39 |
-
|
40 |
-
def send(self, request, cacheable_methods=None, **kw):
|
41 |
-
"""
|
42 |
-
Send a request. Use the request information to see if it
|
43 |
-
exists in the cache and cache the response if we need to and can.
|
44 |
-
"""
|
45 |
-
cacheable = cacheable_methods or self.cacheable_methods
|
46 |
-
if request.method in cacheable:
|
47 |
-
try:
|
48 |
-
cached_response = self.controller.cached_request(request)
|
49 |
-
except zlib.error:
|
50 |
-
cached_response = None
|
51 |
-
if cached_response:
|
52 |
-
return self.build_response(request, cached_response, from_cache=True)
|
53 |
-
|
54 |
-
# check for etags and add headers if appropriate
|
55 |
-
request.headers.update(self.controller.conditional_headers(request))
|
56 |
-
|
57 |
-
resp = super(CacheControlAdapter, self).send(request, **kw)
|
58 |
-
|
59 |
-
return resp
|
60 |
-
|
61 |
-
def build_response(
|
62 |
-
self, request, response, from_cache=False, cacheable_methods=None
|
63 |
-
):
|
64 |
-
"""
|
65 |
-
Build a response by making a request or using the cache.
|
66 |
-
|
67 |
-
This will end up calling send and returning a potentially
|
68 |
-
cached response
|
69 |
-
"""
|
70 |
-
cacheable = cacheable_methods or self.cacheable_methods
|
71 |
-
if not from_cache and request.method in cacheable:
|
72 |
-
# Check for any heuristics that might update headers
|
73 |
-
# before trying to cache.
|
74 |
-
if self.heuristic:
|
75 |
-
response = self.heuristic.apply(response)
|
76 |
-
|
77 |
-
# apply any expiration heuristics
|
78 |
-
if response.status == 304:
|
79 |
-
# We must have sent an ETag request. This could mean
|
80 |
-
# that we've been expired already or that we simply
|
81 |
-
# have an etag. In either case, we want to try and
|
82 |
-
# update the cache if that is the case.
|
83 |
-
cached_response = self.controller.update_cached_response(
|
84 |
-
request, response
|
85 |
-
)
|
86 |
-
|
87 |
-
if cached_response is not response:
|
88 |
-
from_cache = True
|
89 |
-
|
90 |
-
# We are done with the server response, read a
|
91 |
-
# possible response body (compliant servers will
|
92 |
-
# not return one, but we cannot be 100% sure) and
|
93 |
-
# release the connection back to the pool.
|
94 |
-
response.read(decode_content=False)
|
95 |
-
response.release_conn()
|
96 |
-
|
97 |
-
response = cached_response
|
98 |
-
|
99 |
-
# We always cache the 301 responses
|
100 |
-
elif int(response.status) in PERMANENT_REDIRECT_STATUSES:
|
101 |
-
self.controller.cache_response(request, response)
|
102 |
-
else:
|
103 |
-
# Wrap the response file with a wrapper that will cache the
|
104 |
-
# response when the stream has been consumed.
|
105 |
-
response._fp = CallbackFileWrapper(
|
106 |
-
response._fp,
|
107 |
-
functools.partial(
|
108 |
-
self.controller.cache_response, request, response
|
109 |
-
),
|
110 |
-
)
|
111 |
-
if response.chunked:
|
112 |
-
super_update_chunk_length = response._update_chunk_length
|
113 |
-
|
114 |
-
def _update_chunk_length(self):
|
115 |
-
super_update_chunk_length()
|
116 |
-
if self.chunk_left == 0:
|
117 |
-
self._fp._close()
|
118 |
-
|
119 |
-
response._update_chunk_length = types.MethodType(
|
120 |
-
_update_chunk_length, response
|
121 |
-
)
|
122 |
-
|
123 |
-
resp = super(CacheControlAdapter, self).build_response(request, response)
|
124 |
-
|
125 |
-
# See if we should invalidate the cache.
|
126 |
-
if request.method in self.invalidating_methods and resp.ok:
|
127 |
-
cache_url = self.controller.cache_url(request.url)
|
128 |
-
self.cache.delete(cache_url)
|
129 |
-
|
130 |
-
# Give the request a from_cache attr to let people use it
|
131 |
-
resp.from_cache = from_cache
|
132 |
-
|
133 |
-
return resp
|
134 |
-
|
135 |
-
def close(self):
|
136 |
-
self.cache.close()
|
137 |
-
super(CacheControlAdapter, self).close()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Audio-AGI/AudioSep/models/CLAP/training/zero_shot.py
DELETED
@@ -1,95 +0,0 @@
|
|
1 |
-
# NOTE: This script is currently not supported for CLAP.
|
2 |
-
import logging
|
3 |
-
from contextlib import suppress
|
4 |
-
|
5 |
-
import torch
|
6 |
-
import torch.nn.functional as F
|
7 |
-
from tqdm import tqdm
|
8 |
-
|
9 |
-
from open_clip import tokenize
|
10 |
-
from .imagenet_zeroshot_data import imagenet_classnames, openai_imagenet_template
|
11 |
-
|
12 |
-
|
13 |
-
def zero_shot_classifier(model, classnames, templates, args):
|
14 |
-
with torch.no_grad():
|
15 |
-
zeroshot_weights = []
|
16 |
-
for classname in tqdm(classnames):
|
17 |
-
texts = [template(classname) for template in templates] # format with class
|
18 |
-
texts = tokenize(texts).to(args.device) # tokenize
|
19 |
-
if args.distributed and not args.horovod:
|
20 |
-
class_embeddings = model.module.encode_text(texts)
|
21 |
-
else:
|
22 |
-
class_embeddings = model.encode_text(texts)
|
23 |
-
class_embedding = F.normalize(class_embeddings, dim=-1).mean(dim=0)
|
24 |
-
class_embedding /= class_embedding.norm()
|
25 |
-
zeroshot_weights.append(class_embedding)
|
26 |
-
zeroshot_weights = torch.stack(zeroshot_weights, dim=1).to(args.device)
|
27 |
-
return zeroshot_weights
|
28 |
-
|
29 |
-
|
30 |
-
def accuracy(output, target, topk=(1,)):
|
31 |
-
pred = output.topk(max(topk), 1, True, True)[1].t()
|
32 |
-
correct = pred.eq(target.view(1, -1).expand_as(pred))
|
33 |
-
return [
|
34 |
-
float(correct[:k].reshape(-1).float().sum(0, keepdim=True).cpu().numpy())
|
35 |
-
for k in topk
|
36 |
-
]
|
37 |
-
|
38 |
-
|
39 |
-
def run(model, classifier, dataloader, args):
|
40 |
-
autocast = torch.cuda.amp.autocast if args.precision == "amp" else suppress
|
41 |
-
with torch.no_grad():
|
42 |
-
top1, top5, n = 0.0, 0.0, 0.0
|
43 |
-
for images, target in tqdm(dataloader, unit_scale=args.batch_size):
|
44 |
-
images = images.to(args.device)
|
45 |
-
target = target.to(args.device)
|
46 |
-
|
47 |
-
with autocast():
|
48 |
-
# predict
|
49 |
-
if args.distributed and not args.horovod:
|
50 |
-
image_features = model.module.encode_image(images)
|
51 |
-
else:
|
52 |
-
image_features = model.encode_image(images)
|
53 |
-
image_features = F.normalize(image_features, dim=-1)
|
54 |
-
logits = 100.0 * image_features @ classifier
|
55 |
-
|
56 |
-
# measure accuracy
|
57 |
-
acc1, acc5 = accuracy(logits, target, topk=(1, 5))
|
58 |
-
top1 += acc1
|
59 |
-
top5 += acc5
|
60 |
-
n += images.size(0)
|
61 |
-
|
62 |
-
top1 = top1 / n
|
63 |
-
top5 = top5 / n
|
64 |
-
return top1, top5
|
65 |
-
|
66 |
-
|
67 |
-
def zero_shot_eval(model, data, epoch, args):
|
68 |
-
if "imagenet-val" not in data and "imagenet-v2" not in data:
|
69 |
-
return {}
|
70 |
-
if args.zeroshot_frequency == 0:
|
71 |
-
return {}
|
72 |
-
if (epoch % args.zeroshot_frequency) != 0 and epoch != args.epochs:
|
73 |
-
return {}
|
74 |
-
|
75 |
-
logging.info("Starting zero-shot imagenet.")
|
76 |
-
|
77 |
-
logging.info("Building zero-shot classifier")
|
78 |
-
classifier = zero_shot_classifier(
|
79 |
-
model, imagenet_classnames, openai_imagenet_template, args
|
80 |
-
)
|
81 |
-
|
82 |
-
logging.info("Using classifier")
|
83 |
-
results = {}
|
84 |
-
if "imagenet-val" in data:
|
85 |
-
top1, top5 = run(model, classifier, data["imagenet-val"].dataloader, args)
|
86 |
-
results["imagenet-zeroshot-val-top1"] = top1
|
87 |
-
results["imagenet-zeroshot-val-top5"] = top5
|
88 |
-
if "imagenet-v2" in data:
|
89 |
-
top1, top5 = run(model, classifier, data["imagenet-v2"].dataloader, args)
|
90 |
-
results["imagenetv2-zeroshot-val-top1"] = top1
|
91 |
-
results["imagenetv2-zeroshot-val-top5"] = top5
|
92 |
-
|
93 |
-
logging.info("Finished zero-shot imagenet.")
|
94 |
-
|
95 |
-
return results
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cpu.cpp
DELETED
@@ -1,522 +0,0 @@
|
|
1 |
-
// Copyright (c) Facebook, Inc. and its affiliates.
|
2 |
-
#include <ATen/TensorUtils.h>
|
3 |
-
#include "ROIAlignRotated.h"
|
4 |
-
|
5 |
-
// Note: this implementation originates from the Caffe2 ROIAlignRotated Op
|
6 |
-
// and PyTorch ROIAlign (non-rotated) Op implementations.
|
7 |
-
// The key difference between this implementation and those ones is
|
8 |
-
// we don't do "legacy offset" in this version, as there aren't many previous
|
9 |
-
// works, if any, using the "legacy" ROIAlignRotated Op.
|
10 |
-
// This would make the interface a bit cleaner.
|
11 |
-
|
12 |
-
namespace detectron2 {
|
13 |
-
|
14 |
-
namespace {
|
15 |
-
template <typename T>
|
16 |
-
struct PreCalc {
|
17 |
-
int pos1;
|
18 |
-
int pos2;
|
19 |
-
int pos3;
|
20 |
-
int pos4;
|
21 |
-
T w1;
|
22 |
-
T w2;
|
23 |
-
T w3;
|
24 |
-
T w4;
|
25 |
-
};
|
26 |
-
|
27 |
-
template <typename T>
|
28 |
-
void pre_calc_for_bilinear_interpolate(
|
29 |
-
const int height,
|
30 |
-
const int width,
|
31 |
-
const int pooled_height,
|
32 |
-
const int pooled_width,
|
33 |
-
const int iy_upper,
|
34 |
-
const int ix_upper,
|
35 |
-
T roi_start_h,
|
36 |
-
T roi_start_w,
|
37 |
-
T bin_size_h,
|
38 |
-
T bin_size_w,
|
39 |
-
int roi_bin_grid_h,
|
40 |
-
int roi_bin_grid_w,
|
41 |
-
T roi_center_h,
|
42 |
-
T roi_center_w,
|
43 |
-
T cos_theta,
|
44 |
-
T sin_theta,
|
45 |
-
std::vector<PreCalc<T>>& pre_calc) {
|
46 |
-
int pre_calc_index = 0;
|
47 |
-
for (int ph = 0; ph < pooled_height; ph++) {
|
48 |
-
for (int pw = 0; pw < pooled_width; pw++) {
|
49 |
-
for (int iy = 0; iy < iy_upper; iy++) {
|
50 |
-
const T yy = roi_start_h + ph * bin_size_h +
|
51 |
-
static_cast<T>(iy + .5f) * bin_size_h /
|
52 |
-
static_cast<T>(roi_bin_grid_h); // e.g., 0.5, 1.5
|
53 |
-
for (int ix = 0; ix < ix_upper; ix++) {
|
54 |
-
const T xx = roi_start_w + pw * bin_size_w +
|
55 |
-
static_cast<T>(ix + .5f) * bin_size_w /
|
56 |
-
static_cast<T>(roi_bin_grid_w);
|
57 |
-
|
58 |
-
// Rotate by theta around the center and translate
|
59 |
-
// In image space, (y, x) is the order for Right Handed System,
|
60 |
-
// and this is essentially multiplying the point by a rotation matrix
|
61 |
-
// to rotate it counterclockwise through angle theta.
|
62 |
-
T y = yy * cos_theta - xx * sin_theta + roi_center_h;
|
63 |
-
T x = yy * sin_theta + xx * cos_theta + roi_center_w;
|
64 |
-
// deal with: inverse elements are out of feature map boundary
|
65 |
-
if (y < -1.0 || y > height || x < -1.0 || x > width) {
|
66 |
-
// empty
|
67 |
-
PreCalc<T> pc;
|
68 |
-
pc.pos1 = 0;
|
69 |
-
pc.pos2 = 0;
|
70 |
-
pc.pos3 = 0;
|
71 |
-
pc.pos4 = 0;
|
72 |
-
pc.w1 = 0;
|
73 |
-
pc.w2 = 0;
|
74 |
-
pc.w3 = 0;
|
75 |
-
pc.w4 = 0;
|
76 |
-
pre_calc[pre_calc_index] = pc;
|
77 |
-
pre_calc_index += 1;
|
78 |
-
continue;
|
79 |
-
}
|
80 |
-
|
81 |
-
if (y < 0) {
|
82 |
-
y = 0;
|
83 |
-
}
|
84 |
-
if (x < 0) {
|
85 |
-
x = 0;
|
86 |
-
}
|
87 |
-
|
88 |
-
int y_low = (int)y;
|
89 |
-
int x_low = (int)x;
|
90 |
-
int y_high;
|
91 |
-
int x_high;
|
92 |
-
|
93 |
-
if (y_low >= height - 1) {
|
94 |
-
y_high = y_low = height - 1;
|
95 |
-
y = (T)y_low;
|
96 |
-
} else {
|
97 |
-
y_high = y_low + 1;
|
98 |
-
}
|
99 |
-
|
100 |
-
if (x_low >= width - 1) {
|
101 |
-
x_high = x_low = width - 1;
|
102 |
-
x = (T)x_low;
|
103 |
-
} else {
|
104 |
-
x_high = x_low + 1;
|
105 |
-
}
|
106 |
-
|
107 |
-
T ly = y - y_low;
|
108 |
-
T lx = x - x_low;
|
109 |
-
T hy = 1. - ly, hx = 1. - lx;
|
110 |
-
T w1 = hy * hx, w2 = hy * lx, w3 = ly * hx, w4 = ly * lx;
|
111 |
-
|
112 |
-
// save weights and indices
|
113 |
-
PreCalc<T> pc;
|
114 |
-
pc.pos1 = y_low * width + x_low;
|
115 |
-
pc.pos2 = y_low * width + x_high;
|
116 |
-
pc.pos3 = y_high * width + x_low;
|
117 |
-
pc.pos4 = y_high * width + x_high;
|
118 |
-
pc.w1 = w1;
|
119 |
-
pc.w2 = w2;
|
120 |
-
pc.w3 = w3;
|
121 |
-
pc.w4 = w4;
|
122 |
-
pre_calc[pre_calc_index] = pc;
|
123 |
-
|
124 |
-
pre_calc_index += 1;
|
125 |
-
}
|
126 |
-
}
|
127 |
-
}
|
128 |
-
}
|
129 |
-
}
|
130 |
-
|
131 |
-
template <typename T>
|
132 |
-
void bilinear_interpolate_gradient(
|
133 |
-
const int height,
|
134 |
-
const int width,
|
135 |
-
T y,
|
136 |
-
T x,
|
137 |
-
T& w1,
|
138 |
-
T& w2,
|
139 |
-
T& w3,
|
140 |
-
T& w4,
|
141 |
-
int& x_low,
|
142 |
-
int& x_high,
|
143 |
-
int& y_low,
|
144 |
-
int& y_high) {
|
145 |
-
// deal with cases that inverse elements are out of feature map boundary
|
146 |
-
if (y < -1.0 || y > height || x < -1.0 || x > width) {
|
147 |
-
// empty
|
148 |
-
w1 = w2 = w3 = w4 = 0.;
|
149 |
-
x_low = x_high = y_low = y_high = -1;
|
150 |
-
return;
|
151 |
-
}
|
152 |
-
|
153 |
-
if (y < 0) {
|
154 |
-
y = 0;
|
155 |
-
}
|
156 |
-
|
157 |
-
if (x < 0) {
|
158 |
-
x = 0;
|
159 |
-
}
|
160 |
-
|
161 |
-
y_low = (int)y;
|
162 |
-
x_low = (int)x;
|
163 |
-
|
164 |
-
if (y_low >= height - 1) {
|
165 |
-
y_high = y_low = height - 1;
|
166 |
-
y = (T)y_low;
|
167 |
-
} else {
|
168 |
-
y_high = y_low + 1;
|
169 |
-
}
|
170 |
-
|
171 |
-
if (x_low >= width - 1) {
|
172 |
-
x_high = x_low = width - 1;
|
173 |
-
x = (T)x_low;
|
174 |
-
} else {
|
175 |
-
x_high = x_low + 1;
|
176 |
-
}
|
177 |
-
|
178 |
-
T ly = y - y_low;
|
179 |
-
T lx = x - x_low;
|
180 |
-
T hy = 1. - ly, hx = 1. - lx;
|
181 |
-
|
182 |
-
// reference in forward
|
183 |
-
// T v1 = input[y_low * width + x_low];
|
184 |
-
// T v2 = input[y_low * width + x_high];
|
185 |
-
// T v3 = input[y_high * width + x_low];
|
186 |
-
// T v4 = input[y_high * width + x_high];
|
187 |
-
// T val = (w1 * v1 + w2 * v2 + w3 * v3 + w4 * v4);
|
188 |
-
|
189 |
-
w1 = hy * hx, w2 = hy * lx, w3 = ly * hx, w4 = ly * lx;
|
190 |
-
|
191 |
-
return;
|
192 |
-
}
|
193 |
-
|
194 |
-
template <class T>
|
195 |
-
inline void add(T* address, const T& val) {
|
196 |
-
*address += val;
|
197 |
-
}
|
198 |
-
|
199 |
-
} // namespace
|
200 |
-
|
201 |
-
template <typename T>
|
202 |
-
void ROIAlignRotatedForward(
|
203 |
-
const int nthreads,
|
204 |
-
const T* input,
|
205 |
-
const T& spatial_scale,
|
206 |
-
const int channels,
|
207 |
-
const int height,
|
208 |
-
const int width,
|
209 |
-
const int pooled_height,
|
210 |
-
const int pooled_width,
|
211 |
-
const int sampling_ratio,
|
212 |
-
const T* rois,
|
213 |
-
T* output) {
|
214 |
-
int n_rois = nthreads / channels / pooled_width / pooled_height;
|
215 |
-
// (n, c, ph, pw) is an element in the pooled output
|
216 |
-
// can be parallelized using omp
|
217 |
-
// #pragma omp parallel for num_threads(32)
|
218 |
-
for (int n = 0; n < n_rois; n++) {
|
219 |
-
int index_n = n * channels * pooled_width * pooled_height;
|
220 |
-
|
221 |
-
const T* current_roi = rois + n * 6;
|
222 |
-
int roi_batch_ind = current_roi[0];
|
223 |
-
|
224 |
-
// Do not use rounding; this implementation detail is critical
|
225 |
-
// ROIAlignRotated supports align == true, i.e., continuous coordinate
|
226 |
-
// by default, thus the 0.5 offset
|
227 |
-
T offset = (T)0.5;
|
228 |
-
T roi_center_w = current_roi[1] * spatial_scale - offset;
|
229 |
-
T roi_center_h = current_roi[2] * spatial_scale - offset;
|
230 |
-
T roi_width = current_roi[3] * spatial_scale;
|
231 |
-
T roi_height = current_roi[4] * spatial_scale;
|
232 |
-
T theta = current_roi[5] * M_PI / 180.0;
|
233 |
-
T cos_theta = cos(theta);
|
234 |
-
T sin_theta = sin(theta);
|
235 |
-
|
236 |
-
AT_ASSERTM(
|
237 |
-
roi_width >= 0 && roi_height >= 0,
|
238 |
-
"ROIs in ROIAlignRotated do not have non-negative size!");
|
239 |
-
|
240 |
-
T bin_size_h = static_cast<T>(roi_height) / static_cast<T>(pooled_height);
|
241 |
-
T bin_size_w = static_cast<T>(roi_width) / static_cast<T>(pooled_width);
|
242 |
-
|
243 |
-
// We use roi_bin_grid to sample the grid and mimic integral
|
244 |
-
int roi_bin_grid_h = (sampling_ratio > 0)
|
245 |
-
? sampling_ratio
|
246 |
-
: ceil(roi_height / pooled_height); // e.g., = 2
|
247 |
-
int roi_bin_grid_w =
|
248 |
-
(sampling_ratio > 0) ? sampling_ratio : ceil(roi_width / pooled_width);
|
249 |
-
|
250 |
-
// We do average (integral) pooling inside a bin
|
251 |
-
const T count = std::max(roi_bin_grid_h * roi_bin_grid_w, 1); // e.g. = 4
|
252 |
-
|
253 |
-
// we want to precalculate indices and weights shared by all channels,
|
254 |
-
// this is the key point of optimization
|
255 |
-
std::vector<PreCalc<T>> pre_calc(
|
256 |
-
roi_bin_grid_h * roi_bin_grid_w * pooled_width * pooled_height);
|
257 |
-
|
258 |
-
// roi_start_h and roi_start_w are computed wrt the center of RoI (x, y).
|
259 |
-
// Appropriate translation needs to be applied after.
|
260 |
-
T roi_start_h = -roi_height / 2.0;
|
261 |
-
T roi_start_w = -roi_width / 2.0;
|
262 |
-
|
263 |
-
pre_calc_for_bilinear_interpolate(
|
264 |
-
height,
|
265 |
-
width,
|
266 |
-
pooled_height,
|
267 |
-
pooled_width,
|
268 |
-
roi_bin_grid_h,
|
269 |
-
roi_bin_grid_w,
|
270 |
-
roi_start_h,
|
271 |
-
roi_start_w,
|
272 |
-
bin_size_h,
|
273 |
-
bin_size_w,
|
274 |
-
roi_bin_grid_h,
|
275 |
-
roi_bin_grid_w,
|
276 |
-
roi_center_h,
|
277 |
-
roi_center_w,
|
278 |
-
cos_theta,
|
279 |
-
sin_theta,
|
280 |
-
pre_calc);
|
281 |
-
|
282 |
-
for (int c = 0; c < channels; c++) {
|
283 |
-
int index_n_c = index_n + c * pooled_width * pooled_height;
|
284 |
-
const T* offset_input =
|
285 |
-
input + (roi_batch_ind * channels + c) * height * width;
|
286 |
-
int pre_calc_index = 0;
|
287 |
-
|
288 |
-
for (int ph = 0; ph < pooled_height; ph++) {
|
289 |
-
for (int pw = 0; pw < pooled_width; pw++) {
|
290 |
-
int index = index_n_c + ph * pooled_width + pw;
|
291 |
-
|
292 |
-
T output_val = 0.;
|
293 |
-
for (int iy = 0; iy < roi_bin_grid_h; iy++) {
|
294 |
-
for (int ix = 0; ix < roi_bin_grid_w; ix++) {
|
295 |
-
PreCalc<T> pc = pre_calc[pre_calc_index];
|
296 |
-
output_val += pc.w1 * offset_input[pc.pos1] +
|
297 |
-
pc.w2 * offset_input[pc.pos2] +
|
298 |
-
pc.w3 * offset_input[pc.pos3] + pc.w4 * offset_input[pc.pos4];
|
299 |
-
|
300 |
-
pre_calc_index += 1;
|
301 |
-
}
|
302 |
-
}
|
303 |
-
output_val /= count;
|
304 |
-
|
305 |
-
output[index] = output_val;
|
306 |
-
} // for pw
|
307 |
-
} // for ph
|
308 |
-
} // for c
|
309 |
-
} // for n
|
310 |
-
}
|
311 |
-
|
312 |
-
template <typename T>
|
313 |
-
void ROIAlignRotatedBackward(
|
314 |
-
const int nthreads,
|
315 |
-
// may not be contiguous. should index using n_stride, etc
|
316 |
-
const T* grad_output,
|
317 |
-
const T& spatial_scale,
|
318 |
-
const int channels,
|
319 |
-
const int height,
|
320 |
-
const int width,
|
321 |
-
const int pooled_height,
|
322 |
-
const int pooled_width,
|
323 |
-
const int sampling_ratio,
|
324 |
-
T* grad_input,
|
325 |
-
const T* rois,
|
326 |
-
const int n_stride,
|
327 |
-
const int c_stride,
|
328 |
-
const int h_stride,
|
329 |
-
const int w_stride) {
|
330 |
-
for (int index = 0; index < nthreads; index++) {
|
331 |
-
// (n, c, ph, pw) is an element in the pooled output
|
332 |
-
int pw = index % pooled_width;
|
333 |
-
int ph = (index / pooled_width) % pooled_height;
|
334 |
-
int c = (index / pooled_width / pooled_height) % channels;
|
335 |
-
int n = index / pooled_width / pooled_height / channels;
|
336 |
-
|
337 |
-
const T* current_roi = rois + n * 6;
|
338 |
-
int roi_batch_ind = current_roi[0];
|
339 |
-
|
340 |
-
// Do not use rounding; this implementation detail is critical
|
341 |
-
// ROIAlignRotated supports align == true, i.e., continuous coordinate
|
342 |
-
// by default, thus the 0.5 offset
|
343 |
-
T offset = (T)0.5;
|
344 |
-
T roi_center_w = current_roi[1] * spatial_scale - offset;
|
345 |
-
T roi_center_h = current_roi[2] * spatial_scale - offset;
|
346 |
-
T roi_width = current_roi[3] * spatial_scale;
|
347 |
-
T roi_height = current_roi[4] * spatial_scale;
|
348 |
-
T theta = current_roi[5] * M_PI / 180.0;
|
349 |
-
T cos_theta = cos(theta);
|
350 |
-
T sin_theta = sin(theta);
|
351 |
-
|
352 |
-
AT_ASSERTM(
|
353 |
-
roi_width >= 0 && roi_height >= 0,
|
354 |
-
"ROIs in ROIAlignRotated do not have non-negative size!");
|
355 |
-
|
356 |
-
T bin_size_h = static_cast<T>(roi_height) / static_cast<T>(pooled_height);
|
357 |
-
T bin_size_w = static_cast<T>(roi_width) / static_cast<T>(pooled_width);
|
358 |
-
|
359 |
-
T* offset_grad_input =
|
360 |
-
grad_input + ((roi_batch_ind * channels + c) * height * width);
|
361 |
-
|
362 |
-
int output_offset = n * n_stride + c * c_stride;
|
363 |
-
const T* offset_grad_output = grad_output + output_offset;
|
364 |
-
const T grad_output_this_bin =
|
365 |
-
offset_grad_output[ph * h_stride + pw * w_stride];
|
366 |
-
|
367 |
-
// We use roi_bin_grid to sample the grid and mimic integral
|
368 |
-
int roi_bin_grid_h = (sampling_ratio > 0)
|
369 |
-
? sampling_ratio
|
370 |
-
: ceil(roi_height / pooled_height); // e.g., = 2
|
371 |
-
int roi_bin_grid_w =
|
372 |
-
(sampling_ratio > 0) ? sampling_ratio : ceil(roi_width / pooled_width);
|
373 |
-
|
374 |
-
// roi_start_h and roi_start_w are computed wrt the center of RoI (x, y).
|
375 |
-
// Appropriate translation needs to be applied after.
|
376 |
-
T roi_start_h = -roi_height / 2.0;
|
377 |
-
T roi_start_w = -roi_width / 2.0;
|
378 |
-
|
379 |
-
// We do average (integral) pooling inside a bin
|
380 |
-
const T count = roi_bin_grid_h * roi_bin_grid_w; // e.g. = 4
|
381 |
-
|
382 |
-
for (int iy = 0; iy < roi_bin_grid_h; iy++) {
|
383 |
-
const T yy = roi_start_h + ph * bin_size_h +
|
384 |
-
static_cast<T>(iy + .5f) * bin_size_h /
|
385 |
-
static_cast<T>(roi_bin_grid_h); // e.g., 0.5, 1.5
|
386 |
-
for (int ix = 0; ix < roi_bin_grid_w; ix++) {
|
387 |
-
const T xx = roi_start_w + pw * bin_size_w +
|
388 |
-
static_cast<T>(ix + .5f) * bin_size_w /
|
389 |
-
static_cast<T>(roi_bin_grid_w);
|
390 |
-
|
391 |
-
// Rotate by theta around the center and translate
|
392 |
-
T y = yy * cos_theta - xx * sin_theta + roi_center_h;
|
393 |
-
T x = yy * sin_theta + xx * cos_theta + roi_center_w;
|
394 |
-
|
395 |
-
T w1, w2, w3, w4;
|
396 |
-
int x_low, x_high, y_low, y_high;
|
397 |
-
|
398 |
-
bilinear_interpolate_gradient(
|
399 |
-
height, width, y, x, w1, w2, w3, w4, x_low, x_high, y_low, y_high);
|
400 |
-
|
401 |
-
T g1 = grad_output_this_bin * w1 / count;
|
402 |
-
T g2 = grad_output_this_bin * w2 / count;
|
403 |
-
T g3 = grad_output_this_bin * w3 / count;
|
404 |
-
T g4 = grad_output_this_bin * w4 / count;
|
405 |
-
|
406 |
-
if (x_low >= 0 && x_high >= 0 && y_low >= 0 && y_high >= 0) {
|
407 |
-
// atomic add is not needed for now since it is single threaded
|
408 |
-
add(offset_grad_input + y_low * width + x_low, static_cast<T>(g1));
|
409 |
-
add(offset_grad_input + y_low * width + x_high, static_cast<T>(g2));
|
410 |
-
add(offset_grad_input + y_high * width + x_low, static_cast<T>(g3));
|
411 |
-
add(offset_grad_input + y_high * width + x_high, static_cast<T>(g4));
|
412 |
-
} // if
|
413 |
-
} // ix
|
414 |
-
} // iy
|
415 |
-
} // for
|
416 |
-
} // ROIAlignRotatedBackward
|
417 |
-
|
418 |
-
at::Tensor ROIAlignRotated_forward_cpu(
|
419 |
-
const at::Tensor& input,
|
420 |
-
const at::Tensor& rois,
|
421 |
-
const float spatial_scale,
|
422 |
-
const int pooled_height,
|
423 |
-
const int pooled_width,
|
424 |
-
const int sampling_ratio) {
|
425 |
-
AT_ASSERTM(input.device().is_cpu(), "input must be a CPU tensor");
|
426 |
-
AT_ASSERTM(rois.device().is_cpu(), "rois must be a CPU tensor");
|
427 |
-
|
428 |
-
at::TensorArg input_t{input, "input", 1}, rois_t{rois, "rois", 2};
|
429 |
-
|
430 |
-
at::CheckedFrom c = "ROIAlign_forward_cpu";
|
431 |
-
at::checkAllSameType(c, {input_t, rois_t});
|
432 |
-
|
433 |
-
auto num_rois = rois.size(0);
|
434 |
-
auto channels = input.size(1);
|
435 |
-
auto height = input.size(2);
|
436 |
-
auto width = input.size(3);
|
437 |
-
|
438 |
-
at::Tensor output = at::zeros(
|
439 |
-
{num_rois, channels, pooled_height, pooled_width}, input.options());
|
440 |
-
|
441 |
-
auto output_size = num_rois * pooled_height * pooled_width * channels;
|
442 |
-
|
443 |
-
if (output.numel() == 0) {
|
444 |
-
return output;
|
445 |
-
}
|
446 |
-
|
447 |
-
auto input_ = input.contiguous(), rois_ = rois.contiguous();
|
448 |
-
AT_DISPATCH_FLOATING_TYPES_AND_HALF(
|
449 |
-
input.scalar_type(), "ROIAlignRotated_forward", [&] {
|
450 |
-
ROIAlignRotatedForward<scalar_t>(
|
451 |
-
output_size,
|
452 |
-
input_.data_ptr<scalar_t>(),
|
453 |
-
spatial_scale,
|
454 |
-
channels,
|
455 |
-
height,
|
456 |
-
width,
|
457 |
-
pooled_height,
|
458 |
-
pooled_width,
|
459 |
-
sampling_ratio,
|
460 |
-
rois_.data_ptr<scalar_t>(),
|
461 |
-
output.data_ptr<scalar_t>());
|
462 |
-
});
|
463 |
-
return output;
|
464 |
-
}
|
465 |
-
|
466 |
-
at::Tensor ROIAlignRotated_backward_cpu(
|
467 |
-
const at::Tensor& grad,
|
468 |
-
const at::Tensor& rois,
|
469 |
-
const float spatial_scale,
|
470 |
-
const int pooled_height,
|
471 |
-
const int pooled_width,
|
472 |
-
const int batch_size,
|
473 |
-
const int channels,
|
474 |
-
const int height,
|
475 |
-
const int width,
|
476 |
-
const int sampling_ratio) {
|
477 |
-
AT_ASSERTM(grad.device().is_cpu(), "grad must be a CPU tensor");
|
478 |
-
AT_ASSERTM(rois.device().is_cpu(), "rois must be a CPU tensor");
|
479 |
-
|
480 |
-
at::TensorArg grad_t{grad, "grad", 1}, rois_t{rois, "rois", 2};
|
481 |
-
|
482 |
-
at::CheckedFrom c = "ROIAlignRotated_backward_cpu";
|
483 |
-
at::checkAllSameType(c, {grad_t, rois_t});
|
484 |
-
|
485 |
-
at::Tensor grad_input =
|
486 |
-
at::zeros({batch_size, channels, height, width}, grad.options());
|
487 |
-
|
488 |
-
// handle possibly empty gradients
|
489 |
-
if (grad.numel() == 0) {
|
490 |
-
return grad_input;
|
491 |
-
}
|
492 |
-
|
493 |
-
// get stride values to ensure indexing into gradients is correct.
|
494 |
-
int n_stride = grad.stride(0);
|
495 |
-
int c_stride = grad.stride(1);
|
496 |
-
int h_stride = grad.stride(2);
|
497 |
-
int w_stride = grad.stride(3);
|
498 |
-
|
499 |
-
auto rois_ = rois.contiguous();
|
500 |
-
AT_DISPATCH_FLOATING_TYPES_AND_HALF(
|
501 |
-
grad.scalar_type(), "ROIAlignRotated_forward", [&] {
|
502 |
-
ROIAlignRotatedBackward<scalar_t>(
|
503 |
-
grad.numel(),
|
504 |
-
grad.data_ptr<scalar_t>(),
|
505 |
-
spatial_scale,
|
506 |
-
channels,
|
507 |
-
height,
|
508 |
-
width,
|
509 |
-
pooled_height,
|
510 |
-
pooled_width,
|
511 |
-
sampling_ratio,
|
512 |
-
grad_input.data_ptr<scalar_t>(),
|
513 |
-
rois_.data_ptr<scalar_t>(),
|
514 |
-
n_stride,
|
515 |
-
c_stride,
|
516 |
-
h_stride,
|
517 |
-
w_stride);
|
518 |
-
});
|
519 |
-
return grad_input;
|
520 |
-
}
|
521 |
-
|
522 |
-
} // namespace detectron2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Arena Of Global Value Apk.md
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<tabla>
|
3 |
-
<tr>
|
4 |
-
<td>
|
5 |
-
<h1>Arena de Valor Global APK: Cómo descargar y jugar el último 5v5 MOBA en su dispositivo Android</h1>
|
6 |
-
<p>¿Eres un fan de los juegos multijugador de arena de batalla en línea (MOBA)? ¿Quieres experimentar una épica nueva MOBA 5v5 en tu dispositivo Android? Si es así, entonces definitivamente deberías echar un vistazo a Arena of Valor, traído a ti por Level Infinite y TiMi Studio Group. En este artículo, le diremos todo lo que necesita saber sobre Arena of Valor Global APK, cómo descargarlo e instalarlo en su dispositivo Android, cómo jugarlo, y cómo mejorar su experiencia de juego con él. ¡Vamos a empezar! </p>
|
7 |
-
<h2>arena of global value apk</h2><br /><p><b><b>Download Zip</b> ⇒⇒⇒ <a href="https://bltlly.com/2v6LWF">https://bltlly.com/2v6LWF</a></b></p><br /><br />
|
8 |
-
<h2>¿Qué es la Arena del Valor? </h2>
|
9 |
-
<h3>Breve introducción al juego</h3>
|
10 |
-
<p>Arena of Valor es un juego MOBA gratuito que se lanzó por primera vez en China en 2015 bajo el nombre de Honor of Kings. Más tarde se lanzó a nivel mundial en 2017 bajo el nombre de Arena of Valor. Es uno de los juegos MOBA más populares y exitosos del mundo, con más de 200 millones de jugadores registrados y más de 80 millones de usuarios activos diarios a partir de 2020. También ha ganado varios premios, como el Premio al Mejor Juego Competitivo de Google Play en 2017 y el Premio al Mejor Juego Competitivo de Google Play en 2018. </p>
|
11 |
-
<h3>Las características y los beneficios de jugar Arena of Valor</ <h3>Los diferentes modos y mapas en Arena of Valor</h3>
|
12 |
-
<p>Arena of Valor ofrece varios modos de juego para que los jugadores disfruten, cada uno con sus propias reglas, objetivos y desafíos. Estos son algunos de los modos de juego que puedes probar en Arena of Valor:</p>
|
13 |
-
<ul>
|
14 |
-
<li><strong>Gran batalla</strong>: Este es el modo clásico 5v5, donde dos equipos de cinco jugadores compiten en el mapa del campo de batalla de Antaris, que tiene tres carriles, una selva y un río. El objetivo es destruir el núcleo del enemigo, mientras que la defensa de los suyos. En el camino, también puedes asegurar objetivos como el Dragón Abisal y el Cazador Oscuro, que otorgan potenciadores y ventajas a tu equipo. Este modo también se utiliza para los partidos clasificados, donde se puede subir la escalera y ganar recompensas. </li>
|
15 |
-
|
16 |
-
<li><strong>Escaramuza del valle</strong>: Este es un modo 3v3 donde dos equipos luchan en un mapa más pequeño, con un carril y una selva. El objetivo es destruir el núcleo del enemigo, mientras se asegura el potenciador de velocidad y el potenciador tirano en la selva. Este modo es rápido y lleno de acción, perfecto para un partido rápido. </li>
|
17 |
-
<li><strong>Solo Battle</strong>: Este es un modo 1v1 donde dos jugadores se enfrentan en un mapa pequeño, con un carril y dos pinceles. No hay opción de recordar, y solo se puede curar recogiendo el paquete de salud en el centro del mapa. El objetivo es destruir la torre y el núcleo del enemigo, mientras los supera en duelos. </li>
|
18 |
-
<li><strong>Death Match</strong>: Este es un modo especial que se puede jugar en 2v2, 3v3 o 5v5. Se lleva a cabo en un mapa sin torres, esbirros o selva. Todos los jugadores comienzan con el nivel máximo y los elementos completos. El objetivo es matar a todos los enemigos. Una vez que mueres, no reapareces hasta la siguiente ronda. El primer equipo en ganar tres rondas gana el partido. </li>
|
19 |
-
<li><strong>Hook Wars</strong>: Este es otro modo especial que solo se puede jugar los fines de semana. Es un modo 5v5 donde dos equipos luchan en un mapa cuadrado, separados por una brecha. Cada jugador obtiene un héroe al azar al principio, y puede redirigir una vez gratis. El objetivo es enganchar y tirar de los enemigos en su lado del mapa, donde serán asesinados al instante por su torre. También puedes usar tus habilidades y objetos para dañar e interrumpir a los enemigos. El primer equipo en anotar 15 puntos gana el partido. </li>
|
20 |
-
</ul>
|
21 |
-
<h3>Los diferentes héroes y roles en la arena del valor</h3>
|
22 |
-
<p>Arena of Valor tiene más de 90 héroes para elegir, cada uno con sus propias habilidades y estilos de juego únicos. Puedes desbloquear héroes usando oro o vales, o completando ciertas misiones o eventos. También puedes probar héroes gratis en el modo de práctica o en el modo de prueba del héroe. </p>
|
23 |
-
|
24 |
-
<ul>
|
25 |
-
<li><strong>Assassin</strong>: Estos son héroes que se especializan en infligir daño de ráfaga alta y matar enemigos rápidamente. Por lo general, tienen alta movilidad y habilidades de sigilo, pero baja defensa y salud. Son los más adecuados para deambular por el mapa, matar monstruos de la selva y cazar enemigos que están fuera de posición o con poca salud. Algunos ejemplos de asesinos son Batman, Butterfly, Murad, Quillen, Raz, Sinestrea, Wukong y Zill.</li>
|
26 |
-
<li><strong>Mago</strong>: Estos son héroes que usan habilidades mágicas para infligir daño en áreas altas y controlar a los enemigos con efectos de control de multitudes como aturdimientos, ralentizaciones, silencios, etc. Por lo general, tienen un alto rendimiento y rango de daño, pero baja defensa y movilidad. Son los más adecuados para laning en el carril medio, donde pueden cultivar oro y experimentar rápidamente y ayudar a sus compañeros de equipo con sus hechizos. Algunos ejemplos de magos son Aleister, Azzen'Ka, D'Arcy, Diaochan, Iggy, Ignis, Ilumia, Ishar, Jinnar, Kahlii, Lauriel, Liliana, Lorion, Marja, Mganga, Natalya, Pre [asistente](continuar) <h3>Los diferentes héroes y los papeles en Arena<h3/h
|
27 |
-
<p>Arena of Valor tiene más de 90 héroes para elegir, cada uno con sus propias habilidades y estilos de juego únicos. Puedes desbloquear héroes usando oro o vales, o completando ciertas misiones o eventos. También puedes probar héroes gratis en el modo de práctica o en el modo de prueba del héroe. </p>
|
28 |
-
<p>Los héroes se clasifican en seis roles: asesino, mago, tirador, apoyo, tanque y guerrero. Cada rol tiene sus propias fortalezas y debilidades, y contribuye de manera diferente al equipo. Aquí están algunos de los roles y sus funciones:</p>
|
29 |
-
<p></p>
|
30 |
-
<ul>
|
31 |
-
|
32 |
-
<li><strong>Mago</strong>: Estos son héroes que usan habilidades mágicas para infligir daño en áreas altas y controlar a los enemigos con efectos de control de multitudes como aturdimientos, ralentizaciones, silencios, etc. Por lo general, tienen un alto rendimiento y rango de daño, pero baja defensa y movilidad. Son los más adecuados para laning en el carril medio, donde pueden cultivar oro y experimentar rápidamente y ayudar a sus compañeros de equipo con sus hechizos. Some examples of mages are Aleister, Azzen'Ka, D'Arcy, Diaochan, Iggy, Ignis, Ilumia, Ishar, Jinnar, Kahlii, Lauriel, Liliana, Lorion, Marja, Mganga, Natalya, Preyta, Raziel, Sephera, Tulen, Veera, Violeta, Vol'Kath, Yena, and Yorn.</li>
|
33 |
-
<li><strong>Tirador</strong>: Estos son héroes que usan ataques físicos a distancia para infligir daño alto y destruir objetivos. Por lo general, tienen alta velocidad de ataque y tasa crítica, pero baja defensa y salud. Son los más adecuados para lanear en el carril inferior, donde pueden cultivar oro y experimentar de forma segura y empujar torres con sus compañeros de equipo. Algunos ejemplos de tiradores son Brunhilda, Capheny, Elsu, Fennik, Hayate, Joker, Kriknak, Laville, Lindis, Moren, Slimz, Tel'Annas, Valhein, Violet, Wisp y Yorn.</li>
|
34 |
-
<li><strong>Apoyo</strong>: Estos son héroes que utilizan varias habilidades para proteger y ayudar a sus aliados. Por lo general, tienen una alta defensa y salud, pero baja producción de daños. Son más adecuados para laning en el carril inferior con un tirador o vagando por el mapa con un asesino. Some examples of supports are Alice, Annette, Arum, Baldum, Chaugnar, Cresht, Gildur Krizzix Lumburr Min'a Omega Ormarr Peura Rouie Teemee Thane Toro Xeniel and Zip.</li>
|
35 |
-
|
36 |
-
<li><strong>Guerrero</strong>: Estos son héroes que usan una mezcla de ataques físicos y habilidades para infligir daño moderado y sobrevivir peleas. Por lo general, tienen estadísticas equilibradas y pueden adaptarse a diferentes situaciones. Ellos son los más adecuados para laning en el carril superior donde pueden duelo enemigos y dividir torres de empuje. Algunos ejemplos de guerreros son Airi Amily Astrid Ata Errol Florentino Jinnar Kil'Groth Lu Bu Maloch Max Omen Qi Riktor Rourke Ryoma Skud Superman Taara Veres Wonder Woman Wukong Iel Yena Zanis y Zephys.</li>
|
37 |
-
</ul>
|
38 |
-
<h2>¿Cómo mejorar tu experiencia de juego con Arena of Valor? </h2>
|
39 |
-
<h3>Los mejores ajustes y personalizaciones para Arena of Valor</h3>
|
40 |
-
<p>Arena of Valor le permite personalizar Arena of Valor le permite personalizar sus ajustes y preferencias de juego para satisfacer sus necesidades y preferencias. Estos son algunos de los ajustes y personalizaciones que puedes ajustar en Arena of Valor:</p>
|
41 |
-
<ul>
|
42 |
-
<li><strong>Graphics</strong>: Puede ajustar la calidad de los gráficos, la velocidad de fotogramas, el brillo y la resolución del juego para optimizar el rendimiento y la duración de la batería del dispositivo. También puede activar o desactivar funciones como sombras, anti-aliasing y modo de alta definición. </li>
|
43 |
-
<li><strong>Sonido</strong>: Puede ajustar el volumen, el silencio y el idioma de los efectos de sonido, la música y las voces en off del juego. También puede elegir entre diferentes temas de sonido y locutores para el juego. </li>
|
44 |
-
<li><strong>Controles</strong>: Puedes elegir entre diferentes esquemas de control para el juego, como joystick, touch o custom. También puede personalizar el tamaño, la posición y la transparencia de los botones e iconos en la pantalla. También puede habilitar o deshabilitar funciones como puntería automática, compra automática, actualización automática, chat rápido, lanzamiento rápido y ping inteligente. </li>
|
45 |
-
|
46 |
-
<li><strong>Cuenta</strong>: Puede administrar la información de su cuenta, como su nombre de usuario, avatar, firma, región, servidor, lista de amigos, gremio, logros, estadísticas y configuraciones. También puedes vincular tu cuenta a otras plataformas como Facebook, Google Play Games, Game Center o VK.</li>
|
47 |
-
</ul>
|
48 |
-
<h3>Las mejores estrategias y tácticas para ganar en Arena of Valor</h3>
|
49 |
-
<p>Arena of Valor es un juego que requiere trabajo en equipo, coordinación, comunicación y estrategia para ganar. Estas son algunas de las mejores estrategias y tácticas para ganar en Arena of Valor:</p>
|
50 |
-
<ul>
|
51 |
-
<li><strong>Elige una composición de equipo equilibrada</strong>: Una buena composición de equipo debe tener una mezcla de diferentes roles y héroes que complementen las fortalezas de cada uno y cubran las debilidades de cada uno. Por ejemplo, una composición típica de equipo podría tener un tanque o un guerrero en el carril superior, un mago o un asesino en el carril medio, un tirador y un apoyo en el carril inferior, y un asesino o un guerrero en la selva. Trata de evitar elegir héroes que son demasiado similares o demasiado débiles contra el equipo enemigo. </li>
|
52 |
-
<li><strong>Comunícate con tus compañeros</strong>: La comunicación es clave para ganar en Arena of Valor. Debes usar el chat o el chat de voz para comunicarte con tus compañeros de equipo sobre tus planes, tus acciones, los movimientos de tus enemigos, tus objetivos, tus peticiones, tus advertencias y tus alabanzas. También debe utilizar el chat rápido o el ping inteligente para transmitir mensajes simples como "Ataque", "Retiro", "Reunir", "Falta", "Peligro", "Ayuda", etc.</li>
|
53 |
-
|
54 |
-
<li><strong>Conoce a tus enemigos</strong>: Conocer a tus enemigos es la mitad de la batalla. Debes aprender sobre las habilidades, fortalezas, debilidades y tendencias de sus héroes. También debe prestar atención a sus artículos, niveles, oro, muertes, muertes, asistencias y objetivos. Debes usar esta información para planificar tus estrategias, contrarrestar sus movimientos, explotar sus errores y evitar sus trampas. </li>
|
55 |
-
<li><strong>Administra tus recursos</strong>: Los recursos son esenciales para ganar en Arena of Valor. Debes administrar tus recursos con sabiduría y eficiencia. Los recursos incluyen oro, experiencia, salud, maná, reutilizaciones, objetos, potenciadores y objetivos. Debes usar tus recursos para obtener ventajas sobre tus enemigos y alcanzar tus objetivos. También debes negar los recursos de tus enemigos matándolos, robando sus monstruos de la selva, destruyendo sus torres y asegurando sus objetivos. </li>
|
56 |
-
<li><strong>Adaptarse a la situación</strong>: Arena of Valor es un juego dinámico e impredecible. Debes adaptarte a la situación y ser flexible con tus estrategias y tácticas. Usted debe ser consciente de los cambios en el estado del juego, tales como el tiempo, la puntuación, el mapa, los héroes, los objetos, los potenciadores, y los objetivos. También debes ser consciente de las oportunidades y amenazas que surgen en el juego, tales como peleas en equipo, ganchos, emboscadas, empujones divididos, puertas traseras, etc. Debes ajustar tus acciones y decisiones en consecuencia para maximizar tus posibilidades de ganar. </li>
|
57 |
-
</ul>
|
58 |
-
<h3>Los mejores recursos y comunidades para aprender y mejorar en la arena del valor</h3>
|
59 |
-
<p>Arena of Valor es un juego que requiere constante aprendizaje y mejora. Siempre debes buscar mejorar tus conocimientos y habilidades en el juego. Estos son algunos de los mejores recursos y comunidades para aprender y mejorar en Arena of Valor:</p>
|
60 |
-
<ul>
|
61 |
-
|
62 |
-
<li><strong>Los tutoriales en el juego y los modos de práctica</strong>: Puedes acceder a los tutoriales en el juego y los modos de práctica tocando el botón "Aprender" en el menú principal. Puedes aprender sobre los fundamentos del juego, como los controles, la interfaz, los roles, los héroes, los objetos, las habilidades, los objetivos y más. También puedes practicar tus habilidades y probar a tus héroes en diferentes modos, como el modo de prueba del héroe, el modo de práctica, el modo personalizado y el modo casual. </li>
|
63 |
-
<li><strong>Las guías y videos en línea</strong>: Puedes encontrar varias guías y videos en línea sobre Arena of Valor en diferentes sitios web y plataformas, como <a href="">https:/samurai-gamers.com/arena-of-valor/</a>, <a href=">>>>https://sportdotecom/a/a-valor.of-valor/news</a>, <a href=">https://www.proguides.com/arena-of-valor</a>, <a href="">https:/www.mobafire.com/arena-of-</a>, <a href=">>>tps:/ww.tube.com/w.>>>search/query=rs.car.car.una.unaf.guía/valora=, a==a ">https://www.youtube.com/results?search_query=arenaạofvalorǐplay</a>, y más. Puedes aprender de estas guías y videos sobre diferentes aspectos del juego, como la construcción del héroe, la construcción del objeto, los combos de habilidad, las estrategias del carril, las estrategias del equipo, los consejos y trucos, y más. </li>
|
64 |
-
|
65 |
-
</ul>
|
66 |
-
<h2>Conclusión</h2>
|
67 |
-
<p>Arena of Valor es un divertido y emocionante juego 5v5 MOBA que puedes jugar en tu dispositivo Android. Tiene gráficos increíbles, sonido y jugabilidad, así como una gran variedad de héroes, modos y mapas. Es fácil de descargar e instalar, y se puede personalizar a su gusto. También es una gran manera de aprender y mejorar tus habilidades, así como para conectar y competir con otros jugadores de todo el mundo. Si estás buscando un nuevo juego MOBA para probar, definitivamente deberías darle una oportunidad a Arena of Valor. ¡No te arrepentirás! </p>
|
68 |
-
<h2>Preguntas frecuentes</h2>
|
69 |
-
<h4>Q: ¿Es Arena of Valor libre para jugar? </h4>
|
70 |
-
<p>A: Sí, Arena of Valor es gratis para jugar. Puedes descargarlo e instalarlo desde Google Play Store o QooApp Game Store sin pagar nada. También puedes jugar todos los modos y héroes sin gastar dinero. Sin embargo, también puedes comprar algunos artículos opcionales como pieles, arcanos, vales y cofres con dinero real si quieres apoyar el juego o mejorar tu apariencia. </p>
|
71 |
-
<h4>Q: ¿Arena of Valor es compatible con mi dispositivo? </h4>
|
72 |
-
<p>A: Arena of Valor es compatible con la mayoría de los dispositivos Android que tienen Android 4.0.3 o superior y al menos 1 GB de RAM. Sin embargo, algunos dispositivos pueden tener problemas de rendimiento o problemas de compatibilidad dependiendo de sus especificaciones y configuraciones. Puede comprobar la compatibilidad de su dispositivo visitando <a href=">https://www.arenaofvalor.com/devicecheck/</a> o poniéndose en contacto con el servicio de atención al cliente en <a href="">https:/www.arenaof.com/support/<//a>. </p>
|
73 |
-
<h4>Q: ¿Cómo puedo actualizar Arena of Valor? </h4>
|
74 |
-
<p>A: Arena of Valor se actualiza constantemente con nuevas características, contenido, correcciones y mejoras. Puedes actualizar Arena of Valor visitando Google Play Store o QooApp Game Store y pulsando el botón "Actualizar". También puede habilitar la opción de actualización automática en la configuración de su dispositivo para actualizar Arena of Valor automáticamente cada vez que haya una nueva versión disponible. </p>
|
75 |
-
<h4>Q: ¿Cómo puedo reportar un error o un problema en Arena of Valor? </h4>
|
76 |
-
|
77 |
-
<h4>Q: ¿Cómo puedo mejorar en Arena of Valor? </h4>
|
78 |
-
<p>A: La mejor manera de mejorar en Arena of Valor es practicar regularmente y aprender de tus errores. También puede ver guías y videos en línea, leer foros y comunidades en línea, unirse a torneos y eventos en línea, y pedir consejo a otros jugadores y expertos. También deberías probar diferentes héroes, roles, modos y estrategias para encontrar lo que más te convenga. </p> 64aa2da5cf<br />
|
79 |
-
<br />
|
80 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Camino De Los Titanes Mac Descargar.md
DELETED
@@ -1,96 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>El camino de los titanes: un MMO de supervivencia de dinosaurios para Mac</h1>
|
3 |
-
<p>¿Alguna vez has soñado con vivir como un dinosaurio en un mundo prehistórico? ¿Quieres explorar, cazar, luchar y crecer con otros jugadores en línea? Si respondiste afirmativamente a cualquiera de estas preguntas, quizás quieras echar un vistazo a <strong>Path of Titans</strong>, un juego de supervivencia de dinosaurios MMO disponible para Mac y otras plataformas. </p>
|
4 |
-
<p>Path of Titans es un juego desarrollado y publicado por Alderon Games, un estudio independiente con sede en Australia. Actualmente está en desarrollo activo, con actualizaciones regulares y nuevos contenidos. En este juego, puedes elegir entre más de 30 especies de dinosaurios diferentes, cada una con sus propias habilidades, habilidades y apariencia. Puedes personalizar tu dinosaurio con cientos de pieles, marcas y colores, y verlo crecer desde una cría hasta un adulto mientras completas misiones y desafíos. También puedes unirte a fiestas y gremios con otros jugadores, o ir solo y labrar tu propio camino en un enorme mundo abierto lleno de criaturas de IA, eventos naturales y peligros ambientales. </p>
|
5 |
-
<h2>camino de los titanes mac descargar</h2><br /><p><b><b>Download File</b> > <a href="https://bltlly.com/2v6LgZ">https://bltlly.com/2v6LgZ</a></b></p><br /><br />
|
6 |
-
<p>Si usted es un usuario de Mac, es posible que se pregunte cómo descargar y jugar Path of Titans en su dispositivo. En este artículo, te mostraremos cómo hacerlo, además de darte una visión general de las características del juego, los requisitos del sistema, las revisiones y las alternativas. Así que, sin más preámbulos, ¡empecemos! </p>
|
7 |
-
<h2>Cómo descargar Path of Titans en Mac</h2>
|
8 |
-
<p>Descargar Path of Titans en Mac es fácil y sencillo. Solo sigue estos sencillos pasos:</p>
|
9 |
-
<ol>
|
10 |
-
<li><p>Visite el sitio web oficial de Path of Titans en <a href="( 1 )">https://pathoftitans.com/</a> y compre el juego. Puedes elegir entre diferentes paquetes que ofrecen diferentes ventajas y recompensas, como pieles, moneda del juego, banda sonora, etc. El paquete más barato cuesta $20 USD.</p></li>
|
11 |
-
|
12 |
-
<li><p>Descargue el lanzador de Alderon Games para Mac desde el enlace proporcionado en el correo electrónico. El tamaño del archivo es de aproximadamente 100 MB.</p></li>
|
13 |
-
<li><p>Abra el archivo descargado y siga las instrucciones para instalar el lanzador en su Mac.</p></li>
|
14 |
-
<li><p>Inicie el lanzador de Alderon Games e inicie sesión con sus credenciales de cuenta. </p></li>
|
15 |
-
<li><p>Seleccione Path of Titans de la lista de juegos y haga clic en el botón Instalar. El tamaño del juego es de aproximadamente 4 GB.</p>
|
16 |
-
<p></p></li>
|
17 |
-
<li><p>Espere a que termine la instalación y luego haga clic en el botón Play para iniciar el juego. </p></li>
|
18 |
-
</ol>
|
19 |
-
<p>Felicidades, has descargado e instalado correctamente Path of Titans en tu Mac. Ahora puedes disfrutar del juego y sumergirte en el mundo de los dinosaurios. </p>
|
20 |
-
<h2>Características del juego Path of Titans</h2>
|
21 |
-
<p>Path of Titans no es solo otro juego de dinosaurios. Es un juego que ofrece muchas características y contenido que lo hacen destacar entre la multitud. Estas son algunas de las principales características que puedes esperar de Path of Titans:</p>
|
22 |
-
<h3>Multijugador masivo con juego multiplataforma</h3>
|
23 |
-
<p>Uno de los aspectos más atractivos de Path of Titans es que es un juego multijugador masivo en línea, lo que significa que puedes jugar con miles de otros jugadores de todo el mundo. Puede unirse a servidores que alojan hasta 200 jugadores a la vez e interactuar con ellos a través de chat, voz y emotes. También puedes formar fiestas y gremios con tus amigos u otros jugadores, y cooperar o competir con ellos en diversas actividades. Además, Path of Titans admite el juego multiplataforma, lo que significa que puedes jugar con jugadores que utilizan diferentes dispositivos, como PC, Mac, Linux, iOS, Android e incluso consolas. Esto hace que el juego sea más accesible y diverso. </p>
|
24 |
-
<h3>Personalización y crecimiento de dinosaurios</h3>
|
25 |
-
|
26 |
-
<h3>Combate y habilidades</h3>
|
27 |
-
<p>Como un juego de supervivencia de dinosaurios, Path of Titans implica mucho combate y acción. Tendrás que buscar comida, defenderte de los depredadores, luchar por el territorio y competir por los recursos. También tendrá que lidiar con eventos naturales, como tormentas, incendios, inundaciones, terremotos y erupciones volcánicas. Para sobrevivir en este duro entorno, tendrás que usar sabiamente las habilidades de tu dinosaurio. Cada dinosaurio tiene su propio conjunto de habilidades que se pueden activar presionando ciertas teclas o botones. Estas habilidades incluyen morder, arañar, rugir, pisar fuerte, azotar la cola, cargar, esquivar, saltar, agacharse, descansar, dormir, beber, comer, etc. Algunas habilidades son más efectivas que otras dependiendo de la situación y el oponente. Tendrás que aprender a usarlas estratégica y tácticamente. </p>
|
28 |
-
<h3>Misiones y logros</h3>
|
29 |
-
<p>Para mantenerte comprometido y motivado en el juego, Path of Titans ofrece una variedad de misiones y logros que puedes completar y ganar recompensas. Las misiones son tareas que puedes aceptar de NPCs u otros jugadores que requieren que hagas algo específico en el mundo del juego. Por ejemplo, es posible que te pidan que caces cierto tipo de animal, explores cierta área, recojas cierto objeto, etc. Completar misiones te dará puntos de experiencia, moneda del juego y otras recompensas. Los logros son hitos que puedes alcanzar haciendo algo notable o desafiante en el mundo del juego. Por ejemplo, puedes conseguir un logro por sobrevivir durante cierto tiempo, matar a un cierto número de enemigos, alcanzar un cierto nivel, etc. Logros te darán derechos de fanfarronear, así como artículos cosméticos, como pieles, sombreros, accesorios, etc.</p>
|
30 |
-
<h3>Herramientas de modificación y soporte comunitario</h3>
|
31 |
-
|
32 |
-
<h2>Requisitos del sistema de Path of Titans para Mac</h2>
|
33 |
-
<p>Antes de descargar y jugar Path of Titans en tu Mac, debes asegurarte de que tu dispositivo cumple con los requisitos mínimos o recomendados del sistema para el juego. Estos son los requisitos del sistema para Path of Titans para Mac:</p>
|
34 |
-
<tabla>
|
35 |
-
<tr>
|
36 |
-
<th>Requisitos mínimos</th>
|
37 |
-
<th>Requisitos recomendados</th>
|
38 |
-
</tr>
|
39 |
-
<tr>
|
40 |
-
<td>OS: Mac OS X 10.9 o superior</td>
|
41 |
-
<td>OS: Mac OS X 10.13 o superior</td>
|
42 |
-
</tr>
|
43 |
-
<tr>
|
44 |
-
<td>CPU: Intel Core i5-2400 o equivalente</td>
|
45 |
-
<td>CPU: Intel Core i7-4770 o equivalente</td>
|
46 |
-
</tr>
|
47 |
-
<tr>
|
48 |
-
<td>RAM: 8 GB</td>
|
49 |
-
<td>RAM: 16 GB</td>
|
50 |
-
</tr>
|
51 |
-
<tr>
|
52 |
-
<td>GPU: NVIDIA GeForce GTX 660 o equivalente</td>
|
53 |
-
<td>GPU: NVIDIA GeForce GTX 1060 o equivalente</td>
|
54 |
-
</tr>
|
55 |
-
<tr>
|
56 |
-
<td>Almacenamiento: 10 GB de espacio disponible</td>
|
57 |
-
<td>Almacenamiento: 20 GB de espacio disponible</td>
|
58 |
-
</tr>
|
59 |
-
<tr>
|
60 |
-
<td>Red: Conexión a Internet de banda ancha</td>
|
61 |
-
<td>Red: Conexión a Internet de banda ancha</td>
|
62 |
-
</tr>
|
63 |
-
</tabla>
|
64 |
-
<p>Si tu Mac cumple con estos requisitos, deberías poder ejecutar Path of Titans sin problemas y de forma agradable. Sin embargo, si tu Mac no cumple con estos requisitos, es posible que experimentes retrasos, fallos, fallos u otros problemas que podrían afectar tu experiencia de juego. En ese caso, es posible que desee actualizar su dispositivo o intentar jugar Path of Titans en otra plataforma. </p>
|
65 |
-
<h2>Camino de los Titanes Comentarios y Alternativas</h2>
|
66 |
-
<p>Si todavía no está convencido de que Path of Titans es un juego que vale la pena jugar en su Mac, es posible que desee leer algunos comentarios de otros jugadores y críticos que han probado el juego. Estos son algunos de los comentarios que hemos encontrado en línea:</p>
|
67 |
-
<h3>Comentario 1: IGN</h3>
|
68 |
-
<p><a href=">https://www.ign.com/artículos/path-of--titans-review-a-dinosaur-survival-game-with-potential</a></p>
|
69 |
-
|
70 |
-
<h3>Comentario 2: Reddit</h3>
|
71 |
-
<p><a href=">https://www.reddit.com/r//PathOfTitans/comments/pt9w6g/my_review_of_path_of_titans_after_100_hours_of/</a></p>
|
72 |
-
<p>"He estado jugando Path of Titans durante más de 100 horas, y tengo que decir que me encanta este juego. Es el mejor juego de dinosaurios que he jugado, y he jugado un montón de ellos. El juego es muy inmersivo y realista, y te hace sentir como si estuvieras viviendo como un dinosaurio. Los gráficos son impresionantes, los efectos de sonido son increíbles, las animaciones son suaves, y el juego es divertido y desafiante. El juego tiene mucha variedad y valor de repetición, ya que puedes jugar como diferentes dinosaurios, personalizarlos, subir de nivel, hacer misiones, unirte a gremios, etc. El juego también tiene una gran comunidad y soporte para desarrolladores, ya que son muy amigables, útiles y activos. El juego no es perfecto, por supuesto, ya que todavía tiene algunos errores, fallos, problemas de equilibrio y características que faltan. Pero el juego se actualiza y mejora constantemente, y tengo fe en que los desarrolladores harán que este juego sea aún mejor en el futuro. Recomiendo este juego a cualquiera que ame los dinosaurios y los juegos de supervivencia." </p>
|
73 |
-
<h3>Comentario 3: GamesHedge</h3>
|
74 |
-
<p><a href=">https://gameshedge.com/path-of-titans-review/</a></p>
|
75 |
-
|
76 |
-
<h3>Alternativa 1: Remanentes</h3>
|
77 |
-
<p>Si usted está buscando otro juego de supervivencia que no se trata de dinosaurios, pero todavía ofrece un montón de desafío y diversión, es posible que desee comprobar los restos. Remnants es un juego desarrollado por Immersion Studios que se desarrolla en un mundo post-apocalíptico donde tienes que sobrevivir contra zombies, mutantes, raiders, vida silvestre y otros jugadores. Puedes crear armas, armaduras, herramientas, construir bases, cultivos agrícolas, domesticar animales y comerciar con otros jugadores. También puede explorar un mapa grande y diverso que tiene diferentes biomas, puntos de referencia, secretos y peligros. Puedes jugar Remnants en PC y Mac, y puedes descargarlo desde Steam por $19.99 USD.</p>
|
78 |
-
<h3>Alternativa 2: Impacto de Genshin</h3>
|
79 |
-
<p>Si usted está buscando otro juego que no es un juego de supervivencia, pero todavía ofrece un montón de aventura y diversión, es posible que desee echa un vistazo a Genshin Impact. Genshin Impact es un juego desarrollado por miHoYo que es un juego de rol de acción de mundo abierto con gráficos y personajes de estilo anime. En este juego, puedes explorar un vasto y hermoso mundo llamado Teyvat, donde puedes encontrar varios enemigos, misiones, rompecabezas, secretos y tesoros. También puedes reunir y mejorar a más de 30 personajes diferentes, cada uno con sus propias habilidades, armas y elementos. También puede cambiar entre ellos durante el combate y utilizar sus interacciones elementales para crear combos de gran alcance. También puedes jugar a Genshin Impact con tus amigos en línea en el modo cooperativo, donde puedes formar equipo y enfrentar desafíos juntos. Puedes jugar a Genshin Impact en PC, Mac, iOS, Android, PlayStation 4, PlayStation 5 y Nintendo Switch. Puedes descargarlo de forma gratuita desde el sitio web oficial o las respectivas tiendas de aplicaciones. </p>
|
80 |
-
<h2>Conclusión y preguntas frecuentes</h2>
|
81 |
-
|
82 |
-
<p>Si estás interesado en jugar a Path of Titans en tu Mac, puedes seguir los pasos que hemos proporcionado anteriormente para descargar e instalar el juego en tu dispositivo. También puedes leer algunas reseñas de otros jugadores y críticos que han probado el juego para tener una mejor idea de qué esperar. También puedes ver algunas alternativas a Path of Titans si estás buscando algo diferente o similar. </p>
|
83 |
-
<p>Esperamos que este artículo te haya ayudado a aprender más sobre Path of Titans y cómo jugarlo en tu Mac. Si tiene alguna pregunta o comentario sobre el juego o el artículo, no dude en dejarlos a continuación. Nos encantaría saber de usted. </p>
|
84 |
-
<p>Aquí hay algunas preguntas frecuentes que puede tener sobre Path of Titans:</p>
|
85 |
-
<h3>FAQ 1: ¿Cuánto cuesta Path of Titans? </h3>
|
86 |
-
<p>Path of Titans cuesta $20 USD para el paquete básico que incluye el acceso al juego y algunas ventajas. Sin embargo, también puedes elegir entre diferentes paquetes que ofrecen más beneficios y recompensas, como skins, moneda del juego, banda sonora, etc. El paquete más caro cuesta $100 USD.</p>
|
87 |
-
<h3>FAQ 2: ¿Cuántos dinosaurios puedo jugar como en Path of Titans? </h3>
|
88 |
-
<p>Path of Titans actualmente tiene más de 30 especies de dinosaurios diferentes a las que puedes jugar, y se planea agregar más en el futuro. Puede elegir entre herbívoros, carnívoros, omnívoros y carroñeros, y de tamaños pequeños, medianos y grandes. Algunos de los dinosaurios que puedes jugar son Allosaurus, Ankylosaurus, Camarasaurus, Carnotaurus, Deinonychus, Parasaurolophus, Spinosaurus, Stegosaurus, Triceratops, Tyrannosaurus Rex, y más. </p>
|
89 |
-
<h3>FAQ 3: ¿Cómo puedo unirme a una fiesta o a un gremio en Path of Titans? </h3>
|
90 |
-
|
91 |
-
<h3>FAQ 4: ¿Cómo puedo modificar el camino de los titanes? </h3>
|
92 |
-
<p>Para mod Path of Titans, necesitas usar las herramientas de modding proporcionadas por Alderon Games, que se basan en Unreal Engine 4. Puedes acceder a estas herramientas desde el lanzador de Alderon Games, y seguir los tutoriales y guías disponibles en el sitio web oficial y los foros. Puedes crear tu propio contenido para el juego, como nuevos dinosaurios, skins, mapas, misiones, etc., y compartirlos con otros jugadores. También puede descargar y reproducir el contenido creado por otros jugadores, y calificar y comentar sobre ellos. </p>
|
93 |
-
<h3>FAQ 5: ¿Está Path of Titans todavía en desarrollo? </h3>
|
94 |
-
<p>Sí, Path of Titans todavía está en desarrollo y aún no ha terminado. El juego se encuentra actualmente en fase alfa, lo que significa que todavía se está probando y mejorando. El juego puede tener algunos errores, fallos, problemas de rendimiento y características que faltan que podrían afectar a su experiencia de juego. Sin embargo, el juego también está siendo constantemente actualizado y mejorado por los desarrolladores, que escuchan los comentarios y sugerencias de los jugadores y la comunidad. Se espera que el juego llegue pronto a la fase beta, lo que significa que será más estable y pulido. </p> 64aa2da5cf<br />
|
95 |
-
<br />
|
96 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Coc Apk.md
DELETED
@@ -1,77 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Simulador de coches 2 Mod APK: Un juego de carreras realista y divertido</h1>
|
3 |
-
<p>Si usted es un fan de los juegos de carreras, es posible que desee probar Car Simulator 2 Mod APK, un juego de carreras de coches gratis que ofrece dinero ilimitado, oro, y todos los coches desbloqueados. Este juego te permite experimentar un mundo realista y divertido de carreras, donde puedes conducir varios coches, personalizarlos y competir con otros jugadores en línea. En este artículo, le diremos todo lo que necesita saber sobre Car Simulator 2 Mod APK, incluyendo sus características, cómo descargar e instalar, sus pros y contras, y algunos consejos y trucos para jugarlo. </p>
|
4 |
-
<h2>coc apk</h2><br /><p><b><b>Download Zip</b> ✶✶✶ <a href="https://bltlly.com/2v6K1T">https://bltlly.com/2v6K1T</a></b></p><br /><br />
|
5 |
-
<h2>¿Qué es el simulador de coche 2 Mod APK? </h2>
|
6 |
-
<p>Car Simulator 2 Mod APK es una versión modificada del juego original de Car Simulator 2, que es un juego de simulación desarrollado por Oppana Games. En este juego, puedes entrar en un vasto mundo con muchas tareas que puedes realizar, como conducir, correr, estacionar, derrapar, afinar y más. También puedes elegir entre diferentes modos de juego, como en solitario, multijugador o online. Puede invitar a sus amigos a unirse a usted en el juego y jugar juntos. </p>
|
7 |
-
<p>La versión modificada del juego viene con algunas características adicionales que hacen el juego más agradable y más fácil. Por ejemplo, puede obtener dinero y oro ilimitados, que puede usar para comprar autos nuevos o actualizar los existentes. También puede desbloquear todos los coches en el juego, que incluyen coches deportivos, SUV, camiones y más. Puede personalizar sus coches con diferentes colores, ruedas, spoilers y otros accesorios. También puedes acceder a todas las ubicaciones del juego, como la ciudad, el aeropuerto, el desierto y más. </p>
|
8 |
-
<h3>Características del simulador de coche 2 Mod APK</h3>
|
9 |
-
<h4>Un mundo realista de carreras</h4>
|
10 |
-
|
11 |
-
<h4>Diferentes modos de juego</h4>
|
12 |
-
<p>Otra característica de Car Simulator 2 Mod APK es que ofrece diferentes modos de juego que se adapten a sus preferencias y habilidades. Puedes jugar en solitario si quieres disfrutar del juego por ti mismo o practicar tus habilidades de conducción. Puedes jugar al modo multijugador si quieres invitar a tus amigos a unirse a ti en el juego y divertirse juntos. También puedes jugar al modo online si quieres competir con otros jugadores de todo el mundo y posicionarte en la clasificación. </p>
|
13 |
-
<h4>Personalizar coches</h4>
|
14 |
-
<p>Una tercera característica de Car Simulator 2 Mod APK es que le permite personalizar sus coches de acuerdo a su gusto y estilo. Usted puede elegir entre una variedad de coches en el juego, tales como coches deportivos, SUV, camiones, y más. También puede desbloquear todos los coches en el juego con dinero ilimitado y oro. Puedes cambiar el color de tu coche o añadir diferentes accesorios, como ruedas, spoilers, pegatinas, etc. También puedes mejorar el rendimiento de tu coche mejorando su motor, frenos, suspensión, etc.</p>
|
15 |
-
<p></p>
|
16 |
-
<h4>Juego multijugador</h4>
|
17 |
-
<p>Una cuarta característica de Car Simulator <p>Una cuarta característica de Car Simulator 2 Mod APK es que es un juego multijugador que le permite jugar con sus amigos u otros jugadores en línea. Puede crear su propia habitación e invitar a sus amigos a unirse a usted en el juego. También puede unirse a otras habitaciones y conocer gente nueva. Puede chatear con otros jugadores y comunicarse con ellos mediante mensajes de voz o de texto. También puedes retar a otros jugadores a carreras o duelos y mostrar tus habilidades de conducción. </p>
|
18 |
-
<h3> ¿Cómo descargar e instalar Car Simulator 2 Mod APK? </h3>
|
19 |
-
<p>Si desea descargar e instalar Car Simulator 2 Mod APK, es necesario seguir estos sencillos pasos:</p>
|
20 |
-
<ol>
|
21 |
-
<li>Primero, debe habilitar la instalación de aplicaciones de fuentes desconocidas en su dispositivo. Para hacer esto, ve a la configuración del dispositivo, luego a la seguridad, luego a fuentes desconocidas y enciéndelo. </li>
|
22 |
-
|
23 |
-
<li>En tercer lugar, es necesario localizar el archivo descargado en el dispositivo y toque en él para iniciar el proceso de instalación. Siga las instrucciones de la pantalla y espere a que termine la instalación. </li>
|
24 |
-
<li>Cuarto, es necesario iniciar el juego y disfrutar de jugar con dinero ilimitado, oro, y todos los coches desbloqueados. </li>
|
25 |
-
</ol>
|
26 |
-
<p>Nota: Es posible que tenga que desinstalar el juego original de Car Simulator 2 antes de instalar la versión modificada. </p>
|
27 |
-
<h3> Pros y contras de Car Simulator 2 Mod APK</h3>
|
28 |
-
<h4>Pros</h4>
|
29 |
-
<p>Algunos de los pros de Car Simulator 2 Mod APK son:</p>
|
30 |
-
<ul>
|
31 |
-
<li> Es un juego gratuito que no requiere ningún registro o suscripción. </li>
|
32 |
-
<li>Ofrece dinero ilimitado y oro que se puede utilizar para comprar coches nuevos o actualizar los existentes. </li>
|
33 |
-
<li>Desbloquea todos los coches en el juego, que incluyen coches deportivos, SUV, camiones y más. </li>
|
34 |
-
<li>Le permite personalizar sus coches con diferentes colores, ruedas, alerones y otros accesorios. </li>
|
35 |
-
<li> Tiene gráficos realistas y efectos de sonido que te hacen sentir como si estuvieras en un coche real. </li>
|
36 |
-
<li> Tiene diferentes modos de juego que se adapten a sus preferencias y habilidades. </li>
|
37 |
-
<li>Es un juego multijugador que te permite jugar con tus amigos u otros jugadores online. </li>
|
38 |
-
</ul>
|
39 |
-
<h4>Contras</h4>
|
40 |
-
<p>Algunos de los contras de Car Simulator 2 Mod APK son:</p>
|
41 |
-
<ul>
|
42 |
-
<li>Puede no ser compatible con algunos dispositivos o sistemas operativos. </li>
|
43 |
-
<li> Puede tener algunos errores o fallos que afectan el juego o el rendimiento. </li>
|
44 |
-
<li>Puede que no se actualice regularmente o no tenga nuevas características. </li>
|
45 |
-
<li>Puede violar los términos y condiciones del juego original o la tienda de aplicaciones. </li>
|
46 |
-
</ul>
|
47 |
-
<h3> Consejos y trucos para jugar Car Simulator 2 Mod APK</h3>
|
48 |
-
<h4>Elegir el coche adecuado para cada modo</h4>
|
49 |
-
|
50 |
-
<h4>Utilice el mapa y el GPS para navegar</h4>
|
51 |
-
<p>Otro consejo para jugar Car Simulator 2 Mod APK es utilizar el mapa y el GPS para navegar. El juego tiene un mundo grande con muchos lugares que puedes explorar, como la ciudad, el aeropuerto, el desierto y más. Puedes usar el mapa para ver dónde estás y dónde quieres ir. También puedes usar el GPS para obtener direcciones y encontrar tu destino. El GPS le mostrará la mejor ruta y le dirá cuándo girar o detenerse. También puede acercar o alejar el mapa o el GPS para ver más detalles o información general. </p>
|
52 |
-
<h4>Gana dinero y oro completando tareas y desafíos</h4>
|
53 |
-
<p>Un tercer consejo para jugar Car Simulator 2 Mod APK es ganar dinero y oro completando tareas y desafíos. El juego tiene muchas tareas que puedes realizar, como conducir, correr, aparcar, derrapar, afinar, etc. También puedes encontrar desafíos que ponen a prueba tus habilidades o conocimientos, como preguntas de trivial, puzzles, acertijos, etc. Completando estas tareas y desafíos, Usted puede ganar dinero y oro que se puede utilizar para comprar coches nuevos o actualizar sus existentes. También puedes ganar dinero y oro ganando carreras o duelos contra otros jugadores online. </p <h4>Mejora tu coche y compra otros nuevos</h4>
|
54 |
-
<p>Un cuarto consejo para jugar Car Simulator 2 Mod APK es actualizar su coche y comprar nuevos. El juego tiene un garaje donde puede almacenar sus coches y modificarlos. Puede mejorar el rendimiento de su coche mediante la mejora de su motor, frenos, suspensión, etc. También puede cambiar la apariencia de su coche mediante la adición de diferentes accesorios, tales como ruedas, spoilers, pegatinas, etc. También puede comprar coches nuevos con dinero ilimitado y oro. Usted puede elegir entre una variedad de coches en el juego, tales como coches deportivos, SUV, camiones, y más. También puedes desbloquear todos los coches del juego con la versión modificada. </p>
|
55 |
-
<h2>Conclusión</h2>
|
56 |
-
|
57 |
-
<h3>Preguntas frecuentes</h3>
|
58 |
-
<p>Aquí hay algunas preguntas frecuentes sobre Car Simulator 2 Mod APK:</p>
|
59 |
-
<ol>
|
60 |
-
<li>Q: ¿Es seguro usar Car Simulator 2 Mod APK? </li>
|
61 |
-
<li>A: Car Simulator 2 Mod APK es una versión modificada del juego original que no puede ser autorizado por el desarrollador o la tienda de aplicaciones. Por lo tanto, puede no ser seguro de usar y puede dañar su dispositivo o datos. Solo debe descargar la versión modificada de una fuente confiable y escanearla en busca de virus o malware antes de instalarla. </li>
|
62 |
-
<li>Q: ¿Cómo puedo jugar Car Simulator 2 Mod APK con mis amigos? </li>
|
63 |
-
<li>A: Car Simulator 2 Mod APK es un juego multijugador que le permite jugar con sus amigos u otros jugadores en línea. Puede crear su propia habitación e invitar a sus amigos a unirse a usted en el juego. También puede unirse a otras habitaciones y conocer gente nueva. Puede chatear con otros jugadores y comunicarse con ellos mediante mensajes de voz o de texto. También puedes retar a otros jugadores a carreras o duelos y mostrar tus habilidades de conducción. </li>
|
64 |
-
<li>Q: ¿Cuáles son los mejores coches en Car Simulator 2 Mod APK? </li>
|
65 |
-
<li>A: Car Simulator 2 Mod APK tiene una variedad de coches en el juego, tales como coches deportivos, SUV, camiones, y más. Los mejores coches en el juego dependen de su preferencia y nivel de habilidad. Sin embargo, algunos de los coches más populares en el juego son:</li>
|
66 |
-
<ul>
|
67 |
-
<li>- Lamborghini Aventador: Un coche deportivo rápido y potente que tiene una velocidad máxima de 350 km/h y una aceleración de 0-100 km/h en 2,9 segundos. </li>
|
68 |
-
<li>- Ford F-150 Raptor: Un camión robusto y duradero que tiene una velocidad máxima de 170 km/h y una aceleración de 0-100 km/h en 5.5 segundos. </li>
|
69 |
-
<li>- Toyota Land Cruiser: Un SUV versátil y fiable que tiene una velocidad máxima de 200 km/h y una aceleración de 0-100 km/h en 8 segundos. </li>
|
70 |
-
</ul>
|
71 |
-
<li>Q: ¿Cómo puedo obtener más dinero y oro en Car Simulator 2 Mod APK? </li>
|
72 |
-
|
73 |
-
<li>Q: ¿Cómo puedo actualizar Car Simulator 2 Mod APK? </li>
|
74 |
-
<li>A: Car Simulator 2 Mod APK no puede ser actualizado regularmente o tener nuevas características añadidas por el desarrollador o la tienda de aplicaciones. Por lo tanto, es posible que no pueda actualizar la versión modificada del juego de forma automática o manual. Sin embargo, puede buscar actualizaciones de la fuente donde descargó la versión modificada o buscar versiones más nuevas en línea. </li>
|
75 |
-
</ol></p> 64aa2da5cf<br />
|
76 |
-
<br />
|
77 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
# SPDX-FileCopyrightText: 2015 Eric Larson
|
2 |
-
#
|
3 |
-
# SPDX-License-Identifier: Apache-2.0
|
4 |
-
|
5 |
-
from .adapter import CacheControlAdapter
|
6 |
-
from .cache import DictCache
|
7 |
-
|
8 |
-
|
9 |
-
def CacheControl(
|
10 |
-
sess,
|
11 |
-
cache=None,
|
12 |
-
cache_etags=True,
|
13 |
-
serializer=None,
|
14 |
-
heuristic=None,
|
15 |
-
controller_class=None,
|
16 |
-
adapter_class=None,
|
17 |
-
cacheable_methods=None,
|
18 |
-
):
|
19 |
-
|
20 |
-
cache = DictCache() if cache is None else cache
|
21 |
-
adapter_class = adapter_class or CacheControlAdapter
|
22 |
-
adapter = adapter_class(
|
23 |
-
cache,
|
24 |
-
cache_etags=cache_etags,
|
25 |
-
serializer=serializer,
|
26 |
-
heuristic=heuristic,
|
27 |
-
controller_class=controller_class,
|
28 |
-
cacheable_methods=cacheable_methods,
|
29 |
-
)
|
30 |
-
sess.mount("http://", adapter)
|
31 |
-
sess.mount("https://", adapter)
|
32 |
-
|
33 |
-
return sess
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/pkg_resources/_vendor/packaging/requirements.py
DELETED
@@ -1,146 +0,0 @@
|
|
1 |
-
# This file is dual licensed under the terms of the Apache License, Version
|
2 |
-
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
3 |
-
# for complete details.
|
4 |
-
|
5 |
-
import re
|
6 |
-
import string
|
7 |
-
import urllib.parse
|
8 |
-
from typing import List, Optional as TOptional, Set
|
9 |
-
|
10 |
-
from pkg_resources.extern.pyparsing import ( # noqa
|
11 |
-
Combine,
|
12 |
-
Literal as L,
|
13 |
-
Optional,
|
14 |
-
ParseException,
|
15 |
-
Regex,
|
16 |
-
Word,
|
17 |
-
ZeroOrMore,
|
18 |
-
originalTextFor,
|
19 |
-
stringEnd,
|
20 |
-
stringStart,
|
21 |
-
)
|
22 |
-
|
23 |
-
from .markers import MARKER_EXPR, Marker
|
24 |
-
from .specifiers import LegacySpecifier, Specifier, SpecifierSet
|
25 |
-
|
26 |
-
|
27 |
-
class InvalidRequirement(ValueError):
|
28 |
-
"""
|
29 |
-
An invalid requirement was found, users should refer to PEP 508.
|
30 |
-
"""
|
31 |
-
|
32 |
-
|
33 |
-
ALPHANUM = Word(string.ascii_letters + string.digits)
|
34 |
-
|
35 |
-
LBRACKET = L("[").suppress()
|
36 |
-
RBRACKET = L("]").suppress()
|
37 |
-
LPAREN = L("(").suppress()
|
38 |
-
RPAREN = L(")").suppress()
|
39 |
-
COMMA = L(",").suppress()
|
40 |
-
SEMICOLON = L(";").suppress()
|
41 |
-
AT = L("@").suppress()
|
42 |
-
|
43 |
-
PUNCTUATION = Word("-_.")
|
44 |
-
IDENTIFIER_END = ALPHANUM | (ZeroOrMore(PUNCTUATION) + ALPHANUM)
|
45 |
-
IDENTIFIER = Combine(ALPHANUM + ZeroOrMore(IDENTIFIER_END))
|
46 |
-
|
47 |
-
NAME = IDENTIFIER("name")
|
48 |
-
EXTRA = IDENTIFIER
|
49 |
-
|
50 |
-
URI = Regex(r"[^ ]+")("url")
|
51 |
-
URL = AT + URI
|
52 |
-
|
53 |
-
EXTRAS_LIST = EXTRA + ZeroOrMore(COMMA + EXTRA)
|
54 |
-
EXTRAS = (LBRACKET + Optional(EXTRAS_LIST) + RBRACKET)("extras")
|
55 |
-
|
56 |
-
VERSION_PEP440 = Regex(Specifier._regex_str, re.VERBOSE | re.IGNORECASE)
|
57 |
-
VERSION_LEGACY = Regex(LegacySpecifier._regex_str, re.VERBOSE | re.IGNORECASE)
|
58 |
-
|
59 |
-
VERSION_ONE = VERSION_PEP440 ^ VERSION_LEGACY
|
60 |
-
VERSION_MANY = Combine(
|
61 |
-
VERSION_ONE + ZeroOrMore(COMMA + VERSION_ONE), joinString=",", adjacent=False
|
62 |
-
)("_raw_spec")
|
63 |
-
_VERSION_SPEC = Optional((LPAREN + VERSION_MANY + RPAREN) | VERSION_MANY)
|
64 |
-
_VERSION_SPEC.setParseAction(lambda s, l, t: t._raw_spec or "")
|
65 |
-
|
66 |
-
VERSION_SPEC = originalTextFor(_VERSION_SPEC)("specifier")
|
67 |
-
VERSION_SPEC.setParseAction(lambda s, l, t: t[1])
|
68 |
-
|
69 |
-
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
|
70 |
-
MARKER_EXPR.setParseAction(
|
71 |
-
lambda s, l, t: Marker(s[t._original_start : t._original_end])
|
72 |
-
)
|
73 |
-
MARKER_SEPARATOR = SEMICOLON
|
74 |
-
MARKER = MARKER_SEPARATOR + MARKER_EXPR
|
75 |
-
|
76 |
-
VERSION_AND_MARKER = VERSION_SPEC + Optional(MARKER)
|
77 |
-
URL_AND_MARKER = URL + Optional(MARKER)
|
78 |
-
|
79 |
-
NAMED_REQUIREMENT = NAME + Optional(EXTRAS) + (URL_AND_MARKER | VERSION_AND_MARKER)
|
80 |
-
|
81 |
-
REQUIREMENT = stringStart + NAMED_REQUIREMENT + stringEnd
|
82 |
-
# pkg_resources.extern.pyparsing isn't thread safe during initialization, so we do it eagerly, see
|
83 |
-
# issue #104
|
84 |
-
REQUIREMENT.parseString("x[]")
|
85 |
-
|
86 |
-
|
87 |
-
class Requirement:
|
88 |
-
"""Parse a requirement.
|
89 |
-
|
90 |
-
Parse a given requirement string into its parts, such as name, specifier,
|
91 |
-
URL, and extras. Raises InvalidRequirement on a badly-formed requirement
|
92 |
-
string.
|
93 |
-
"""
|
94 |
-
|
95 |
-
# TODO: Can we test whether something is contained within a requirement?
|
96 |
-
# If so how do we do that? Do we need to test against the _name_ of
|
97 |
-
# the thing as well as the version? What about the markers?
|
98 |
-
# TODO: Can we normalize the name and extra name?
|
99 |
-
|
100 |
-
def __init__(self, requirement_string: str) -> None:
|
101 |
-
try:
|
102 |
-
req = REQUIREMENT.parseString(requirement_string)
|
103 |
-
except ParseException as e:
|
104 |
-
raise InvalidRequirement(
|
105 |
-
f'Parse error at "{ requirement_string[e.loc : e.loc + 8]!r}": {e.msg}'
|
106 |
-
)
|
107 |
-
|
108 |
-
self.name: str = req.name
|
109 |
-
if req.url:
|
110 |
-
parsed_url = urllib.parse.urlparse(req.url)
|
111 |
-
if parsed_url.scheme == "file":
|
112 |
-
if urllib.parse.urlunparse(parsed_url) != req.url:
|
113 |
-
raise InvalidRequirement("Invalid URL given")
|
114 |
-
elif not (parsed_url.scheme and parsed_url.netloc) or (
|
115 |
-
not parsed_url.scheme and not parsed_url.netloc
|
116 |
-
):
|
117 |
-
raise InvalidRequirement(f"Invalid URL: {req.url}")
|
118 |
-
self.url: TOptional[str] = req.url
|
119 |
-
else:
|
120 |
-
self.url = None
|
121 |
-
self.extras: Set[str] = set(req.extras.asList() if req.extras else [])
|
122 |
-
self.specifier: SpecifierSet = SpecifierSet(req.specifier)
|
123 |
-
self.marker: TOptional[Marker] = req.marker if req.marker else None
|
124 |
-
|
125 |
-
def __str__(self) -> str:
|
126 |
-
parts: List[str] = [self.name]
|
127 |
-
|
128 |
-
if self.extras:
|
129 |
-
formatted_extras = ",".join(sorted(self.extras))
|
130 |
-
parts.append(f"[{formatted_extras}]")
|
131 |
-
|
132 |
-
if self.specifier:
|
133 |
-
parts.append(str(self.specifier))
|
134 |
-
|
135 |
-
if self.url:
|
136 |
-
parts.append(f"@ {self.url}")
|
137 |
-
if self.marker:
|
138 |
-
parts.append(" ")
|
139 |
-
|
140 |
-
if self.marker:
|
141 |
-
parts.append(f"; {self.marker}")
|
142 |
-
|
143 |
-
return "".join(parts)
|
144 |
-
|
145 |
-
def __repr__(self) -> str:
|
146 |
-
return f"<Requirement('{self}')>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/Dual-Key_Backdoor_Attacks/openvqa/data/gqa/gqa_feat_preproc.py
DELETED
@@ -1,126 +0,0 @@
|
|
1 |
-
# --------------------------------------------------------
|
2 |
-
# OpenVQA
|
3 |
-
# GQA spatial features & object features .h5 files to .npz files transform script
|
4 |
-
# Written by Pengbing Gao https://github.com/nbgao
|
5 |
-
# --------------------------------------------------------
|
6 |
-
|
7 |
-
'''
|
8 |
-
Command line example:
|
9 |
-
(1) Process spatial features
|
10 |
-
python gqa_feat_preproc.py --mode=spatial --spatial_dir=./spatialFeatures --out_dir=./feats/gqa-grid
|
11 |
-
|
12 |
-
(2) Process object features
|
13 |
-
python gqa_feat_preproc.py --mode=object --object_dir=./objectFeatures --out_dir=./feats/gqa-frcn
|
14 |
-
'''
|
15 |
-
|
16 |
-
import h5py, glob, json, cv2, argparse
|
17 |
-
import numpy as np
|
18 |
-
|
19 |
-
# spatial features
|
20 |
-
def process_spatial_features(feat_path, out_path):
|
21 |
-
info_file = feat_path + '/gqa_spatial_info.json'
|
22 |
-
try:
|
23 |
-
info = json.load(open(info_file, 'r'))
|
24 |
-
except:
|
25 |
-
print('Failed to open info file:', info_file)
|
26 |
-
return
|
27 |
-
print('Total grid features', len(info))
|
28 |
-
|
29 |
-
print('Making the <h5 index> to <image id> dict...')
|
30 |
-
h5idx_to_imgid = {}
|
31 |
-
for img_id in info:
|
32 |
-
h5idx_to_imgid[str(info[img_id]['file']) + '_' + str(info[img_id]['idx'])] = img_id
|
33 |
-
|
34 |
-
for ix in range(16):
|
35 |
-
feat_file = feat_path + '/gqa_spatial_' + str(ix) + '.h5'
|
36 |
-
print('Processing', feat_file)
|
37 |
-
try:
|
38 |
-
feat_dict = h5py.File(feat_file, 'r')
|
39 |
-
except:
|
40 |
-
print('Failed to open feat file:', feat_file)
|
41 |
-
return
|
42 |
-
|
43 |
-
features = feat_dict['features']
|
44 |
-
|
45 |
-
for iy in range(features.shape[0]):
|
46 |
-
img_id = h5idx_to_imgid[str(ix) + '_' + str(iy)]
|
47 |
-
feature = features[iy]
|
48 |
-
# save to .npz file ['x']
|
49 |
-
np.savez(
|
50 |
-
out_path + '/' + img_id + '.npz',
|
51 |
-
x=feature.reshape(2048, 49).transpose(1, 0), # (49, 2048)
|
52 |
-
)
|
53 |
-
|
54 |
-
print('Process spatial features successfully!')
|
55 |
-
|
56 |
-
|
57 |
-
# object features
|
58 |
-
def process_object_features(feat_path, out_path):
|
59 |
-
info_file = feat_path + '/gqa_objects_info.json'
|
60 |
-
try:
|
61 |
-
info = json.load(open(info_file, 'r'))
|
62 |
-
except:
|
63 |
-
print('Failed to open info file:', info_file)
|
64 |
-
return
|
65 |
-
print('Total frcn features', len(info))
|
66 |
-
|
67 |
-
print('Making the <h5 index> to <image id> dict...')
|
68 |
-
h5idx_to_imgid = {}
|
69 |
-
for img_id in info:
|
70 |
-
h5idx_to_imgid[str(info[img_id]['file']) + '_' + str(info[img_id]['idx'])] = img_id
|
71 |
-
|
72 |
-
for ix in range(16):
|
73 |
-
feat_file = feat_path + '/gqa_objects_' + str(ix) + '.h5'
|
74 |
-
print('Processing', feat_file)
|
75 |
-
|
76 |
-
try:
|
77 |
-
feat_dict = h5py.File(feat_file, 'r')
|
78 |
-
except:
|
79 |
-
print('Failed to open feat file:', feat_file)
|
80 |
-
return
|
81 |
-
|
82 |
-
bboxes = feat_dict['bboxes']
|
83 |
-
features = feat_dict['features']
|
84 |
-
|
85 |
-
for iy in range(features.shape[0]):
|
86 |
-
img_id = h5idx_to_imgid[str(ix) + '_' + str(iy)]
|
87 |
-
img_info = info[img_id]
|
88 |
-
objects_num = img_info['objectsNum']
|
89 |
-
# save to .npz file ['x', 'bbox', 'width', 'height']
|
90 |
-
np.savez(
|
91 |
-
out_path + '/' + img_id + '.npz',
|
92 |
-
x=features[iy, :objects_num],
|
93 |
-
bbox=bboxes[iy, :objects_num],
|
94 |
-
width=img_info['width'],
|
95 |
-
height=img_info['height'],
|
96 |
-
)
|
97 |
-
|
98 |
-
print('Process object features successfully!')
|
99 |
-
|
100 |
-
|
101 |
-
parser = argparse.ArgumentParser(description='gqa_h52npz')
|
102 |
-
parser.add_argument('--mode', '-mode', choices=['object', 'spatial', 'frcn', 'grid'], help='mode', type=str)
|
103 |
-
parser.add_argument('--object_dir', '-object_dir', help='object features dir', type=str)
|
104 |
-
parser.add_argument('--spatial_dir', '-spatial_dir', help='spatial features dir', type=str)
|
105 |
-
parser.add_argument('--out_dir', '-out_dir', help='output dir', type=str)
|
106 |
-
|
107 |
-
args = parser.parse_args()
|
108 |
-
|
109 |
-
mode = args.mode
|
110 |
-
object_path = args.object_dir
|
111 |
-
spatial_path = args.spatial_dir
|
112 |
-
out_path = args.out_dir
|
113 |
-
|
114 |
-
print('mode:', mode)
|
115 |
-
print('object_path:', object_path)
|
116 |
-
print('spatial_path:', spatial_path)
|
117 |
-
print('out_path:', out_path)
|
118 |
-
|
119 |
-
# process spatial features
|
120 |
-
if mode in ['spatial', 'grid']:
|
121 |
-
process_spatial_features(spatial_path, out_path)
|
122 |
-
|
123 |
-
# process object features
|
124 |
-
if mode in ['object', 'frcn']:
|
125 |
-
process_object_features(object_path, out_path)
|
126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/Dual-Key_Backdoor_Attacks/openvqa/openvqa/datasets/gqa/eval/gqa_eval.py
DELETED
@@ -1,307 +0,0 @@
|
|
1 |
-
# --------------------------------------------------------
|
2 |
-
# OpenVQA
|
3 |
-
# Written by Yuhao Cui https://github.com/cuiyuhao1996
|
4 |
-
# --------------------------------------------------------
|
5 |
-
|
6 |
-
from collections import defaultdict
|
7 |
-
from tqdm import tqdm
|
8 |
-
import os.path
|
9 |
-
import glob
|
10 |
-
import json
|
11 |
-
|
12 |
-
|
13 |
-
class GQAEval:
|
14 |
-
def __init__(self, __C, result_eval_file, ques_file_path, choices_path=None, EVAL_CONSISTENCY=False):
|
15 |
-
##### Files Loading
|
16 |
-
##########################################################################################
|
17 |
-
|
18 |
-
# self.question_path = __C.QUESTION_PATH[__C.SPLIT[__C.RUN_MODE]]
|
19 |
-
# self.val_choices_path = __C.EVAL_PATH['val_choices']
|
20 |
-
# self.prediction_path = __C.EVAL_PATH['tmp'] + 'result_run_' + __C.VERSION + '.json'
|
21 |
-
|
22 |
-
# # Load scene graphs
|
23 |
-
# print("Loading scene graphs...")
|
24 |
-
# scenes = self.loadFile(args.scenes.format(tier=args.tier))
|
25 |
-
|
26 |
-
# Load questions
|
27 |
-
print("Loading questions...")
|
28 |
-
questions = self.loadFile(ques_file_path)
|
29 |
-
|
30 |
-
# Load choices
|
31 |
-
choices = None
|
32 |
-
if choices_path is not None:
|
33 |
-
print("Loading choices...")
|
34 |
-
choices = self.loadFile(choices_path)
|
35 |
-
|
36 |
-
# Load predictions and turn them into a dictionary
|
37 |
-
print("Loading predictions...")
|
38 |
-
self.predictions = self.loadFile(result_eval_file)
|
39 |
-
self.predictions = {p["questionId"]: p["prediction"] for p in self.predictions}
|
40 |
-
|
41 |
-
# Make sure all question have predictions
|
42 |
-
for qid in questions:
|
43 |
-
if (qid not in self.predictions) and (EVAL_CONSISTENCY or questions[qid]["isBalanced"]):
|
44 |
-
print("no prediction for question {}. Please add prediction for all questions.".format(qid))
|
45 |
-
raise Exception("missing predictions")
|
46 |
-
|
47 |
-
self.scores = {
|
48 |
-
"accuracy": [], # list of accuracies per question (1 if correct else 0). Will be averaged ultimately.
|
49 |
-
"binary": [], # list of accuracies per a binary question (1 if correct else 0). Will be averaged ultimately.
|
50 |
-
"open": [], # list of accuracies per an open question (1 if correct else 0). Will be averaged ultimately.
|
51 |
-
"validity": [], # list of validity per question (1 if valid else 0).
|
52 |
-
"plausibility": [], # list of plausibility per question (1 if plausible else 0).
|
53 |
-
"consistency": [], # list of consistency scores for entailed questions.
|
54 |
-
"accuracyPerStructuralType": defaultdict(list), # list of question accuracies for each structural type (e.g. compare, logic questions).
|
55 |
-
"accuracyPerSemanticType": defaultdict(list), # list of question accuracies for each semantic type (e.g. questions about an object, an attribute, a relation).
|
56 |
-
"accuracyPerLength": defaultdict(list), # list of question accuracies per question's word number.
|
57 |
-
"accuracyPerSteps": defaultdict(list), # list of question accuracies per question's reasoning length (steps number).
|
58 |
-
"grounding": [] # list of grounding scores for each question.
|
59 |
-
}
|
60 |
-
|
61 |
-
# Initialize golden and predicted histograms per each question group. Used to compute the distribution metric.
|
62 |
-
self.dist = {
|
63 |
-
"gold": defaultdict(lambda: defaultdict(int)),
|
64 |
-
"predicted": defaultdict(lambda: defaultdict(int))
|
65 |
-
}
|
66 |
-
|
67 |
-
##### Main score computation
|
68 |
-
##########################################################################################
|
69 |
-
|
70 |
-
# Loop over the questions and compute mterics
|
71 |
-
for qid, question in tqdm(questions.items()):
|
72 |
-
gold = question["answer"]
|
73 |
-
predicted = self.predictions[qid]
|
74 |
-
|
75 |
-
self.correct = (predicted == gold)
|
76 |
-
score = self.toScore(self.correct)
|
77 |
-
|
78 |
-
wordsNum = self.getWordsNum(question)
|
79 |
-
stepsNum = self.getStepsNum(question)
|
80 |
-
|
81 |
-
# Compute scores over the balanced dataset (more robust against cheating by making educated guesses)
|
82 |
-
if question["isBalanced"]:
|
83 |
-
# Update accuracy
|
84 |
-
self.scores["accuracy"].append(score)
|
85 |
-
self.scores["accuracyPerLength"][wordsNum].append(score)
|
86 |
-
self.scores["accuracyPerSteps"][stepsNum].append(score)
|
87 |
-
self.scores["accuracyPerStructuralType"][question["types"]["structural"]].append(score)
|
88 |
-
self.scores["accuracyPerSemanticType"][question["types"]["semantic"]].append(score)
|
89 |
-
answerType = "open" if question["types"]["structural"] == "query" else "binary"
|
90 |
-
self.scores[answerType].append(score)
|
91 |
-
|
92 |
-
if choices_path is not None:
|
93 |
-
# Update validity score
|
94 |
-
valid = self.belongs(predicted, choices[qid]["valid"], question)
|
95 |
-
self.scores["validity"].append(self.toScore(valid))
|
96 |
-
|
97 |
-
# Update plausibility score
|
98 |
-
plausible = self.belongs(predicted, choices[qid]["plausible"], question)
|
99 |
-
self.scores["plausibility"].append(self.toScore(plausible))
|
100 |
-
|
101 |
-
# Update histograms for gold and predicted answers
|
102 |
-
globalGroup = question["groups"]["global"]
|
103 |
-
if globalGroup is not None:
|
104 |
-
self.dist["gold"][globalGroup][gold] += 1
|
105 |
-
self.dist["predicted"][globalGroup][predicted] += 1
|
106 |
-
|
107 |
-
if EVAL_CONSISTENCY:
|
108 |
-
# Compute consistency (for entailed questions)
|
109 |
-
self.updateConsistency(qid, question, questions)
|
110 |
-
|
111 |
-
# Compute distribution score
|
112 |
-
self.scores["distribution"] = self.chiSquare(self.dist["gold"], self.dist["predicted"]) / 100
|
113 |
-
|
114 |
-
# Average scores over all questions (in the balanced dataset) and print scores
|
115 |
-
|
116 |
-
metrics = [
|
117 |
-
"binary",
|
118 |
-
"open",
|
119 |
-
"accuracy",
|
120 |
-
"consistency",
|
121 |
-
"validity",
|
122 |
-
"plausibility",
|
123 |
-
"grounding",
|
124 |
-
"distribution"
|
125 |
-
]
|
126 |
-
|
127 |
-
detailedMetrics = [
|
128 |
-
("accuracyPerStructuralType", "Accuracy / structural type"),
|
129 |
-
("accuracyPerSemanticType", "Accuracy / semantic type"),
|
130 |
-
("accuracyPerSteps", "Accuracy / steps number"),
|
131 |
-
("accuracyPerLength", "Accuracy / words number")
|
132 |
-
]
|
133 |
-
|
134 |
-
subMetrics = {
|
135 |
-
"attr": "attribute",
|
136 |
-
"cat": "category",
|
137 |
-
"global": "scene",
|
138 |
-
"obj": "object",
|
139 |
-
"rel": "relation"
|
140 |
-
}
|
141 |
-
# average
|
142 |
-
for k in metrics:
|
143 |
-
if isinstance(self.scores[k], list):
|
144 |
-
self.scores[k] = self.avg(self.scores[k]) * 100
|
145 |
-
|
146 |
-
for k, _ in detailedMetrics:
|
147 |
-
for t in self.scores[k]:
|
148 |
-
self.scores[k][t] = self.avg(self.scores[k][t]) * 100, len(self.scores[k][t])
|
149 |
-
|
150 |
-
self.result_string = []
|
151 |
-
self.detail_result_string = []
|
152 |
-
|
153 |
-
# print
|
154 |
-
# print("")
|
155 |
-
for m in metrics:
|
156 |
-
# skip grounding and consistency scores if not requested
|
157 |
-
if m == "grounding":
|
158 |
-
continue
|
159 |
-
if m == "consistency" and not EVAL_CONSISTENCY:
|
160 |
-
continue
|
161 |
-
if m == "validity" and choices_path is None:
|
162 |
-
continue
|
163 |
-
if m == "plausibility" and choices_path is None:
|
164 |
-
continue
|
165 |
-
|
166 |
-
self.result_string.append("{title}: {score:.2f}{suffix}".format(title=m.capitalize(), score=self.scores[m],
|
167 |
-
suffix=" (lower is better)" if m == "distribution" else "%"))
|
168 |
-
# print score
|
169 |
-
# print("{title}: {score:.2f}{suffix}".format(title=m.capitalize(), score=self.scores[m],
|
170 |
-
# suffix=" (lower is better)" if m == "distribution" else "%"))
|
171 |
-
|
172 |
-
for m, mPrintName in detailedMetrics:
|
173 |
-
# print("")
|
174 |
-
# self.detail_result_string.append('\n')
|
175 |
-
|
176 |
-
# print metric title
|
177 |
-
# print("{}:".format(mPrintName))
|
178 |
-
self.detail_result_string.append("{}:".format(mPrintName))
|
179 |
-
|
180 |
-
for t in sorted(list(self.scores[m].keys())):
|
181 |
-
# set sub-metric title
|
182 |
-
tName = t
|
183 |
-
if isinstance(self.scores[k], list):
|
184 |
-
tName = subMetrics.get(t, t).capitalize()
|
185 |
-
|
186 |
-
self.detail_result_string.append(" {title}: {score:.2f}{suffix} ({amount} questions)".format(title=tName,
|
187 |
-
score=self.scores[m][t][0], suffix="%",
|
188 |
-
amount=self.scores[m][t][1]))
|
189 |
-
# # print score
|
190 |
-
# print(" {title}: {score:.2f}{suffix} ({amount} questions)".format(title=tName,
|
191 |
-
# score=self.scores[m][t][0], suffix="%",
|
192 |
-
# amount=self.scores[m][t][1]))
|
193 |
-
|
194 |
-
|
195 |
-
def get_str_result(self):
|
196 |
-
return self.result_string, self.detail_result_string
|
197 |
-
|
198 |
-
def loadFile(self, name):
|
199 |
-
# load standard json file
|
200 |
-
if os.path.isfile(name):
|
201 |
-
with open(name) as file:
|
202 |
-
data = json.load(file)
|
203 |
-
# load file chunks if too big
|
204 |
-
elif os.path.isdir(name.split(".")[0]):
|
205 |
-
data = {}
|
206 |
-
chunks = glob.glob('{dir}/{dir}_*.{ext}'.format(dir = name.split(".")[0], ext = name.split(".")[1]))
|
207 |
-
for chunk in chunks:
|
208 |
-
with open(chunk) as file:
|
209 |
-
data.update(json.load(file))
|
210 |
-
else:
|
211 |
-
raise Exception("Can't find {}".format(name))
|
212 |
-
return data
|
213 |
-
|
214 |
-
# book to float
|
215 |
-
def toScore(self, b):
|
216 |
-
return float(1 if b else 0)
|
217 |
-
|
218 |
-
# Compute average of a list
|
219 |
-
def avg(self, l):
|
220 |
-
if len(l) == 0:
|
221 |
-
return 0
|
222 |
-
return float(sum(l)) / len(l)
|
223 |
-
|
224 |
-
def wavg(self, l, w):
|
225 |
-
if sum(w) == 0:
|
226 |
-
return None
|
227 |
-
return float(sum(l[i] * w[i] for i in range(len(l)))) / sum(w)
|
228 |
-
|
229 |
-
##### Question lengths - words numbers and reasoning steps number
|
230 |
-
##########################################################################################
|
231 |
-
|
232 |
-
# Compute question length (words number)
|
233 |
-
def getWordsNum(self, question):
|
234 |
-
return len(question["question"].split())
|
235 |
-
|
236 |
-
# Compute number of reasoning steps (excluding the final "querying" step which doesn't increase effective reasoning length)
|
237 |
-
def getStepsNum(self, question):
|
238 |
-
return len([c for c in question["semantic"] if not (any([o in "{}: {}".format(c["operation"], c["argument"])
|
239 |
-
for o in ["exist", "query: name", "choose name"]]))])
|
240 |
-
|
241 |
-
# ##### Functions for question annotations
|
242 |
-
# ##########################################################################################
|
243 |
-
#
|
244 |
-
# # Utility function for converting question annotations string keys to slices
|
245 |
-
# def toSlice(self, strSlice):
|
246 |
-
# sliceLims = (int(n) for n in strSlice.split(':'))
|
247 |
-
# return apply(slice, sliceLims)
|
248 |
-
#
|
249 |
-
# # Utility function for converting question annotations string keys to indexes list:
|
250 |
-
# # "1" => [0]
|
251 |
-
# # "1:3" => [1, 2]
|
252 |
-
# # "4:9:2" => [4, 6, 8]
|
253 |
-
# def intsFromSlice(self, strSlice):
|
254 |
-
# slice_obj = get_slice_obj(slicearg)
|
255 |
-
# return (range(slice_obj.start or 0, slice_obj.stop or -1, slice_obj.step or 1))
|
256 |
-
|
257 |
-
##### Functions for validity and plausibility
|
258 |
-
##########################################################################################
|
259 |
-
|
260 |
-
def belongs(self, element, group, question):
|
261 |
-
# normalization ()
|
262 |
-
if "Common" in question["types"]["detailed"]:
|
263 |
-
group = ["color", "material", "shape"]
|
264 |
-
|
265 |
-
return element in group
|
266 |
-
|
267 |
-
##### Functions for consistency scores (for entailed questions ("inferred"))
|
268 |
-
##########################################################################################
|
269 |
-
|
270 |
-
def updateConsistency(self, questionId, question, questions):
|
271 |
-
inferredQuestions = [eid for eid in question["entailed"] if eid != questionId]
|
272 |
-
|
273 |
-
if self.correct and len(inferredQuestions) > 0:
|
274 |
-
|
275 |
-
cosnsitencyScores = []
|
276 |
-
for eid in inferredQuestions:
|
277 |
-
gold = questions[eid]["answer"]
|
278 |
-
predicted = self.predictions[eid]
|
279 |
-
score = self.toScore(predicted == gold)
|
280 |
-
cosnsitencyScores.append(score)
|
281 |
-
|
282 |
-
self.scores["consistency"].append(self.avg(cosnsitencyScores))
|
283 |
-
|
284 |
-
##### Functions for distribution score
|
285 |
-
##########################################################################################
|
286 |
-
|
287 |
-
# Compute chi square statistic of gold distribution vs predicted distribution,
|
288 |
-
# averaged over all question groups
|
289 |
-
def chiSquare(self, goldDist, predictedDist):
|
290 |
-
sumScore, sumOverall = 0, 0
|
291 |
-
|
292 |
-
for group in goldDist:
|
293 |
-
score, overall = 0, 0
|
294 |
-
|
295 |
-
for ans in goldDist[group]:
|
296 |
-
e = goldDist[group][ans]
|
297 |
-
o = predictedDist[group].get(ans, 0)
|
298 |
-
score += ((float(o - e) ** 2) / e)
|
299 |
-
overall += goldDist[group][ans]
|
300 |
-
|
301 |
-
sumScore += score * overall
|
302 |
-
sumOverall += overall
|
303 |
-
|
304 |
-
avgScore = float(sumScore) / sumOverall
|
305 |
-
|
306 |
-
return avgScore
|
307 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/Text2Human/Text2Human/sample_from_pose.py
DELETED
@@ -1,52 +0,0 @@
|
|
1 |
-
import argparse
|
2 |
-
import logging
|
3 |
-
import os.path as osp
|
4 |
-
import random
|
5 |
-
|
6 |
-
import torch
|
7 |
-
|
8 |
-
from data.pose_attr_dataset import DeepFashionAttrPoseDataset
|
9 |
-
from models import create_model
|
10 |
-
from utils.logger import get_root_logger
|
11 |
-
from utils.options import dict2str, dict_to_nonedict, parse
|
12 |
-
from utils.util import make_exp_dirs, set_random_seed
|
13 |
-
|
14 |
-
|
15 |
-
def main():
|
16 |
-
# options
|
17 |
-
parser = argparse.ArgumentParser()
|
18 |
-
parser.add_argument('-opt', type=str, help='Path to option YAML file.')
|
19 |
-
args = parser.parse_args()
|
20 |
-
opt = parse(args.opt, is_train=False)
|
21 |
-
|
22 |
-
# mkdir and loggers
|
23 |
-
make_exp_dirs(opt)
|
24 |
-
log_file = osp.join(opt['path']['log'], f"test_{opt['name']}.log")
|
25 |
-
logger = get_root_logger(
|
26 |
-
logger_name='base', log_level=logging.INFO, log_file=log_file)
|
27 |
-
logger.info(dict2str(opt))
|
28 |
-
|
29 |
-
# convert to NoneDict, which returns None for missing keys
|
30 |
-
opt = dict_to_nonedict(opt)
|
31 |
-
|
32 |
-
# random seed
|
33 |
-
seed = opt['manual_seed']
|
34 |
-
if seed is None:
|
35 |
-
seed = random.randint(1, 10000)
|
36 |
-
logger.info(f'Random seed: {seed}')
|
37 |
-
set_random_seed(seed)
|
38 |
-
|
39 |
-
test_dataset = DeepFashionAttrPoseDataset(
|
40 |
-
pose_dir=opt['pose_dir'],
|
41 |
-
texture_ann_dir=opt['texture_ann_file'],
|
42 |
-
shape_ann_path=opt['shape_ann_path'])
|
43 |
-
test_loader = torch.utils.data.DataLoader(
|
44 |
-
dataset=test_dataset, batch_size=4, shuffle=False)
|
45 |
-
logger.info(f'Number of test set: {len(test_dataset)}.')
|
46 |
-
|
47 |
-
model = create_model(opt)
|
48 |
-
_ = model.inference(test_loader, opt['path']['results_root'])
|
49 |
-
|
50 |
-
|
51 |
-
if __name__ == '__main__':
|
52 |
-
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/WALT/mmdet/models/roi_heads/bbox_heads/__init__.py
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
from .bbox_head import BBoxHead
|
2 |
-
from .convfc_bbox_head import (ConvFCBBoxHead, Shared2FCBBoxHead,
|
3 |
-
Shared4Conv1FCBBoxHead)
|
4 |
-
from .dii_head import DIIHead
|
5 |
-
from .double_bbox_head import DoubleConvFCBBoxHead
|
6 |
-
from .sabl_head import SABLHead
|
7 |
-
from .scnet_bbox_head import SCNetBBoxHead
|
8 |
-
|
9 |
-
__all__ = [
|
10 |
-
'BBoxHead', 'ConvFCBBoxHead', 'Shared2FCBBoxHead',
|
11 |
-
'Shared4Conv1FCBBoxHead', 'DoubleConvFCBBoxHead', 'SABLHead', 'DIIHead',
|
12 |
-
'SCNetBBoxHead'
|
13 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/regionclip-demo/detectron2/modeling/backbone/__init__.py
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
# Copyright (c) Facebook, Inc. and its affiliates.
|
2 |
-
from .build import build_backbone, build_text_backbone, BACKBONE_REGISTRY # noqa F401 isort:skip
|
3 |
-
|
4 |
-
from .backbone import Backbone
|
5 |
-
from .fpn import FPN, LastLevelMaxPool
|
6 |
-
from .regnet import RegNet
|
7 |
-
from .resnet import (
|
8 |
-
BasicStem,
|
9 |
-
ResNet,
|
10 |
-
ResNetBlockBase,
|
11 |
-
build_resnet_backbone,
|
12 |
-
make_stage,
|
13 |
-
BottleneckBlock,
|
14 |
-
)
|
15 |
-
from .clip_backbone import ModifiedResNet, build_resnet_clip, build_clip_resnet_backbone, build_clip_language_encoder
|
16 |
-
from .clip_swin import build_clip_swin, build_clip_swin_backbone
|
17 |
-
|
18 |
-
__all__ = [k for k in globals().keys() if not k.startswith("_")]
|
19 |
-
# TODO can expose more resnet blocks after careful consideration
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Caoyunkang/Segment-Any-Anomaly/SAM/segment_anything/modeling/common.py
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
2 |
-
# All rights reserved.
|
3 |
-
|
4 |
-
# This source code is licensed under the license found in the
|
5 |
-
# LICENSE file in the root directory of this source tree.
|
6 |
-
|
7 |
-
import torch
|
8 |
-
import torch.nn as nn
|
9 |
-
|
10 |
-
from typing import Type
|
11 |
-
|
12 |
-
|
13 |
-
class MLPBlock(nn.Module):
|
14 |
-
def __init__(
|
15 |
-
self,
|
16 |
-
embedding_dim: int,
|
17 |
-
mlp_dim: int,
|
18 |
-
act: Type[nn.Module] = nn.GELU,
|
19 |
-
) -> None:
|
20 |
-
super().__init__()
|
21 |
-
self.lin1 = nn.Linear(embedding_dim, mlp_dim)
|
22 |
-
self.lin2 = nn.Linear(mlp_dim, embedding_dim)
|
23 |
-
self.act = act()
|
24 |
-
|
25 |
-
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
26 |
-
return self.lin2(self.act(self.lin1(x)))
|
27 |
-
|
28 |
-
|
29 |
-
# From https://github.com/facebookresearch/detectron2/blob/main/detectron2/layers/batch_norm.py # noqa
|
30 |
-
# Itself from https://github.com/facebookresearch/ConvNeXt/blob/d1fa8f6fef0a165b27399986cc2bdacc92777e40/models/convnext.py#L119 # noqa
|
31 |
-
class LayerNorm2d(nn.Module):
|
32 |
-
def __init__(self, num_channels: int, eps: float = 1e-6) -> None:
|
33 |
-
super().__init__()
|
34 |
-
self.weight = nn.Parameter(torch.ones(num_channels))
|
35 |
-
self.bias = nn.Parameter(torch.zeros(num_channels))
|
36 |
-
self.eps = eps
|
37 |
-
|
38 |
-
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
39 |
-
u = x.mean(1, keepdim=True)
|
40 |
-
s = (x - u).pow(2).mean(1, keepdim=True)
|
41 |
-
x = (x - u) / torch.sqrt(s + self.eps)
|
42 |
-
x = self.weight[:, None, None] * x + self.bias[:, None, None]
|
43 |
-
return x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/ChrisCaviar/ControlNet-v1-1/utils.py
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
import random
|
2 |
-
|
3 |
-
|
4 |
-
def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|
5 |
-
if randomize_seed:
|
6 |
-
seed = random.randint(0, 1000000)
|
7 |
-
return seed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/ChrisPreston/diff-svc_minato_aqua/utils/audio.py
DELETED
@@ -1,56 +0,0 @@
|
|
1 |
-
import subprocess
|
2 |
-
import matplotlib
|
3 |
-
|
4 |
-
matplotlib.use('Agg')
|
5 |
-
import librosa
|
6 |
-
import librosa.filters
|
7 |
-
import numpy as np
|
8 |
-
from scipy import signal
|
9 |
-
from scipy.io import wavfile
|
10 |
-
|
11 |
-
|
12 |
-
def save_wav(wav, path, sr, norm=False):
|
13 |
-
if norm:
|
14 |
-
wav = wav / np.abs(wav).max()
|
15 |
-
wav *= 32767
|
16 |
-
# proposed by @dsmiller
|
17 |
-
wavfile.write(path, sr, wav.astype(np.int16))
|
18 |
-
|
19 |
-
|
20 |
-
def get_hop_size(hparams):
|
21 |
-
hop_size = hparams['hop_size']
|
22 |
-
if hop_size is None:
|
23 |
-
assert hparams['frame_shift_ms'] is not None
|
24 |
-
hop_size = int(hparams['frame_shift_ms'] / 1000 * hparams['audio_sample_rate'])
|
25 |
-
return hop_size
|
26 |
-
|
27 |
-
|
28 |
-
###########################################################################################
|
29 |
-
def _stft(y, hparams):
|
30 |
-
return librosa.stft(y=y, n_fft=hparams['fft_size'], hop_length=get_hop_size(hparams),
|
31 |
-
win_length=hparams['win_size'], pad_mode='constant')
|
32 |
-
|
33 |
-
|
34 |
-
def _istft(y, hparams):
|
35 |
-
return librosa.istft(y, hop_length=get_hop_size(hparams), win_length=hparams['win_size'])
|
36 |
-
|
37 |
-
|
38 |
-
def librosa_pad_lr(x, fsize, fshift, pad_sides=1):
|
39 |
-
'''compute right padding (final frame) or both sides padding (first and final frames)
|
40 |
-
'''
|
41 |
-
assert pad_sides in (1, 2)
|
42 |
-
# return int(fsize // 2)
|
43 |
-
pad = (x.shape[0] // fshift + 1) * fshift - x.shape[0]
|
44 |
-
if pad_sides == 1:
|
45 |
-
return 0, pad
|
46 |
-
else:
|
47 |
-
return pad // 2, pad // 2 + pad % 2
|
48 |
-
|
49 |
-
|
50 |
-
# Conversions
|
51 |
-
def amp_to_db(x):
|
52 |
-
return 20 * np.log10(np.maximum(1e-5, x))
|
53 |
-
|
54 |
-
|
55 |
-
def normalize(S, hparams):
|
56 |
-
return (S - hparams['min_level_db']) / -hparams['min_level_db']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Christyyu/textgenerator/README.md
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Textgenerator
|
3 |
-
emoji: 📉
|
4 |
-
colorFrom: purple
|
5 |
-
colorTo: purple
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.19.1
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CikeyQI/meme-api/meme_generator/memes/crawl/__init__.py
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
import random
|
2 |
-
from pathlib import Path
|
3 |
-
from typing import List
|
4 |
-
|
5 |
-
from pil_utils import BuildImage
|
6 |
-
from pydantic import Field
|
7 |
-
|
8 |
-
from meme_generator import MemeArgsModel, MemeArgsParser, MemeArgsType, add_meme
|
9 |
-
|
10 |
-
img_dir = Path(__file__).parent / "images"
|
11 |
-
|
12 |
-
|
13 |
-
help = "图片编号,范围为 1~92"
|
14 |
-
|
15 |
-
parser = MemeArgsParser()
|
16 |
-
parser.add_argument("-n", "--number", type=int, default=0, help=help)
|
17 |
-
|
18 |
-
|
19 |
-
class Model(MemeArgsModel):
|
20 |
-
number: int = Field(0, description=help)
|
21 |
-
|
22 |
-
|
23 |
-
def crawl(images: List[BuildImage], texts: List[str], args: Model):
|
24 |
-
total_num = 92
|
25 |
-
if 1 <= args.number <= total_num:
|
26 |
-
num = args.number
|
27 |
-
else:
|
28 |
-
num = random.randint(1, total_num)
|
29 |
-
|
30 |
-
img = images[0].convert("RGBA").circle().resize((100, 100))
|
31 |
-
frame = BuildImage.open(img_dir / f"{num:02d}.jpg")
|
32 |
-
frame.paste(img, (0, 400), alpha=True)
|
33 |
-
return frame.save_jpg()
|
34 |
-
|
35 |
-
|
36 |
-
add_meme(
|
37 |
-
"crawl",
|
38 |
-
crawl,
|
39 |
-
min_images=1,
|
40 |
-
max_images=1,
|
41 |
-
args_type=MemeArgsType(parser, Model),
|
42 |
-
keywords=["爬"],
|
43 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Cpp4App/Cpp4App/CDM/detect_compo/lib_ip/ip_draw.py
DELETED
@@ -1,139 +0,0 @@
|
|
1 |
-
import cv2
|
2 |
-
import numpy as np
|
3 |
-
from random import randint as rint
|
4 |
-
from CDM.config.CONFIG_UIED import Config
|
5 |
-
|
6 |
-
|
7 |
-
C = Config()
|
8 |
-
|
9 |
-
|
10 |
-
def draw_bounding_box_class(org, components, color_map=C.COLOR, line=2, show=False, write_path=None, name='board'):
|
11 |
-
"""
|
12 |
-
Draw bounding box of components with their classes on the original image
|
13 |
-
:param org: original image
|
14 |
-
:param components: bbox [(column_min, row_min, column_max, row_max)]
|
15 |
-
-> top_left: (column_min, row_min)
|
16 |
-
-> bottom_right: (column_max, row_max)
|
17 |
-
:param color_map: colors mapping to different components
|
18 |
-
:param line: line thickness
|
19 |
-
:param compo_class: classes matching the corners of components
|
20 |
-
:param show: show or not
|
21 |
-
:return: labeled image
|
22 |
-
"""
|
23 |
-
board = org.copy()
|
24 |
-
for compo in components:
|
25 |
-
bbox = compo.put_bbox()
|
26 |
-
board = cv2.rectangle(board, (bbox[0], bbox[1]), (bbox[2], bbox[3]), color_map[compo.category], line)
|
27 |
-
# board = cv2.putText(board, compo.category, (bbox[0]+5, bbox[1]+20), cv2.FONT_HERSHEY_SIMPLEX, 0.5, color_map[compo.category], 2)
|
28 |
-
if show:
|
29 |
-
cv2.imshow(name, board)
|
30 |
-
cv2.waitKey(0)
|
31 |
-
if write_path is not None:
|
32 |
-
cv2.imwrite(write_path, board)
|
33 |
-
return board
|
34 |
-
|
35 |
-
|
36 |
-
def draw_bounding_box(org, ratio, components, color=(0, 255, 0), line=2,
|
37 |
-
show=False, write_path=None, name='board', is_return=False, wait_key=0):
|
38 |
-
"""
|
39 |
-
Draw bounding box of components on the original image
|
40 |
-
:param org: original image
|
41 |
-
:param components: bbox [(column_min, row_min, column_max, row_max)]
|
42 |
-
-> top_left: (column_min, row_min)
|
43 |
-
-> bottom_right: (column_max, row_max)
|
44 |
-
:param color: line color
|
45 |
-
:param line: line thickness
|
46 |
-
:param show: show or not
|
47 |
-
:return: labeled image
|
48 |
-
"""
|
49 |
-
if not show and write_path is None and not is_return: return
|
50 |
-
board = org.copy()
|
51 |
-
# board = cv2.imread(img_path)
|
52 |
-
# ratio = board.shape[0]/org.shape[0]
|
53 |
-
|
54 |
-
for compo in components:
|
55 |
-
bbox = compo.put_bbox()
|
56 |
-
|
57 |
-
# bounding box on full size image
|
58 |
-
# bbox = int(ratio * bbox)
|
59 |
-
bbox = [int(x * ratio) for x in bbox]
|
60 |
-
board = cv2.rectangle(board, (bbox[0], bbox[1]), (bbox[2], bbox[3]), color, line)
|
61 |
-
if show:
|
62 |
-
cv2.imshow(name, board)
|
63 |
-
if wait_key is not None:
|
64 |
-
cv2.waitKey(wait_key)
|
65 |
-
if wait_key == 0:
|
66 |
-
cv2.destroyWindow(name)
|
67 |
-
if write_path is not None:
|
68 |
-
# board = cv2.resize(board, (1080, 1920))
|
69 |
-
# board = board[100:-110]
|
70 |
-
cv2.imwrite(write_path, board)
|
71 |
-
return board
|
72 |
-
|
73 |
-
|
74 |
-
def draw_line(org, lines, color=(0, 255, 0), show=False):
|
75 |
-
"""
|
76 |
-
Draw detected lines on the original image
|
77 |
-
:param org: original image
|
78 |
-
:param lines: [line_h, line_v]
|
79 |
-
-> line_h: horizontal {'head':(column_min, row), 'end':(column_max, row), 'thickness':int)
|
80 |
-
-> line_v: vertical {'head':(column, row_min), 'end':(column, row_max), 'thickness':int}
|
81 |
-
:param color: drawn color
|
82 |
-
:param show: show or not
|
83 |
-
:return: image with lines drawn
|
84 |
-
"""
|
85 |
-
board = org.copy()
|
86 |
-
line_h, line_v = lines
|
87 |
-
for line in line_h:
|
88 |
-
cv2.line(board, tuple(line['head']), tuple(line['end']), color, line['thickness'])
|
89 |
-
for line in line_v:
|
90 |
-
cv2.line(board, tuple(line['head']), tuple(line['end']), color, line['thickness'])
|
91 |
-
if show:
|
92 |
-
cv2.imshow('img', board)
|
93 |
-
cv2.waitKey(0)
|
94 |
-
return board
|
95 |
-
|
96 |
-
|
97 |
-
def draw_boundary(components, shape, show=False):
|
98 |
-
"""
|
99 |
-
Draw boundary of objects on the black withe
|
100 |
-
:param components: boundary: [top, bottom, left, right]
|
101 |
-
-> up, bottom: (column_index, min/max row border)
|
102 |
-
-> left, right: (row_index, min/max column border) detect range of each row
|
103 |
-
:param shape: shape or original image
|
104 |
-
:param show: show or not
|
105 |
-
:return: drawn board
|
106 |
-
"""
|
107 |
-
board = np.zeros(shape[:2], dtype=np.uint8) # binary board
|
108 |
-
for component in components:
|
109 |
-
# up and bottom: (column_index, min/max row border)
|
110 |
-
for point in component.boundary[0] + component.boundary[1]:
|
111 |
-
board[point[1], point[0]] = 255
|
112 |
-
# left, right: (row_index, min/max column border)
|
113 |
-
for point in component.boundary[2] + component.boundary[3]:
|
114 |
-
board[point[0], point[1]] = 255
|
115 |
-
if show:
|
116 |
-
cv2.imshow('rec', board)
|
117 |
-
cv2.waitKey(0)
|
118 |
-
return board
|
119 |
-
|
120 |
-
|
121 |
-
def draw_region(region, broad, show=False):
|
122 |
-
color = (rint(0,255), rint(0,255), rint(0,255))
|
123 |
-
for point in region:
|
124 |
-
broad[point[0], point[1]] = color
|
125 |
-
|
126 |
-
if show:
|
127 |
-
cv2.imshow('region', broad)
|
128 |
-
cv2.waitKey()
|
129 |
-
return broad
|
130 |
-
|
131 |
-
|
132 |
-
def draw_region_bin(region, broad, show=False):
|
133 |
-
for point in region:
|
134 |
-
broad[point[0], point[1]] = 255
|
135 |
-
|
136 |
-
if show:
|
137 |
-
cv2.imshow('region', broad)
|
138 |
-
cv2.waitKey()
|
139 |
-
return broad
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Cristiants/captiongeneration/README.md
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Captiongeneration
|
3 |
-
emoji: 👞👟🥾🥿👠👡👢
|
4 |
-
colorFrom: purple
|
5 |
-
colorTo: green
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.19.1
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Cropinky/esrgan/realesrgan/version.py
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
# GENERATED VERSION FILE
|
2 |
-
# TIME: Fri Jun 2 00:17:29 2023
|
3 |
-
__version__ = '0.3.0'
|
4 |
-
__gitsha__ = '5ca1078'
|
5 |
-
version_info = (0, 3, 0)
|
|
|
|
|
|
|
|
|
|
|
|