Commit
·
70e7b61
1
Parent(s):
aa24cd0
Update parquet files (step 8 of 249)
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- README.md +0 -202
- spaces/101-5/gpt4free/g4f/.v1/gpt4free/gptworldAi/__init__.py +0 -105
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Dont Upgrade Your Mac Yet How to Use OBS Studio on Mac OS X 10.12.6.md +0 -44
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Football-Manager-2012-Patch- -v12.2.2-UPDATE-Skidrow Download and Install Guide.md +0 -146
- spaces/1gistliPinn/ChatGPT4/Examples/COOKING MAMA Apk Mod Unlock All Learn Cooking Techniques and Create Your Own Recipes with Unlimited Coins and Levels.md +0 -33
- spaces/1gistliPinn/ChatGPT4/Examples/Download Bullett Raja Movies 1080p Torrent.md +0 -6
- spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Bubble Shooter Un juego de burbujas adictivo y gratuito - APK Descargar.md +0 -130
- spaces/1phancelerku/anime-remove-background/Animal Voice How to Record and Edit Animal Sounds for Your Projects.md +0 -192
- spaces/1phancelerku/anime-remove-background/Descarga Chicken Gun Mod Apk con Dinero Infinito y Menu de Mods.md +0 -102
- spaces/1phancelerku/anime-remove-background/Discover the Truth of the Universe in Mineirinho Ultra Adventures 2 Mobile Illuminati Trail DLC.md +0 -106
- spaces/1phancelerku/anime-remove-background/Download Gas Station Simulator Mod APK - The Best Simulation Game for Android Users.md +0 -97
- spaces/1phancelerku/anime-remove-background/Download Rebaixados Elite Brasil APK and Drive from Different Perspectives.md +0 -129
- spaces/1phancelerku/anime-remove-background/Download and Install God of War Collection for PS3 Emulator (RPCS3) on PC.md +0 -162
- spaces/4Taps/SadTalker/src/face3d/models/arcface_torch/utils/utils_amp.py +0 -88
- spaces/7hao/bingo/tailwind.config.js +0 -48
- spaces/AIConsultant/MusicGen/app.py +0 -463
- spaces/Adr740/CV_XPLORER_POC/README.md +0 -12
- spaces/AgentVerse/agentVerse/agentverse/environments/simulation_env/rules/order/prisoner.py +0 -48
- spaces/AgentVerse/agentVerse/agentverse/environments/simulation_env/rules/visibility/base.py +0 -18
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/confirmdialog/methods/RegisterEvents.js +0 -41
- spaces/Akhil-77/Toxicity_Detector/README.md +0 -13
- spaces/Al-Chan/Vits_League_of_Legends_Yuumi_TTS/attentions.py +0 -303
- spaces/AlexWang/lama/models/ade20k/base.py +0 -627
- spaces/Alfasign/fdvdv/README.md +0 -12
- spaces/Ameaou/academic-chatgpt3.1/crazy_functions/__init__.py +0 -0
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/examples/research_projects/dreambooth_inpaint/train_dreambooth_inpaint_lora.py +0 -831
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/scripts/convert_ms_text_to_video_to_diffusers.py +0 -428
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/schedulers/test_scheduler_kdpm2_ancestral.py +0 -123
- spaces/Andy1621/uniformer_image_demo/app.py +0 -87
- spaces/Andy1621/uniformer_image_detection/configs/groie/README.md +0 -65
- spaces/Andy1621/uniformer_image_detection/configs/groie/faster_rcnn_r50_fpn_groie_1x_coco.py +0 -25
- spaces/Andy1621/uniformer_image_detection/configs/ld/ld_r50_gflv1_r101_fpn_coco_1x.py +0 -19
- spaces/Andy1621/uniformer_image_detection/mmdet/datasets/builder.py +0 -143
- spaces/Andy1621/uniformer_image_segmentation/configs/nonlocal_net/nonlocal_r50-d8_769x769_80k_cityscapes.py +0 -9
- spaces/Anonymous-123/ImageNet-Editing/object_removal/TFill/model/stylegan_ops/style_function.py +0 -236
- spaces/Anonymous-sub/Rerender/ControlNet/annotator/uniformer/mmseg/core/seg/sampler/base_pixel_sampler.py +0 -12
- spaces/AntNikYab/NaturalLanguageProcessing/pages/mayakovsky.py +0 -64
- spaces/Apex-X/GODROOP/app.py +0 -72
- spaces/Artrajz/vits-simple-api/vits/text/ngu_dialect.py +0 -30
- spaces/Autopixel/blurry-faces/kornia_benchmark.py +0 -63
- spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/dev/packaging/README.md +0 -17
- spaces/Banbri/zcvzcv/src/components/ui/tooltip.tsx +0 -30
- spaces/Basil2k4/botbasil203/src/create_user_and_fix_permissions.sh +0 -47
- spaces/Benson/text-generation/Examples/Bicicleta Real De Carreras Mod Apkdone.md +0 -84
- spaces/Benson/text-generation/Examples/Cmo Hacer Un Simulador De Cabra.md +0 -63
- spaces/Benson/text-generation/Examples/Cricket League Mod Apk 1.8.1.md +0 -52
- spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_internal/utils/packaging.py +0 -57
- spaces/Boadiwaa/Recipes/app.py +0 -77
- spaces/CVPR/Dual-Key_Backdoor_Attacks/analyze.py +0 -996
- spaces/CVPR/GFPGAN-example/gfpgan/data/__init__.py +0 -10
README.md
DELETED
@@ -1,202 +0,0 @@
|
|
1 |
-
---
|
2 |
-
configs:
|
3 |
-
- config_name: default
|
4 |
-
data_files:
|
5 |
-
spaces.csv
|
6 |
-
|
7 |
-
license: other
|
8 |
-
language:
|
9 |
-
- code
|
10 |
-
size_categories:
|
11 |
-
- 100K<n<1M
|
12 |
-
---
|
13 |
-

|
14 |
-
|
15 |
-
# 📊 Dataset Description
|
16 |
-
|
17 |
-
This dataset comprises code files of Huggingface Spaces that have more than 0 likes as of November 10, 2023. This dataset contains various programming languages totaling in 672 MB of compressed and 2.05 GB of uncompressed data.
|
18 |
-
|
19 |
-
# 📝 Data Fields
|
20 |
-
|
21 |
-
| Field | Type | Description |
|
22 |
-
|------------|--------|------------------------------------------|
|
23 |
-
| repository | string | Huggingface Spaces repository names. |
|
24 |
-
| sdk | string | Software Development Kit of the space. |
|
25 |
-
| license | string | License type of the space. |
|
26 |
-
|
27 |
-
## 🧩 Data Structure
|
28 |
-
|
29 |
-
Data structure of the data.
|
30 |
-
|
31 |
-
```
|
32 |
-
spaces/
|
33 |
-
├─ author1/
|
34 |
-
│ ├─ space1
|
35 |
-
│ ├─ space2
|
36 |
-
├─ author2/
|
37 |
-
│ ├─ space1
|
38 |
-
│ ├─ space2
|
39 |
-
│ ├─ space3
|
40 |
-
```
|
41 |
-
|
42 |
-
# 🏛️ Licenses
|
43 |
-
|
44 |
-
Huggingface Spaces contains a variety of licenses. Here is the list of the licenses that this dataset contains:
|
45 |
-
|
46 |
-
```python
|
47 |
-
[
|
48 |
-
'None',
|
49 |
-
'mit',
|
50 |
-
'apache-2.0',
|
51 |
-
'openrail',
|
52 |
-
'gpl-3.0',
|
53 |
-
'other',
|
54 |
-
'afl-3.0',
|
55 |
-
'unknown',
|
56 |
-
'creativeml-openrail-m',
|
57 |
-
'cc-by-nc-4.0',
|
58 |
-
'cc-by-4.0',
|
59 |
-
'cc',
|
60 |
-
'cc-by-nc-sa-4.0',
|
61 |
-
'bigscience-openrail-m',
|
62 |
-
'bsd-3-clause',
|
63 |
-
'agpl-3.0',
|
64 |
-
'wtfpl',
|
65 |
-
'gpl',
|
66 |
-
'artistic-2.0',
|
67 |
-
'lgpl-3.0',
|
68 |
-
'cc-by-sa-4.0',
|
69 |
-
'Configuration error',
|
70 |
-
'bsd',
|
71 |
-
'cc-by-nc-nd-4.0',
|
72 |
-
'cc0-1.0',
|
73 |
-
'unlicense',
|
74 |
-
'llama2',
|
75 |
-
'bigscience-bloom-rail-1.0',
|
76 |
-
'gpl-2.0',
|
77 |
-
'bsd-2-clause',
|
78 |
-
'osl-3.0',
|
79 |
-
'cc-by-2.0',
|
80 |
-
'cc-by-3.0',
|
81 |
-
'cc-by-nc-3.0',
|
82 |
-
'cc-by-nc-2.0',
|
83 |
-
'cc-by-nd-4.0',
|
84 |
-
'openrail++',
|
85 |
-
'bigcode-openrail-m',
|
86 |
-
'bsd-3-clause-clear',
|
87 |
-
'eupl-1.1',
|
88 |
-
'cc-by-sa-3.0',
|
89 |
-
'mpl-2.0',
|
90 |
-
'c-uda',
|
91 |
-
'gfdl',
|
92 |
-
'cc-by-nc-sa-2.0',
|
93 |
-
'cc-by-2.5',
|
94 |
-
'bsl-1.0',
|
95 |
-
'odc-by',
|
96 |
-
'deepfloyd-if-license',
|
97 |
-
'ms-pl',
|
98 |
-
'ecl-2.0',
|
99 |
-
'pddl',
|
100 |
-
'ofl-1.1',
|
101 |
-
'lgpl-2.1',
|
102 |
-
'postgresql',
|
103 |
-
'lppl-1.3c',
|
104 |
-
'ncsa',
|
105 |
-
'cc-by-nc-sa-3.0'
|
106 |
-
]
|
107 |
-
```
|
108 |
-
|
109 |
-
# 📊 Dataset Statistics
|
110 |
-
|
111 |
-
| Language | File Extension | File Counts | File Size (MB) | Line Counts |
|
112 |
-
|------------|-----------------|-------------|----------------|-------------|
|
113 |
-
| Python | .py | 141,560 | 1079.0 | 28,653,744 |
|
114 |
-
| SQL | .sql | 21 | 523.6 | 645 |
|
115 |
-
| JavaScript | .js | 6,790 | 369.8 | 2,137,054 |
|
116 |
-
| Markdown | .md | 63,237 | 273.4 | 3,110,443 |
|
117 |
-
| HTML | .html | 1,953 | 265.8 | 516,020 |
|
118 |
-
| C | .c | 1,320 | 132.2 | 3,558,826 |
|
119 |
-
| Go | .go | 429 | 46.3 | 6,331 |
|
120 |
-
| CSS | .css | 3,097 | 25.6 | 386,334 |
|
121 |
-
| C Header | .h | 2,824 | 20.4 | 570,948 |
|
122 |
-
| C++ | .cpp | 1,117 | 15.3 | 494,939 |
|
123 |
-
| TypeScript | .ts | 4,158 | 14.8 | 439,551 |
|
124 |
-
| TSX | .tsx | 4,273 | 9.4 | 306,416 |
|
125 |
-
| Shell | .sh | 3,294 | 5.5 | 171,943 |
|
126 |
-
| Perl | .pm | 92 | 4.2 | 128,594 |
|
127 |
-
| C# | .cs | 22 | 3.9 | 41,265 |
|
128 |
-
|
129 |
-
|
130 |
-
## 🖥️ Language
|
131 |
-
|
132 |
-

|
133 |
-
|
134 |
-
## 📁 Size
|
135 |
-
|
136 |
-

|
137 |
-
|
138 |
-
## 📝 Line Count
|
139 |
-
|
140 |
-

|
141 |
-
|
142 |
-
# 🤗 Huggingface Spaces Statistics
|
143 |
-
|
144 |
-
## 🛠️ Software Development Kit (SDK)
|
145 |
-
|
146 |
-
Software Development Kit pie chart.
|
147 |
-
|
148 |
-

|
149 |
-
|
150 |
-
## 🏛️ License
|
151 |
-
|
152 |
-
License chart.
|
153 |
-
|
154 |
-

|
155 |
-
|
156 |
-
# 📅 Dataset Creation
|
157 |
-
|
158 |
-
This dataset was created in these steps:
|
159 |
-
|
160 |
-
1. Scraped all spaces using the Huggingface Hub API.
|
161 |
-
|
162 |
-
```python
|
163 |
-
from huggingface_hub import HfApi
|
164 |
-
api = HfApi()
|
165 |
-
|
166 |
-
spaces = api.list_spaces(sort="likes", full=1, direction=-1)
|
167 |
-
```
|
168 |
-
|
169 |
-
2. Filtered spaces with more than 0 likes.
|
170 |
-
|
171 |
-
```python
|
172 |
-
a = {}
|
173 |
-
|
174 |
-
for i in tqdm(spaces):
|
175 |
-
i = i.__dict__
|
176 |
-
if i['likes'] > 0:
|
177 |
-
try:
|
178 |
-
try:
|
179 |
-
a[i['id']] = {'sdk': i['sdk'], 'license': i['cardData']['license'], 'likes': i['likes']}
|
180 |
-
except KeyError:
|
181 |
-
a[i['id']] = {'sdk': i['sdk'], 'license': None, 'likes': i['likes']}
|
182 |
-
except:
|
183 |
-
a[i['id']] = {'sdk': "Configuration error", 'license': "Configuration error", 'likes': i['likes']}
|
184 |
-
|
185 |
-
data_list = [{'repository': key, 'sdk': value['sdk'], 'license': value['license'], 'likes': value['likes']} for key, value in a.items()]
|
186 |
-
|
187 |
-
df = pd.DataFrame(data_list)
|
188 |
-
```
|
189 |
-
|
190 |
-
3. Cloned spaces locally.
|
191 |
-
|
192 |
-
```python
|
193 |
-
from huggingface_hub import snapshot_download
|
194 |
-
|
195 |
-
programming = ['.asm', '.bat', '.cmd', '.c', '.h', '.cs', '.cpp', '.hpp', '.c++', '.h++', '.cc', '.hh', '.C', '.H', '.cmake', '.css', '.dockerfile', 'Dockerfile', '.f90', '.f', '.f03', '.f08', '.f77', '.f95', '.for', '.fpp', '.go', '.hs', '.html', '.java', '.js', '.jl', '.lua', 'Makefile', '.md', '.markdown', '.php', '.php3', '.php4', '.php5', '.phps', '.phpt', '.pl', '.pm', '.pod', '.perl', '.ps1', '.psd1', '.psm1', '.py', '.rb', '.rs', '.sql', '.scala', '.sh', '.bash', '.command', '.zsh', '.ts', '.tsx', '.tex', '.vb']
|
196 |
-
pattern = [f"*{i}" for i in programming]
|
197 |
-
|
198 |
-
for i in repos:
|
199 |
-
snapshot_download(i, repo_type="space", local_dir=f"spaces/{i}", allow_patterns=pattern)
|
200 |
-
````
|
201 |
-
|
202 |
-
4. Processed the data to derive statistics.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/101-5/gpt4free/g4f/.v1/gpt4free/gptworldAi/__init__.py
DELETED
@@ -1,105 +0,0 @@
|
|
1 |
-
# -*- coding: utf-8 -*-
|
2 |
-
"""
|
3 |
-
@Time : 2023/5/23 13:37
|
4 |
-
@Auth : Hp_mzx
|
5 |
-
@File :__init__.py.py
|
6 |
-
@IDE :PyCharm
|
7 |
-
"""
|
8 |
-
import json
|
9 |
-
import uuid
|
10 |
-
import random
|
11 |
-
import binascii
|
12 |
-
import requests
|
13 |
-
import Crypto.Cipher.AES as AES
|
14 |
-
from fake_useragent import UserAgent
|
15 |
-
|
16 |
-
class ChatCompletion:
|
17 |
-
@staticmethod
|
18 |
-
def create(messages:[],proxy: str = None):
|
19 |
-
url = "https://chat.getgpt.world/api/chat/stream"
|
20 |
-
headers = {
|
21 |
-
"Content-Type": "application/json",
|
22 |
-
"Referer": "https://chat.getgpt.world/",
|
23 |
-
'user-agent': UserAgent().random,
|
24 |
-
}
|
25 |
-
proxies = {'http': 'http://' + proxy, 'https': 'http://' + proxy} if proxy else None
|
26 |
-
data = json.dumps({
|
27 |
-
"messages": messages,
|
28 |
-
"frequency_penalty": 0,
|
29 |
-
"max_tokens": 4000,
|
30 |
-
"model": "gpt-3.5-turbo",
|
31 |
-
"presence_penalty": 0,
|
32 |
-
"temperature": 1,
|
33 |
-
"top_p": 1,
|
34 |
-
"stream": True,
|
35 |
-
"uuid": str(uuid.uuid4())
|
36 |
-
})
|
37 |
-
signature = ChatCompletion.encrypt(data)
|
38 |
-
res = requests.post(url, headers=headers, data=json.dumps({"signature": signature}), proxies=proxies,stream=True)
|
39 |
-
for chunk in res.iter_content(chunk_size=None):
|
40 |
-
res.raise_for_status()
|
41 |
-
datas = chunk.decode('utf-8').split('data: ')
|
42 |
-
for data in datas:
|
43 |
-
if not data or "[DONE]" in data:
|
44 |
-
continue
|
45 |
-
data_json = json.loads(data)
|
46 |
-
content = data_json['choices'][0]['delta'].get('content')
|
47 |
-
if content:
|
48 |
-
yield content
|
49 |
-
|
50 |
-
|
51 |
-
@staticmethod
|
52 |
-
def random_token(e):
|
53 |
-
token = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
|
54 |
-
n = len(token)
|
55 |
-
return "".join([token[random.randint(0, n - 1)] for i in range(e)])
|
56 |
-
|
57 |
-
@staticmethod
|
58 |
-
def encrypt(e):
|
59 |
-
t = ChatCompletion.random_token(16).encode('utf-8')
|
60 |
-
n = ChatCompletion.random_token(16).encode('utf-8')
|
61 |
-
r = e.encode('utf-8')
|
62 |
-
cipher = AES.new(t, AES.MODE_CBC, n)
|
63 |
-
ciphertext = cipher.encrypt(ChatCompletion.__pad_data(r))
|
64 |
-
return binascii.hexlify(ciphertext).decode('utf-8') + t.decode('utf-8') + n.decode('utf-8')
|
65 |
-
|
66 |
-
@staticmethod
|
67 |
-
def __pad_data(data: bytes) -> bytes:
|
68 |
-
block_size = AES.block_size
|
69 |
-
padding_size = block_size - len(data) % block_size
|
70 |
-
padding = bytes([padding_size] * padding_size)
|
71 |
-
return data + padding
|
72 |
-
|
73 |
-
|
74 |
-
class Completion:
|
75 |
-
@staticmethod
|
76 |
-
def create(prompt:str,proxy:str=None):
|
77 |
-
return ChatCompletion.create([
|
78 |
-
{
|
79 |
-
"content": "You are ChatGPT, a large language model trained by OpenAI.\nCarefully heed the user's instructions. \nRespond using Markdown.",
|
80 |
-
"role": "system"
|
81 |
-
},
|
82 |
-
{"role": "user", "content": prompt}
|
83 |
-
], proxy)
|
84 |
-
|
85 |
-
|
86 |
-
if __name__ == '__main__':
|
87 |
-
# single completion
|
88 |
-
text = ""
|
89 |
-
for chunk in Completion.create("你是谁", "127.0.0.1:7890"):
|
90 |
-
text = text + chunk
|
91 |
-
print(chunk, end="", flush=True)
|
92 |
-
print()
|
93 |
-
|
94 |
-
|
95 |
-
#chat completion
|
96 |
-
message = []
|
97 |
-
while True:
|
98 |
-
prompt = input("请输入问题:")
|
99 |
-
message.append({"role": "user","content": prompt})
|
100 |
-
text = ""
|
101 |
-
for chunk in ChatCompletion.create(message,'127.0.0.1:7890'):
|
102 |
-
text = text+chunk
|
103 |
-
print(chunk, end="", flush=True)
|
104 |
-
print()
|
105 |
-
message.append({"role": "assistant", "content": text})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Dont Upgrade Your Mac Yet How to Use OBS Studio on Mac OS X 10.12.6.md
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
# How to Download and Install OBS Studio on Mac OS X 10.12.6
|
3 |
-
|
4 |
-
OBS Studio is a free and open source software that allows you to record and stream video and audio from your computer. With OBS Studio, you can create professional-looking videos for live streaming, gaming, webinars, podcasts, and more. OBS Studio supports multiple sources, scenes, transitions, filters, and plugins that give you full control over your video production.
|
5 |
-
|
6 |
-
But how can you download and install OBS Studio on Mac OS X 10.12.6? Is there a compatible version for this older operating system? In this article, we will show you how to get OBS Studio up and running on your Mac in a few simple steps.
|
7 |
-
|
8 |
-
## Download OBS Studio for Mac OS X 10.12.6
|
9 |
-
|
10 |
-
The first thing you need to do is to download the OBS Studio installer for Mac OS X 10.12.6 from the official website. The latest version of OBS Studio requires Mac OS X 10.13 or later, but there is an older version (25.0.8) that works with Mac OS X 10.12.6.
|
11 |
-
|
12 |
-
To download OBS Studio for Mac OS X 10.12.6, go to the [download page](https://obsproject.com/download) and scroll down to the "Older Versions" section. Click on the "Mac OS X" tab and look for the version 25.0.8. Click on the "Download Installer" button and save the file to your computer.
|
13 |
-
|
14 |
-
## Install OBS Studio on Mac OS X 10.12.6
|
15 |
-
|
16 |
-
Once you have downloaded the OBS Studio installer for Mac OS X 10.12.6, you can proceed to install it on your computer. To install OBS Studio on Mac OS X 10.12.6, follow these steps:
|
17 |
-
|
18 |
-
- Double-click on the downloaded file (obs-mac-25.0.8-installer.pkg) to launch the installer.
|
19 |
-
- Click on "Continue" and agree to the license agreement.
|
20 |
-
- Choose the destination folder for OBS Studio and click on "Install".
|
21 |
-
- Enter your administrator password if prompted and click on "Install Software".
|
22 |
-
- Wait for the installation to complete and click on "Close".
|
23 |
-
|
24 |
-
## Launch OBS Studio on Mac OS X 10.12.6
|
25 |
-
|
26 |
-
Now that you have installed OBS Studio on your Mac, you can launch it and start using it for your video recording and streaming needs. To launch OBS Studio on Mac OS X 10.12.6, follow these steps:
|
27 |
-
|
28 |
-
- Go to the Applications folder and look for the OBS icon.
|
29 |
-
- Double-click on the OBS icon to open the application.
|
30 |
-
- If you see a warning message saying that "OBS" can't be opened because it is from an unidentified developer, click on "Open Anyway".
|
31 |
-
- If you see a dialog box asking for permission to access your microphone or camera, click on "OK".
|
32 |
-
- You will see the main window of OBS Studio with a preview of your video source and some buttons and menus.
|
33 |
-
- You can now configure your settings, add sources and scenes, apply filters and transitions, and start recording or streaming.
|
34 |
-
|
35 |
-
## Conclusion
|
36 |
-
|
37 |
-
OBS Studio is a powerful and versatile software that can help you create high-quality videos for various purposes. Whether you want to stream live events, record gameplay, or make tutorials, OBS Studio can handle it all.
|
38 |
-
|
39 |
-
However, if you have an older Mac with Mac OS X 10.12.6, you may encounter some compatibility issues with the latest version of OBS Studio. Fortunately, there is an older version of OBS Studio that works with Mac OS X 10.12.6 and can be downloaded and installed easily.
|
40 |
-
|
41 |
-
By following this guide, you can download and install OBS Studio on Mac OS X 10.12.6 and start using it without any problems.</p>
|
42 |
-
<h2>obs studio download mac 10.12.6</h2><br /><p><b><b>DOWNLOAD</b> ✫✫✫ <a href="https://byltly.com/2uKwok">https://byltly.com/2uKwok</a></b></p><br /><br /> ddb901b051<br />
|
43 |
-
<br />
|
44 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Football-Manager-2012-Patch- -v12.2.2-UPDATE-Skidrow Download and Install Guide.md
DELETED
@@ -1,146 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Football Manager 2012 Patch 12.2.2 Update Skidrow</h1>
|
3 |
-
<p>If you are a fan of football management games, you probably have heard of Football Manager 2012, one of the most popular and realistic games in the genre. But did you know that there is a patch 12.2.2 update that adds new features and fixes bugs to the game? And did you know that you can download and install it for free from Skidrow, a group of hackers who crack and release games online? In this article, we will tell you everything you need to know about Football Manager 2012 patch 12.2.2 update Skidrow, including how to download and install it, what's new in it, and why you should try it.</p>
|
4 |
-
<h2>Football-Manager-2012-Patch- -v12.2.2-UPDATE-Skidrow</h2><br /><p><b><b>DOWNLOAD</b> — <a href="https://byltly.com/2uKxkW">https://byltly.com/2uKxkW</a></b></p><br /><br />
|
5 |
-
<h2>Introduction</h2>
|
6 |
-
<h3>What is Football Manager 2012?</h3>
|
7 |
-
<p>Football Manager 2012 is a football management simulation game developed by Sports Interactive and published by Sega in October 2011. It is the eighth game in the Football Manager series, and it allows you to take control of any club from over 50 countries across the world, as well as create your own custom club. You can manage every aspect of your club, from tactics and training to transfers and finances, as well as interact with players, staff, media, and fans. You can also compete with other managers online or offline in various modes and challenges.</p>
|
8 |
-
<h3>What is the Patch 12.2.2 Update?</h3>
|
9 |
-
<p>The patch 12.2.2 update is an official update released by Sports Interactive in March 2012 that fixes some bugs and errors in the game, as well as adds some new features and content. Some of the main changes include:</p>
|
10 |
-
<ul>
|
11 |
-
<li>Improved match engine performance and stability</li>
|
12 |
-
<li>Fixed issues with contracts, transfers, loans, and free agents</li>
|
13 |
-
<li>Updated player and staff data for the winter transfer window</li>
|
14 |
-
<li>Added new leagues and competitions, such as the Australian A-League, the Indian Super League, and the UEFA Europa Conference League</li>
|
15 |
-
<li>Added new graphics and sounds, such as new player faces, kits, logos, trophies, and crowd chants</li>
|
16 |
-
</ul>
|
17 |
-
<h3>What is Skidrow?</h3>
|
18 |
-
<p>Skidrow is a group of hackers who crack and release games online for free. They are known for cracking games that have DRM (digital rights management) protection, such as Steam or Origin, which prevent users from playing games without buying them or having an internet connection. Skidrow has cracked many popular games, such as Assassin's Creed, Call of Duty, FIFA, Grand Theft Auto, and more. They usually release their cracks along with updates or patches for the games.</p>
|
19 |
-
<h2>How to Download and Install the Patch 12.2.2 Update Skidrow</h2>
|
20 |
-
<h3>Requirements</h3>
|
21 |
-
<p>Before you download and install the patch 12.0 update Skidrow, you need to have some requirements:</p>
|
22 |
-
<ul>
|
23 |
-
<li>A PC that meets the minimum system requirements for Football Manager 2010 (you can check them here: https://www.systemrequirementslab.com/cyri/requirements/football-manager-2010/11210)</li>
|
24 |
-
<li>A copy of Football Manager 2010 installed on your PC (you can buy it from Steam or other platforms)</li>
|
25 |
-
<li>A reliable internet connection</li>
|
26 |
-
<li>A torrent client (such as uTorrent or BitTorrent) to download the patch 12.0 update Skidrow file</li>
|
27 |
-
<li>A file extractor (such as WinRAR or 7-Zip) to extract the files from the patch 12.0 update Skidrow file</li>
|
28 |
-
<li>An antivirus software (such as Avast or Norton) to scan the files for viruses or malware</li>
|
29 |
-
</ul>
|
30 |
-
<h3>Steps</h3>
|
31 |
-
<p>Once you have all the requirements ready, you can follow these steps to download and install the patch 12.0 update Skidrow:</p>
|
32 |
-
<h4>Download the Patch 12.0 Update Skidrow from a trusted source</h4>
|
33 |
-
the patch 12.0 update Skidrow file from a trusted source online. You can use a torrent site (such as The Pirate Bay or Kickass Torrents) or a direct download site (such as Mega or Mediafire) to find and download the file.</p>
|
34 |
-
<p>The file size should be around 1 GB, and it should have a name like "Football.Manager.2010.Patch.v12.0-UPDATE-SKIDROW.rar" or something similar.</p>
|
35 |
-
<h4>Extract the files to your Football Manager 2010 folder</h4>
|
36 |
-
<p>The second step is to extract the files from the patch 12.0 update Skidrow file to your Football Manager 2010 folder on your PC.</p>
|
37 |
-
<p>You can use a file extractor (such as WinRAR or 7-Zip) to open the file and extract its contents.</p>
|
38 |
-
<p>Football Manager 2012 Patch v12.2.2 Update Skidrow Download<br />
|
39 |
-
How to Install Football Manager 2012 Patch v12.2.2 Update Skidrow<br />
|
40 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Crack<br />
|
41 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Torrent<br />
|
42 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Review<br />
|
43 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Changelog<br />
|
44 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Fixes<br />
|
45 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Features<br />
|
46 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Gameplay<br />
|
47 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Mods<br />
|
48 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Cheats<br />
|
49 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Tips<br />
|
50 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Guide<br />
|
51 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow System Requirements<br />
|
52 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Free Download<br />
|
53 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Full Version<br />
|
54 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Steam<br />
|
55 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Mac<br />
|
56 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Linux<br />
|
57 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Android<br />
|
58 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow iOS<br />
|
59 |
-
Football Manager 2012 Patch v12.2.2 Update Skidrow Windows<br />
|
60 |
-
Football Manager 2011 vs Football Manager 2010 vs Football Manager 2009 vs Football Manager 2008 vs Football Manager 2007 vs Football Manager 2006 vs Football Manager 2005 vs Football Manager 2004 vs Football Manager 2003 vs Football Manager 2001 vs Championship manager series comparison with patch update skidrow versions.<br />
|
61 |
-
Best Players in Football Manager 2010 with patch update skidrow version.<br />
|
62 |
-
Best Tactics in Football Manager 2009 with patch update skidrow version.<br />
|
63 |
-
Best Teams in Football Manager 2008 with patch update skidrow version.<br />
|
64 |
-
Best Leagues in Football Manager 2007 with patch update skidrow version.<br />
|
65 |
-
Best Transfers in Football Manager 2006 with patch update skidrow version.<br />
|
66 |
-
Best Staff in Football Manager 2005 with patch update skidrow version.<br />
|
67 |
-
Best Training in Football Manager 2004 with patch update skidrow version.<br />
|
68 |
-
Best Scouting in Football Manager 2003 with patch update skidrow version.<br />
|
69 |
-
Best Youth Development in Football Manager 2001 with patch update skidrow version.<br />
|
70 |
-
How to Win the Champions League in Football Manager with patch update skidrow version.<br />
|
71 |
-
How to Win the World Cup in Football Manager with patch update skidrow version.<br />
|
72 |
-
How to Win the Premier League in Football Manager with patch update skidrow version.<br />
|
73 |
-
How to Win the Bundesliga in Football Manager with patch update skidrow version.<br />
|
74 |
-
How to Win the Serie A in Football Manager with patch update skidrow version.<br />
|
75 |
-
How to Win the La Liga in Football Manager with patch update skidrow version.<br />
|
76 |
-
How to Win the Ligue 1 in Football Manager with patch update skidrow version.<br />
|
77 |
-
How to Win the Eredivisie in Football Manager with patch update skidrow version.<br />
|
78 |
-
How to Win the MLS in Football Manager with patch update skidrow version.<br />
|
79 |
-
How to Win the Copa Libertadores in Football Manager with patch update skidrow version.<br />
|
80 |
-
How to Win the Asian Champions League in Football Manager with patch update skidrow version.<br />
|
81 |
-
How to Win the African Champions League in Football Manager with patch update skidrow version.<br />
|
82 |
-
How to Win the Oceania Champions League in Football Manager with patch update skidrow version.</p>
|
83 |
-
<p>You should see a folder named "Football.Manager.2010.Patch.v12-UPDATE-SKIDROW" or something similar inside.</p>
|
84 |
-
<p>You need to copy this folder to your Football Manager 2010 folder on your PC.</p>
|
85 |
-
<p>You can find your Football Manager 2010 folder by following this path: C:\Program Files (x86)\Steam\steamapps\common\Football Manager 2010\ (or wherever you installed your game).</p>
|
86 |
-
<h4>Run the installer and follow the instructions</h4>
|
87 |
-
<p>The third step is to run the installer inside the "Football.Manager-2010.Patch.v12-UPDATE-SKIDROW" folder and follow the instructions on the screen.</p>
|
88 |
-
<p>You should see a file named "setup.exe" or something similar inside.</p>
|
89 |
-
<p>You need to double-click on this file and allow it to run on your PC.</p>
|
90 |
-
<p>You should see a window that asks you to select the language and agree to the terms and conditions.</p>
|
91 |
-
<p>You need to choose your preferred language and click on "I Agree".</p>
|
92 |
-
<p>You should then see another window that asks you to select the destination folder for the patch installation.</p>
|
93 |
-
<p>You need to browse and select your Football Manager 2010 folder on your PC (the same one where you copied the "Football.Manager-2010.Patch.v12-UPDATE-SKIDROW" folder).</p>
|
94 |
-
<p>You should then see another window that shows the progress of the installation.</p>
|
95 |
-
<p>You need to wait until the installation is complete.</p>
|
96 |
-
<h4>Copy the crack files to your Football Manager 2010 folder</h4>
|
97 |
-
<p>The fourth step is to copy the crack files from the "Football.Manager-2010.Patch.v12-UPDATE-SKIDROW" folder to your Football Manager 2010 folder on your PC.</p>
|
98 |
-
<p>You should see a folder named "SKIDROW" inside.</p>
|
99 |
-
<p>You need to open this folder and copy all its contents.</p>
|
100 |
-
<p>You then need to paste them into your Football Manager 2010 folder on your PC (the same one where you installed the patch).</p>
|
101 |
-
<h4>Enjoy the game with the latest updates and features</h4>
|
102 |
-
<p>The final step is to enjoy the game with the latest updates and features.</p>
|
103 |
-
<p>You can launch the game from Steam or from your desktop shortcut.</p>
|
104 |
-
<p>You should see a message that says "Football Manager is now running version v12-UPDATE-SKIDROW".</p>
|
105 |
-
<h5>Congratulations! You have successfully downloaded and installed the patch v12-UPDATE-SKIDROW for Football Manager !</h5>
|
106 |
-
<h5>Note: If you encounter any problems or errors while playing the game, you can check the official website of Sports Interactive (https://www.sigames.com/) or the Skidrow website (https://www.skidrowreloaded.com/) for solutions or support.</h5>
|
107 |
-
<h2>What's New in the Patch 12.2.2 Update Skidrow</h2>
|
108 |
-
<h3>Bug Fixes and Improvements</h3>
|
109 |
-
<p>The patch 12.2.2 update Skidrow fixes some bugs and errors that were present in the previous versions of the game, such as:</p>
|
110 |
-
<ul>
|
111 |
-
<li>Fixed crash issues when loading or saving games</li>
|
112 |
-
<li>Fixed compatibility issues with Windows 10 and DirectX 11</li>
|
113 |
-
<li>Fixed graphical glitches and display errors</li>
|
114 |
-
<li>Fixed gameplay issues such as unrealistic results, player ratings, injuries, and penalties</li>
|
115 |
-
<li>Fixed database issues such as missing or incorrect data, duplicate players, and outdated information</li>
|
116 |
-
<li>Fixed interface issues such as missing or incorrect buttons, menus, and tooltips</li>
|
117 |
-
<li>Fixed network issues such as connection problems, lag, and synchronization errors</li>
|
118 |
-
<li>Fixed editor issues such as missing or incorrect options, functions, and features</li>
|
119 |
-
<li>Fixed localization issues such as missing or incorrect texts, fonts, and languages</li>
|
120 |
-
<li>Fixed security issues such as malware, viruses, and hackers</li>
|
121 |
-
</ul>
|
122 |
-
<h3>New Transfers and Contracts</h3>
|
123 |
-
<p>The patch 12.2.2 update Skidrow also adds some new transfers and contracts that were made during the winter transfer window of 2012, such as:</p>
|
124 |
-
| Player | From | To | Fee | | --- | --- | --- | --- | | Carlos Tevez | Manchester City | AC Milan | £25m | | Thierry Henry | New York Red Bulls | Arsenal | Loan | | Gary Cahill | Bolton Wanderers | Chelsea | £7m | | Papiss Cisse | Freiburg | Newcastle United | £9m | | Alex | Chelsea | Paris Saint-Germain | £4m | | Paul Scholes | Retired | Manchester United | Free | | David Beckham | LA Galaxy | Paris Saint-Germain | Free | | Tim Cahill | Everton | New York Red Bulls | £1m | | Robbie Keane | LA Galaxy | Aston Villa | Loan | | Nicolas Anelka | Chelsea | Shanghai Shenhua | Free | <h3>New Leagues and Competitions</h3>
|
125 |
-
<p>The patch 12.2.2 update Skidrow also adds some new leagues and competitions that were not available in the previous versions of the game, such as:</p>
|
126 |
-
| League/Competition | Country/Region | Level/Format | | --- | --- | --- | | Australian A-League | Australia/New Zealand | Top division/10 teams | | Indian Super League | India | Top division/8 teams | | UEFA Europa Conference League | Europe | Third-tier continental competition/184 teams | | FIFA Club World Cup Expanded Edition | Worldwide | Intercontinental competition/24 teams | | UEFA Nations League Finals | Europe | International competition/4 teams | <h3>New Graphics and Sounds</h3>
|
127 |
-
<p>The patch 12.2.2 update Skidrow also adds some new graphics and sounds that enhance the visual and audio quality of the game, such as:</p>
|
128 |
-
| Graphic/Sound | Description | | --- | --- | | New player faces | More realistic and updated faces for over 500 players | | New kits | More authentic and updated kits for over 100 clubs and national teams | | New logos | More accurate and updated logos for over 200 clubs and competitions | | New trophies | More detailed and realistic trophies for over 50 competitions | | New crowd chants | More diverse and realistic crowd chants for over 50 clubs and national teams | <h2>Conclusion</h2>
|
129 |
-
<h3>Summary of the main points</h3>
|
130 |
-
<p>In conclusion, Football Manager 2012 patch 12.2.2 update Skidrow is an amazing update that improves the game in many ways. It fixes some bugs and errors, adds some new features and content, and enhances the visual and audio quality of the game. It is easy to download and install, and it is free of charge. It is compatible with Windows 10 and DirectX 11, and it works with Steam or other platforms. It is a must-have update for any fan of football management games.</p>
|
131 |
-
<h3>Call to action for the readers</h3>
|
132 |
-
<p>If you are interested in trying out Football Manager 2012 patch 12.2.2 update Skidrow, you can follow the steps we have provided in this article to download and install it on your PC. You can also check out our other articles on how to play Football Manager 2012 better, how to find hidden gems in Football Manager 2012, how to create custom tactics in Football Manager 2012, and more. You can also share your feedback, opinions, questions, or suggestions with us in the comments section below. We would love to hear from you!</p>
|
133 |
-
<h3>Frequently Asked Questions (FAQs)</h3>
|
134 |
-
<ol><li><b>Do I need to have Football Manager 2012 installed on my PC before I download and install the patch 12.2.2 update Skidrow?</b></li></ol>
|
135 |
-
<p>Yes, you need to have Football Manager 2012 installed on your PC before you download and install the patch 12.2.2 update Skidrow. You can buy it from Steam or other platforms.</p>
|
136 |
-
connection to play Football Manager 2012 after I download and install the patch 12.2.2 update Skidrow?</b></li></ol>
|
137 |
-
<p>No, you do not need to have an internet connection to play Football Manager 2012 after you download and install the patch 12.2.2 update Skidrow. You can play it offline or online as you wish.</p>
|
138 |
-
<ol start="3"><li><b>Is the patch 12.2.2 update Skidrow safe to download and install on my PC?</b></li></ol>
|
139 |
-
<p>Yes, the patch 12.2.2 update Skidrow is safe to download and install on your PC. However, you should always scan the files for viruses or malware before you open them, and you should always download them from trusted sources online.</p>
|
140 |
-
<ol start="4"><li><b>Will the patch 12.2.2 update Skidrow affect my saved games or achievements in Football Manager 2012?</b></li></ol>
|
141 |
-
<p>No, the patch 12.2.2 update Skidrow will not affect your saved games or achievements in Football Manager 2012. You can continue playing your saved games or earning your achievements as usual.</p>
|
142 |
-
<ol start="5"><li><b>Can I uninstall the patch 12.2.2 update Skidrow if I do not like it or if it causes problems on my PC?</b></li></ol>
|
143 |
-
<p>Yes, you can uninstall the patch 12.2.2 update Skidrow if you do not like it or if it causes problems on your PC. You can use the uninstaller inside the "Football.Manager-2010.Patch.v12-UPDATE-SKIDROW" folder to remove it from your PC.</p>
|
144 |
-
<h5></h5></p> 0a6ba089eb<br />
|
145 |
-
<br />
|
146 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/COOKING MAMA Apk Mod Unlock All Learn Cooking Techniques and Create Your Own Recipes with Unlimited Coins and Levels.md
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
|
2 |
-
<p>If you want to create a big and wonderful restaurant, then serve your cooking as often as possible. This way people can get the best experience from their meal by eating at an establishment run by someone who cares deeply about food quality!</p>
|
3 |
-
<p>With its intuitive controls, both children and adults can enjoy the game. Also, even if you make mistakes there are no game overs, so everyone can complete dishes. Furthermore, children who play may develop an interest in cooking.</p>
|
4 |
-
<h2>COOKING MAMA Apk Mod Unlock All</h2><br /><p><b><b>Download File</b> >>>>> <a href="https://imgfil.com/2uxWXX">https://imgfil.com/2uxWXX</a></b></p><br /><br />
|
5 |
-
<p>[Game Features]<br>With its intuitive controls, both children and adults can enjoy the game. Also, even if you make mistakes there are no game-overs, so everyone can complete dishes. Furthermore, children who play may develop an interest in cooking.<br><br>[Recommended Setup]<br>Android OS 4.1 or later.<br>**Game may not be playable on certain devices even if the above conditions are met.</p>
|
6 |
-
<p>In the game, Android gamers will find themselves having access to your own interesting cooking adventures with Cooking Mama and Papa. Our two characters will stay with you from the beginning of the game as your cooking mentors and testers. Join them as you discover your own exciting journeys into the world of delicious foods and the fun while cooking them</p>
|
7 |
-
<p>To start with, Android gamers in <strong>Cooking Mama</strong> will find themselves having access to the simple, intuitive and extremely fun gameplay of cooking, in which you can dive into and enjoy it to the fullest. Have fun as you create delicious foods from multiple ingredients and follow amazing recipes. Have it tested by Papa and serve your foods to other villagers. Make delicious in varied categories with the help of the intuitive touch controls. Try out the unique gameplay as you create yummy food and find yourself getting hungry really fast. Fans of the famous Cooking Fever will certainly find themselves having access to yet another amazing cooking game on the mobile devices.</p>
|
8 |
-
<p>Gamers in Cooking Mama will immediately find themselves having access to the friendly and inviting styles of graphics as you dive into the exciting cooking gameplay in the game. The cartoony and adorable cooking tools, ingredients, and animations will also allow gamers to quickly immersed in the gameplay. And most importantly, the undemanding graphics will also guarantee your smooth and satisfying experiences with the game.</p>
|
9 |
-
<p>Do you love cooking unique dishes and searching for a game that helps you to cook various delicious dishes in a unique way? If you think so, then Cooking Mama MOD Apk is the perfect choice for you. There are a number of bonus features available in this cooking game, which can be unlocked as you continue playing the game. These include unlocking new dishes and other items as well as receiving extra points.</p>
|
10 |
-
<p>Cooking Mama is considered the most engaging cooking game for various platforms including android. There is a built-in automatic recipe guide available in the app that will help you to determine the type of dish that you can make for a particular level. Moreover, the recipe guide is very accurate and reliable, so you can be sure that the dish you are making will turn out perfect.</p>
|
11 |
-
<p></p>
|
12 |
-
<p>You can choose your level of difficulty while cooking in this game. If you are a beginner, then start with the easy levels before moving on to the medium ones. The hard levels are very challenging so be prepared for them when you are done with the easy levels.</p>
|
13 |
-
<p>The most important thing in cooking is to be accurate with the timing as the same happened with this post. If you leave your dish in the oven for too long, then it might burn and ruin the whole dish. You also have to wait for the right time before taking it out of the oven and other cooking utensils so that all your dishes achieve perfection.</p>
|
14 |
-
<p>This cooking game features awesome sound effects which make everything feel more fun and enjoyable especially when you are slicing or dicing up ingredients with your knife. You will be able to immerse yourself in the experience of cooking delicious dishes.</p>
|
15 |
-
<p>The best thing about this cooking game is that the controls are very easy to understand and use. You will be able to start cooking right from the next moment as you install the game on your smartphone.</p>
|
16 |
-
<p>There are various mini-games involved in this cooking game which keep things interesting as you keep playing the game over time. Some of these mini-games require fast reflexes while some simply require patience and persistence, but all of them are equally fun to play.</p>
|
17 |
-
<p>You can also challenge your friends and online players to a cook-off to see who can make the best dish. This adds an extra layer of competition to the cooking game and makes it more enjoyable to play. Also, the online players are from all around the world, so you can learn new recipes and cooking tips from them.</p>
|
18 |
-
<p>The best way to grab lots of points in this game is by sharing your recipes with the Cooking Mama community. You can share your own recipes with other players and earn points as a thank you for sharing. These points can be used to upgrade your appliances or unlock new dishes.</p>
|
19 |
-
<p>At the end of this article, I would like to say that Cooking Mama is the best cooking game for android devices ever made for smartphones. From intuitive designs and interesting gameplay, this game has everything that a user can expect from an ideal cooking game.</p>
|
20 |
-
<p>There is no cost associated with playing this cooking game, which makes it even more popular among fans. There are in-app purchases available for players who want to boost their character level while playing or unlocking content faster. You can purchase them or use this Cooking Mama MOD version.</p>
|
21 |
-
<p>Android gamers will have access to their own entertaining cooking adventures with Cooking Mama and Papa in the game. Our two characters will be your cooking tutors and testers from the beginning of the game. Join them as they embark on their own thrilling travels into the world of delectable meals and the fun that comes with preparing them.</p>
|
22 |
-
<p>Cooking with a Twist Mama is a terrible cooking game in which you must assist the renowned cooking mama in preparing and cooking a turkey. However, cooking mama has begun to exhibit her really evil and twisted side, so if you are squeamish, you should avoid playing this game. To prepare and cook the dish, follow the directions step by step.</p>
|
23 |
-
<p><strong>Cooking mama: Let's cook puzzle</strong> - make tasty dishes using foods on the screen and match 3 and more same ones. Improve your culinary skills in this fun game for Android. Make delicious meals easy. To do this just match same ingredients.</p>
|
24 |
-
<p>Join the game, you will play as a young girl trying to learn to cook with Mama and Papa. You will be guided through every small step to complete delicious dishes and please your parents. Cooking is easy as you just tap on the screen to select ingredients, then swipe or rotate to cook, and finally cook with kitchen tools and appliances. Delicious dishes will attract all your eyes with eye-catching colors. Besides, the cooking process is always accompanied by upbeat music, helping you both cook and relax. So, are you ready to cook with your parents? Show your talent to become the most talented kid chef in the house.</p>
|
25 |
-
<p>Your delicious dishes will be judged by your parents and diners. They will give you the number of stars and points corresponding to the quality of the dish. You can use your scores and stars to unlock new ingredients and recipes. If you play hard, you can add dozens of new items to the restaurant menu every day. Cooking is not as difficult as you think. Besides the video tutorial, you just need to use your fingers to cook. As soon as you make a mistake, you can also finish the dish. So this game is really suitable for kids and amateur chefs who love to cook on the phone.</p>
|
26 |
-
<p>You can play minigames to train your brain and relax after hours of cooking in the kitchen. It can be jigsaw puzzles, memorization, number filling, hidden objects, and more. The mini-games are built with lovely, playful pictures and music. You can also compete with your friends on the leaderboards of online minigames. Through these games, the game also gives you many attractive gifts to unlock unique items. Feel free to design your character with impressive clothing items, hair colors, and accessories.</p>
|
27 |
-
<p>With a game for children, this game is designed with a super cute and friendly graphic style. The characters and objects in the game are depicted in a chibi cartoon style. Cooking operations in the first person create a sense of authenticity and fun. The restaurant scene is always filled with bright colors, stimulating the concentration and creativity of all young chefs. And relaxing music will also make you happy all day with the cooking experience here.</p>
|
28 |
-
<p><strong>Cooking Mama: Let's cook! MOD Coins</strong> - A game that will teach you how to cook from scratch! Slice, knead, fry, boil and bake, create a real culinary masterpiece! During the game, uncontrolled urges to eat are possible! Better to play on a full stomach! Cook - playfully, the entire cooking process will be accompanied by cute mini-games, try to do everything perfectly to serve a really tasty and right dish.</p>
|
29 |
-
<p>In the game, you will learn more than 30 recipes for delicious and healthy food, and also try to open your own restaurant, where you will sell your culinary masterpieces. In addition, all food is completely sustainable, go fishing, do gardening and serve customers only your own food. And if you want to take a break from the usual cooking, you can always play interesting mini-games.</p>
|
30 |
-
<p>These recipes are either obtained by default or by purchases. Other options include playing daily (7 days for each recipe) or completing Requests from Papa, labeled under as <b>Bonus</b>. There are 4 recipes that can be obtained through Facebook by inviting your friends to download a copy of the game. All subsequent lists after Starter Recipes require purchases before further unlocking requirements. Purchasing packs will build up a counter that lets you earn more Game Coins.</p>
|
31 |
-
<p>Early builds of the game require you to obtain these recipes via <b>Facebook</b> invitations. Each recipe would be unlocked sequentially as you invite more friends. However, as of December 2016, they can be purchased as a pack without interacting with <b>Facebook</b>. Please note that you will still have to pay the total amount for the pack even if some are already obtained.</p> aaccfb2cb3<br />
|
32 |
-
<br />
|
33 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Download Bullett Raja Movies 1080p Torrent.md
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<h2>Download Bullett Raja Movies 1080p Torrent</h2><br /><p><b><b>Download File</b> ✵ <a href="https://imgfil.com/2uxY08">https://imgfil.com/2uxY08</a></b></p><br /><br />
|
2 |
-
<br />
|
3 |
-
Download Dubbed Torrent Full Movies In HD With Fast and safe Way. ... Bullet Raja Hindi Movie Trailer movie Download in HD mp4, 3Gp, 720p . Bullett Raja ... 4d29de3e1b<br />
|
4 |
-
<br />
|
5 |
-
<br />
|
6 |
-
<p></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Bubble Shooter Un juego de burbujas adictivo y gratuito - APK Descargar.md
DELETED
@@ -1,130 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Bubble Shooter APK: How to Download and Play this Fun Game</h1>
|
3 |
-
<p>If you are looking for a casual puzzle game that is easy to play, addictive, and enjoyable, then you should try Bubble Shooter APK. This is a classic game that has been around for decades, but it never gets old. In this article, we will tell you what Bubble Shooter APK is, how to download and install it on your Android device, how to play it and enjoy its benefits, and some tips and tricks to help you master it.</p>
|
4 |
-
<h2>What is Bubble Shooter APK?</h2>
|
5 |
-
<h3>A brief introduction to the game and its features</h3>
|
6 |
-
<p>Bubble Shooter APK is a free game that you can download from the Google Play Store or from other websites . It is inspired by Puzzle Bobble, a popular arcade game from the 90s. The goal of Bubble Shooter APK is to clear the screen by matching three or more bubbles of the same color. You can use your finger or mouse to aim and shoot bubbles at the rows above your shooter. You can see the next bubble to come in the bottom right corner of the screen. You can also change the color of your bubble by tapping on it.</p>
|
7 |
-
<h2>bubble shooter apk para descargar</h2><br /><p><b><b>Download Zip</b> ✅ <a href="https://urlin.us/2uSSlC">https://urlin.us/2uSSlC</a></b></p><br /><br />
|
8 |
-
<p>Bubble Shooter APK has many features that make it fun and challenging. Some of them are:</p>
|
9 |
-
<ul>
|
10 |
-
<li>It has more than 3000 levels with different layouts, obstacles, and goals.</li>
|
11 |
-
<li>It has new elements and prizes that you can unlock as you progress.</li>
|
12 |
-
<li>It has colorful graphics and sound effects that create a pleasant atmosphere.</li>
|
13 |
-
<li>It has a leaderboard and achievements that you can compete with your friends and other players.</li>
|
14 |
-
<li>It has a colorblind mode that makes it accessible for everyone.</li>
|
15 |
-
</ul>
|
16 |
-
<h3>How to download and install Bubble Shooter APK on your Android device</h3>
|
17 |
-
<p>To download and install Bubble Shooter APK on your Android device, you need to follow these simple steps:</p>
|
18 |
-
<ol>
|
19 |
-
<li>Go to the Google Play Store or any other website that offers Bubble Shooter APK . Make sure that the source is reliable and safe.</li>
|
20 |
-
<li>Tap on the download button or scan the QR code to start downloading the file.</li>
|
21 |
-
<li>Once the download is complete, open the file manager on your device and locate the file.</li>
|
22 |
-
<li>Tap on the file and allow the installation from unknown sources if prompted.</li>
|
23 |
-
<li>Follow the instructions on the screen to complete the installation.</li>
|
24 |
-
<li>Launch the game and enjoy!</li>
|
25 |
-
</ol>
|
26 |
-
<h3>How to play Bubble Shooter APK and enjoy its benefits</h3>
|
27 |
-
<p>To play Bubble Shooter APK, you need to have a basic understanding of how the game works. Here are some guidelines to help you get started:</p>
|
28 |
-
<ul>
|
29 |
-
<li>The game has three modes: classic, arcade, and puzzle. You can choose any mode according to your preference.</li>
|
30 |
-
<li>In each mode, you will have different levels with different objectives. You can see the objective at the top of the screen before starting each level.</li>
|
31 |
-
<li>To clear a level, you need to match three or more bubbles of the same color by shooting them with your shooter. You can aim by moving your finger or mouse on the screen. You can also bounce the bubbles off the walls for tricky shots.</li>
|
32 |
-
<li>You will get points for each bubble you pop. The more bubbles you pop at once, the more points you get. You can also get bonus points for dropping bubbles that are not attached to any other bubbles.</li>
|
33 |
-
<li>You will lose a life if you miss a shot or if the bubbles reach the bottom of the screen. You have a limited number of lives, so be careful.</li>
|
34 |
-
<li>You can use power-ups to help you clear the levels faster and easier. You can get power-ups by popping special bubbles or by buying them with coins.</li>
|
35 |
-
<li>You can earn coins by completing levels, watching ads, or buying them with real money.</li>
|
36 |
-
<li>You can pause the game at any time by tapping on the menu button at the top left corner of the screen. You can also adjust the settings, such as sound, music, and colorblind mode, from the menu.</li>
|
37 |
-
</ul>
|
38 |
-
<h2>Tips and Tricks for Bubble Shooter APK</h2>
|
39 |
-
<h3>How to aim and shoot bubbles effectively</h3>
|
40 |
-
<p>Aiming and shooting bubbles is the most important skill in Bubble Shooter APK. Here are some tips to help you improve your accuracy and efficiency:</p>
|
41 |
-
<ul>
|
42 |
-
<li>Use your finger or mouse to aim carefully before shooting. Don't rush your shots, as you might miss or hit the wrong bubble.</li>
|
43 |
-
<li>Try to create clusters of bubbles of the same color. This will make it easier to pop them and clear the board.</li>
|
44 |
-
<li>Focus on the bubbles that are close to the bottom of the screen. If you let them pile up, they will block your shooter and make it harder to aim.</li>
|
45 |
-
<li>Don't waste your shots on bubbles that are not connected to any other bubbles. They will not affect the board and will only reduce your score.</li>
|
46 |
-
</ul>
|
47 |
-
<h3>How to use the walls and the next bubble indicator</h3>
|
48 |
-
<p>Using the walls and the next bubble indicator can give you an edge in Bubble Shooter APK. Here are some ways to use them effectively:</p>
|
49 |
-
<ul>
|
50 |
-
<li>You can bounce the bubbles off the walls to reach difficult spots or angles. This can help you create more matches and clear more bubbles.</li>
|
51 |
-
<li>You can see the next bubble that will come out of your shooter in the bottom right corner of the screen. You can use this information to plan your next move and strategy.</li>
|
52 |
-
<li>You can also swap the current bubble with the next bubble by tapping on it. This can help you avoid unwanted colors or create better matches.</li>
|
53 |
-
</ul>
|
54 |
-
<h3>How to clear the board and score high points</h3>
|
55 |
-
<p>Clearing the board and scoring high points are the main objectives of Bubble Shooter APK. Here are some strategies to help you achieve them:</p>
|
56 |
-
<ul>
|
57 |
-
<li>Try to pop as many bubbles as possible in one shot. This will give you more points and bonus points for dropping bubbles.</li>
|
58 |
-
<li>Try to clear all the bubbles on the board. This will give you a perfect score and extra coins.</li>
|
59 |
-
<li>Try to complete the level as fast as possible. This will give you a time bonus and more points.</li>
|
60 |
-
<li>Try to use power-ups wisely. They can help you clear more bubbles, but they also cost coins or lives.</li>
|
61 |
-
</ul>
|
62 |
-
<h2>Benefits of Playing Bubble Shooter APK</h2>
|
63 |
-
<h3>It is a free, fun, and relaxing game</h3>
|
64 |
-
<p>Bubble Shooter APK is a game that you can play for free anytime and anywhere. You don't need an internet connection or a subscription to enjoy it. You can play it on your phone, tablet, or computer. It is a game that is suitable for all ages and preferences. It is a game that is fun and relaxing, as it does not require too much thinking or stress. You can play it at your own pace and mood.</p>
|
65 |
-
<h3>It improves your brain skills and concentration</h3>
|
66 |
-
<p>Bubble Shooter APK is a game that can also improve your brain skills and concentration. It is a game that requires you to use your logic, strategy, and observation skills. You have to think fast and smart to clear the levels and score high points. You have to pay attention to the colors, patterns, and movements of the bubbles. You have to focus on your aim and timing. Playing Bubble Shooter APK can help you sharpen your mind and enhance your mental abilities.</p>
|
67 |
-
<p>bubble shooter 2 apk descargar gratis<br />
|
68 |
-
bubble shooter classic pop apk descargar<br />
|
69 |
-
bubble shooter yang games and apps apk descargar<br />
|
70 |
-
bubble shooter apk descargar última versión<br />
|
71 |
-
bubble shooter apk descargar para android<br />
|
72 |
-
bubble shooter wood apk descargar<br />
|
73 |
-
bubble shooter epic puzzles apk descargar<br />
|
74 |
-
bubble shooter apk descargar sin wifi<br />
|
75 |
-
bubble shooter apk descargar 2022<br />
|
76 |
-
bubble shooter apk descargar 3d<br />
|
77 |
-
bubble shooter apk descargar mod<br />
|
78 |
-
bubble shooter apk descargar offline<br />
|
79 |
-
bubble shooter apk descargar hackeado<br />
|
80 |
-
bubble shooter apk descargar sin anuncios<br />
|
81 |
-
bubble shooter apk descargar ilimitado<br />
|
82 |
-
bubble shooter apk descargar divertido<br />
|
83 |
-
bubble shooter apk descargar original<br />
|
84 |
-
bubble shooter apk descargar fácil<br />
|
85 |
-
bubble shooter apk descargar desafío<br />
|
86 |
-
bubble shooter apk descargar sorpresas<br />
|
87 |
-
bubble shooter apk descargar colores<br />
|
88 |
-
bubble shooter apk descargar niveles<br />
|
89 |
-
bubble shooter apk descargar aventura<br />
|
90 |
-
bubble shooter apk descargar adictivo<br />
|
91 |
-
bubble shooter apk descargar relajante<br />
|
92 |
-
bubble shooter space apk descargar<br />
|
93 |
-
bubble shooter panda apk descargar<br />
|
94 |
-
bubble shooter dragon pop apk descargar<br />
|
95 |
-
bubble shooter witch saga apk descargar<br />
|
96 |
-
bubble shooter farm pop 2 apk descargar<br />
|
97 |
-
bubble shooter pet rescue saga apk descargar<br />
|
98 |
-
bubble shooter candy crush saga apk descargar<br />
|
99 |
-
bubble shooter angry birds pop apk descargar<br />
|
100 |
-
bubble shooter frozen pop apk descargar<br />
|
101 |
-
bubble shooter toy blast pop cubes crush apk descargar<br />
|
102 |
-
bubble shooter gummy drop match 3 puzzle game apk descargar<br />
|
103 |
-
bubble shooter cookie jam blast match 3 game apk descargar<br />
|
104 |
-
bubble shooter jewel legend match 3 puzzle game apk descargar<br />
|
105 |
-
bubble shooter garden of flowers match 3 game apk descargar<br />
|
106 |
-
bubble shooter fruit splash match 3 game apk descargar</p>
|
107 |
-
<h3>It offers thousands of levels and challenges</h3>
|
108 |
-
<p>Bubble Shooter APK is a game that offers thousands of levels and challenges for you to enjoy. It has three modes: classic, arcade, and puzzle, each with different objectives and difficulties. It has new elements and prizes that you can unlock as you progress. It has a leaderboard and achievements that you can compete with your friends and other players. It has a colorblind mode that makes it accessible for everyone. Playing Bubble Shooter APK can keep you entertained and satisfied for hours.</p>
|
109 |
-
<h2>Conclusion</h2>
|
110 |
-
<p>Bubble Shooter APK is a game that you should try if you are looking for a casual puzzle game that is easy to play, addictive, and enjoyable. It is a game that has many features that make it fun and challenging. It is a game that can improve your brain skills and concentration. It is a game that offers thousands of levels and challenges for you to enjoy. It is a game that is free, fun, and relaxing. You can download and install Bubble Shooter APK on your Android device easily and safely. You can play it anytime and anywhere. You can also use some tips and tricks to help you master it. If you are ready to pop some bubbles and have some fun, then download Bubble Shooter APK today and start playing!</p>
|
111 |
-
<h2>FAQs</h2>
|
112 |
-
<p>Here are some frequently asked questions about Bubble Shooter APK:</p>
|
113 |
-
<h4>Q: Is Bubble Shooter APK safe to download and install?</h4>
|
114 |
-
<p>A: Yes, Bubble Shooter APK is safe to download and install, as long as you get it from a reliable and secure source, such as the Google Play Store or the official website . You should avoid downloading it from unknown or suspicious sources, as they might contain malware or viruses that can harm your device.</p>
|
115 |
-
<h4>Q: How can I get more coins in Bubble Shooter APK?</h4>
|
116 |
-
<p>A: You can get more coins in Bubble Shooter APK by completing levels, watching ads, or buying them with real money. You can use coins to buy power-ups, lives, or unlock new elements and prizes.</p>
|
117 |
-
<h4>Q: How can I play Bubble Shooter APK with my friends?</h4>
|
118 |
-
<p>A: You can play Bubble Shooter APK with your friends by connecting your game to Facebook or Google Play Games. You can then see your friends' scores and achievements on the leaderboard and challenge them to beat your records. You can also invite them to play with you or send them gifts.</p>
|
119 |
-
<h4>Q: What are the power-ups in Bubble Shooter APK?</h4>
|
120 |
-
<p>A: The power-ups in Bubble Shooter APK are special bubbles that can help you clear the levels faster and easier. Some of the power-ups are:</p>
|
121 |
-
<ul>
|
122 |
-
<li>Bomb: It explodes and pops all the bubbles around it.</li>
|
123 |
-
<li>Fireball: It burns through all the bubbles in its path.</li>
|
124 |
-
<li>Color Changer: It changes the color of all the bubbles of the same color as the one it hits.</li>
|
125 |
-
<li>Rainbow: It matches with any color of bubble.</li>
|
126 |
-
</ul>
|
127 |
-
<h4>Q: How can I contact the developers of Bubble Shooter APK?</h4>
|
128 |
-
<p>A: You can contact the developers of Bubble Shooter APK by sending them an email at [email protected] or by visiting their website. You can also follow them on Facebook, Twitter, or Instagram for updates, news, and tips.</p> 197e85843d<br />
|
129 |
-
<br />
|
130 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Animal Voice How to Record and Edit Animal Sounds for Your Projects.md
DELETED
@@ -1,192 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Animal Voice: How Animals Communicate and How You Can Train Your Pet to Talk</h1>
|
3 |
-
<h2>Introduction</h2>
|
4 |
-
<p>Have you ever wondered what your pet is trying to tell you when they bark, meow, or chirp? Have you ever wished you could teach your pet to talk and understand what they are thinking and feeling? If so, you are not alone. Many animal lovers are fascinated by the idea of animal voice and communication.</p>
|
5 |
-
<p>Animal voice is the term used to describe the sounds, gestures, and other signals that animals use to communicate with each other and with humans. Animal communication is a complex and diverse phenomenon that involves various modes, functions, and contexts. Animal communication is also an important source of information that influences the behavior and decision making of both senders and receivers.</p>
|
6 |
-
<h2>animal voice</h2><br /><p><b><b>Download Zip</b> 🗹 <a href="https://jinyurl.com/2uNQ9C">https://jinyurl.com/2uNQ9C</a></b></p><br /><br />
|
7 |
-
<p>In this article, you will learn more about animal voice and communication, such as what types of signals animals use, how they vary across species and situations, and what benefits and challenges they entail. You will also learn how you can train your pet to talk using recordable dog training buttons, which are devices that allow your pet to express their wants, needs, and thoughts by pressing buttons that produce pre-recorded words. By the end of this article, you will have a better understanding of animal voice and communication, as well as some practical tips and tricks on how to train your pet to talk using buttons.</p>
|
8 |
-
<h2>Types of animal voice and communication</h2>
|
9 |
-
<h3>Visual signals: gestures, facial expressions, colors, patterns, etc.</h3>
|
10 |
-
<p>One of the most common types of animal voice and communication is visual signals. Visual signals are actions or anatomical structures that provide information to another animal through sight. Visual signals can include gestures, facial expressions, body postures, movements, colors, patterns, displays, etc.</p>
|
11 |
-
<p>animal voice changer app<br />
|
12 |
-
animal voice over video<br />
|
13 |
-
animal voice recognition software<br />
|
14 |
-
animal voice translator device<br />
|
15 |
-
animal voice sound effects<br />
|
16 |
-
animal voice therapy for humans<br />
|
17 |
-
animal voice actors in movies<br />
|
18 |
-
animal voice communication research<br />
|
19 |
-
animal voice imitation game<br />
|
20 |
-
animal voice modulation techniques<br />
|
21 |
-
animal voice box surgery<br />
|
22 |
-
animal voice dubbing studio<br />
|
23 |
-
animal voice generator online<br />
|
24 |
-
animal voice identification system<br />
|
25 |
-
animal voice ringtone download<br />
|
26 |
-
animal voice talent agency<br />
|
27 |
-
animal voice comparison chart<br />
|
28 |
-
animal voice frequency range<br />
|
29 |
-
animal voice quiz for kids<br />
|
30 |
-
animal voice activated toys<br />
|
31 |
-
animal voice samples free<br />
|
32 |
-
animal voice memes funny<br />
|
33 |
-
animal voice recording app<br />
|
34 |
-
animal voice classification scheme<br />
|
35 |
-
animal voice synthesizer software<br />
|
36 |
-
animal voice alarm clock<br />
|
37 |
-
animal voice analysis tool<br />
|
38 |
-
animal voice bluetooth speaker<br />
|
39 |
-
animal voice crossword clue<br />
|
40 |
-
animal voice detector circuit<br />
|
41 |
-
animal voice emulator program<br />
|
42 |
-
animal voice filter for snapchat<br />
|
43 |
-
animal voice greeting cards<br />
|
44 |
-
animal voice headphones review<br />
|
45 |
-
animal voice interpreter gadget<br />
|
46 |
-
animal voice jokes hilarious<br />
|
47 |
-
animal voice keyboard online<br />
|
48 |
-
animal voice learning app<br />
|
49 |
-
animal voice mask amazon<br />
|
50 |
-
animal voice navigation app<br />
|
51 |
-
animal voice optimization tips<br />
|
52 |
-
animal voice podcast episodes<br />
|
53 |
-
animal voice quizlet flashcards<br />
|
54 |
-
animal voice reader online<br />
|
55 |
-
animal voice simulator game<br />
|
56 |
-
animal voice training course<br />
|
57 |
-
animal voice usb drive<br />
|
58 |
-
animal voice vocabulary list</p>
|
59 |
-
<h4>Examples of visual signals in different animals</h4>
|
60 |
-
<p>Some examples of visual signals in different animals are:</p>
|
61 |
-
<ul>
|
62 |
-
<li>The parent herring gull displays its bright yellow bill on the ground next over its chick when it has returned to the nest with food. The chicks exhibit a begging response by tapping the red spot on the lower mandible of the parent h <p>erring gull, which triggers the parent to regurgitate food for them.</li>
|
63 |
-
<li>The male peacock displays its colorful and elaborate tail feathers to attract the attention and preference of the female peahen. The size, shape, and symmetry of the tail feathers indicate the quality and fitness of the male peacock.</li>
|
64 |
-
<li>The dog shows its submission or appeasement to another dog or human by lowering its head, tucking its tail, flattening its ears, licking its lips, and avoiding eye contact. These signals indicate that the dog is not a threat and wants to avoid conflict.</li>
|
65 |
-
</ul>
|
66 |
-
<h4>Advantages and disadvantages of visual signals</h4>
|
67 |
-
<p>Visual signals have some advantages and disadvantages as a mode of animal voice and communication. Some of the advantages are:</p>
|
68 |
-
<ul>
|
69 |
-
<li>Visual signals can be fast, precise, and efficient in conveying information over short distances.</li>
|
70 |
-
<li>Visual signals can be modified or adjusted according to the context and the feedback of the receiver.</li>
|
71 |
-
<li>Visual signals can be used to communicate complex and diverse messages, such as identity, status, mood, intention, etc.</li>
|
72 |
-
</ul>
|
73 |
-
<p>Some of the disadvantages are:</p>
|
74 |
-
<ul>
|
75 |
-
<li>Visual signals require a clear line of sight between the sender and the receiver, which can be obstructed by obstacles, distance, or darkness.</li>
|
76 |
-
<li>Visual signals can be costly to produce and maintain, especially if they involve elaborate structures or displays that require energy and resources.</li>
|
77 |
-
<li>Visual signals can be easily detected and exploited by predators, parasites, or competitors, which can pose a risk to the sender or the receiver.</li>
|
78 |
-
</ul>
|
79 |
-
<h3>Auditory signals: sounds, calls, songs, etc.</h3>
|
80 |
-
<p>Another common type of animal voice and communication is auditory signals. Auditory signals are sounds that animals produce and perceive through hearing. Auditory signals can include calls, songs, cries, whistles, clicks, etc.</p>
|
81 |
-
<h4>Examples of auditory signals in different animals</h4>
|
82 |
-
<p>Some examples of auditory signals in different animals are:</p>
|
83 |
-
<ul>
|
84 |
-
<li>The humpback whale produces complex and melodious songs that can last for hours and travel for hundreds of kilometers underwater. The songs are used by males to attract females and to compete with other males during the breeding season.</li>
|
85 |
-
<li>The vervet monkey emits different alarm calls depending on the type of predator it encounters. For example, it makes a high-pitched shriek for aerial predators like eagles, a low-pitched bark for terrestrial predators like leopards, and a chuttering sound for snakes. These calls alert other monkeys to take appropriate defensive actions.</li>
|
86 |
-
<li>The parrot mimics the sounds of other animals or humans that it hears in its environment. The parrot uses these sounds to communicate with its social group, to bond with its mate or owner, or to manipulate or deceive others.</li>
|
87 |
-
</ul>
|
88 |
-
<h4>Advantages and disadvantages of auditory signals</h4>
|
89 |
-
<p>Auditory signals have some advantages and disadvantages as a mode of animal voice and communication. Some of the advantages are:</p>
|
90 |
-
<ul>
|
91 |
-
<li>Auditory signals can travel over long distances and reach multiple receivers at once.</li>
|
92 |
-
<li>Auditory signals can be transmitted and received in any direction, regardless of the orientation or position of the sender or the receiver.</li>
|
93 |
-
<li>Auditory signals can be varied in pitch, volume, duration, rhythm, tone, etc., to convey different meanings and emotions.</li>
|
94 |
-
</ul>
|
95 |
-
<p>Some of the disadvantages are:</p>
|
96 |
-
<ul>
|
97 |
-
<li>Auditory signals can be affected by noise interference from other sources, such as wind, water, traffic, etc.</li>
|
98 |
-
<li>Auditory signals can be difficult to localize or identify the source or direction of the sound.</li>
|
99 |
-
<li>Auditory signals can be hard to modify or retract once they are emitted.</li>
|
100 |
-
</ul>
|
101 |
-
<h3>Chemical signals: pheromones, scents, tastes, etc.</h3>
|
102 |
-
<p>A less obvious but equally important type of animal voice and communication is chemical signals. Chemical signals are substances that animals secrete or release into their environment that affect the behavior or physiology of another animal through smell or taste. Chemical signals can include pheromones, scents, tastes, etc.</p>
|
103 |
-
<h4>Examples of chemical signals in different animals</h4>
|
104 |
-
<p>Some examples of chemical signals in different animals are:</p>
|
105 |
-
<ul>
|
106 |
-
<li>The honey bee releases a pheromone called alarm pheromone when it stings an intruder. The pheromone attracts other bees to join the attack and defend the hive.</li>
|
107 |
-
<li>The cat rubs its cheek glands on objects or people that it likes or owns. The scent marks its territory and signals its affiliation and identity to other cats.</li>
|
108 |
-
<li>The ant follows a trail of pheromones left by other ants to find food sources or nest sites. The pheromones also indicate the quality and quantity of the food or the suitability of the nest.</li>
|
109 |
-
</ul>
|
110 |
-
<h4>Advantages and disadvantages of chemical signals</h4>
|
111 |
-
<p>Chemical signals have some advantages and disadvantages as a mode of animal voice and communication. Some of the advantages are:</p>
|
112 |
-
<ul>
|
113 |
-
<li>Chemical signals can persist for a long time and remain effective even when the sender or the receiver is absent.</li>
|
114 |
-
<li>Chemical signals can convey information that is not easily detected by other senses, such as genetic compatibility, reproductive status, health condition, etc.</li>
|
115 |
-
<li>Chemical signals can be combined with other modes of communication to enhance or modify their effects.</li>
|
116 |
-
</ul>
|
117 |
-
<p>Some of the disadvantages are:</p>
|
118 |
-
<ul>
|
119 |
-
<li>Chemical signals can be slow to reach the receiver and require close proximity or contact.</li>
|
120 |
-
<li>Chemical signals can be diluted, degraded, or masked by environmental factors, such as temperature, humidity, wind, etc.</li>
|
121 |
-
<li>Chemical signals can be difficult to interpret or distinguish from other sources, especially if they are similar or overlapping.</li>
|
122 |
-
</ul>
|
123 |
-
<h3>Tactile signals: touch, vibration, electric fields, etc.</h3>
|
124 |
-
<p>The last type of animal voice and communication that we will discuss is tactile signals. Tactile signals are physical stimuli that animals apply or receive through touch or other forms of contact. Tactile signals can include touch, vibration, electric fields, etc.</p>
|
125 |
-
<h4>Examples of tactile signals in different animals</h4>
|
126 |
-
<p>Some examples of tactile signals in different animals are:</p>
|
127 |
-
<ul>
|
128 |
-
<li>The elephant uses its trunk to touch and caress other elephants as a sign of affection, reassurance, or comfort. The trunk also serves as a tool for exploring, manipulating, and communicating with objects and other animals.</li>
|
129 |
-
<li>The spider senses the vibration of its web when a prey or a predator approaches. The spider can also use its legs to send vibration signals to other spiders for mating or territorial purposes.</li>
|
130 |
-
<li>The electric eel generates electric pulses that it uses to navigate, locate, and stun its prey. The electric eel can also communicate with other electric eels by modulating the frequency and intensity of its electric pulses.</li>
|
131 |
-
</ul>
|
132 |
-
<h4>Advantages and disadvantages of tactile signals</h4>
|
133 |
-
<p>Tactile signals have some advantages and disadvantages as a mode of animal voice and communication. Some of the advantages are:</p>
|
134 |
-
<ul>
|
135 |
-
<li>Tactile signals can be very precise and specific in conveying information to a single or a few receivers.</li>
|
136 |
-
<li>Tactile signals can be used in situations where other modes of communication are ineffective or unavailable, such as in darkness, silence, or underwater.</li>
|
137 |
-
<li>Tactile signals can elicit immediate and strong responses from the receiver, such as arousal, alarm, or pain.</li>
|
138 |
-
</ul>
|
139 |
-
<p>Some of the disadvantages are:</p>
|
140 |
-
<ul>
|
141 |
-
<li>Tactile signals require direct contact or close proximity between the sender and the receiver, which can limit their range and scope.</li>
|
142 |
-
<li>Tactile signals can be invasive or unwanted by the receiver, especially if they are aggressive or harmful.</li>
|
143 |
-
<li>Tactile signals can be easily disrupted or blocked by physical barriers or interference.</li>
|
144 |
-
</ul>
|
145 |
-
<h2>How to train your pet to talk using buttons</h2>
|
146 |
-
<h3>What are recordable dog training buttons and how do they work?</h3>
|
147 |
-
<p>If you want to train your pet to talk using buttons, you will need some recordable dog training buttons. These are devices that allow your pet to express their wants, needs, and thoughts by pressing buttons that produce pre-recorded words. For example, you can record words like "outside", "play", "water", "treat", etc., on different buttons and place them on a mat or a board. Then you can teach your pet to associate each button with its corresponding word and action. When your pet wants something or wants to communicate something to you, they can press the appropriate button and hear the word spoken out loud.</p>
|
148 |
-
<p>Recordable dog training buttons are based on the idea that animals can learn to use symbols or words to communicate with humans. This idea has been tested and proven by many studies and experiments involving animals like chimpanzees, dolphins, parrots, etc. Recordable dog training buttons are also inspired by augmentative and alternative communication (AAC) devices that are used by humans who have speech impairments or disabilities. AAC devices help these humans communicate with others using pictures, symbols, gestures, sounds, etc.</p>
|
149 |
-
<p>Recordable dog training buttons are easy to use and affordable <p>Recordable dog training buttons are easy to use and affordable, and you can find them online or in pet stores. For example, you can check out the PawTalk Recordable Dog Buttons, the Hunger for Words Talking Pet Starter Set, the Talking Products Talking Tiles, or the Decdeal Recordable Talking Button With LED Function. These are some of the popular and recommended products that you can use to train your pet to talk using buttons.</p>
|
150 |
-
<h3>How to teach your dog to speak on command using buttons</h3>
|
151 |
-
<p>One of the simplest and most fun ways to train your pet to talk using buttons is to teach them to speak on command. This means that you will teach your dog to bark when you ask them to, and then associate that bark with a word on a button. For example, you can teach your dog to say "hello" by barking when you say "hello" and then pressing a button that says "hello". This way, your dog will learn that barking and pressing the button are both ways of saying "hello". Here are the steps to teach your dog to speak on command using buttons:</p>
|
152 |
-
<h4>Step 1: Have your reward ready</h4>
|
153 |
-
<p>The first step is to have a reward ready for your dog. This can be a treat, a toy, or praise, depending on what your dog likes best. You will use this reward to reinforce your dog's behavior and make them more likely to repeat it. Make sure you have enough rewards for multiple repetitions and sessions.</p>
|
154 |
-
<h4>Step 2: Get your dog to speak naturally</h4>
|
155 |
-
<p>The next step is to get your dog to speak naturally. This means that you will wait for your dog to bark on their own, without prompting them. You can do this by observing your dog and noticing what triggers them to bark, such as a doorbell, a squirrel, or another dog. You can also try to make your dog excited or curious by playing with them, showing them something interesting, or hiding behind something. When your dog barks, mark the behavior with a clicker or a word like "yes" or "good". Then give them the reward immediately.</p>
|
156 |
-
<h4>Step 3: Mark the bark with a cue word and a reward</h4>
|
157 |
-
<p>The third step is to mark the bark with a cue word and a reward. This means that you will say a word that you want your dog to associate with barking, such as "speak", "talk", or "bark", right before or as your dog barks. Then give them the reward as usual. For example, if you want your dog to say "hello", you can say "hello" when they bark and then give them the reward. Repeat this several times until your dog learns that barking when you say "hello" earns them a reward.</p>
|
158 |
-
<h4>Step 4: Add a hand signal if desired</h4>
|
159 |
-
<p>The fourth step is optional, but it can help your dog learn faster and more reliably. You can add a hand signal that matches the cue word, such as waving your hand or pointing at your mouth, when you say the word and wait for your dog to bark. Then give them the reward as usual. For example, if you want your dog to say "hello", you can wave your hand and say "hello" when they bark and then give them the reward. Repeat this several times until your dog learns that barking when you wave your hand and say "hello" earns them a reward.</p>
|
160 |
-
<h4>Step 5: Practice and reinforce the behavior consistently</h4>
|
161 |
-
<p>The final step is to practice and reinforce the behavior consistently. This means that you will ask your dog to speak on command using the cue word and/or the hand signal, and then reward them for barking. You can also introduce a button that says the word that you want your dog to say, such as "hello", and place it near your dog. When your dog barks on command, press the button for them so they can hear the word spoken out loud. Then give them the reward as usual. Repeat this several times until your dog learns that barking on command and pressing the button are both ways of saying the word.</p>
|
162 |
-
<h3>Tips and tricks for training your dog to speak using buttons</h3>
|
163 |
-
<p>Training your pet to talk using buttons can be a fun and rewarding experience for both of you, but it also requires some patience and consistency. Here are some tips and tricks that can help you train your pet more effectively:</p>
|
164 |
-
<h4>Be patient and consistent</h4>
|
165 |
-
<p>Don't expect your pet to learn overnight or without mistakes. It may take some time and practice for your pet to understand what you want them to do and how to do it correctly. Be patient and consistent with <p>Be patient and consistent with your training sessions, and don't give up or get frustrated if your pet doesn't get it right away. Keep the sessions short, fun, and positive, and end on a high note. Reward your pet for every correct response, and ignore or redirect any incorrect or unwanted behavior. Gradually increase the difficulty and complexity of the commands and the buttons as your pet progresses.</p>
|
166 |
-
<h4>Reward only barking on command and not nuisance barking</h4>
|
167 |
-
<p>One of the potential drawbacks of teaching your pet to speak using buttons is that they may start to bark excessively or inappropriately, such as when they are bored, anxious, or attention-seeking. This can be annoying and disruptive for you and your neighbors. To prevent this, you should only reward your pet for barking on command and not for nuisance barking. You should also teach your pet a "quiet" command that tells them to stop barking, and reward them for obeying it. You can also provide your pet with enough mental and physical stimulation, such as toys, games, walks, etc., to keep them happy and occupied.</p>
|
168 |
-
<h4>Capture and mark only a single bark or a desired number of barks</h4>
|
169 |
-
<p>Another challenge of teaching your pet to speak using buttons is that they may bark too much or too little when you ask them to. For example, they may bark multiple times when you want them to say "hello", or they may not bark at all when you want them to say "yes". To avoid this, you should capture and mark only a single bark or a desired number of barks when you train your pet. You can do this by using a clicker or a word like "yes" or "good" to mark the exact moment when your pet barks the way you want them to. Then give them the reward immediately. This will help your pet learn to control their barking and match it with the word on the button.</p>
|
170 |
-
<h4>Be mindful of your neighbors and the noise level of your dog's barking</h4>
|
171 |
-
<p>The last tip for training your pet to speak using buttons is to be mindful of your neighbors and the noise level of your dog's barking. Some people may not appreciate hearing your dog talk all day long, especially if they are loud or frequent. You should respect your neighbors' privacy and comfort, and try to limit your training sessions to reasonable hours and durations. You should also choose words that are not too loud or harsh, such as "hi", "ok", "yay", etc., instead of words that are louder or more aggressive, such as "no", "stop", "bad", etc. You can also use volume control buttons that allow you to adjust the loudness of the words on the buttons.</p>
|
172 |
-
<h2>Conclusion</h2>
|
173 |
-
<h3>Summary of the main points of the article</h3>
|
174 |
-
<p>In conclusion, animal voice and communication are fascinating and diverse phenomena that involve various types of signals, such as visual, auditory, chemical, and tactile signals. Animals use these signals to communicate with each other and with humans for various purposes, such as survival, reproduction, socialization, etc. Animal voice and communication have some advantages and disadvantages depending on the mode, function, and context of the communication.</p>
|
175 |
-
<p>You can also train your pet to talk using recordable dog training buttons, which are devices that allow your pet to express their wants, needs, and thoughts by pressing buttons that produce pre-recorded words. You can teach your pet to speak on command using buttons by following some simple steps, such as having a reward ready, getting your pet to speak naturally, marking the bark with a cue word and a reward, adding a hand signal if desired, and practicing and reinforcing the behavior consistently. You can also use some tips and tricks to train your pet more effectively, such as being patient and consistent, rewarding only barking on command and not nuisance barking <p>rewarding only barking on command and not nuisance barking, capturing and marking only a single bark or a desired number of barks, and being mindful of your neighbors and the noise level of your dog's barking.</p>
|
176 |
-
<p>By training your pet to talk using buttons, you can enhance your bond with your pet, enrich your pet's mental and physical well-being, and have fun and meaningful conversations with your pet. You can also learn more about your pet's personality, preferences, and emotions, and appreciate the diversity and complexity of animal voice and communication.</p>
|
177 |
-
<h3>Call to action for the readers to try training their pet to talk using buttons</h3>
|
178 |
-
<p>If you are interested in training your pet to talk using buttons, why not give it a try? You can start by getting some recordable dog training buttons online or in pet stores, and following the steps and tips that we have shared in this article. You can also watch some videos or read some stories of other pet owners who have successfully trained their pets to talk using buttons, such as Bunny the talking dog, Stella the talking dog, or Billi Speaks. These are some of the amazing and inspiring examples of pets who have learned to communicate with their humans using buttons.</p>
|
179 |
-
<p>Training your pet to talk using buttons can be a rewarding and enjoyable experience for both of you, and you may be surprised by how much your pet has to say. So don't hesitate and start training your pet to talk using buttons today!</p>
|
180 |
-
<h2>FAQs</h2>
|
181 |
-
<h3>What is animal voice and communication?</h3>
|
182 |
-
<p>Animal voice and communication are the sounds, gestures, and other signals that animals use to communicate with each other and with humans.</p>
|
183 |
-
<h3>What types of signals do animals use to communicate?</h3>
|
184 |
-
<p>Animals use various types of signals to communicate, such as visual, auditory, chemical, and tactile signals.</p>
|
185 |
-
<h3>What are recordable dog training buttons?</h3>
|
186 |
-
<p>Recordable dog training buttons are devices that allow your pet to express their wants, needs, and thoughts by pressing buttons that produce pre-recorded words.</p>
|
187 |
-
<h3>How can I train my pet to speak on command using buttons?</h3>
|
188 |
-
<p>You can train your pet to speak on command using buttons by following some simple steps, such as having a reward ready, getting your pet to speak naturally, marking the bark with a cue word and a reward, adding a hand signal if desired, and practicing and reinforcing the behavior consistently.</p>
|
189 |
-
<h3>What are some tips and tricks for training my pet to speak using buttons?</h3>
|
190 |
-
<p>Some tips and tricks for training your pet to speak using buttons are being patient and consistent, rewarding only barking on command and not nuisance barking, capturing and marking only a single bark or a desired number of barks, and being mindful of your neighbors and the noise level of your dog's barking.</p> 401be4b1e0<br />
|
191 |
-
<br />
|
192 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Descarga Chicken Gun Mod Apk con Dinero Infinito y Menu de Mods.md
DELETED
@@ -1,102 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Chicken Gun Dinero Infinito APK: How to Download and Play the Ultimate Shooting Game</h1>
|
3 |
-
<p>If you are looking for a fun and hilarious multiplayer shooter game, you should try Chicken Gun. This game lets you play as a chicken with a gun, and your goal is to shoot other chickens in various maps and modes. You can also customize your chicken with different weapons, accessories, and skins. But what if you want to have more money and health in the game? That's where Chicken Gun Dinero Infinito APK comes in. This is a modified version of the game that gives you unlimited resources and advantages. In this article, we will tell you what Chicken Gun is, what Chicken Gun Dinero Infinito APK is, and how to download and install it on your device.</p>
|
4 |
-
<h2>chicken gun dinero infinito apk</h2><br /><p><b><b>DOWNLOAD</b> 🗸 <a href="https://jinyurl.com/2uNQhm">https://jinyurl.com/2uNQhm</a></b></p><br /><br />
|
5 |
-
<h2>What is Chicken Gun?</h2>
|
6 |
-
<h3>A hilarious and addictive multiplayer shooter game</h3>
|
7 |
-
<p>Chicken Gun is a game developed by ChaloApps, a studio based in Argentina. It was released in 2020 for Android and iOS devices. The game is a 3D shooter game that features chickens as the main characters. You can play as a chicken with a gun, and your objective is to shoot other chickens in different maps and modes. You can play solo or with your friends online, and compete with other players from around the world. The game has a cartoonish and colorful graphics style, and a funny sound effects and music. The game is suitable for all ages, as it does not contain any gore or violence.</p>
|
8 |
-
<h3>Features of Chicken Gun</h3>
|
9 |
-
<h4>Play as shooting chickens</h4>
|
10 |
-
<p>The game lets you choose from different types of chickens, such as white, brown, black, or rainbow. Each chicken has its own stats, such as speed, health, damage, and accuracy. You can also upgrade your chicken's skills with coins that you earn from playing the game.</p>
|
11 |
-
<h4>Choose from various weapons</h4>
|
12 |
-
<p>The game offers a variety of weapons that you can use to shoot other chickens, such as pistols, rifles, shotguns, snipers, rocket launchers, grenades, and more. Each weapon has its own characteristics, such as range, fire rate, reload time, and ammo capacity. You can also switch between different weapons during the game.</p>
|
13 |
-
<p>chicken gun mod apk unlimited money<br />
|
14 |
-
chicken gun hack apk download<br />
|
15 |
-
chicken gun mod menu apk mediafire<br />
|
16 |
-
chicken gun game online<br />
|
17 |
-
chicken gun apk mod menu 2023<br />
|
18 |
-
chicken gun dinheiro infinito atualizado<br />
|
19 |
-
chicken gun mod apk latest version<br />
|
20 |
-
chicken gun hack apk 2023<br />
|
21 |
-
chicken gun game download<br />
|
22 |
-
chicken gun apk mod menu download<br />
|
23 |
-
chicken gun dinheiro infinito mediafire<br />
|
24 |
-
chicken gun mod apk android 1<br />
|
25 |
-
chicken gun hack apk mediafire<br />
|
26 |
-
chicken gun game mod apk<br />
|
27 |
-
chicken gun apk mod menu atualizado<br />
|
28 |
-
chicken gun dinheiro infinito 2023<br />
|
29 |
-
chicken gun mod apk free download<br />
|
30 |
-
chicken gun hack apk android 1<br />
|
31 |
-
chicken gun game hack<br />
|
32 |
-
chicken gun apk mod menu free fire<br />
|
33 |
-
chicken gun dinheiro infinito download<br />
|
34 |
-
chicken gun mod apk unlimited gems<br />
|
35 |
-
chicken gun hack apk free fire<br />
|
36 |
-
chicken gun game online multiplayer<br />
|
37 |
-
chicken gun apk mod menu hack<br />
|
38 |
-
chicken gun dinheiro infinito gratis<br />
|
39 |
-
chicken gun mod apk no root<br />
|
40 |
-
chicken gun hack apk no root<br />
|
41 |
-
chicken gun game offline<br />
|
42 |
-
chicken gun apk mod menu no root<br />
|
43 |
-
chicken gun dinheiro infinito no root<br />
|
44 |
-
chicken gun mod apk offline<br />
|
45 |
-
chicken gun hack apk offline<br />
|
46 |
-
chicken gun game play store<br />
|
47 |
-
chicken gun apk mod menu offline<br />
|
48 |
-
chicken gun dinheiro infinito play store<br />
|
49 |
-
chicken gun mod apk online multiplayer<br />
|
50 |
-
chicken gun hack apk online multiplayer<br />
|
51 |
-
chicken gun game review<br />
|
52 |
-
chicken gun apk mod menu play store<br />
|
53 |
-
chicken gun dinheiro infinito para android<br />
|
54 |
-
chicken gun mod apk rexdl<br />
|
55 |
-
chicken gun hack apk rexdl<br />
|
56 |
-
chicken gun game trailer<br />
|
57 |
-
chicken gun apk mod menu rexdl<br />
|
58 |
-
chicken gun dinheiro infinito sem root<br />
|
59 |
-
chicken gun mod apk unlimited health<br />
|
60 |
-
chicken gun hack apk unlimited health</p>
|
61 |
-
<h4>Defeat other players online</h4>
|
62 |
-
<p>The game has several modes that you can play online with other players, such as deathmatch, team deathmatch, capture the flag, zombie mode, and more. You can join or create a room with up to 10 players per team, and chat with them using voice or text messages. You can also view your stats and rank on the leaderboard.</p>
|
63 |
-
<h4>Customize your cute chickens</h4>
|
64 |
-
<p>The game allows you to personalize your chicken with different accessories, such as hats, glasses, masks, helmets, backpacks, wings, tails, and more. You can also change your chicken's skin color and pattern. You can mix and match different items to create your own unique style. You can also preview how your chicken looks before entering the game.</p>
|
65 |
-
<h4>Be the best shooting chicken</h4>
|
66 |
-
<p>The game challenges you to be the best shooting chicken in the world. You can earn coins and gems by playing the game, and use them to buy more weapons and accessories. You can also unlock achievements and trophies by completing various tasks and missions. You can also share your gameplay videos and screenshots with your friends on social media.</p>
|
67 |
-
<h2>What is Chicken Gun Dinero Infinito APK?</h2>
|
68 |
-
<h3>A modified version of Chicken Gun with unlimited money and health</h3>
|
69 |
-
<p>Chicken Gun Dinero Infinito APK is a modified version of Chicken Gun that gives you unlimited money and health in the game. This means that you can buy all the weapons and accessories that you want, and never run out of health or ammo. You can also play the game without any ads or in-app purchases. This way, you can enjoy the game without any limitations or interruptions.</p>
|
70 |
-
<h3>Benefits of Chicken Gun Dinero Infinito APK</h3>
|
71 |
-
<h4>Unlock all the weapons and accessories</h4>
|
72 |
-
<p>With Chicken Gun Dinero Infinito APK, you can unlock all the weapons and accessories that are available in the game. You can choose from over 50 weapons, such as pistols, rifles, shotguns, snipers, rocket launchers, grenades, and more. You can also customize your chicken with over 100 accessories, such as hats, glasses, masks, helmets, backpacks, wings, tails, and more. You can create your own unique chicken with different combinations of items.</p>
|
73 |
-
<h4>Survive longer and win more matches</h4>
|
74 |
-
<p>With Chicken Gun Dinero Infinito APK, you can survive longer and win more matches in the game. You can have unlimited health and ammo in the game, which means that you can withstand any damage and shoot as much as you want. You can also have unlimited coins and gems in the game, which means that you can upgrade your chicken's skills and abilities. You can also have unlimited lives in the game, which means that you can respawn as many times as you want. You can dominate the game with these advantages.</p>
|
75 |
-
<h4>Enjoy the game without ads or in-app purchases</h4>
|
76 |
-
<p>With Chicken Gun Dinero Infinito APK, you can enjoy the game without ads or in-app purchases. You can play the game without any annoying ads that pop up on your screen or interrupt your gameplay. You can also play the game without any in-app purchases that ask you to spend real money to get more coins or gems. You can have everything for free with this modded version of the game.</p>
|
77 |
-
<h2>How to Download and Install Chicken Gun Dinero Infinito APK?</h2>
|
78 |
-
<h3>Follow these simple steps to get the game on your device</h3>
|
79 |
-
<h4>Step 1: Enable unknown sources on your device settings</h4>
|
80 |
-
<p>To download and install Chicken Gun Dinero Infinito APK, you need to enable unknown sources on your device settings. This will allow you to install apps that are not from the official Google Play Store. To do this, go to your device settings > security > unknown sources > enable.</p>
|
81 |
-
<h4>Step 2: Download the APK file from a trusted source</h4>
|
82 |
-
<p>To download Chicken Gun Dinero Infinito APK, you need to find a trusted source that provides the APK file. You can search online for websites that offer this modded version of the game. Make sure that the website is safe and reliable before downloading anything from it. You can also scan the APK file with an antivirus software before installing it.</p>
|
83 |
-
<h4>Step 3: Locate and install the APK file on your device</h4>
|
84 |
-
<p>To install Chicken Gun Dinero Infinito APK, you need to locate the APK file on your device. You can use a file manager app to find the file in your downloads folder or any other location where you saved it. Once you find it, tap on it and follow the instructions on your screen to install it.</p>
|
85 |
-
<h4>Step 4: Launch the game and have fun</h4>
|
86 |
-
<p>To play Chicken Gun Dinero Infinito APK, you need to launch the game on your device. You can find it on your app drawer or home screen. Tap on it and enjoy playing the ultimate shooting game with unlimited money and health.</p>
|
87 |
-
<h2>Conclusion</h2>
|
88 |
-
<h3>Chicken Gun Dinero Infinito APK is a great way to enjoy the game with more features and fun</h3>
|
89 |
-
<p>Chicken Gun is a fun and hilarious multiplayer shooter game that lets you play as a chicken with a gun. You can shoot other chickens in various maps and modes, customize your chicken with different weapons and accessories , and compete with other players online. Chicken Gun Dinero Infinito APK is a modified version of the game that gives you unlimited money and health in the game. You can unlock all the weapons and accessories, survive longer and win more matches, and enjoy the game without ads or in-app purchases. To download and install Chicken Gun Dinero Infinito APK, you need to enable unknown sources on your device settings, download the APK file from a trusted source, locate and install the APK file on your device, and launch the game and have fun. Chicken Gun Dinero Infinito APK is a great way to enjoy the game with more features and fun.</p>
|
90 |
-
<p>Here are some FAQs that you might have about Chicken Gun Dinero Infinito APK:</p>
|
91 |
-
<h4>Q: Is Chicken Gun Dinero Infinito APK safe to use?</h4>
|
92 |
-
<p>A: Chicken Gun Dinero Infinito APK is safe to use as long as you download it from a trusted source and scan it with an antivirus software before installing it. However, you should be aware that using a modded version of the game might violate the terms and conditions of the original game, and you might face some risks or consequences from the game developers or authorities.</p>
|
93 |
-
<h4>Q: Do I need to root my device to use Chicken Gun Dinero Infinito APK?</h4>
|
94 |
-
<p>A: No, you do not need to root your device to use Chicken Gun Dinero Infinito APK. You just need to enable unknown sources on your device settings and install the APK file as you would with any other app.</p>
|
95 |
-
<h4>Q: Can I play Chicken Gun Dinero Infinito APK with my friends online?</h4>
|
96 |
-
<p>A: Yes, you can play Chicken Gun Dinero Infinito APK with your friends online. You can join or create a room with up to 10 players per team, and chat with them using voice or text messages. However, you should be aware that some players might not like playing with modded users, and they might report you or kick you out of the room.</p>
|
97 |
-
<h4>Q: Can I update Chicken Gun Dinero Infinito APK to the latest version of the game?</h4>
|
98 |
-
<p>A: No, you cannot update Chicken Gun Dinero Infinito APK to the latest version of the game. You need to wait for the modded version of the game to be updated by its developers. If you try to update the game from the official Google Play Store, you might lose all your modded features and data.</p>
|
99 |
-
<h4>Q: Where can I find more information about Chicken Gun Dinero Infinito APK?</h4>
|
100 |
-
<p>A: You can find more information about Chicken Gun Dinero Infinito APK by searching online for websites or forums that provide this modded version of the game. You can also watch videos or read reviews from other users who have tried this modded version of the game.</p> 197e85843d<br />
|
101 |
-
<br />
|
102 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Discover the Truth of the Universe in Mineirinho Ultra Adventures 2 Mobile Illuminati Trail DLC.md
DELETED
@@ -1,106 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Mineirinho Ultra Adventures 2 Mobile: A Guide for Beginners</h1>
|
3 |
-
<p>If you are looking for a challenging and fun 3D platform game that will test your skills and reflexes, then you should try <b>Mineirinho Ultra Adventures 2 Mobile</b>. This game is the sequel to the popular <b>Mineirinho Ultra Adventures</b>, which was released in 2017 and became a cult hit among gamers. In this game, you will join our friend Miner, a Brazilian hero who goes on amazing adventures with extreme difficulty. You will explore different worlds, face various enemies, collect power ups, and overcome all the obstacles that stand in your way. This game is not for the faint of heart, as it requires a lot of patience, perseverance, and precision. But if you are up for the challenge, you will find a lot of satisfaction and enjoyment in this game.</p>
|
4 |
-
<h2>How to download Mineirinho Ultra Adventures 2 Mobile on your device</h2>
|
5 |
-
<p>Mineirinho Ultra Adventures 2 Mobile is available for both Android and iOS devices. You can download it from the Google Play Store or the App Store, depending on your device. The game is free to download and play, but it contains ads and in-app purchases. You can also play the game on your PC by downloading it from Steam, where it costs $5.99. However, you will need a compatible controller to play the game on your PC.</p>
|
6 |
-
<h2>download mineirinho ultra adventures 2 mobile</h2><br /><p><b><b>Download File</b> ✵ <a href="https://jinyurl.com/2uNSuE">https://jinyurl.com/2uNSuE</a></b></p><br /><br />
|
7 |
-
<h2>What are the features of Mineirinho Ultra Adventures 2 Mobile?</h2>
|
8 |
-
<p>Mineirinho Ultra Adventures 2 Mobile is a game that offers a lot of features that make it unique and exciting. Here are some of the features that you can expect from this game:</p>
|
9 |
-
<h3>Real Physics</h3>
|
10 |
-
<p>The game uses real physics to simulate the movement and interaction of objects and characters in the game world. This means that you will have to deal with gravity, inertia, friction, momentum, and other forces that affect your gameplay. For example, you can use a bubblegum rope to swing from one platform to another, but you have to be careful not to lose your balance or hit any obstacles along the way.</p>
|
11 |
-
<h3>Bubblegum Rope</h3>
|
12 |
-
<p>One of the most distinctive features of this game is the bubblegum rope, which is a special power up that allows you to swing from one place to another like Spider-Man. You can use the bubblegum rope to reach higher places, cross gaps, avoid enemies, or just have fun. The bubblegum rope has a limited length and durability, so you have to use it wisely and strategically.</p>
|
13 |
-
<h3>Excellent for Speedrun</h3>
|
14 |
-
<p>If you are a fan of speedrunning, which is the practice of completing a game or a level as fast as possible, then you will love this game. The game has many levels that are designed for speedrunning, with different routes, shortcuts , and challenges that will test your skills and reflexes. You can also compete with other players online and see who can finish the levels faster. The game has a leaderboard system that ranks the best players in the world, as well as a replay feature that lets you watch your own or other players' runs.</p>
|
15 |
-
<h3>Super Ultra Adventures</h3>
|
16 |
-
<p>The game has a total of 12 worlds, each with its own theme, enemies, obstacles, and boss. You will travel to different places, such as the jungle, the desert, the city, the snow, the space, and more. Each world has 10 levels, plus a bonus level and a boss level. The levels are full of surprises and secrets that will keep you entertained and curious. You will also encounter many different enemies, such as snakes, spiders, scorpions, robots, aliens, and more. Some of them are easy to defeat, while others will require more strategy and skill. The boss levels are especially challenging and fun, as you will have to face a giant enemy that has its own attacks and patterns.</p>
|
17 |
-
<h3>Cool Toon Shader</h3>
|
18 |
-
<p>The game has a colorful and cartoonish graphics style that uses a toon shader effect. This means that the game has a cel-shaded look that makes it look like a comic book or an animated movie. The game also has a lot of humor and personality, with funny animations, expressions, and sounds. The game is suitable for all ages and audiences, as it does not contain any violence or gore.</p>
|
19 |
-
<h3>Extreme Difficulty</h3>
|
20 |
-
<p>One of the main features of this game is its extreme difficulty level. This game is not for casual gamers or beginners, as it requires a lot of skill, patience, and perseverance. The game is very hard to beat, as it has many traps, pitfalls, spikes, enemies, and other hazards that will make you die a lot. The game also has a permadeath system, which means that if you die in a level, you have to start from the beginning of the world. The game does not have any checkpoints or save points, so you have to be very careful and cautious. The game also does not have any tutorials or hints, so you have to figure out everything by yourself.</p>
|
21 |
-
<p>How to download mineirinho ultra adventures 2 on android<br />
|
22 |
-
Mineirinho ultra adventures 2 apk free download<br />
|
23 |
-
Best 3d platform games for mobile devices<br />
|
24 |
-
Mineirinho ultra adventures 2 steam review<br />
|
25 |
-
Mineirinho ultra adventures 2 gameplay and walkthrough<br />
|
26 |
-
Mineirinho ultra adventures 2 multiplayer mode<br />
|
27 |
-
Mineirinho ultra adventures 2 cheats and tips<br />
|
28 |
-
Mineirinho ultra adventures 2 vs mineirinho classic<br />
|
29 |
-
Mineirinho ultra adventures 2 system requirements<br />
|
30 |
-
Mineirinho ultra adventures 2 trailer and screenshots<br />
|
31 |
-
Mineirinho ultra adventures 2 speedrun challenge<br />
|
32 |
-
Mineirinho ultra adventures 2 bubblegum rope feature<br />
|
33 |
-
Mineirinho ultra adventures 2 cool toon shader effect<br />
|
34 |
-
Mineirinho ultra adventures 2 extreme difficulty level<br />
|
35 |
-
Mineirinho ultra adventures 2 food power ups guide<br />
|
36 |
-
Mineirinho ultra adventures 2 developer interview<br />
|
37 |
-
Mineirinho ultra adventures 2 release date and price<br />
|
38 |
-
Mineirinho ultra adventures 2 dlc illuminati trail<br />
|
39 |
-
Mineirinho ultra adventures 2 sinned games franchise<br />
|
40 |
-
Mineirinho ultra adventures 2 jazzghost youtube video<br />
|
41 |
-
Download mineirinho ultra adventures 2 for ios<br />
|
42 |
-
Mineirinho ultra adventures 2 mod apk unlimited money<br />
|
43 |
-
Top 10 3d platform games for mobile in 2023<br />
|
44 |
-
Mineirinho ultra adventures 2 steam key giveaway<br />
|
45 |
-
Mineirinho ultra adventures 2 online co-op mode<br />
|
46 |
-
Mineirinho ultra adventures 2 hack and mod menu<br />
|
47 |
-
Mineirinho ultra adventures 2 comparison with other games<br />
|
48 |
-
Mineirinho ultra adventures 2 achievements and trophies<br />
|
49 |
-
Mineirinho ultra adventures 2 minimum and recommended specs<br />
|
50 |
-
Mineirinho ultra adventures 2 official website and social media<br />
|
51 |
-
Download mineirinho ultra adventures 2 for pc<br />
|
52 |
-
Mineirinho ultra adventures 2 cracked apk download link<br />
|
53 |
-
Best mobile games made by blender game engine<br />
|
54 |
-
Mineirinho ultra adventures 2 steam discount code<br />
|
55 |
-
Mineirinho ultra adventures 2 offline single-player mode<br />
|
56 |
-
Mineirinho ultra adventures 2 unlimited lives and coins<br />
|
57 |
-
Mineirinho ultra adventures 2 fan art and memes<br />
|
58 |
-
Mineirinho ultra adventures 2 soundtrack and music<br />
|
59 |
-
Mineirinho ultra adventures 2 optimal settings and performance<br />
|
60 |
-
Mineirinho ultra adventures 2 contact and support information</p>
|
61 |
-
<h3>Many Crazy Levels</h3>
|
62 |
-
<p>The game has many crazy levels that will challenge your creativity and imagination. The levels are full of puzzles, secrets, hidden areas, and Easter eggs that will make you explore every corner of the game world. The levels are also very varied and unpredictable, as they have different mechanics and elements that will change your gameplay. For example, some levels have gravity switches that will make you walk on walls or ceilings, some levels have portals that will teleport you to different places, some levels have water or lava that will affect your movement and abilities, and so on.</p>
|
63 |
-
<h3>Super Fun Multiplayer</h3>
|
64 |
-
<p>The game also has a super fun multiplayer mode that lets you play with up to four friends online or locally. You can choose from different modes, such as co-op mode, where you work together to complete the levels; versus mode , where you compete against each other to finish the levels faster or collect more items; and party mode, where you play mini-games that are based on the game mechanics. The multiplayer mode is very fun and chaotic, as you can cooperate or sabotage each other, use power ups or traps, and chat or taunt each other.</p>
|
65 |
-
<h3>Radical Movements</h3>
|
66 |
-
<p>The game also has a lot of radical movements that you can perform with your character. You can run, jump, slide, roll, dash, wall jump, and more. You can also use the bubblegum rope to swing, pull, or launch yourself. The game has a smooth and responsive control system that lets you execute these movements with ease and precision. You will need to master these movements to overcome the challenges and obstacles in the game.</p>
|
67 |
-
<h3>Cool Food Power Ups</h3>
|
68 |
-
<p>The game also has a lot of cool food power ups that you can collect and use in the game. These power ups are based on Brazilian cuisine and culture, such as feijoada, brigadeiro, guarana, caipirinha, and more. Each power up has a different effect and duration, such as giving you extra speed, health, invincibility, or other abilities. You can also combine different power ups to create new effects and combinations. The power ups are very useful and fun to use in the game.</p>
|
69 |
-
<h2>How to play Mineirinho Ultra Adventures 2 Mobile?</h2>
|
70 |
-
<p>Now that you know what the game is about and what features it offers, you might be wondering how to play it. Here are some basic tips and instructions on how to play Mineirinho Ultra Adventures 2 Mobile:</p>
|
71 |
-
<h3>Controls and Gameplay</h3>
|
72 |
-
<p>The game has different controls depending on the device you are using. If you are playing on a mobile device, you will use the touch screen to control your character. You will have a virtual joystick on the left side of the screen to move your character, and buttons on the right side of the screen to jump, slide, dash, use the bubblegum rope, or use a power up. You can also swipe the screen to change the camera angle or zoom in or out. If you are playing on a PC, you will use a controller to control your character. You will have a left stick to move your character, and buttons to jump, slide, dash, use the bubblegum rope, or use a power up. You can also use the right stick to change the camera angle or zoom in or out.</p>
|
73 |
-
<p>The gameplay is simple but challenging. Your goal is to complete each level by reaching the end of it without dying. You will have to avoid or defeat enemies, dodge or overcome obstacles, collect items and power ups, and solve puzzles along the way. You will also have to face a boss at the end of each world. The game has a timer that shows how long it takes you to finish each level. You can also collect stars that are hidden in each level. The stars are used to unlock new worlds and levels in the game.</p>
|
74 |
-
<h3>Tips and Tricks</h3>
|
75 |
-
<p>Here are some tips and tricks that will help you play better and enjoy more Mineirinho Ultra Adventures 2 Mobile:</p>
|
76 |
-
<ul>
|
77 |
-
<li>Practice makes perfect. The game is very hard and unforgiving, so you will need a lot of practice and patience to beat it. Don't give up if you die a lot or get stuck in a level. Try again and learn from your mistakes.</li>
|
78 |
-
<li>Use the bubblegum rope wisely. The bubblegum rope is a very useful tool that can help you reach places that are otherwise inaccessible or too dangerous. However, it also has a limited length and durability, so you have to use it carefully and strategically. Don't waste it on unnecessary swings or pulls.</li>
|
79 |
-
<li>Explore every corner of the game world. The game has many secrets and hidden areas that will reward you with items, power ups, stars, or Easter eggs. Don't be afraid to explore every corner of the game world and look for clues or hints that might lead you to these secrets.</li>
|
80 |
-
<li>Experiment with different power ups and combinations. The game has many cool food power ups that can give you different effects and abilities. You can also combine different power ups to create new effects and combinations. Experiment with different power ups and combinations and see what works best for you.</li>
|
81 |
-
<li>Have fun with multiplayer mode. The game has a super fun multiplayer mode that lets you play with up to four friends online or locally. You can choose from different modes , such as co-op mode, where you work together to complete the levels; versus mode, where you compete against each other to finish the levels faster or collect more items; and party mode, where you play mini-games that are based on the game mechanics. The multiplayer mode is very fun and chaotic, as you can cooperate or sabotage each other, use power ups or traps, and chat or taunt each other.</li>
|
82 |
-
</ul>
|
83 |
-
<h2>How does Mineirinho Ultra Adventures 2 Mobile compare to other games in the genre?</h2>
|
84 |
-
<p>Mineirinho Ultra Adventures 2 Mobile is a game that belongs to the 3D platform genre, which is a type of game that involves moving and jumping on platforms in a three-dimensional environment. Some of the most famous and popular games in this genre are Super Mario 64, Crash Bandicoot, Banjo-Kazooie, Spyro the Dragon, and Sonic Adventure. How does Mineirinho Ultra Adventures 2 Mobile compare to these games?</p>
|
85 |
-
<p>Well, Mineirinho Ultra Adventures 2 Mobile is a game that has its own style and identity, as it is inspired by Brazilian culture and humor. It also has a lot of features that make it unique and different from other games in the genre, such as the real physics, the bubblegum rope, the extreme difficulty, the speedrun potential, and the cool food power ups. The game also has a lot of variety and creativity in its levels, enemies, bosses, and mechanics. The game is not a copy or a clone of any other game, but rather a homage and a tribute to the genre.</p>
|
86 |
-
<p>However, Mineirinho Ultra Adventures 2 Mobile is also a game that respects and follows the conventions and standards of the genre. It has a lot of elements that are common and familiar to fans of the genre, such as the 3D graphics, the platforming gameplay, the collectibles, the secrets, the power ups, the worlds, and the bosses. The game also has a lot of references and nods to other games in the genre, such as Mario's hat, Sonic's rings, Crash's crates, Spyro's gems, and Banjo's jiggy. The game is not a parody or a mockery of any other game, but rather a celebration and an appreciation of the genre.</p>
|
87 |
-
<p>Therefore, Mineirinho Ultra Adventures 2 Mobile is a game that can appeal to both fans and newcomers of the 3D platform genre. It is a game that offers a lot of challenge and fun for anyone who loves this type of game.</p>
|
88 |
-
<h2>Conclusion</h2>
|
89 |
-
<p>Mineirinho Ultra Adventures 2 Mobile is a game that you should definitely try if you are looking for a challenging and fun 3D platform game that will test your skills and reflexes. You will join our friend Miner, a Brazilian hero who goes on amazing adventures with extreme difficulty. You will explore different worlds, face various enemies, collect power ups, and overcome all the obstacles that stand in your way. You will also enjoy the colorful and cartoonish graphics style, the humorous and personality-filled animations and sounds, and the super fun multiplayer mode. You will also appreciate the real physics , the bubblegum rope, the speedrun potential, and the cool food power ups that make this game unique and different from other games in the genre. You will also respect and follow the conventions and standards of the genre, as well as the references and nods to other games in the genre that make this game a homage and a tribute to the genre. Mineirinho Ultra Adventures 2 Mobile is a game that you will not regret playing, as it will give you a lot of satisfaction and enjoyment.</p>
|
90 |
-
<p>So, what are you waiting for? Download Mineirinho Ultra Adventures 2 Mobile on your device today and start your super ultra adventure with Miner. You will not be disappointed. Have fun and good luck!</p>
|
91 |
-
<h2>FAQs</h2>
|
92 |
-
<p>Here are some frequently asked questions about Mineirinho Ultra Adventures 2 Mobile:</p>
|
93 |
-
<ul>
|
94 |
-
<li><b>Q: How many levels are there in Mineirinho Ultra Adventures 2 Mobile?</b></li>
|
95 |
-
<li>A: There are 12 worlds, each with 10 levels, plus a bonus level and a boss level. That makes a total of 144 levels in the game.</li>
|
96 |
-
<li><b>Q: How can I unlock new worlds and levels in Mineirinho Ultra Adventures 2 Mobile?</b></li>
|
97 |
-
<li>A: You can unlock new worlds and levels by collecting stars that are hidden in each level. You need a certain number of stars to unlock each world and level.</li>
|
98 |
-
<li><b>Q: How can I play Mineirinho Ultra Adventures 2 Mobile with my friends?</b></li>
|
99 |
-
<li>A: You can play Mineirinho Ultra Adventures 2 Mobile with your friends online or locally. You can choose from different modes, such as co-op mode, versus mode, or party mode. You can also chat or taunt each other while playing.</li>
|
100 |
-
<li><b>Q: What are the best power ups to use in Mineirinho Ultra Adventures 2 Mobile?</b></li>
|
101 |
-
<li>A: The best power ups to use in Mineirinho Ultra Adventures 2 Mobile depend on your preference and situation. However, some of the most useful and fun power ups are the feijoada, which gives you extra health; the brigadeiro, which gives you invincibility; the guarana, which gives you extra speed; and the caipirinha, which makes you drunk and unpredictable.</li>
|
102 |
-
<li><b>Q: Where can I find more information about Mineirinho Ultra Adventures 2 Mobile?</b></li>
|
103 |
-
<li>A: You can find more information about Mineirinho Ultra Adventures 2 Mobile on the official website, the Facebook page, the Twitter account, or the YouTube channel. You can also contact the developer via email at [email protected].</li>
|
104 |
-
</ul></p> 197e85843d<br />
|
105 |
-
<br />
|
106 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Download Gas Station Simulator Mod APK - The Best Simulation Game for Android Users.md
DELETED
@@ -1,97 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Download Gas Station Simulator Mod APK Android: A Fun and Realistic Business Simulation Game</h1>
|
3 |
-
<p>Do you dream of owning your own gas station and running a successful business? If so, you might want to try Gas Station Simulator, a game that lets you experience the challenges and rewards of managing a gas station. And if you want to make the game more fun and easy, you can download Gas Station Simulator mod apk android, which gives you unlimited money, gems, and other benefits. In this article, we will tell you more about this game and how to download the mod apk version for free.</p>
|
4 |
-
<h2>download gas station simulator mod apk android</h2><br /><p><b><b>DOWNLOAD</b> →→→ <a href="https://jinyurl.com/2uNO8B">https://jinyurl.com/2uNO8B</a></b></p><br /><br />
|
5 |
-
<h2>What is Gas Station Simulator?</h2>
|
6 |
-
<p>Gas Station Simulator is a gas station simulator where you will have to own your own gas station. You have opened your own business, a gas station and you have to start everything small, you have not purchased a large and not in very good condition gas station. You need to work and earn money to get good reviews and not earn bad ones.</p>
|
7 |
-
<p>In this game, you will have to perform various tasks such as refueling cars, repairing tires, washing vehicles, selling snacks, hiring staff, and more. You will also have to deal with different types of customers, some of whom may be rude or impatient. You will have to balance your budget, expenses, and income, as well as improve your reputation and customer satisfaction.</p>
|
8 |
-
<h3>Features of Gas Station Simulator</h3>
|
9 |
-
<h4>- Manage your own gas station</h4>
|
10 |
-
<p>You are the boss of your own gas station and you can decide how to run it. You can choose what services to offer, what products to sell, what prices to charge, and how to decorate your station. You can also hire and fire employees, assign them tasks, and train them.</p>
|
11 |
-
<h4>- Upgrade your facilities and services</h4>
|
12 |
-
<p>As you earn money from your business, you can invest it in upgrading your facilities and services. You can buy new equipment, expand your parking lot, add more pumps, install car washes, build convenience stores, and more. You can also unlock new types of vehicles, such as trucks, buses, motorcycles, etc.</p>
|
13 |
-
<h4>- Interact with customers and employees</h4>
|
14 |
-
<p>You will have to interact with various characters in the game, such as customers and employees. You will have to satisfy their needs and requests, as well as handle their complaints and feedback. You will also have to deal with different situations, such as robberies, accidents, fires, etc.</p>
|
15 |
-
<h4>- Earn money and reputation</h4>
|
16 |
-
<p>Your main goal in the game is to earn money and reputation. Money is needed to buy new items, upgrade your station, pay your bills, etc. Reputation is needed to attract more customers, get better reviews, unlock new features, etc. You can also compete with other players in leaderboards and achievements.</p>
|
17 |
-
<p>How to install gas station simulator mod apk on android<br />
|
18 |
-
Gas station simulator mod apk unlimited money and gems<br />
|
19 |
-
Gas station simulator mod apk latest version free download<br />
|
20 |
-
Gas station simulator hack mod apk for android devices<br />
|
21 |
-
Gas station simulator mod apk offline gameplay<br />
|
22 |
-
Gas station simulator mod apk with unlimited fuel and cash<br />
|
23 |
-
Gas station simulator mod apk no ads and no root<br />
|
24 |
-
Gas station simulator mod apk download link and instructions<br />
|
25 |
-
Gas station simulator mod apk features and benefits<br />
|
26 |
-
Gas station simulator mod apk review and rating<br />
|
27 |
-
Gas station simulator mod apk cheats and tips<br />
|
28 |
-
Gas station simulator mod apk update and bug fixes<br />
|
29 |
-
Gas station simulator mod apk requirements and compatibility<br />
|
30 |
-
Gas station simulator mod apk comparison and alternatives<br />
|
31 |
-
Gas station simulator mod apk support and feedback<br />
|
32 |
-
Best gas station simulator mod apk for android users<br />
|
33 |
-
Gas station simulator premium mod apk unlocked everything<br />
|
34 |
-
Gas station simulator pro mod apk with advanced features<br />
|
35 |
-
Gas station simulator mega mod apk with unlimited resources<br />
|
36 |
-
Gas station simulator vip mod apk with exclusive rewards<br />
|
37 |
-
Download gas station simulator cracked mod apk for android<br />
|
38 |
-
Download gas station simulator full mod apk for android<br />
|
39 |
-
Download gas station simulator original mod apk for android<br />
|
40 |
-
Download gas station simulator new mod apk for android<br />
|
41 |
-
Download gas station simulator old mod apk for android<br />
|
42 |
-
Download gas station simulator 3d mod apk for android<br />
|
43 |
-
Download gas station simulator hd mod apk for android<br />
|
44 |
-
Download gas station simulator realistic mod apk for android<br />
|
45 |
-
Download gas station simulator fun mod apk for android<br />
|
46 |
-
Download gas station simulator easy mod apk for android<br />
|
47 |
-
Download gas station simulator hard mod apk for android<br />
|
48 |
-
Download gas station simulator online mod apk for android<br />
|
49 |
-
Download gas station simulator offline mod apk for android<br />
|
50 |
-
Download gas station simulator multiplayer mod apk for android<br />
|
51 |
-
Download gas station simulator single player mod apk for android<br />
|
52 |
-
Download gas station simulator car wash mod apk for android<br />
|
53 |
-
Download gas station simulator car repair mod apk for android<br />
|
54 |
-
Download gas station simulator car tuning mod apk for android<br />
|
55 |
-
Download gas station simulator car racing mod apk for android<br />
|
56 |
-
Download gas station simulator car parking mod apk for android<br />
|
57 |
-
Download gas station simulator tycoon mod apk for android<br />
|
58 |
-
Download gas station simulator manager mod apk for android<br />
|
59 |
-
Download gas station simulator builder mod apk for android<br />
|
60 |
-
Download gas station simulator designer mod apk for android<br />
|
61 |
-
Download gas station simulator city mod apk for android<br />
|
62 |
-
Download gas station simulator country mod apk for android<br />
|
63 |
-
Download gas station simulator adventure mod apk for android<br />
|
64 |
-
Download gas station simulator simulation mod apk for android</p>
|
65 |
-
<h3>Why download Gas Station Simulator mod apk android?</h3>
|
66 |
-
<p>If you want to enjoy the game without any limitations or difficulties, you can download Gas Station Simulator mod apk android. This is a modified version of the game that gives you several advantages over the original version. Here are some of them:</p>
|
67 |
-
<h4>- Unlimited money and gems</h4>
|
68 |
-
<p>With this mod apk version, you will have unlimited money and gems in the game. This means that you can buy anything you want without worrying about the cost. You can also upgrade your station faster and easier.</p>
|
69 |
-
<h4>- All items and upgrades unlocked</h4>
|
70 |
-
<p>With this mod apk version <p>With this mod apk version, you will have access to all the items and upgrades in the game. You don't have to wait for them to be unlocked or pay for them with real money. You can enjoy the full features of the game from the start.</p>
|
71 |
-
<h4>- No ads and no root required</h4>
|
72 |
-
<p>With this mod apk version, you will not see any ads in the game. You can play the game without any interruptions or distractions. You also don't need to root your device to install the mod apk file. You can simply download it and install it on your android device.</p>
|
73 |
-
<h2>How to download Gas Station Simulator mod apk android?</h2>
|
74 |
-
<p>If you are interested in downloading Gas Station Simulator mod apk android, you can follow these simple steps:</p>
|
75 |
-
<h3>Step 1: Download the mod apk file from a trusted source</h3>
|
76 |
-
<p>The first thing you need to do is to find a reliable website that offers the mod apk file for Gas Station Simulator. You can search for it on Google or use the link below. Make sure that the website is safe and secure, and that the file is free from viruses and malware.</p>
|
77 |
-
<h3>Step 2: Enable unknown sources on your device settings</h3>
|
78 |
-
<p>The next thing you need to do is to enable unknown sources on your device settings. This will allow you to install apps that are not from the Google Play Store. To do this, go to your device settings, then security, then unknown sources, and turn it on.</p>
|
79 |
-
<h3>Step 3: Install the mod apk file and enjoy the game</h3>
|
80 |
-
<p>The last thing you need to do is to install the mod apk file on your device. To do this, locate the file in your downloads folder and tap on it. Follow the instructions on the screen and wait for the installation to finish. Once done, you can open the game and enjoy playing Gas Station Simulator with unlimited money, gems, and other benefits.</p>
|
81 |
-
<h2>Conclusion</h2>
|
82 |
-
<p>Gas Station Simulator is a fun and realistic business simulation game that lets you manage your own gas station. You can perform various tasks, upgrade your facilities, interact with customers and employees, and earn money and reputation. If you want to make the game more enjoyable and easy, you can download Gas Station Simulator mod apk android, which gives you unlimited money, gems, and other advantages. You can download the mod apk file from a trusted source, enable unknown sources on your device settings, and install the file on your device. Then, you can play the game without any limitations or difficulties.</p>
|
83 |
-
<p>We hope that this article has helped you learn more about Gas Station Simulator and how to download its mod apk version for free. If you have any questions or feedback, feel free to leave a comment below. Thank you for reading!</p>
|
84 |
-
<h2>FAQs</h2>
|
85 |
-
<p>Here are some frequently asked questions about Gas Station Simulator and its mod apk version:</p>
|
86 |
-
<h4>- Is Gas Station Simulator free to play?</h4>
|
87 |
-
<p>Yes, Gas Station Simulator is free to play. However, some items and features may require real money purchases or watching ads.</p>
|
88 |
-
<h4>- Is Gas Station Simulator mod apk safe to use?</h4>
|
89 |
-
<p>Yes, Gas Station Simulator mod apk is safe to use as long as you download it from a trusted source. However, we recommend that you use it at your own risk and discretion, as it may violate the terms of service of the original game.</p>
|
90 |
-
<h4>- What are the minimum requirements for Gas Station Simulator?</h4>
|
91 |
-
<p>The minimum requirements for Gas Station Simulator are: - Android 5.0 or higher - 2 GB of RAM - 100 MB of free storage space - Internet connection</p>
|
92 |
-
<h4>- How can I contact the developers of Gas Station Simulator?</h4>
|
93 |
-
<p>You can contact the developers of Gas Station Simulator by sending an email to [email protected] or visiting their website. You can also follow them on Facebook and Twitter for updates and news.</p>
|
94 |
-
<h4>- Can I play Gas Station Simulator offline?</h4>
|
95 |
-
<p>No, Gas Station Simulator requires an internet connection to play. You need to be online to access all the features and functions of the game.</p> 401be4b1e0<br />
|
96 |
-
<br />
|
97 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Download Rebaixados Elite Brasil APK and Drive from Different Perspectives.md
DELETED
@@ -1,129 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>How to Download Rebaixados Elite Brasil APK</h1>
|
3 |
-
<p>Rebaixados Elite Brasil is a popular Android game that lets you customize your car and character in a Brazil-inspired demoted car game. If you want to download the game, you might be wondering how to get the APK file from Google Play Store. In this article, we will show you what Rebaixados Elite Brasil is, why you might want to download the APK file, and how to do it safely and easily.</p>
|
4 |
-
<h2>What is Rebaixados Elite Brasil?</h2>
|
5 |
-
<p>Rebaixados Elite Brasil is a game developed by Sebby Games that simulates the culture of demoted cars in Brazil. You can lower your car to the floor, change the color, wheels, glass, xenon, and more. You can also customize your character with different clothes, accessories, and hairstyles. The game has realistic graphics, physics, and sound effects that make you feel like you are driving a real car.</p>
|
6 |
-
<h2>download rebaixados elite brasil apk</h2><br /><p><b><b>DOWNLOAD</b> ✪ <a href="https://jinyurl.com/2uNN7F">https://jinyurl.com/2uNN7F</a></b></p><br /><br />
|
7 |
-
<h3>A Brazil-inspired demoted car game</h3>
|
8 |
-
<p>The game is inspired by the Brazilian subculture of demoted cars, which are vehicles that have been modified to have a lower suspension, larger wheels, louder sound systems, and flashy decorations. The game lets you explore different scenarios in Brazil, such as streets, highways, gas stations, and parking lots. You can also interact with other cars and characters in the game.</p>
|
9 |
-
<h3>Features of the game</h3>
|
10 |
-
<p>Some of the features of Rebaixados Elite Brasil are:</p>
|
11 |
-
<p>rebaixados elite brasil apk mod<br />
|
12 |
-
rebaixados elite brasil apk latest version<br />
|
13 |
-
rebaixados elite brasil apk free download<br />
|
14 |
-
rebaixados elite brasil apk unlimited money<br />
|
15 |
-
rebaixados elite brasil apk android<br />
|
16 |
-
rebaixados elite brasil apk obb<br />
|
17 |
-
rebaixados elite brasil apk hack<br />
|
18 |
-
rebaixados elite brasil apk offline<br />
|
19 |
-
rebaixados elite brasil apk update<br />
|
20 |
-
rebaixados elite brasil apk full version<br />
|
21 |
-
rebaixados elite brasil apk for pc<br />
|
22 |
-
rebaixados elite brasil apk revdl<br />
|
23 |
-
rebaixados elite brasil apk rexdl<br />
|
24 |
-
rebaixados elite brasil apk pure<br />
|
25 |
-
rebaixados elite brasil apk uptodown<br />
|
26 |
-
rebaixados elite brasil apk old version<br />
|
27 |
-
rebaixados elite brasil apk 2023<br />
|
28 |
-
rebaixados elite brasil apk data<br />
|
29 |
-
rebaixados elite brasil apk mirror<br />
|
30 |
-
rebaixados elite brasil apk mob.org<br />
|
31 |
-
rebaixados elite brasil apk gameplay<br />
|
32 |
-
rebaixados elite brasil apk cheats<br />
|
33 |
-
rebaixados elite brasil apk sebby games<br />
|
34 |
-
rebaixados elite brasil apk android 1<br />
|
35 |
-
rebaixados elite brasil apk android oyun club<br />
|
36 |
-
rebaixados elite brasil apk baixar<br />
|
37 |
-
rebaixados elite brasil apk como instalar<br />
|
38 |
-
rebaixados elite brasil apk descargar<br />
|
39 |
-
rebaixados elite brasil apk download mediafıre<br />
|
40 |
-
rebaixados elite brasil apk download mega<br />
|
41 |
-
rebaixados elite brasil apk download pc<br />
|
42 |
-
rebaixados elite brasil apk download uptodown<br />
|
43 |
-
rebaixados elite brasil apk download 2023<br />
|
44 |
-
rebaixados elite brasil apk download atualizado 2023<br />
|
45 |
-
rebaixados elite brasil apk download gratis<br />
|
46 |
-
rebaixados elite brasil apk download hackeado 2023<br />
|
47 |
-
rebaixados elite brasil apk download infinito 2023<br />
|
48 |
-
rebaixados elite brasil apk download modificado 2023<br />
|
49 |
-
rebaixados elite brasil apk download para pc fraco 2023<br />
|
50 |
-
rebaixados elite brasil apk indir android oyun club 2023</p>
|
51 |
-
<ul>
|
52 |
-
<li>Completely detailed car models that you can customize in various ways.</li>
|
53 |
-
<li>Drive from a first or third person perspective and control your car with a steering wheel, accelerometer, or arrows.</li>
|
54 |
-
<li>Car interiors in 360 degrees and many interactive elements in cars, such as opening doors, hood, trunk, windows, and windshield wipers.</li>
|
55 |
-
<li>Day and night mode and filters for the camera.</li>
|
56 |
-
<li>Character in the game that you can personalize with different outfits and accessories.</li>
|
57 |
-
<li>Turn up the bass of the song and enjoy the music that gets muffled with the trunk of the car locked.</li>
|
58 |
-
<li>Multiple wheels for your car and choose the size of the rim.</li>
|
59 |
-
<li>Neon in the cars and various models of speakers with LED lights.</li>
|
60 |
-
<li>Functional gas station where you can refuel your car.</li>
|
61 |
-
<li>Online cooperative multiplayer mode where you can play with your friends or other players.</li>
|
62 |
-
</ul>
|
63 |
-
<h2>Why download the APK file?</h2>
|
64 |
-
<p>An APK file is an Android Package file that contains all the files and data needed to install an app on an Android device. You can download APK files from Google Play Store or other sources to install apps that are not available in your region, update apps before they are officially released, or backup apps that you want to keep. However, there are also some risks involved in downloading APK files from unknown sources, such as malware, viruses, or spyware.</p>
|
65 |
-
<h3>Benefits of APK files</h3>
|
66 |
-
<p>Some of the benefits of downloading APK files are:</p>
|
67 |
-
<ul>
|
68 |
-
<li>You can access apps that are not available in your country or region due to geo-restrictions or licensing issues.</li>
|
69 |
-
<li>You can update apps before they are officially released on Google Play Store and enjoy new features and bug fixes.</li>
|
70 |
-
<li>You can backup apps that you want to keep or transfer to another device without losing your data or settings.</li>
|
71 |
-
<li>You can install apps that are not compatible with your device or Android version by modifying the APK file.</li>
|
72 |
-
</ul>
|
73 |
-
<h3>Risks of APK files</h3>
|
74 |
-
<p>Some of the risks of downloading APK files are:</p <ul>
|
75 |
-
<li>You can expose your device and data to malware, viruses, or spyware that can harm your device, steal your information, or compromise your privacy.</li>
|
76 |
-
<li>You can violate the terms and conditions of Google Play Store or the app developer and risk losing access to the app or your account.</li>
|
77 |
-
<li>You can damage your device or cause it to malfunction if the APK file is corrupted, modified, or incompatible with your device or Android version.</li>
|
78 |
-
</ul>
|
79 |
-
<h2>How to download the APK file from Google Play Store?</h2>
|
80 |
-
<p>If you want to download the APK file of Rebaixados Elite Brasil from Google Play Store, you have two options: using a web tool or using an APK extractor app. Both methods are easy and safe, but you need to have a Google account and the app installed on your device.</p>
|
81 |
-
<h3>Method 1: Using a web tool</h3>
|
82 |
-
<p>One of the easiest ways to download the APK file of Rebaixados Elite Brasil from Google Play Store is to use a web tool that can generate the download link for you. Here are the steps to follow:</p>
|
83 |
-
<ol>
|
84 |
-
<li>Go to Google Play Store and search for Rebaixados Elite Brasil. Copy the URL of the app page from the address bar.</li>
|
85 |
-
<li>Go to a web tool that can download APK files from Google Play Store, such as [APK Downloader], [APKPure], or [Evozi].</li>
|
86 |
-
<li>Paste the URL of the app page into the input box and click on the download button.</li>
|
87 |
-
<li>Wait for the web tool to generate the download link and click on it to save the APK file to your device or computer.</li>
|
88 |
-
</ol>
|
89 |
-
<h3>Method 2: Using an APK extractor app</h3>
|
90 |
-
<p>Another way to download the APK file of Rebaixados Elite Brasil from Google Play Store is to use an APK extractor app that can extract the APK file from the app installed on your device. Here are the steps to follow:</p>
|
91 |
-
<ol>
|
92 |
-
<li>Go to Google Play Store and install an APK extractor app, such as [APK Extractor], [ML Manager], or [App Backup & Restore].</li>
|
93 |
-
<li>Open the APK extractor app and find Rebaixados Elite Brasil in the list of apps. Tap on it and select the option to extract or share the APK file.</li>
|
94 |
-
<li>Choose where you want to save or send the APK file, such as your device storage, email, cloud service, or Bluetooth.</li>
|
95 |
-
</ol>
|
96 |
-
<h2>How to install the APK file on Android?</h2>
|
97 |
-
<p>Once you have downloaded the APK file of Rebaixados Elite Brasil, you need to install it on your Android device. However, before you do that, you need to enable the option to install apps from unknown sources on your device. This option allows you to install apps that are not from Google Play Store. Here are the steps to enable it:</p>
|
98 |
-
<ol>
|
99 |
-
<li>Go to Settings and tap on Security or Privacy.</li>
|
100 |
-
<li>Find the option that says Unknown Sources or Install Unknown Apps and toggle it on.</li>
|
101 |
-
<li>Confirm your choice by tapping on OK or Allow.</li>
|
102 |
-
</ol>
|
103 |
-
<h3>Steps to install the APK file</h3>
|
104 |
-
<p>After you have enabled the option to install apps from unknown sources, you can proceed to install the APK file of Rebaixados Elite Brasil. Here are the steps to follow:</p>
|
105 |
-
<ol>
|
106 |
-
<li>Locate the APK file on your device using a file manager app or a browser.</li>
|
107 |
-
<li>Tap on the APK file and select Install.</li>
|
108 |
-
<li>Wait for the installation process to finish and tap on Open or Done.</li>
|
109 |
-
</ol>
|
110 |
-
<h3>Tips to avoid installation errors</h3>
|
111 |
-
<p>Sometimes, you might encounter some errors or issues when installing an APK file on your Android device. Here are some tips to avoid them:</p <ul>
|
112 |
-
<li>Make sure that the APK file is not corrupted, modified, or tampered with. You can check the integrity of the APK file by comparing its checksum or signature with the original one.</li>
|
113 |
-
<li>Make sure that the APK file is compatible with your device and Android version. You can check the compatibility of the APK file by looking at its minimum requirements, such as Android version, screen size, processor, RAM, and storage.</li>
|
114 |
-
<li>Make sure that you have enough storage space on your device to install the APK file. You can check the storage space on your device by going to Settings and tapping on Storage.</li>
|
115 |
-
<li>Make sure that you have a stable internet connection when downloading or installing the APK file. You can check the internet connection on your device by going to Settings and tapping on Wi-Fi or Mobile Data.</li>
|
116 |
-
</ul>
|
117 |
-
<h2>Conclusion</h2>
|
118 |
-
<p>Rebaixados Elite Brasil is a fun and realistic game that lets you customize your car and character in a Brazil-inspired demoted car game. You can download the APK file of Rebaixados Elite Brasil from Google Play Store using a web tool or an APK extractor app. You can also install the APK file on your Android device by enabling the option to install apps from unknown sources and following some simple steps. However, you should also be aware of the risks of downloading APK files from unknown sources and take some precautions to avoid installation errors. We hope this article has helped you learn how to download Rebaixados Elite Brasil APK and enjoy the game.</p>
|
119 |
-
<h2>FAQs</h2>
|
120 |
-
<p>Here are some frequently asked questions about Rebaixados Elite Brasil APK:</p>
|
121 |
-
<table>
|
122 |
-
<tr><td><b>Q: Is Rebaixados Elite Brasil free to play?</b></td><td><b>A: Yes, Rebaixados Elite Brasil is free to play, but it contains ads and in-app purchases.</b></td></tr>
|
123 |
-
<tr><td><b>Q: How can I play Rebaixados Elite Brasil online with my friends?</b></td><td><b>A: You can play Rebaixados Elite Brasil online with your friends by joining or creating a room in the multiplayer mode. You need to have an internet connection and a Google account to play online.</b></td></tr>
|
124 |
-
<tr><td><b>Q: How can I remove the ads from Rebaixados Elite Brasil?</b></td><td><b>A: You can remove the ads from Rebaixados Elite Brasil by purchasing the premium version of the game for $1.99.</b></td></tr>
|
125 |
-
<tr><td><b>Q: How can I get more money and diamonds in Rebaixados Elite Brasil?</b></td><td><b>A: You can get more money and diamonds in Rebaixados Elite Brasil by completing missions, watching videos, or buying them with real money.</b></td></tr>
|
126 |
-
<tr><td><b>Q: How can I contact the developer of Rebaixados Elite Brasil?</b></td><td><b>A: You can contact the developer of Rebaixados Elite Brasil by sending an email to [email protected] or following them on Facebook or Instagram.</b></td></tr>
|
127 |
-
</table></p> 197e85843d<br />
|
128 |
-
<br />
|
129 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Download and Install God of War Collection for PS3 Emulator (RPCS3) on PC.md
DELETED
@@ -1,162 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>God of War Collection PS3 Emulator Download: How to Play God of War Games on PC</h1>
|
3 |
-
<p>God of War is one of the most popular and acclaimed action-adventure video game series of all time. The games follow the adventures of Kratos, a Spartan warrior who battles against gods, monsters, and other mythical creatures in ancient Greece and Norse mythology. The games are known for their epic scale, cinematic presentation, brutal combat, and engaging story.</p>
|
4 |
-
<h2>god of war collection ps3 emulator download</h2><br /><p><b><b>DOWNLOAD</b> ✶✶✶ <a href="https://jinyurl.com/2uNKzD">https://jinyurl.com/2uNKzD</a></b></p><br /><br />
|
5 |
-
<p>But what if you don't have a PlayStation console to play these games? Or what if you want to enjoy them with better graphics, performance, and customization options? Well, there is a way to play God of War games on PC, thanks to a PS3 emulator called RPCS3. In this article, we will show you how to download, install, configure, and play God of War Collection PS3 Emulator Download on your PC.</p>
|
6 |
-
<h2>What is God of War Collection PS3 Emulator Download?</h2>
|
7 |
-
<p>God of War Collection PS3 Emulator Download is a package that contains two remastered versions of the first two God of War games: God of War HD and God of War II HD. These games were originally released for the PlayStation 2, but were later ported to the PlayStation 3 as part of the God of War Collection. The remastered versions feature improved graphics, resolution, frame rate, and trophies.</p>
|
8 |
-
<p>RPCS3 is an open-source emulator that allows you to play PlayStation 3 games on your PC. It is currently the most advanced and compatible PS3 emulator available, with support for over 5000 games. RPCS3 can run many PS3 games at full speed, with high resolution, anti-aliasing, and other enhancements. RPCS3 also supports various input devices, such as keyboards, mice, controllers, and even VR headsets.</p>
|
9 |
-
<p>By using RPCS3, you can play God of War Collection PS3 Emulator Download on your PC, as well as other PS3 exclusive games such as Uncharted, The Last of Us, Demon's Souls, Persona 5, and more.</p>
|
10 |
-
<p>god of war collection rpcs3 download<br />
|
11 |
-
god of war 1 and 2 ps3 emulator<br />
|
12 |
-
god of war hd collection pc download<br />
|
13 |
-
god of war ps3 iso download for rpcs3<br />
|
14 |
-
god of war collection ps3 rom<br />
|
15 |
-
how to play god of war collection on pc<br />
|
16 |
-
god of war 1 hd rpcs3 settings<br />
|
17 |
-
god of war 2 hd pc download<br />
|
18 |
-
god of war collection ps3 pkg<br />
|
19 |
-
rpcs3 god of war collection vulkan<br />
|
20 |
-
god of war 1 and 2 pc emulator<br />
|
21 |
-
god of war hd collection ps3 iso<br />
|
22 |
-
god of war collection pc gameplay<br />
|
23 |
-
god of war ps3 emulator android<br />
|
24 |
-
god of war collection ps3 save data<br />
|
25 |
-
rpcs3 god of war collection lle modules<br />
|
26 |
-
god of war 2 hd rpcs3 download<br />
|
27 |
-
god of war hd collection pc requirements<br />
|
28 |
-
god of war ps3 emulator reddit<br />
|
29 |
-
god of war collection ps3 cheats<br />
|
30 |
-
rpcs3 god of war collection install guide<br />
|
31 |
-
god of war 1 hd pc download<br />
|
32 |
-
god of war hd collection ps3 download<br />
|
33 |
-
god of war ps3 emulator online<br />
|
34 |
-
god of war collection ps3 trophy guide<br />
|
35 |
-
rpcs3 god of war collection graphics fix<br />
|
36 |
-
god of war 1 hd rpcs3 cheats<br />
|
37 |
-
god of war 2 hd pc emulator<br />
|
38 |
-
god of war hd collection ps4 download<br />
|
39 |
-
god of war ps3 emulator for windows 10<br />
|
40 |
-
god of war collection ps3 review<br />
|
41 |
-
rpcs3 god of war collection sound problem<br />
|
42 |
-
god of war 1 hd rpcs3 save game<br />
|
43 |
-
god of war 2 hd rpcs3 settings<br />
|
44 |
-
god of war hd collection pc crack<br />
|
45 |
-
god of war ps3 emulator apk<br />
|
46 |
-
god of war collection ps3 price<br />
|
47 |
-
rpcs3 god of war collection controller configuration<br />
|
48 |
-
god of war 1 hd rpcs3 gameplay<br />
|
49 |
-
god of war 2 hd rpcs3 cheats<br />
|
50 |
-
god of war hd collection pc free download<br />
|
51 |
-
god of war ps3 emulator mac<br />
|
52 |
-
god of war collection ps3 gamestop<br />
|
53 |
-
rpcs3 god of war collection black screen fix<br />
|
54 |
-
god of war 1 hd rpcs3 resolution scale<br />
|
55 |
-
god of war 2 hd rpcs3 gameplay<br />
|
56 |
-
god of war hd collection pc steam<br />
|
57 |
-
god of war ps3 emulator linux<br />
|
58 |
-
god of war collection ps3 amazon</p>
|
59 |
-
<h2>How to Download God of War Collection PS3 Emulator Download</h2>
|
60 |
-
<h3>Requirements and Steps to Download and Install RPCS3</h3>
|
61 |
-
<p>To download and install RPCS3, you will need a PC that meets the following minimum requirements:</p>
|
62 |
-
<ul>
|
63 |
-
<li>A 64-bit operating system (Windows 7 or later, Linux, macOS)</li>
|
64 |
-
<li>A CPU that supports x86-64 instructions (Intel Core i5 or AMD Ryzen 5 or higher recommended)</li>
|
65 |
-
<li>A GPU that supports OpenGL 4.3 or Vulkan (NVIDIA GeForce GTX 970 or AMD Radeon R9 390X or higher recommended)</li>
|
66 |
-
<li>At least 8 GB of RAM (16 GB or more recommended)</li>
|
67 |
-
<li>An SSD or HDD with enough space for the emulator data and the game files</li>
|
68 |
-
</ul>
|
69 |
-
<p>Once you have a compatible PC, follow these steps to download and install RPCS3:</p>
|
70 |
-
<ol>
|
71 |
-
<li>Go to <a href="(^6^)">the official website</a> of RPCS3 and click on the Download button.</li>
|
72 |
-
<li>Choose your operating system and download the latest build of RPCS3.</li>
|
73 |
-
<li>Extract the downloaded file to a folder of your choice.</li>
|
74 |
-
<li>Run rpcs3.exe to launch the emulator.</ <h3>Where to Find the ROM Files for God of War Collection PS3 Emulator Download</h3>
|
75 |
-
<p>To play God of War Collection PS3 Emulator Download on your PC, you will also need the ROM files for the games. ROM files are the digital copies of the game discs that can be read by the emulator. However, finding and downloading ROM files can be tricky, as they are often illegal to distribute and share online. Therefore, you should only download ROM files from trusted and reputable sources, and only if you own the original game discs.</p>
|
76 |
-
<p>One possible source for the ROM files is [Reddit](^1^), where some users have shared links to download God of War Collection PS3 Emulator Download in various regions and languages. However, these links may not always work or be safe, so you should use them at your own risk and discretion. You should also scan the downloaded files for viruses and malware before running them on your PC.</p>
|
77 |
-
<p>Another possible source for the ROM files is [Vimm's Lair](^2^), a website that hosts a large collection of classic games for various consoles, including the PS3. You can search for God of War Collection PS3 Emulator Download on this website and download the ROM files from there. However, you should be aware that the download speed may be slow and limited, and that you may encounter some errors or glitches while playing the games.</p>
|
78 |
-
<p>Once you have downloaded the ROM files, you will need to extract them to a folder of your choice. You will also need to install some additional software to run the games, such as [PS3 Firmware](^3^) and [PS3 System Software](^4^). You can find more information on how to install these software on the [RPCS3 website](^6^) or on various online guides and tutorials.</p>
|
79 |
-
<h3>How to Configure RPCS3 for Optimal Performance and Compatibility with God of War Collection PS3 Emulator Download</h3>
|
80 |
-
<p>After you have installed RPCS3 and the ROM files, you will need to configure the emulator settings to ensure that the games run smoothly and without any issues. There are many options and parameters that you can tweak and adjust in RPCS3, but some of the most important ones are:</p>
|
81 |
-
<ul>
|
82 |
-
<li>CPU configuration: You should enable PPU Decoder Recompiler (LLVM) and SPU Decoder Recompiler (LLVM) for better performance. You should also enable SPU Loop Detection, SPU Cache, and Thread Scheduler for better compatibility. You can also experiment with different SPU Block Size values, such as Safe, Mega, or Giga, depending on your CPU model and power.</li>
|
83 |
-
<li>GPU configuration: You should choose Vulkan as your Renderer for better graphics and stability. You should also enable Write Color Buffers, Read Color Buffers, Read Depth Buffer, and Write Depth Buffer for better rendering accuracy. You can also enable Anisotropic Filter, Anti-Aliasing, Resolution Scale, and Texture Scaling for better image quality.</li>
|
84 |
-
<li>Audio configuration: You should choose XAudio2 as your Audio Out for better sound quality and compatibility. You should also enable Audio Buffer Duration and Time Stretching for better audio synchronization.</li>
|
85 |
-
<li>Advanced configuration: You should enable Debug Console Mode, Accurate RSX Reservation Access, Accurate GETLLAR, Accurate PUTLLUC, and Use GPU Texture Scaling for better emulation accuracy. You can also enable Relaxed ZCULL Sync and Driver Wake-Up Delay for better performance.</li>
|
86 |
-
</ul>
|
87 |
-
<p>These settings are based on various online sources that have tested and optimized RPCS3 for God of War Collection PS3 Emulator Download. However, you should keep in mind that these settings may not work for everyone or every game, as different PC configurations and game versions may require different settings. Therefore, you should always test and experiment with different settings until you find the ones that work best for you.</p> to buy or own a PS3 console or the game discs. You can also avoid the hassle of switching discs, updating firmware, and dealing with region locks.</li>
|
88 |
-
</ul>
|
89 |
-
<p>Of course, playing God of War Collection PS3 Emulator Download on PC also has some drawbacks and challenges, such as:</p>
|
90 |
-
<ul>
|
91 |
-
<li>You may encounter some bugs, glitches, crashes, or compatibility issues while playing the games, as RPCS3 is still in development and not perfect. You may also need to update the emulator and the game files regularly to fix these issues.</li>
|
92 |
-
<li>You may need a powerful PC to run the games at full speed and quality, as RPCS3 is very demanding on CPU and GPU resources. You may also need to tweak and optimize the emulator settings for each game to achieve the best performance.</li>
|
93 |
-
<li>You may face some legal or ethical dilemmas while downloading and playing the games, as ROM files are often considered piracy and infringement of intellectual property rights. You should always respect the rights of the game developers and publishers, and only download and play the games if you own the original copies.</li>
|
94 |
-
</ul>
|
95 |
-
<h3>Pros and Cons of Playing God of War Collection PS3 Emulator Download on PC</h3>
|
96 |
-
<p>To summarize, here is a table that compares the pros and cons of playing God of War Collection PS3 Emulator Download on PC versus playing it on a console:</p>
|
97 |
-
<table>
|
98 |
-
<tr>
|
99 |
-
<th>PC</th>
|
100 |
-
<th>Console</th>
|
101 |
-
</tr>
|
102 |
-
<tr>
|
103 |
-
<td>+ Higher resolution, frame rate, and graphical quality</td>
|
104 |
-
<td>- Lower resolution, frame rate, and graphical quality</td>
|
105 |
-
</tr>
|
106 |
-
<tr>
|
107 |
-
<td>+ Various input devices and customization options</td>
|
108 |
-
<td>- Limited input devices and customization options</td>
|
109 |
-
</tr>
|
110 |
-
<tr>
|
111 |
-
<td>+ Save states, cheats, mods, patches, and other enhancements</td>
|
112 |
-
<td>- No save states, cheats, mods, patches, and other enhancements</td>
|
113 |
-
</tr>
|
114 |
-
<tr>
|
115 |
-
<td>+ Access to other PS3 games and emulators</td>
|
116 |
-
<td>- No access to other PS3 games and emulators</td>
|
117 |
-
</tr>
|
118 |
-
<tr>
|
119 |
-
<td>+ No need to buy or own a PS3 console or the game discs</td>
|
120 |
-
<td>- Need to buy or own a PS3 console or the game discs</td>
|
121 |
-
</tr>
|
122 |
-
<tr>
|
123 |
-
<td>- Bugs, glitches, crashes, or compatibility issues</td>
|
124 |
-
<td>+ Stable and reliable gameplay experience</td>
|
125 |
-
</tr>
|
126 |
-
<tr>
|
127 |
-
<td>- High PC requirements and emulator settings optimization</td>
|
128 |
-
<td>+ Low console requirements and plug-and-play convenience</td>
|
129 |
-
</tr>
|
130 |
-
<tr>
|
131 |
-
<td>- Legal or ethical dilemmas regarding ROM files</td>
|
132 |
-
<td>+ Legal or ethical compliance regarding game discs</td>
|
133 |
-
</tr>
|
134 |
-
</table>
|
135 |
-
<h3>Tips and Tricks to Enhance the Gameplay Experience of God of War Collection PS3 Emulator Download on PC</h3>
|
136 |
-
<p>Finally, here are some tips and tricks that can help you enhance the gameplay experience of God of War Collection PS3 Emulator Download on PC:</p>
|
137 |
-
<ul>
|
138 |
-
<li>Check the [RPCS3 compatibility list] to see how well each game runs on the emulator, and what settings are recommended for each game.</li>
|
139 |
-
<li>Check the [RPCS3 wiki] to see if there are any specific instructions or solutions for each game, such as patches, fixes, or workarounds.</li>
|
140 |
-
<li>Check the [RPCS3 forums] or [Discord server] to see if there are any discussions or feedback from other users who have played the same game.</li>
|
141 |
-
<li>Watch some [YouTube videos] or [Twitch streams] of other people who have played the same game on RPCS3, to see how they have configured their settings and how they have enjoyed their gameplay.</li>
|
142 |
-
<li>Read some [reviews] or [guides] of the games themselves, to learn more about their story, characters, gameplay mechanics, secrets, tips, and strategies.</li>
|
143 |
-
<li>Have fun and enjoy playing God of War Collection PS3 Emulator Download on your PC!</li>
|
144 |
-
</ul>
|
145 |
-
<h2>Conclusion</h2>
|
146 |
-
<p>In this article, we have shown you how to download, install, configure, and play God of War Collection PS3 Emulator Download on your PC. We have also discussed the features and benefits, as well as the pros and cons, of playing God of War games on PC. We have also provided some tips and tricks to enhance your gameplay experience.</p>
|
147 |
-
<p>We hope that this article has been helpful and informative for you. If you have any questions or comments about this topic, feel free to leave them below. We would love to hear from you!</p>
|
148 |
-
<p>Thank you for reading this article and happy gaming!</p>
|
149 |
-
<h2>FAQs</h2>
|
150 |
-
<p>Here are some frequently asked questions about God of War Collection PS3 Emulator Download:</p>
|
151 |
-
<h3>Q: Is RPCS3 legal and safe to use?</h3>
|
152 |
-
<p>A: RPCS3 is legal and safe to use, as long as you follow the rules and guidelines of the emulator. You should only download RPCS3 from the official website, and only use it for personal and non-commercial purposes. You should also only play games that you own legally, and not share or distribute ROM files online.</p>
|
153 |
-
<h3>Q: How long does it take to download and install RPCS3 and the ROM files?</h3>
|
154 |
-
<p>A: The download and installation time of RPCS3 and the ROM files may vary depending on your internet speed, PC specifications, and file size. Generally, it may take from a few minutes to a few hours to complete the process.</p>
|
155 |
-
<h3>Q: How much space do I need to store RPCS3 and the ROM files?</h3>
|
156 |
-
<p>A: The space required to store RPCS3 and the ROM files may also vary depending on the number and size of the games you want to play. Generally, RPCS3 itself takes about 100 MB of space, while each game may take from a few GB to tens of GB of space. Therefore, you should have enough space on your SSD or HDD to store them.</p>
|
157 |
-
<h3>Q: Can I play God of War Collection PS3 Emulator Download online or with other players?</h3>
|
158 |
-
<p>A: Unfortunately, RPCS3 does not support online or multiplayer features for most games, including God of War Collection PS3 Emulator Download. Therefore, you can only play the games offline or with local co-op.</p>
|
159 |
-
<h3>Q: Can I play other God of War games on RPCS3?</h3>
|
160 |
-
<p>A: Yes, you can play other God of War games on RPCS3, such as God of War III, God of War: Ascension, God of War: Chains of Olympus, and God of War: Ghost of Sparta. However, some of these games may not run as well as God of War Collection PS3 Emulator Download, or may have some issues or bugs. You should check the compatibility list and the wiki for more information on each game.</p> 197e85843d<br />
|
161 |
-
<br />
|
162 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/4Taps/SadTalker/src/face3d/models/arcface_torch/utils/utils_amp.py
DELETED
@@ -1,88 +0,0 @@
|
|
1 |
-
from typing import Dict, List
|
2 |
-
|
3 |
-
import torch
|
4 |
-
|
5 |
-
if torch.__version__ < '1.9':
|
6 |
-
Iterable = torch._six.container_abcs.Iterable
|
7 |
-
else:
|
8 |
-
import collections
|
9 |
-
|
10 |
-
Iterable = collections.abc.Iterable
|
11 |
-
from torch.cuda.amp import GradScaler
|
12 |
-
|
13 |
-
|
14 |
-
class _MultiDeviceReplicator(object):
|
15 |
-
"""
|
16 |
-
Lazily serves copies of a tensor to requested devices. Copies are cached per-device.
|
17 |
-
"""
|
18 |
-
|
19 |
-
def __init__(self, master_tensor: torch.Tensor) -> None:
|
20 |
-
assert master_tensor.is_cuda
|
21 |
-
self.master = master_tensor
|
22 |
-
self._per_device_tensors: Dict[torch.device, torch.Tensor] = {}
|
23 |
-
|
24 |
-
def get(self, device) -> torch.Tensor:
|
25 |
-
retval = self._per_device_tensors.get(device, None)
|
26 |
-
if retval is None:
|
27 |
-
retval = self.master.to(device=device, non_blocking=True, copy=True)
|
28 |
-
self._per_device_tensors[device] = retval
|
29 |
-
return retval
|
30 |
-
|
31 |
-
|
32 |
-
class MaxClipGradScaler(GradScaler):
|
33 |
-
def __init__(self, init_scale, max_scale: float, growth_interval=100):
|
34 |
-
GradScaler.__init__(self, init_scale=init_scale, growth_interval=growth_interval)
|
35 |
-
self.max_scale = max_scale
|
36 |
-
|
37 |
-
def scale_clip(self):
|
38 |
-
if self.get_scale() == self.max_scale:
|
39 |
-
self.set_growth_factor(1)
|
40 |
-
elif self.get_scale() < self.max_scale:
|
41 |
-
self.set_growth_factor(2)
|
42 |
-
elif self.get_scale() > self.max_scale:
|
43 |
-
self._scale.fill_(self.max_scale)
|
44 |
-
self.set_growth_factor(1)
|
45 |
-
|
46 |
-
def scale(self, outputs):
|
47 |
-
"""
|
48 |
-
Multiplies ('scales') a tensor or list of tensors by the scale factor.
|
49 |
-
|
50 |
-
Returns scaled outputs. If this instance of :class:`GradScaler` is not enabled, outputs are returned
|
51 |
-
unmodified.
|
52 |
-
|
53 |
-
Arguments:
|
54 |
-
outputs (Tensor or iterable of Tensors): Outputs to scale.
|
55 |
-
"""
|
56 |
-
if not self._enabled:
|
57 |
-
return outputs
|
58 |
-
self.scale_clip()
|
59 |
-
# Short-circuit for the common case.
|
60 |
-
if isinstance(outputs, torch.Tensor):
|
61 |
-
assert outputs.is_cuda
|
62 |
-
if self._scale is None:
|
63 |
-
self._lazy_init_scale_growth_tracker(outputs.device)
|
64 |
-
assert self._scale is not None
|
65 |
-
return outputs * self._scale.to(device=outputs.device, non_blocking=True)
|
66 |
-
|
67 |
-
# Invoke the more complex machinery only if we're treating multiple outputs.
|
68 |
-
stash: List[_MultiDeviceReplicator] = [] # holds a reference that can be overwritten by apply_scale
|
69 |
-
|
70 |
-
def apply_scale(val):
|
71 |
-
if isinstance(val, torch.Tensor):
|
72 |
-
assert val.is_cuda
|
73 |
-
if len(stash) == 0:
|
74 |
-
if self._scale is None:
|
75 |
-
self._lazy_init_scale_growth_tracker(val.device)
|
76 |
-
assert self._scale is not None
|
77 |
-
stash.append(_MultiDeviceReplicator(self._scale))
|
78 |
-
return val * stash[0].get(val.device)
|
79 |
-
elif isinstance(val, Iterable):
|
80 |
-
iterable = map(apply_scale, val)
|
81 |
-
if isinstance(val, list) or isinstance(val, tuple):
|
82 |
-
return type(val)(iterable)
|
83 |
-
else:
|
84 |
-
return iterable
|
85 |
-
else:
|
86 |
-
raise ValueError("outputs must be a Tensor or an iterable of Tensors")
|
87 |
-
|
88 |
-
return apply_scale(outputs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/7hao/bingo/tailwind.config.js
DELETED
@@ -1,48 +0,0 @@
|
|
1 |
-
/** @type {import('tailwindcss').Config} */
|
2 |
-
module.exports = {
|
3 |
-
content: [
|
4 |
-
'./src/pages/**/*.{js,ts,jsx,tsx,mdx}',
|
5 |
-
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
|
6 |
-
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
|
7 |
-
'./src/ui/**/*.{js,ts,jsx,tsx,mdx}',
|
8 |
-
],
|
9 |
-
"darkMode": "class",
|
10 |
-
theme: {
|
11 |
-
extend: {
|
12 |
-
colors: {
|
13 |
-
'primary-blue': 'rgb(var(--color-primary-blue) / <alpha-value>)',
|
14 |
-
secondary: 'rgb(var(--color-secondary) / <alpha-value>)',
|
15 |
-
'primary-background': 'rgb(var(--primary-background) / <alpha-value>)',
|
16 |
-
'primary-text': 'rgb(var(--primary-text) / <alpha-value>)',
|
17 |
-
'secondary-text': 'rgb(var(--secondary-text) / <alpha-value>)',
|
18 |
-
'light-text': 'rgb(var(--light-text) / <alpha-value>)',
|
19 |
-
'primary-border': 'rgb(var(--primary-border) / <alpha-value>)',
|
20 |
-
},
|
21 |
-
keyframes: {
|
22 |
-
slideDownAndFade: {
|
23 |
-
from: { opacity: 0, transform: 'translateY(-2px)' },
|
24 |
-
to: { opacity: 1, transform: 'translateY(0)' },
|
25 |
-
},
|
26 |
-
slideLeftAndFade: {
|
27 |
-
from: { opacity: 0, transform: 'translateX(2px)' },
|
28 |
-
to: { opacity: 1, transform: 'translateX(0)' },
|
29 |
-
},
|
30 |
-
slideUpAndFade: {
|
31 |
-
from: { opacity: 0, transform: 'translateY(2px)' },
|
32 |
-
to: { opacity: 1, transform: 'translateY(0)' },
|
33 |
-
},
|
34 |
-
slideRightAndFade: {
|
35 |
-
from: { opacity: 0, transform: 'translateX(2px)' },
|
36 |
-
to: { opacity: 1, transform: 'translateX(0)' },
|
37 |
-
},
|
38 |
-
},
|
39 |
-
animation: {
|
40 |
-
slideDownAndFade: 'slideDownAndFade 400ms cubic-bezier(0.16, 1, 0.3, 1)',
|
41 |
-
slideLeftAndFade: 'slideLeftAndFade 400ms cubic-bezier(0.16, 1, 0.3, 1)',
|
42 |
-
slideUpAndFade: 'slideUpAndFade 400ms cubic-bezier(0.16, 1, 0.3, 1)',
|
43 |
-
slideRightAndFade: 'slideRightAndFade 400ms cubic-bezier(0.16, 1, 0.3, 1)',
|
44 |
-
},
|
45 |
-
},
|
46 |
-
},
|
47 |
-
plugins: [require('@headlessui/tailwindcss'), require('tailwind-scrollbar')],
|
48 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIConsultant/MusicGen/app.py
DELETED
@@ -1,463 +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 |
-
# Updated to account for UI changes from https://github.com/rkfg/audiocraft/blob/long/app.py
|
8 |
-
# also released under the MIT license.
|
9 |
-
|
10 |
-
import argparse
|
11 |
-
from concurrent.futures import ProcessPoolExecutor
|
12 |
-
import os
|
13 |
-
from pathlib import Path
|
14 |
-
import subprocess as sp
|
15 |
-
from tempfile import NamedTemporaryFile
|
16 |
-
import time
|
17 |
-
import typing as tp
|
18 |
-
import warnings
|
19 |
-
|
20 |
-
import torch
|
21 |
-
import gradio as gr
|
22 |
-
|
23 |
-
from audiocraft.data.audio_utils import convert_audio
|
24 |
-
from audiocraft.data.audio import audio_write
|
25 |
-
from audiocraft.models import MusicGen, MultiBandDiffusion
|
26 |
-
|
27 |
-
|
28 |
-
MODEL = None # Last used model
|
29 |
-
IS_BATCHED = "facebook/MusicGen" in os.environ.get('SPACE_ID', '')
|
30 |
-
print(IS_BATCHED)
|
31 |
-
MAX_BATCH_SIZE = 12
|
32 |
-
BATCHED_DURATION = 15
|
33 |
-
INTERRUPTING = False
|
34 |
-
MBD = None
|
35 |
-
# We have to wrap subprocess call to clean a bit the log when using gr.make_waveform
|
36 |
-
_old_call = sp.call
|
37 |
-
|
38 |
-
|
39 |
-
def _call_nostderr(*args, **kwargs):
|
40 |
-
# Avoid ffmpeg vomiting on the logs.
|
41 |
-
kwargs['stderr'] = sp.DEVNULL
|
42 |
-
kwargs['stdout'] = sp.DEVNULL
|
43 |
-
_old_call(*args, **kwargs)
|
44 |
-
|
45 |
-
|
46 |
-
sp.call = _call_nostderr
|
47 |
-
# Preallocating the pool of processes.
|
48 |
-
pool = ProcessPoolExecutor(4)
|
49 |
-
pool.__enter__()
|
50 |
-
|
51 |
-
|
52 |
-
def interrupt():
|
53 |
-
global INTERRUPTING
|
54 |
-
INTERRUPTING = True
|
55 |
-
|
56 |
-
|
57 |
-
class FileCleaner:
|
58 |
-
def __init__(self, file_lifetime: float = 3600):
|
59 |
-
self.file_lifetime = file_lifetime
|
60 |
-
self.files = []
|
61 |
-
|
62 |
-
def add(self, path: tp.Union[str, Path]):
|
63 |
-
self._cleanup()
|
64 |
-
self.files.append((time.time(), Path(path)))
|
65 |
-
|
66 |
-
def _cleanup(self):
|
67 |
-
now = time.time()
|
68 |
-
for time_added, path in list(self.files):
|
69 |
-
if now - time_added > self.file_lifetime:
|
70 |
-
if path.exists():
|
71 |
-
path.unlink()
|
72 |
-
self.files.pop(0)
|
73 |
-
else:
|
74 |
-
break
|
75 |
-
|
76 |
-
|
77 |
-
file_cleaner = FileCleaner()
|
78 |
-
|
79 |
-
|
80 |
-
def make_waveform(*args, **kwargs):
|
81 |
-
# Further remove some warnings.
|
82 |
-
be = time.time()
|
83 |
-
with warnings.catch_warnings():
|
84 |
-
warnings.simplefilter('ignore')
|
85 |
-
out = gr.make_waveform(*args, **kwargs)
|
86 |
-
print("Make a video took", time.time() - be)
|
87 |
-
return out
|
88 |
-
|
89 |
-
|
90 |
-
def load_model(version='facebook/musicgen-melody'):
|
91 |
-
global MODEL
|
92 |
-
print("Loading model", version)
|
93 |
-
if MODEL is None or MODEL.name != version:
|
94 |
-
MODEL = MusicGen.get_pretrained(version)
|
95 |
-
|
96 |
-
|
97 |
-
def load_diffusion():
|
98 |
-
global MBD
|
99 |
-
if MBD is None:
|
100 |
-
print("loading MBD")
|
101 |
-
MBD = MultiBandDiffusion.get_mbd_musicgen()
|
102 |
-
|
103 |
-
|
104 |
-
def _do_predictions(texts, melodies, duration, progress=False, **gen_kwargs):
|
105 |
-
MODEL.set_generation_params(duration=duration, **gen_kwargs)
|
106 |
-
print("new batch", len(texts), texts, [None if m is None else (m[0], m[1].shape) for m in melodies])
|
107 |
-
be = time.time()
|
108 |
-
processed_melodies = []
|
109 |
-
target_sr = 32000
|
110 |
-
target_ac = 1
|
111 |
-
for melody in melodies:
|
112 |
-
if melody is None:
|
113 |
-
processed_melodies.append(None)
|
114 |
-
else:
|
115 |
-
sr, melody = melody[0], torch.from_numpy(melody[1]).to(MODEL.device).float().t()
|
116 |
-
if melody.dim() == 1:
|
117 |
-
melody = melody[None]
|
118 |
-
melody = melody[..., :int(sr * duration)]
|
119 |
-
melody = convert_audio(melody, sr, target_sr, target_ac)
|
120 |
-
processed_melodies.append(melody)
|
121 |
-
|
122 |
-
if any(m is not None for m in processed_melodies):
|
123 |
-
outputs = MODEL.generate_with_chroma(
|
124 |
-
descriptions=texts,
|
125 |
-
melody_wavs=processed_melodies,
|
126 |
-
melody_sample_rate=target_sr,
|
127 |
-
progress=progress,
|
128 |
-
return_tokens=USE_DIFFUSION
|
129 |
-
)
|
130 |
-
else:
|
131 |
-
outputs = MODEL.generate(texts, progress=progress, return_tokens=USE_DIFFUSION)
|
132 |
-
if USE_DIFFUSION:
|
133 |
-
outputs_diffusion = MBD.tokens_to_wav(outputs[1])
|
134 |
-
outputs = torch.cat([outputs[0], outputs_diffusion], dim=0)
|
135 |
-
outputs = outputs.detach().cpu().float()
|
136 |
-
pending_videos = []
|
137 |
-
out_wavs = []
|
138 |
-
for output in outputs:
|
139 |
-
with NamedTemporaryFile("wb", suffix=".wav", delete=False) as file:
|
140 |
-
audio_write(
|
141 |
-
file.name, output, MODEL.sample_rate, strategy="loudness",
|
142 |
-
loudness_headroom_db=16, loudness_compressor=True, add_suffix=False)
|
143 |
-
pending_videos.append(pool.submit(make_waveform, file.name))
|
144 |
-
out_wavs.append(file.name)
|
145 |
-
file_cleaner.add(file.name)
|
146 |
-
out_videos = [pending_video.result() for pending_video in pending_videos]
|
147 |
-
for video in out_videos:
|
148 |
-
file_cleaner.add(video)
|
149 |
-
print("batch finished", len(texts), time.time() - be)
|
150 |
-
print("Tempfiles currently stored: ", len(file_cleaner.files))
|
151 |
-
return out_videos, out_wavs
|
152 |
-
|
153 |
-
|
154 |
-
def predict_batched(texts, melodies):
|
155 |
-
max_text_length = 512
|
156 |
-
texts = [text[:max_text_length] for text in texts]
|
157 |
-
load_model('facebook/musicgen-melody')
|
158 |
-
res = _do_predictions(texts, melodies, BATCHED_DURATION)
|
159 |
-
return res
|
160 |
-
|
161 |
-
|
162 |
-
def predict_full(model, decoder, text, melody, duration, topk, topp, temperature, cfg_coef, progress=gr.Progress()):
|
163 |
-
global INTERRUPTING
|
164 |
-
global USE_DIFFUSION
|
165 |
-
INTERRUPTING = False
|
166 |
-
if temperature < 0:
|
167 |
-
raise gr.Error("Temperature must be >= 0.")
|
168 |
-
if topk < 0:
|
169 |
-
raise gr.Error("Topk must be non-negative.")
|
170 |
-
if topp < 0:
|
171 |
-
raise gr.Error("Topp must be non-negative.")
|
172 |
-
|
173 |
-
topk = int(topk)
|
174 |
-
if decoder == "MultiBand_Diffusion":
|
175 |
-
USE_DIFFUSION = True
|
176 |
-
load_diffusion()
|
177 |
-
else:
|
178 |
-
USE_DIFFUSION = False
|
179 |
-
load_model(model)
|
180 |
-
|
181 |
-
def _progress(generated, to_generate):
|
182 |
-
progress((min(generated, to_generate), to_generate))
|
183 |
-
if INTERRUPTING:
|
184 |
-
raise gr.Error("Interrupted.")
|
185 |
-
MODEL.set_custom_progress_callback(_progress)
|
186 |
-
|
187 |
-
videos, wavs = _do_predictions(
|
188 |
-
[text], [melody], duration, progress=True,
|
189 |
-
top_k=topk, top_p=topp, temperature=temperature, cfg_coef=cfg_coef)
|
190 |
-
if USE_DIFFUSION:
|
191 |
-
return videos[0], wavs[0], videos[1], wavs[1]
|
192 |
-
return videos[0], wavs[0], None, None
|
193 |
-
|
194 |
-
|
195 |
-
def toggle_audio_src(choice):
|
196 |
-
if choice == "mic":
|
197 |
-
return gr.update(source="microphone", value=None, label="Microphone")
|
198 |
-
else:
|
199 |
-
return gr.update(source="upload", value=None, label="File")
|
200 |
-
|
201 |
-
|
202 |
-
def toggle_diffusion(choice):
|
203 |
-
if choice == "MultiBand_Diffusion":
|
204 |
-
return [gr.update(visible=True)] * 2
|
205 |
-
else:
|
206 |
-
return [gr.update(visible=False)] * 2
|
207 |
-
|
208 |
-
|
209 |
-
def ui_full(launch_kwargs):
|
210 |
-
with gr.Blocks() as interface:
|
211 |
-
gr.Markdown(
|
212 |
-
"""
|
213 |
-
# MusicGen
|
214 |
-
This is your private demo for [MusicGen](https://github.com/facebookresearch/audiocraft),
|
215 |
-
a simple and controllable model for music generation
|
216 |
-
presented at: ["Simple and Controllable Music Generation"](https://huggingface.co/papers/2306.05284)
|
217 |
-
"""
|
218 |
-
)
|
219 |
-
with gr.Row():
|
220 |
-
with gr.Column():
|
221 |
-
with gr.Row():
|
222 |
-
text = gr.Text(label="Input Text", interactive=True)
|
223 |
-
with gr.Column():
|
224 |
-
radio = gr.Radio(["file", "mic"], value="file",
|
225 |
-
label="Condition on a melody (optional) File or Mic")
|
226 |
-
melody = gr.Audio(source="upload", type="numpy", label="File",
|
227 |
-
interactive=True, elem_id="melody-input")
|
228 |
-
with gr.Row():
|
229 |
-
submit = gr.Button("Submit")
|
230 |
-
# Adapted from https://github.com/rkfg/audiocraft/blob/long/app.py, MIT license.
|
231 |
-
_ = gr.Button("Interrupt").click(fn=interrupt, queue=False)
|
232 |
-
with gr.Row():
|
233 |
-
model = gr.Radio(["facebook/musicgen-melody", "facebook/musicgen-medium", "facebook/musicgen-small",
|
234 |
-
"facebook/musicgen-large"],
|
235 |
-
label="Model", value="facebook/musicgen-melody", interactive=True)
|
236 |
-
with gr.Row():
|
237 |
-
decoder = gr.Radio(["Default", "MultiBand_Diffusion"],
|
238 |
-
label="Decoder", value="Default", interactive=True)
|
239 |
-
with gr.Row():
|
240 |
-
duration = gr.Slider(minimum=1, maximum=120, value=10, label="Duration", interactive=True)
|
241 |
-
with gr.Row():
|
242 |
-
topk = gr.Number(label="Top-k", value=250, interactive=True)
|
243 |
-
topp = gr.Number(label="Top-p", value=0, interactive=True)
|
244 |
-
temperature = gr.Number(label="Temperature", value=1.0, interactive=True)
|
245 |
-
cfg_coef = gr.Number(label="Classifier Free Guidance", value=3.0, interactive=True)
|
246 |
-
with gr.Column():
|
247 |
-
output = gr.Video(label="Generated Music")
|
248 |
-
audio_output = gr.Audio(label="Generated Music (wav)", type='filepath')
|
249 |
-
diffusion_output = gr.Video(label="MultiBand Diffusion Decoder")
|
250 |
-
audio_diffusion = gr.Audio(label="MultiBand Diffusion Decoder (wav)", type='filepath')
|
251 |
-
submit.click(toggle_diffusion, decoder, [diffusion_output, audio_diffusion], queue=False,
|
252 |
-
show_progress=False).then(predict_full, inputs=[model, decoder, text, melody, duration, topk, topp,
|
253 |
-
temperature, cfg_coef],
|
254 |
-
outputs=[output, audio_output, diffusion_output, audio_diffusion])
|
255 |
-
radio.change(toggle_audio_src, radio, [melody], queue=False, show_progress=False)
|
256 |
-
|
257 |
-
gr.Examples(
|
258 |
-
fn=predict_full,
|
259 |
-
examples=[
|
260 |
-
[
|
261 |
-
"An 80s driving pop song with heavy drums and synth pads in the background",
|
262 |
-
"./assets/bach.mp3",
|
263 |
-
"facebook/musicgen-melody",
|
264 |
-
"Default"
|
265 |
-
],
|
266 |
-
[
|
267 |
-
"A cheerful country song with acoustic guitars",
|
268 |
-
"./assets/bolero_ravel.mp3",
|
269 |
-
"facebook/musicgen-melody",
|
270 |
-
"Default"
|
271 |
-
],
|
272 |
-
[
|
273 |
-
"90s rock song with electric guitar and heavy drums",
|
274 |
-
None,
|
275 |
-
"facebook/musicgen-medium",
|
276 |
-
"Default"
|
277 |
-
],
|
278 |
-
[
|
279 |
-
"a light and cheerly EDM track, with syncopated drums, aery pads, and strong emotions",
|
280 |
-
"./assets/bach.mp3",
|
281 |
-
"facebook/musicgen-melody",
|
282 |
-
"Default"
|
283 |
-
],
|
284 |
-
[
|
285 |
-
"lofi slow bpm electro chill with organic samples",
|
286 |
-
None,
|
287 |
-
"facebook/musicgen-medium",
|
288 |
-
"Default"
|
289 |
-
],
|
290 |
-
[
|
291 |
-
"Punk rock with loud drum and power guitar",
|
292 |
-
None,
|
293 |
-
"facebook/musicgen-medium",
|
294 |
-
"MultiBand_Diffusion"
|
295 |
-
],
|
296 |
-
],
|
297 |
-
inputs=[text, melody, model, decoder],
|
298 |
-
outputs=[output]
|
299 |
-
)
|
300 |
-
gr.Markdown(
|
301 |
-
"""
|
302 |
-
### More details
|
303 |
-
|
304 |
-
The model will generate a short music extract based on the description you provided.
|
305 |
-
The model can generate up to 30 seconds of audio in one pass. It is now possible
|
306 |
-
to extend the generation by feeding back the end of the previous chunk of audio.
|
307 |
-
This can take a long time, and the model might lose consistency. The model might also
|
308 |
-
decide at arbitrary positions that the song ends.
|
309 |
-
|
310 |
-
**WARNING:** Choosing long durations will take a long time to generate (2min might take ~10min).
|
311 |
-
An overlap of 12 seconds is kept with the previously generated chunk, and 18 "new" seconds
|
312 |
-
are generated each time.
|
313 |
-
|
314 |
-
We present 4 model variations:
|
315 |
-
1. facebook/musicgen-melody -- a music generation model capable of generating music condition
|
316 |
-
on text and melody inputs. **Note**, you can also use text only.
|
317 |
-
2. facebook/musicgen-small -- a 300M transformer decoder conditioned on text only.
|
318 |
-
3. facebook/musicgen-medium -- a 1.5B transformer decoder conditioned on text only.
|
319 |
-
4. facebook/musicgen-large -- a 3.3B transformer decoder conditioned on text only.
|
320 |
-
|
321 |
-
We also present two way of decoding the audio tokens
|
322 |
-
1. Use the default GAN based compression model
|
323 |
-
2. Use MultiBand Diffusion from (paper linknano )
|
324 |
-
|
325 |
-
When using `facebook/musicgen-melody`, you can optionally provide a reference audio from
|
326 |
-
which a broad melody will be extracted. The model will then try to follow both
|
327 |
-
the description and melody provided.
|
328 |
-
|
329 |
-
You can also use your own GPU or a Google Colab by following the instructions on our repo.
|
330 |
-
See [github.com/facebookresearch/audiocraft](https://github.com/facebookresearch/audiocraft)
|
331 |
-
for more details.
|
332 |
-
"""
|
333 |
-
)
|
334 |
-
|
335 |
-
interface.queue().launch(**launch_kwargs)
|
336 |
-
|
337 |
-
|
338 |
-
def ui_batched(launch_kwargs):
|
339 |
-
with gr.Blocks() as demo:
|
340 |
-
gr.Markdown(
|
341 |
-
"""
|
342 |
-
# MusicGen
|
343 |
-
|
344 |
-
This is the demo for [MusicGen](https://github.com/facebookresearch/audiocraft),
|
345 |
-
a simple and controllable model for music generation
|
346 |
-
presented at: ["Simple and Controllable Music Generation"](https://huggingface.co/papers/2306.05284).
|
347 |
-
<br/>
|
348 |
-
<a href="https://huggingface.co/spaces/facebook/MusicGen?duplicate=true"
|
349 |
-
style="display: inline-block;margin-top: .5em;margin-right: .25em;" target="_blank">
|
350 |
-
<img style="margin-bottom: 0em;display: inline;margin-top: -.25em;"
|
351 |
-
src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>
|
352 |
-
for longer sequences, more control and no queue.</p>
|
353 |
-
"""
|
354 |
-
)
|
355 |
-
with gr.Row():
|
356 |
-
with gr.Column():
|
357 |
-
with gr.Row():
|
358 |
-
text = gr.Text(label="Describe your music", lines=2, interactive=True)
|
359 |
-
with gr.Column():
|
360 |
-
radio = gr.Radio(["file", "mic"], value="file",
|
361 |
-
label="Condition on a melody (optional) File or Mic")
|
362 |
-
melody = gr.Audio(source="upload", type="numpy", label="File",
|
363 |
-
interactive=True, elem_id="melody-input")
|
364 |
-
with gr.Row():
|
365 |
-
submit = gr.Button("Generate")
|
366 |
-
with gr.Column():
|
367 |
-
output = gr.Video(label="Generated Music")
|
368 |
-
audio_output = gr.Audio(label="Generated Music (wav)", type='filepath')
|
369 |
-
submit.click(predict_batched, inputs=[text, melody],
|
370 |
-
outputs=[output, audio_output], batch=True, max_batch_size=MAX_BATCH_SIZE)
|
371 |
-
radio.change(toggle_audio_src, radio, [melody], queue=False, show_progress=False)
|
372 |
-
gr.Examples(
|
373 |
-
fn=predict_batched,
|
374 |
-
examples=[
|
375 |
-
[
|
376 |
-
"An 80s driving pop song with heavy drums and synth pads in the background",
|
377 |
-
"./assets/bach.mp3",
|
378 |
-
],
|
379 |
-
[
|
380 |
-
"A cheerful country song with acoustic guitars",
|
381 |
-
"./assets/bolero_ravel.mp3",
|
382 |
-
],
|
383 |
-
[
|
384 |
-
"90s rock song with electric guitar and heavy drums",
|
385 |
-
None,
|
386 |
-
],
|
387 |
-
[
|
388 |
-
"a light and cheerly EDM track, with syncopated drums, aery pads, and strong emotions bpm: 130",
|
389 |
-
"./assets/bach.mp3",
|
390 |
-
],
|
391 |
-
[
|
392 |
-
"lofi slow bpm electro chill with organic samples",
|
393 |
-
None,
|
394 |
-
],
|
395 |
-
],
|
396 |
-
inputs=[text, melody],
|
397 |
-
outputs=[output]
|
398 |
-
)
|
399 |
-
gr.Markdown("""
|
400 |
-
### More details
|
401 |
-
|
402 |
-
The model will generate 12 seconds of audio based on the description you provided.
|
403 |
-
You can optionally provide a reference audio from which a broad melody will be extracted.
|
404 |
-
The model will then try to follow both the description and melody provided.
|
405 |
-
All samples are generated with the `melody` model.
|
406 |
-
|
407 |
-
You can also use your own GPU or a Google Colab by following the instructions on our repo.
|
408 |
-
|
409 |
-
See [github.com/facebookresearch/audiocraft](https://github.com/facebookresearch/audiocraft)
|
410 |
-
for more details.
|
411 |
-
""")
|
412 |
-
|
413 |
-
demo.queue(max_size=8 * 4).launch(**launch_kwargs)
|
414 |
-
|
415 |
-
|
416 |
-
if __name__ == "__main__":
|
417 |
-
parser = argparse.ArgumentParser()
|
418 |
-
parser.add_argument(
|
419 |
-
'--listen',
|
420 |
-
type=str,
|
421 |
-
default='0.0.0.0' if 'SPACE_ID' in os.environ else '127.0.0.1',
|
422 |
-
help='IP to listen on for connections to Gradio',
|
423 |
-
)
|
424 |
-
parser.add_argument(
|
425 |
-
'--username', type=str, default='', help='Username for authentication'
|
426 |
-
)
|
427 |
-
parser.add_argument(
|
428 |
-
'--password', type=str, default='', help='Password for authentication'
|
429 |
-
)
|
430 |
-
parser.add_argument(
|
431 |
-
'--server_port',
|
432 |
-
type=int,
|
433 |
-
default=0,
|
434 |
-
help='Port to run the server listener on',
|
435 |
-
)
|
436 |
-
parser.add_argument(
|
437 |
-
'--inbrowser', action='store_true', help='Open in browser'
|
438 |
-
)
|
439 |
-
parser.add_argument(
|
440 |
-
'--share', action='store_true', help='Share the gradio UI'
|
441 |
-
)
|
442 |
-
|
443 |
-
args = parser.parse_args()
|
444 |
-
|
445 |
-
launch_kwargs = {}
|
446 |
-
launch_kwargs['server_name'] = args.listen
|
447 |
-
|
448 |
-
if args.username and args.password:
|
449 |
-
launch_kwargs['auth'] = (args.username, args.password)
|
450 |
-
if args.server_port:
|
451 |
-
launch_kwargs['server_port'] = args.server_port
|
452 |
-
if args.inbrowser:
|
453 |
-
launch_kwargs['inbrowser'] = args.inbrowser
|
454 |
-
if args.share:
|
455 |
-
launch_kwargs['share'] = args.share
|
456 |
-
|
457 |
-
# Show the interface
|
458 |
-
if IS_BATCHED:
|
459 |
-
global USE_DIFFUSION
|
460 |
-
USE_DIFFUSION = False
|
461 |
-
ui_batched(launch_kwargs)
|
462 |
-
else:
|
463 |
-
ui_full(launch_kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Adr740/CV_XPLORER_POC/README.md
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Demo CV AI Explorer
|
3 |
-
emoji: 🏃
|
4 |
-
colorFrom: green
|
5 |
-
colorTo: blue
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.20.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/AgentVerse/agentVerse/agentverse/environments/simulation_env/rules/order/prisoner.py
DELETED
@@ -1,48 +0,0 @@
|
|
1 |
-
from __future__ import annotations
|
2 |
-
|
3 |
-
import logging
|
4 |
-
import re
|
5 |
-
from typing import TYPE_CHECKING, Any, List, Optional
|
6 |
-
|
7 |
-
from . import order_registry as OrderRegistry
|
8 |
-
from .base import BaseOrder
|
9 |
-
|
10 |
-
if TYPE_CHECKING:
|
11 |
-
from agentverse.environments import BaseEnvironment
|
12 |
-
|
13 |
-
|
14 |
-
@OrderRegistry.register("prisoner")
|
15 |
-
class PrisonerOrder(BaseOrder):
|
16 |
-
"""The order for a classroom discussion
|
17 |
-
The agents speak in the following order:
|
18 |
-
1. The professor speaks first
|
19 |
-
2. Then the professor can continue to speak, and the students can raise hands
|
20 |
-
3. The professor can call on a student, then the student can speak or ask a question
|
21 |
-
4. In the group discussion, the students in the group can speak in turn
|
22 |
-
"""
|
23 |
-
|
24 |
-
# try police, prisoner1 prisoner2 first
|
25 |
-
|
26 |
-
last_prisoner_index: int = 1
|
27 |
-
switch_func: dict = {1: 2, 2: 1}
|
28 |
-
|
29 |
-
def get_next_agent_idx(self, environment: BaseEnvironment) -> List[int]:
|
30 |
-
if len(environment.last_messages) == 0:
|
31 |
-
# If the game just begins or , we let only the police speak
|
32 |
-
return [0]
|
33 |
-
elif len(environment.last_messages) == 1:
|
34 |
-
message = environment.last_messages[0]
|
35 |
-
sender = message.sender
|
36 |
-
content = message.content
|
37 |
-
if sender.startswith("Police"):
|
38 |
-
next_prisoner = self.last_prisoner_index
|
39 |
-
self.last_prisoner_index = self.switch_func[self.last_prisoner_index]
|
40 |
-
return [next_prisoner]
|
41 |
-
elif sender.startswith("Suspect"):
|
42 |
-
# 3. when one prisoner made his action, let the police tell another prisoner
|
43 |
-
return [0]
|
44 |
-
else:
|
45 |
-
# If len(last_messages) > 1, then
|
46 |
-
# 1. there must be at least one student raises hand or speaks.
|
47 |
-
# 2. the group discussion is just over.
|
48 |
-
return [0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/agentverse/environments/simulation_env/rules/visibility/base.py
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
from __future__ import annotations
|
2 |
-
|
3 |
-
from abc import abstractmethod
|
4 |
-
from typing import TYPE_CHECKING, Any
|
5 |
-
|
6 |
-
from pydantic import BaseModel
|
7 |
-
|
8 |
-
if TYPE_CHECKING:
|
9 |
-
from agentverse.environments import BaseEnvironment
|
10 |
-
|
11 |
-
|
12 |
-
class BaseVisibility(BaseModel):
|
13 |
-
@abstractmethod
|
14 |
-
def update_visible_agents(self, environment: BaseEnvironment):
|
15 |
-
"""Update the set of visible agents for the agent"""
|
16 |
-
|
17 |
-
def reset(self):
|
18 |
-
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/confirmdialog/methods/RegisterEvents.js
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
var OnPointerOverCallback = function (button) {
|
2 |
-
if (button.setHoverState) {
|
3 |
-
button.setHoverState(true);
|
4 |
-
}
|
5 |
-
}
|
6 |
-
|
7 |
-
var OnPointerOutCallback = function (button) {
|
8 |
-
if (button.setHoverState) {
|
9 |
-
button.setHoverState(false);
|
10 |
-
}
|
11 |
-
}
|
12 |
-
|
13 |
-
var OnChoiceButtonStateChange = function (button, groupName, index, value) {
|
14 |
-
if (button.setActiveState) {
|
15 |
-
button.setActiveState(value);
|
16 |
-
}
|
17 |
-
}
|
18 |
-
|
19 |
-
var OnButtonEnable = function (button) {
|
20 |
-
if (button.setDisableState) {
|
21 |
-
button.setDisableState(false);
|
22 |
-
}
|
23 |
-
}
|
24 |
-
|
25 |
-
var OnButtonDisable = function (button) {
|
26 |
-
if (button.setDisableState) {
|
27 |
-
button.setDisableState(true);
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
var RegisterEvents = function () {
|
32 |
-
this
|
33 |
-
.on('button.over', OnPointerOverCallback)
|
34 |
-
.on('button.out', OnPointerOutCallback)
|
35 |
-
.on('button.enable', OnButtonEnable)
|
36 |
-
.on('button.disable', OnButtonDisable)
|
37 |
-
.on('button.statechange', OnChoiceButtonStateChange)
|
38 |
-
|
39 |
-
}
|
40 |
-
|
41 |
-
export default RegisterEvents;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Akhil-77/Toxicity_Detector/README.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Toxicity Detector
|
3 |
-
emoji: 😤
|
4 |
-
colorFrom: yellow
|
5 |
-
colorTo: blue
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.40.1
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
license: mit
|
11 |
-
---
|
12 |
-
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Al-Chan/Vits_League_of_Legends_Yuumi_TTS/attentions.py
DELETED
@@ -1,303 +0,0 @@
|
|
1 |
-
import copy
|
2 |
-
import math
|
3 |
-
import numpy as np
|
4 |
-
import torch
|
5 |
-
from torch import nn
|
6 |
-
from torch.nn import functional as F
|
7 |
-
|
8 |
-
import commons
|
9 |
-
import modules
|
10 |
-
from modules import LayerNorm
|
11 |
-
|
12 |
-
|
13 |
-
class Encoder(nn.Module):
|
14 |
-
def __init__(self, hidden_channels, filter_channels, n_heads, n_layers, kernel_size=1, p_dropout=0., window_size=4, **kwargs):
|
15 |
-
super().__init__()
|
16 |
-
self.hidden_channels = hidden_channels
|
17 |
-
self.filter_channels = filter_channels
|
18 |
-
self.n_heads = n_heads
|
19 |
-
self.n_layers = n_layers
|
20 |
-
self.kernel_size = kernel_size
|
21 |
-
self.p_dropout = p_dropout
|
22 |
-
self.window_size = window_size
|
23 |
-
|
24 |
-
self.drop = nn.Dropout(p_dropout)
|
25 |
-
self.attn_layers = nn.ModuleList()
|
26 |
-
self.norm_layers_1 = nn.ModuleList()
|
27 |
-
self.ffn_layers = nn.ModuleList()
|
28 |
-
self.norm_layers_2 = nn.ModuleList()
|
29 |
-
for i in range(self.n_layers):
|
30 |
-
self.attn_layers.append(MultiHeadAttention(hidden_channels, hidden_channels, n_heads, p_dropout=p_dropout, window_size=window_size))
|
31 |
-
self.norm_layers_1.append(LayerNorm(hidden_channels))
|
32 |
-
self.ffn_layers.append(FFN(hidden_channels, hidden_channels, filter_channels, kernel_size, p_dropout=p_dropout))
|
33 |
-
self.norm_layers_2.append(LayerNorm(hidden_channels))
|
34 |
-
|
35 |
-
def forward(self, x, x_mask):
|
36 |
-
attn_mask = x_mask.unsqueeze(2) * x_mask.unsqueeze(-1)
|
37 |
-
x = x * x_mask
|
38 |
-
for i in range(self.n_layers):
|
39 |
-
y = self.attn_layers[i](x, x, attn_mask)
|
40 |
-
y = self.drop(y)
|
41 |
-
x = self.norm_layers_1[i](x + y)
|
42 |
-
|
43 |
-
y = self.ffn_layers[i](x, x_mask)
|
44 |
-
y = self.drop(y)
|
45 |
-
x = self.norm_layers_2[i](x + y)
|
46 |
-
x = x * x_mask
|
47 |
-
return x
|
48 |
-
|
49 |
-
|
50 |
-
class Decoder(nn.Module):
|
51 |
-
def __init__(self, hidden_channels, filter_channels, n_heads, n_layers, kernel_size=1, p_dropout=0., proximal_bias=False, proximal_init=True, **kwargs):
|
52 |
-
super().__init__()
|
53 |
-
self.hidden_channels = hidden_channels
|
54 |
-
self.filter_channels = filter_channels
|
55 |
-
self.n_heads = n_heads
|
56 |
-
self.n_layers = n_layers
|
57 |
-
self.kernel_size = kernel_size
|
58 |
-
self.p_dropout = p_dropout
|
59 |
-
self.proximal_bias = proximal_bias
|
60 |
-
self.proximal_init = proximal_init
|
61 |
-
|
62 |
-
self.drop = nn.Dropout(p_dropout)
|
63 |
-
self.self_attn_layers = nn.ModuleList()
|
64 |
-
self.norm_layers_0 = nn.ModuleList()
|
65 |
-
self.encdec_attn_layers = nn.ModuleList()
|
66 |
-
self.norm_layers_1 = nn.ModuleList()
|
67 |
-
self.ffn_layers = nn.ModuleList()
|
68 |
-
self.norm_layers_2 = nn.ModuleList()
|
69 |
-
for i in range(self.n_layers):
|
70 |
-
self.self_attn_layers.append(MultiHeadAttention(hidden_channels, hidden_channels, n_heads, p_dropout=p_dropout, proximal_bias=proximal_bias, proximal_init=proximal_init))
|
71 |
-
self.norm_layers_0.append(LayerNorm(hidden_channels))
|
72 |
-
self.encdec_attn_layers.append(MultiHeadAttention(hidden_channels, hidden_channels, n_heads, p_dropout=p_dropout))
|
73 |
-
self.norm_layers_1.append(LayerNorm(hidden_channels))
|
74 |
-
self.ffn_layers.append(FFN(hidden_channels, hidden_channels, filter_channels, kernel_size, p_dropout=p_dropout, causal=True))
|
75 |
-
self.norm_layers_2.append(LayerNorm(hidden_channels))
|
76 |
-
|
77 |
-
def forward(self, x, x_mask, h, h_mask):
|
78 |
-
"""
|
79 |
-
x: decoder input
|
80 |
-
h: encoder output
|
81 |
-
"""
|
82 |
-
self_attn_mask = commons.subsequent_mask(x_mask.size(2)).to(device=x.device, dtype=x.dtype)
|
83 |
-
encdec_attn_mask = h_mask.unsqueeze(2) * x_mask.unsqueeze(-1)
|
84 |
-
x = x * x_mask
|
85 |
-
for i in range(self.n_layers):
|
86 |
-
y = self.self_attn_layers[i](x, x, self_attn_mask)
|
87 |
-
y = self.drop(y)
|
88 |
-
x = self.norm_layers_0[i](x + y)
|
89 |
-
|
90 |
-
y = self.encdec_attn_layers[i](x, h, encdec_attn_mask)
|
91 |
-
y = self.drop(y)
|
92 |
-
x = self.norm_layers_1[i](x + y)
|
93 |
-
|
94 |
-
y = self.ffn_layers[i](x, x_mask)
|
95 |
-
y = self.drop(y)
|
96 |
-
x = self.norm_layers_2[i](x + y)
|
97 |
-
x = x * x_mask
|
98 |
-
return x
|
99 |
-
|
100 |
-
|
101 |
-
class MultiHeadAttention(nn.Module):
|
102 |
-
def __init__(self, channels, out_channels, n_heads, p_dropout=0., window_size=None, heads_share=True, block_length=None, proximal_bias=False, proximal_init=False):
|
103 |
-
super().__init__()
|
104 |
-
assert channels % n_heads == 0
|
105 |
-
|
106 |
-
self.channels = channels
|
107 |
-
self.out_channels = out_channels
|
108 |
-
self.n_heads = n_heads
|
109 |
-
self.p_dropout = p_dropout
|
110 |
-
self.window_size = window_size
|
111 |
-
self.heads_share = heads_share
|
112 |
-
self.block_length = block_length
|
113 |
-
self.proximal_bias = proximal_bias
|
114 |
-
self.proximal_init = proximal_init
|
115 |
-
self.attn = None
|
116 |
-
|
117 |
-
self.k_channels = channels // n_heads
|
118 |
-
self.conv_q = nn.Conv1d(channels, channels, 1)
|
119 |
-
self.conv_k = nn.Conv1d(channels, channels, 1)
|
120 |
-
self.conv_v = nn.Conv1d(channels, channels, 1)
|
121 |
-
self.conv_o = nn.Conv1d(channels, out_channels, 1)
|
122 |
-
self.drop = nn.Dropout(p_dropout)
|
123 |
-
|
124 |
-
if window_size is not None:
|
125 |
-
n_heads_rel = 1 if heads_share else n_heads
|
126 |
-
rel_stddev = self.k_channels**-0.5
|
127 |
-
self.emb_rel_k = nn.Parameter(torch.randn(n_heads_rel, window_size * 2 + 1, self.k_channels) * rel_stddev)
|
128 |
-
self.emb_rel_v = nn.Parameter(torch.randn(n_heads_rel, window_size * 2 + 1, self.k_channels) * rel_stddev)
|
129 |
-
|
130 |
-
nn.init.xavier_uniform_(self.conv_q.weight)
|
131 |
-
nn.init.xavier_uniform_(self.conv_k.weight)
|
132 |
-
nn.init.xavier_uniform_(self.conv_v.weight)
|
133 |
-
if proximal_init:
|
134 |
-
with torch.no_grad():
|
135 |
-
self.conv_k.weight.copy_(self.conv_q.weight)
|
136 |
-
self.conv_k.bias.copy_(self.conv_q.bias)
|
137 |
-
|
138 |
-
def forward(self, x, c, attn_mask=None):
|
139 |
-
q = self.conv_q(x)
|
140 |
-
k = self.conv_k(c)
|
141 |
-
v = self.conv_v(c)
|
142 |
-
|
143 |
-
x, self.attn = self.attention(q, k, v, mask=attn_mask)
|
144 |
-
|
145 |
-
x = self.conv_o(x)
|
146 |
-
return x
|
147 |
-
|
148 |
-
def attention(self, query, key, value, mask=None):
|
149 |
-
# reshape [b, d, t] -> [b, n_h, t, d_k]
|
150 |
-
b, d, t_s, t_t = (*key.size(), query.size(2))
|
151 |
-
query = query.view(b, self.n_heads, self.k_channels, t_t).transpose(2, 3)
|
152 |
-
key = key.view(b, self.n_heads, self.k_channels, t_s).transpose(2, 3)
|
153 |
-
value = value.view(b, self.n_heads, self.k_channels, t_s).transpose(2, 3)
|
154 |
-
|
155 |
-
scores = torch.matmul(query / math.sqrt(self.k_channels), key.transpose(-2, -1))
|
156 |
-
if self.window_size is not None:
|
157 |
-
assert t_s == t_t, "Relative attention is only available for self-attention."
|
158 |
-
key_relative_embeddings = self._get_relative_embeddings(self.emb_rel_k, t_s)
|
159 |
-
rel_logits = self._matmul_with_relative_keys(query /math.sqrt(self.k_channels), key_relative_embeddings)
|
160 |
-
scores_local = self._relative_position_to_absolute_position(rel_logits)
|
161 |
-
scores = scores + scores_local
|
162 |
-
if self.proximal_bias:
|
163 |
-
assert t_s == t_t, "Proximal bias is only available for self-attention."
|
164 |
-
scores = scores + self._attention_bias_proximal(t_s).to(device=scores.device, dtype=scores.dtype)
|
165 |
-
if mask is not None:
|
166 |
-
scores = scores.masked_fill(mask == 0, -1e4)
|
167 |
-
if self.block_length is not None:
|
168 |
-
assert t_s == t_t, "Local attention is only available for self-attention."
|
169 |
-
block_mask = torch.ones_like(scores).triu(-self.block_length).tril(self.block_length)
|
170 |
-
scores = scores.masked_fill(block_mask == 0, -1e4)
|
171 |
-
p_attn = F.softmax(scores, dim=-1) # [b, n_h, t_t, t_s]
|
172 |
-
p_attn = self.drop(p_attn)
|
173 |
-
output = torch.matmul(p_attn, value)
|
174 |
-
if self.window_size is not None:
|
175 |
-
relative_weights = self._absolute_position_to_relative_position(p_attn)
|
176 |
-
value_relative_embeddings = self._get_relative_embeddings(self.emb_rel_v, t_s)
|
177 |
-
output = output + self._matmul_with_relative_values(relative_weights, value_relative_embeddings)
|
178 |
-
output = output.transpose(2, 3).contiguous().view(b, d, t_t) # [b, n_h, t_t, d_k] -> [b, d, t_t]
|
179 |
-
return output, p_attn
|
180 |
-
|
181 |
-
def _matmul_with_relative_values(self, x, y):
|
182 |
-
"""
|
183 |
-
x: [b, h, l, m]
|
184 |
-
y: [h or 1, m, d]
|
185 |
-
ret: [b, h, l, d]
|
186 |
-
"""
|
187 |
-
ret = torch.matmul(x, y.unsqueeze(0))
|
188 |
-
return ret
|
189 |
-
|
190 |
-
def _matmul_with_relative_keys(self, x, y):
|
191 |
-
"""
|
192 |
-
x: [b, h, l, d]
|
193 |
-
y: [h or 1, m, d]
|
194 |
-
ret: [b, h, l, m]
|
195 |
-
"""
|
196 |
-
ret = torch.matmul(x, y.unsqueeze(0).transpose(-2, -1))
|
197 |
-
return ret
|
198 |
-
|
199 |
-
def _get_relative_embeddings(self, relative_embeddings, length):
|
200 |
-
max_relative_position = 2 * self.window_size + 1
|
201 |
-
# Pad first before slice to avoid using cond ops.
|
202 |
-
pad_length = max(length - (self.window_size + 1), 0)
|
203 |
-
slice_start_position = max((self.window_size + 1) - length, 0)
|
204 |
-
slice_end_position = slice_start_position + 2 * length - 1
|
205 |
-
if pad_length > 0:
|
206 |
-
padded_relative_embeddings = F.pad(
|
207 |
-
relative_embeddings,
|
208 |
-
commons.convert_pad_shape([[0, 0], [pad_length, pad_length], [0, 0]]))
|
209 |
-
else:
|
210 |
-
padded_relative_embeddings = relative_embeddings
|
211 |
-
used_relative_embeddings = padded_relative_embeddings[:,slice_start_position:slice_end_position]
|
212 |
-
return used_relative_embeddings
|
213 |
-
|
214 |
-
def _relative_position_to_absolute_position(self, x):
|
215 |
-
"""
|
216 |
-
x: [b, h, l, 2*l-1]
|
217 |
-
ret: [b, h, l, l]
|
218 |
-
"""
|
219 |
-
batch, heads, length, _ = x.size()
|
220 |
-
# Concat columns of pad to shift from relative to absolute indexing.
|
221 |
-
x = F.pad(x, commons.convert_pad_shape([[0,0],[0,0],[0,0],[0,1]]))
|
222 |
-
|
223 |
-
# Concat extra elements so to add up to shape (len+1, 2*len-1).
|
224 |
-
x_flat = x.view([batch, heads, length * 2 * length])
|
225 |
-
x_flat = F.pad(x_flat, commons.convert_pad_shape([[0,0],[0,0],[0,length-1]]))
|
226 |
-
|
227 |
-
# Reshape and slice out the padded elements.
|
228 |
-
x_final = x_flat.view([batch, heads, length+1, 2*length-1])[:, :, :length, length-1:]
|
229 |
-
return x_final
|
230 |
-
|
231 |
-
def _absolute_position_to_relative_position(self, x):
|
232 |
-
"""
|
233 |
-
x: [b, h, l, l]
|
234 |
-
ret: [b, h, l, 2*l-1]
|
235 |
-
"""
|
236 |
-
batch, heads, length, _ = x.size()
|
237 |
-
# padd along column
|
238 |
-
x = F.pad(x, commons.convert_pad_shape([[0, 0], [0, 0], [0, 0], [0, length-1]]))
|
239 |
-
x_flat = x.view([batch, heads, length**2 + length*(length -1)])
|
240 |
-
# add 0's in the beginning that will skew the elements after reshape
|
241 |
-
x_flat = F.pad(x_flat, commons.convert_pad_shape([[0, 0], [0, 0], [length, 0]]))
|
242 |
-
x_final = x_flat.view([batch, heads, length, 2*length])[:,:,:,1:]
|
243 |
-
return x_final
|
244 |
-
|
245 |
-
def _attention_bias_proximal(self, length):
|
246 |
-
"""Bias for self-attention to encourage attention to close positions.
|
247 |
-
Args:
|
248 |
-
length: an integer scalar.
|
249 |
-
Returns:
|
250 |
-
a Tensor with shape [1, 1, length, length]
|
251 |
-
"""
|
252 |
-
r = torch.arange(length, dtype=torch.float32)
|
253 |
-
diff = torch.unsqueeze(r, 0) - torch.unsqueeze(r, 1)
|
254 |
-
return torch.unsqueeze(torch.unsqueeze(-torch.log1p(torch.abs(diff)), 0), 0)
|
255 |
-
|
256 |
-
|
257 |
-
class FFN(nn.Module):
|
258 |
-
def __init__(self, in_channels, out_channels, filter_channels, kernel_size, p_dropout=0., activation=None, causal=False):
|
259 |
-
super().__init__()
|
260 |
-
self.in_channels = in_channels
|
261 |
-
self.out_channels = out_channels
|
262 |
-
self.filter_channels = filter_channels
|
263 |
-
self.kernel_size = kernel_size
|
264 |
-
self.p_dropout = p_dropout
|
265 |
-
self.activation = activation
|
266 |
-
self.causal = causal
|
267 |
-
|
268 |
-
if causal:
|
269 |
-
self.padding = self._causal_padding
|
270 |
-
else:
|
271 |
-
self.padding = self._same_padding
|
272 |
-
|
273 |
-
self.conv_1 = nn.Conv1d(in_channels, filter_channels, kernel_size)
|
274 |
-
self.conv_2 = nn.Conv1d(filter_channels, out_channels, kernel_size)
|
275 |
-
self.drop = nn.Dropout(p_dropout)
|
276 |
-
|
277 |
-
def forward(self, x, x_mask):
|
278 |
-
x = self.conv_1(self.padding(x * x_mask))
|
279 |
-
if self.activation == "gelu":
|
280 |
-
x = x * torch.sigmoid(1.702 * x)
|
281 |
-
else:
|
282 |
-
x = torch.relu(x)
|
283 |
-
x = self.drop(x)
|
284 |
-
x = self.conv_2(self.padding(x * x_mask))
|
285 |
-
return x * x_mask
|
286 |
-
|
287 |
-
def _causal_padding(self, x):
|
288 |
-
if self.kernel_size == 1:
|
289 |
-
return x
|
290 |
-
pad_l = self.kernel_size - 1
|
291 |
-
pad_r = 0
|
292 |
-
padding = [[0, 0], [0, 0], [pad_l, pad_r]]
|
293 |
-
x = F.pad(x, commons.convert_pad_shape(padding))
|
294 |
-
return x
|
295 |
-
|
296 |
-
def _same_padding(self, x):
|
297 |
-
if self.kernel_size == 1:
|
298 |
-
return x
|
299 |
-
pad_l = (self.kernel_size - 1) // 2
|
300 |
-
pad_r = self.kernel_size // 2
|
301 |
-
padding = [[0, 0], [0, 0], [pad_l, pad_r]]
|
302 |
-
x = F.pad(x, commons.convert_pad_shape(padding))
|
303 |
-
return x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AlexWang/lama/models/ade20k/base.py
DELETED
@@ -1,627 +0,0 @@
|
|
1 |
-
"""Modified from https://github.com/CSAILVision/semantic-segmentation-pytorch"""
|
2 |
-
|
3 |
-
import os
|
4 |
-
|
5 |
-
import pandas as pd
|
6 |
-
import torch
|
7 |
-
import torch.nn as nn
|
8 |
-
import torch.nn.functional as F
|
9 |
-
from scipy.io import loadmat
|
10 |
-
from torch.nn.modules import BatchNorm2d
|
11 |
-
|
12 |
-
from . import resnet
|
13 |
-
from . import mobilenet
|
14 |
-
|
15 |
-
|
16 |
-
NUM_CLASS = 150
|
17 |
-
base_path = os.path.dirname(os.path.abspath(__file__)) # current file path
|
18 |
-
colors_path = os.path.join(base_path, 'color150.mat')
|
19 |
-
classes_path = os.path.join(base_path, 'object150_info.csv')
|
20 |
-
|
21 |
-
segm_options = dict(colors=loadmat(colors_path)['colors'],
|
22 |
-
classes=pd.read_csv(classes_path),)
|
23 |
-
|
24 |
-
|
25 |
-
class NormalizeTensor:
|
26 |
-
def __init__(self, mean, std, inplace=False):
|
27 |
-
"""Normalize a tensor image with mean and standard deviation.
|
28 |
-
.. note::
|
29 |
-
This transform acts out of place by default, i.e., it does not mutates the input tensor.
|
30 |
-
See :class:`~torchvision.transforms.Normalize` for more details.
|
31 |
-
Args:
|
32 |
-
tensor (Tensor): Tensor image of size (C, H, W) to be normalized.
|
33 |
-
mean (sequence): Sequence of means for each channel.
|
34 |
-
std (sequence): Sequence of standard deviations for each channel.
|
35 |
-
inplace(bool,optional): Bool to make this operation inplace.
|
36 |
-
Returns:
|
37 |
-
Tensor: Normalized Tensor image.
|
38 |
-
"""
|
39 |
-
|
40 |
-
self.mean = mean
|
41 |
-
self.std = std
|
42 |
-
self.inplace = inplace
|
43 |
-
|
44 |
-
def __call__(self, tensor):
|
45 |
-
if not self.inplace:
|
46 |
-
tensor = tensor.clone()
|
47 |
-
|
48 |
-
dtype = tensor.dtype
|
49 |
-
mean = torch.as_tensor(self.mean, dtype=dtype, device=tensor.device)
|
50 |
-
std = torch.as_tensor(self.std, dtype=dtype, device=tensor.device)
|
51 |
-
tensor.sub_(mean[None, :, None, None]).div_(std[None, :, None, None])
|
52 |
-
return tensor
|
53 |
-
|
54 |
-
|
55 |
-
# Model Builder
|
56 |
-
class ModelBuilder:
|
57 |
-
# custom weights initialization
|
58 |
-
@staticmethod
|
59 |
-
def weights_init(m):
|
60 |
-
classname = m.__class__.__name__
|
61 |
-
if classname.find('Conv') != -1:
|
62 |
-
nn.init.kaiming_normal_(m.weight.data)
|
63 |
-
elif classname.find('BatchNorm') != -1:
|
64 |
-
m.weight.data.fill_(1.)
|
65 |
-
m.bias.data.fill_(1e-4)
|
66 |
-
|
67 |
-
@staticmethod
|
68 |
-
def build_encoder(arch='resnet50dilated', fc_dim=512, weights=''):
|
69 |
-
pretrained = True if len(weights) == 0 else False
|
70 |
-
arch = arch.lower()
|
71 |
-
if arch == 'mobilenetv2dilated':
|
72 |
-
orig_mobilenet = mobilenet.__dict__['mobilenetv2'](pretrained=pretrained)
|
73 |
-
net_encoder = MobileNetV2Dilated(orig_mobilenet, dilate_scale=8)
|
74 |
-
elif arch == 'resnet18':
|
75 |
-
orig_resnet = resnet.__dict__['resnet18'](pretrained=pretrained)
|
76 |
-
net_encoder = Resnet(orig_resnet)
|
77 |
-
elif arch == 'resnet18dilated':
|
78 |
-
orig_resnet = resnet.__dict__['resnet18'](pretrained=pretrained)
|
79 |
-
net_encoder = ResnetDilated(orig_resnet, dilate_scale=8)
|
80 |
-
elif arch == 'resnet50dilated':
|
81 |
-
orig_resnet = resnet.__dict__['resnet50'](pretrained=pretrained)
|
82 |
-
net_encoder = ResnetDilated(orig_resnet, dilate_scale=8)
|
83 |
-
elif arch == 'resnet50':
|
84 |
-
orig_resnet = resnet.__dict__['resnet50'](pretrained=pretrained)
|
85 |
-
net_encoder = Resnet(orig_resnet)
|
86 |
-
else:
|
87 |
-
raise Exception('Architecture undefined!')
|
88 |
-
|
89 |
-
# encoders are usually pretrained
|
90 |
-
# net_encoder.apply(ModelBuilder.weights_init)
|
91 |
-
if len(weights) > 0:
|
92 |
-
print('Loading weights for net_encoder')
|
93 |
-
net_encoder.load_state_dict(
|
94 |
-
torch.load(weights, map_location=lambda storage, loc: storage), strict=False)
|
95 |
-
return net_encoder
|
96 |
-
|
97 |
-
@staticmethod
|
98 |
-
def build_decoder(arch='ppm_deepsup',
|
99 |
-
fc_dim=512, num_class=NUM_CLASS,
|
100 |
-
weights='', use_softmax=False, drop_last_conv=False):
|
101 |
-
arch = arch.lower()
|
102 |
-
if arch == 'ppm_deepsup':
|
103 |
-
net_decoder = PPMDeepsup(
|
104 |
-
num_class=num_class,
|
105 |
-
fc_dim=fc_dim,
|
106 |
-
use_softmax=use_softmax,
|
107 |
-
drop_last_conv=drop_last_conv)
|
108 |
-
elif arch == 'c1_deepsup':
|
109 |
-
net_decoder = C1DeepSup(
|
110 |
-
num_class=num_class,
|
111 |
-
fc_dim=fc_dim,
|
112 |
-
use_softmax=use_softmax,
|
113 |
-
drop_last_conv=drop_last_conv)
|
114 |
-
else:
|
115 |
-
raise Exception('Architecture undefined!')
|
116 |
-
|
117 |
-
net_decoder.apply(ModelBuilder.weights_init)
|
118 |
-
if len(weights) > 0:
|
119 |
-
print('Loading weights for net_decoder')
|
120 |
-
net_decoder.load_state_dict(
|
121 |
-
torch.load(weights, map_location=lambda storage, loc: storage), strict=False)
|
122 |
-
return net_decoder
|
123 |
-
|
124 |
-
@staticmethod
|
125 |
-
def get_decoder(weights_path, arch_encoder, arch_decoder, fc_dim, drop_last_conv, *arts, **kwargs):
|
126 |
-
path = os.path.join(weights_path, 'ade20k', f'ade20k-{arch_encoder}-{arch_decoder}/decoder_epoch_20.pth')
|
127 |
-
return ModelBuilder.build_decoder(arch=arch_decoder, fc_dim=fc_dim, weights=path, use_softmax=True, drop_last_conv=drop_last_conv)
|
128 |
-
|
129 |
-
@staticmethod
|
130 |
-
def get_encoder(weights_path, arch_encoder, arch_decoder, fc_dim, segmentation,
|
131 |
-
*arts, **kwargs):
|
132 |
-
if segmentation:
|
133 |
-
path = os.path.join(weights_path, 'ade20k', f'ade20k-{arch_encoder}-{arch_decoder}/encoder_epoch_20.pth')
|
134 |
-
else:
|
135 |
-
path = ''
|
136 |
-
return ModelBuilder.build_encoder(arch=arch_encoder, fc_dim=fc_dim, weights=path)
|
137 |
-
|
138 |
-
|
139 |
-
def conv3x3_bn_relu(in_planes, out_planes, stride=1):
|
140 |
-
return nn.Sequential(
|
141 |
-
nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False),
|
142 |
-
BatchNorm2d(out_planes),
|
143 |
-
nn.ReLU(inplace=True),
|
144 |
-
)
|
145 |
-
|
146 |
-
|
147 |
-
class SegmentationModule(nn.Module):
|
148 |
-
def __init__(self,
|
149 |
-
weights_path,
|
150 |
-
num_classes=150,
|
151 |
-
arch_encoder="resnet50dilated",
|
152 |
-
drop_last_conv=False,
|
153 |
-
net_enc=None, # None for Default encoder
|
154 |
-
net_dec=None, # None for Default decoder
|
155 |
-
encode=None, # {None, 'binary', 'color', 'sky'}
|
156 |
-
use_default_normalization=False,
|
157 |
-
return_feature_maps=False,
|
158 |
-
return_feature_maps_level=3, # {0, 1, 2, 3}
|
159 |
-
return_feature_maps_only=True,
|
160 |
-
**kwargs,
|
161 |
-
):
|
162 |
-
super().__init__()
|
163 |
-
self.weights_path = weights_path
|
164 |
-
self.drop_last_conv = drop_last_conv
|
165 |
-
self.arch_encoder = arch_encoder
|
166 |
-
if self.arch_encoder == "resnet50dilated":
|
167 |
-
self.arch_decoder = "ppm_deepsup"
|
168 |
-
self.fc_dim = 2048
|
169 |
-
elif self.arch_encoder == "mobilenetv2dilated":
|
170 |
-
self.arch_decoder = "c1_deepsup"
|
171 |
-
self.fc_dim = 320
|
172 |
-
else:
|
173 |
-
raise NotImplementedError(f"No such arch_encoder={self.arch_encoder}")
|
174 |
-
model_builder_kwargs = dict(arch_encoder=self.arch_encoder,
|
175 |
-
arch_decoder=self.arch_decoder,
|
176 |
-
fc_dim=self.fc_dim,
|
177 |
-
drop_last_conv=drop_last_conv,
|
178 |
-
weights_path=self.weights_path)
|
179 |
-
|
180 |
-
self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
181 |
-
self.encoder = ModelBuilder.get_encoder(**model_builder_kwargs) if net_enc is None else net_enc
|
182 |
-
self.decoder = ModelBuilder.get_decoder(**model_builder_kwargs) if net_dec is None else net_dec
|
183 |
-
self.use_default_normalization = use_default_normalization
|
184 |
-
self.default_normalization = NormalizeTensor(mean=[0.485, 0.456, 0.406],
|
185 |
-
std=[0.229, 0.224, 0.225])
|
186 |
-
|
187 |
-
self.encode = encode
|
188 |
-
|
189 |
-
self.return_feature_maps = return_feature_maps
|
190 |
-
|
191 |
-
assert 0 <= return_feature_maps_level <= 3
|
192 |
-
self.return_feature_maps_level = return_feature_maps_level
|
193 |
-
|
194 |
-
def normalize_input(self, tensor):
|
195 |
-
if tensor.min() < 0 or tensor.max() > 1:
|
196 |
-
raise ValueError("Tensor should be 0..1 before using normalize_input")
|
197 |
-
return self.default_normalization(tensor)
|
198 |
-
|
199 |
-
@property
|
200 |
-
def feature_maps_channels(self):
|
201 |
-
return 256 * 2**(self.return_feature_maps_level) # 256, 512, 1024, 2048
|
202 |
-
|
203 |
-
def forward(self, img_data, segSize=None):
|
204 |
-
if segSize is None:
|
205 |
-
raise NotImplementedError("Please pass segSize param. By default: (300, 300)")
|
206 |
-
|
207 |
-
fmaps = self.encoder(img_data, return_feature_maps=True)
|
208 |
-
pred = self.decoder(fmaps, segSize=segSize)
|
209 |
-
|
210 |
-
if self.return_feature_maps:
|
211 |
-
return pred, fmaps
|
212 |
-
# print("BINARY", img_data.shape, pred.shape)
|
213 |
-
return pred
|
214 |
-
|
215 |
-
def multi_mask_from_multiclass(self, pred, classes):
|
216 |
-
def isin(ar1, ar2):
|
217 |
-
return (ar1[..., None] == ar2).any(-1).float()
|
218 |
-
return isin(pred, torch.LongTensor(classes).to(self.device))
|
219 |
-
|
220 |
-
@staticmethod
|
221 |
-
def multi_mask_from_multiclass_probs(scores, classes):
|
222 |
-
res = None
|
223 |
-
for c in classes:
|
224 |
-
if res is None:
|
225 |
-
res = scores[:, c]
|
226 |
-
else:
|
227 |
-
res += scores[:, c]
|
228 |
-
return res
|
229 |
-
|
230 |
-
def predict(self, tensor, imgSizes=(-1,), # (300, 375, 450, 525, 600)
|
231 |
-
segSize=None):
|
232 |
-
"""Entry-point for segmentation. Use this methods instead of forward
|
233 |
-
Arguments:
|
234 |
-
tensor {torch.Tensor} -- BCHW
|
235 |
-
Keyword Arguments:
|
236 |
-
imgSizes {tuple or list} -- imgSizes for segmentation input.
|
237 |
-
default: (300, 450)
|
238 |
-
original implementation: (300, 375, 450, 525, 600)
|
239 |
-
|
240 |
-
"""
|
241 |
-
if segSize is None:
|
242 |
-
segSize = tensor.shape[-2:]
|
243 |
-
segSize = (tensor.shape[2], tensor.shape[3])
|
244 |
-
with torch.no_grad():
|
245 |
-
if self.use_default_normalization:
|
246 |
-
tensor = self.normalize_input(tensor)
|
247 |
-
scores = torch.zeros(1, NUM_CLASS, segSize[0], segSize[1]).to(self.device)
|
248 |
-
features = torch.zeros(1, self.feature_maps_channels, segSize[0], segSize[1]).to(self.device)
|
249 |
-
|
250 |
-
result = []
|
251 |
-
for img_size in imgSizes:
|
252 |
-
if img_size != -1:
|
253 |
-
img_data = F.interpolate(tensor.clone(), size=img_size)
|
254 |
-
else:
|
255 |
-
img_data = tensor.clone()
|
256 |
-
|
257 |
-
if self.return_feature_maps:
|
258 |
-
pred_current, fmaps = self.forward(img_data, segSize=segSize)
|
259 |
-
else:
|
260 |
-
pred_current = self.forward(img_data, segSize=segSize)
|
261 |
-
|
262 |
-
|
263 |
-
result.append(pred_current)
|
264 |
-
scores = scores + pred_current / len(imgSizes)
|
265 |
-
|
266 |
-
# Disclaimer: We use and aggregate only last fmaps: fmaps[3]
|
267 |
-
if self.return_feature_maps:
|
268 |
-
features = features + F.interpolate(fmaps[self.return_feature_maps_level], size=segSize) / len(imgSizes)
|
269 |
-
|
270 |
-
_, pred = torch.max(scores, dim=1)
|
271 |
-
|
272 |
-
if self.return_feature_maps:
|
273 |
-
return features
|
274 |
-
|
275 |
-
return pred, result
|
276 |
-
|
277 |
-
def get_edges(self, t):
|
278 |
-
edge = torch.cuda.ByteTensor(t.size()).zero_()
|
279 |
-
edge[:, :, :, 1:] = edge[:, :, :, 1:] | (t[:, :, :, 1:] != t[:, :, :, :-1])
|
280 |
-
edge[:, :, :, :-1] = edge[:, :, :, :-1] | (t[:, :, :, 1:] != t[:, :, :, :-1])
|
281 |
-
edge[:, :, 1:, :] = edge[:, :, 1:, :] | (t[:, :, 1:, :] != t[:, :, :-1, :])
|
282 |
-
edge[:, :, :-1, :] = edge[:, :, :-1, :] | (t[:, :, 1:, :] != t[:, :, :-1, :])
|
283 |
-
|
284 |
-
if True:
|
285 |
-
return edge.half()
|
286 |
-
return edge.float()
|
287 |
-
|
288 |
-
|
289 |
-
# pyramid pooling, deep supervision
|
290 |
-
class PPMDeepsup(nn.Module):
|
291 |
-
def __init__(self, num_class=NUM_CLASS, fc_dim=4096,
|
292 |
-
use_softmax=False, pool_scales=(1, 2, 3, 6),
|
293 |
-
drop_last_conv=False):
|
294 |
-
super().__init__()
|
295 |
-
self.use_softmax = use_softmax
|
296 |
-
self.drop_last_conv = drop_last_conv
|
297 |
-
|
298 |
-
self.ppm = []
|
299 |
-
for scale in pool_scales:
|
300 |
-
self.ppm.append(nn.Sequential(
|
301 |
-
nn.AdaptiveAvgPool2d(scale),
|
302 |
-
nn.Conv2d(fc_dim, 512, kernel_size=1, bias=False),
|
303 |
-
BatchNorm2d(512),
|
304 |
-
nn.ReLU(inplace=True)
|
305 |
-
))
|
306 |
-
self.ppm = nn.ModuleList(self.ppm)
|
307 |
-
self.cbr_deepsup = conv3x3_bn_relu(fc_dim // 2, fc_dim // 4, 1)
|
308 |
-
|
309 |
-
self.conv_last = nn.Sequential(
|
310 |
-
nn.Conv2d(fc_dim + len(pool_scales) * 512, 512,
|
311 |
-
kernel_size=3, padding=1, bias=False),
|
312 |
-
BatchNorm2d(512),
|
313 |
-
nn.ReLU(inplace=True),
|
314 |
-
nn.Dropout2d(0.1),
|
315 |
-
nn.Conv2d(512, num_class, kernel_size=1)
|
316 |
-
)
|
317 |
-
self.conv_last_deepsup = nn.Conv2d(fc_dim // 4, num_class, 1, 1, 0)
|
318 |
-
self.dropout_deepsup = nn.Dropout2d(0.1)
|
319 |
-
|
320 |
-
def forward(self, conv_out, segSize=None):
|
321 |
-
conv5 = conv_out[-1]
|
322 |
-
|
323 |
-
input_size = conv5.size()
|
324 |
-
ppm_out = [conv5]
|
325 |
-
for pool_scale in self.ppm:
|
326 |
-
ppm_out.append(nn.functional.interpolate(
|
327 |
-
pool_scale(conv5),
|
328 |
-
(input_size[2], input_size[3]),
|
329 |
-
mode='bilinear', align_corners=False))
|
330 |
-
ppm_out = torch.cat(ppm_out, 1)
|
331 |
-
|
332 |
-
if self.drop_last_conv:
|
333 |
-
return ppm_out
|
334 |
-
else:
|
335 |
-
x = self.conv_last(ppm_out)
|
336 |
-
|
337 |
-
if self.use_softmax: # is True during inference
|
338 |
-
x = nn.functional.interpolate(
|
339 |
-
x, size=segSize, mode='bilinear', align_corners=False)
|
340 |
-
x = nn.functional.softmax(x, dim=1)
|
341 |
-
return x
|
342 |
-
|
343 |
-
# deep sup
|
344 |
-
conv4 = conv_out[-2]
|
345 |
-
_ = self.cbr_deepsup(conv4)
|
346 |
-
_ = self.dropout_deepsup(_)
|
347 |
-
_ = self.conv_last_deepsup(_)
|
348 |
-
|
349 |
-
x = nn.functional.log_softmax(x, dim=1)
|
350 |
-
_ = nn.functional.log_softmax(_, dim=1)
|
351 |
-
|
352 |
-
return (x, _)
|
353 |
-
|
354 |
-
|
355 |
-
class Resnet(nn.Module):
|
356 |
-
def __init__(self, orig_resnet):
|
357 |
-
super(Resnet, self).__init__()
|
358 |
-
|
359 |
-
# take pretrained resnet, except AvgPool and FC
|
360 |
-
self.conv1 = orig_resnet.conv1
|
361 |
-
self.bn1 = orig_resnet.bn1
|
362 |
-
self.relu1 = orig_resnet.relu1
|
363 |
-
self.conv2 = orig_resnet.conv2
|
364 |
-
self.bn2 = orig_resnet.bn2
|
365 |
-
self.relu2 = orig_resnet.relu2
|
366 |
-
self.conv3 = orig_resnet.conv3
|
367 |
-
self.bn3 = orig_resnet.bn3
|
368 |
-
self.relu3 = orig_resnet.relu3
|
369 |
-
self.maxpool = orig_resnet.maxpool
|
370 |
-
self.layer1 = orig_resnet.layer1
|
371 |
-
self.layer2 = orig_resnet.layer2
|
372 |
-
self.layer3 = orig_resnet.layer3
|
373 |
-
self.layer4 = orig_resnet.layer4
|
374 |
-
|
375 |
-
def forward(self, x, return_feature_maps=False):
|
376 |
-
conv_out = []
|
377 |
-
|
378 |
-
x = self.relu1(self.bn1(self.conv1(x)))
|
379 |
-
x = self.relu2(self.bn2(self.conv2(x)))
|
380 |
-
x = self.relu3(self.bn3(self.conv3(x)))
|
381 |
-
x = self.maxpool(x)
|
382 |
-
|
383 |
-
x = self.layer1(x); conv_out.append(x);
|
384 |
-
x = self.layer2(x); conv_out.append(x);
|
385 |
-
x = self.layer3(x); conv_out.append(x);
|
386 |
-
x = self.layer4(x); conv_out.append(x);
|
387 |
-
|
388 |
-
if return_feature_maps:
|
389 |
-
return conv_out
|
390 |
-
return [x]
|
391 |
-
|
392 |
-
# Resnet Dilated
|
393 |
-
class ResnetDilated(nn.Module):
|
394 |
-
def __init__(self, orig_resnet, dilate_scale=8):
|
395 |
-
super().__init__()
|
396 |
-
from functools import partial
|
397 |
-
|
398 |
-
if dilate_scale == 8:
|
399 |
-
orig_resnet.layer3.apply(
|
400 |
-
partial(self._nostride_dilate, dilate=2))
|
401 |
-
orig_resnet.layer4.apply(
|
402 |
-
partial(self._nostride_dilate, dilate=4))
|
403 |
-
elif dilate_scale == 16:
|
404 |
-
orig_resnet.layer4.apply(
|
405 |
-
partial(self._nostride_dilate, dilate=2))
|
406 |
-
|
407 |
-
# take pretrained resnet, except AvgPool and FC
|
408 |
-
self.conv1 = orig_resnet.conv1
|
409 |
-
self.bn1 = orig_resnet.bn1
|
410 |
-
self.relu1 = orig_resnet.relu1
|
411 |
-
self.conv2 = orig_resnet.conv2
|
412 |
-
self.bn2 = orig_resnet.bn2
|
413 |
-
self.relu2 = orig_resnet.relu2
|
414 |
-
self.conv3 = orig_resnet.conv3
|
415 |
-
self.bn3 = orig_resnet.bn3
|
416 |
-
self.relu3 = orig_resnet.relu3
|
417 |
-
self.maxpool = orig_resnet.maxpool
|
418 |
-
self.layer1 = orig_resnet.layer1
|
419 |
-
self.layer2 = orig_resnet.layer2
|
420 |
-
self.layer3 = orig_resnet.layer3
|
421 |
-
self.layer4 = orig_resnet.layer4
|
422 |
-
|
423 |
-
def _nostride_dilate(self, m, dilate):
|
424 |
-
classname = m.__class__.__name__
|
425 |
-
if classname.find('Conv') != -1:
|
426 |
-
# the convolution with stride
|
427 |
-
if m.stride == (2, 2):
|
428 |
-
m.stride = (1, 1)
|
429 |
-
if m.kernel_size == (3, 3):
|
430 |
-
m.dilation = (dilate // 2, dilate // 2)
|
431 |
-
m.padding = (dilate // 2, dilate // 2)
|
432 |
-
# other convoluions
|
433 |
-
else:
|
434 |
-
if m.kernel_size == (3, 3):
|
435 |
-
m.dilation = (dilate, dilate)
|
436 |
-
m.padding = (dilate, dilate)
|
437 |
-
|
438 |
-
def forward(self, x, return_feature_maps=False):
|
439 |
-
conv_out = []
|
440 |
-
|
441 |
-
x = self.relu1(self.bn1(self.conv1(x)))
|
442 |
-
x = self.relu2(self.bn2(self.conv2(x)))
|
443 |
-
x = self.relu3(self.bn3(self.conv3(x)))
|
444 |
-
x = self.maxpool(x)
|
445 |
-
|
446 |
-
x = self.layer1(x)
|
447 |
-
conv_out.append(x)
|
448 |
-
x = self.layer2(x)
|
449 |
-
conv_out.append(x)
|
450 |
-
x = self.layer3(x)
|
451 |
-
conv_out.append(x)
|
452 |
-
x = self.layer4(x)
|
453 |
-
conv_out.append(x)
|
454 |
-
|
455 |
-
if return_feature_maps:
|
456 |
-
return conv_out
|
457 |
-
return [x]
|
458 |
-
|
459 |
-
class MobileNetV2Dilated(nn.Module):
|
460 |
-
def __init__(self, orig_net, dilate_scale=8):
|
461 |
-
super(MobileNetV2Dilated, self).__init__()
|
462 |
-
from functools import partial
|
463 |
-
|
464 |
-
# take pretrained mobilenet features
|
465 |
-
self.features = orig_net.features[:-1]
|
466 |
-
|
467 |
-
self.total_idx = len(self.features)
|
468 |
-
self.down_idx = [2, 4, 7, 14]
|
469 |
-
|
470 |
-
if dilate_scale == 8:
|
471 |
-
for i in range(self.down_idx[-2], self.down_idx[-1]):
|
472 |
-
self.features[i].apply(
|
473 |
-
partial(self._nostride_dilate, dilate=2)
|
474 |
-
)
|
475 |
-
for i in range(self.down_idx[-1], self.total_idx):
|
476 |
-
self.features[i].apply(
|
477 |
-
partial(self._nostride_dilate, dilate=4)
|
478 |
-
)
|
479 |
-
elif dilate_scale == 16:
|
480 |
-
for i in range(self.down_idx[-1], self.total_idx):
|
481 |
-
self.features[i].apply(
|
482 |
-
partial(self._nostride_dilate, dilate=2)
|
483 |
-
)
|
484 |
-
|
485 |
-
def _nostride_dilate(self, m, dilate):
|
486 |
-
classname = m.__class__.__name__
|
487 |
-
if classname.find('Conv') != -1:
|
488 |
-
# the convolution with stride
|
489 |
-
if m.stride == (2, 2):
|
490 |
-
m.stride = (1, 1)
|
491 |
-
if m.kernel_size == (3, 3):
|
492 |
-
m.dilation = (dilate//2, dilate//2)
|
493 |
-
m.padding = (dilate//2, dilate//2)
|
494 |
-
# other convoluions
|
495 |
-
else:
|
496 |
-
if m.kernel_size == (3, 3):
|
497 |
-
m.dilation = (dilate, dilate)
|
498 |
-
m.padding = (dilate, dilate)
|
499 |
-
|
500 |
-
def forward(self, x, return_feature_maps=False):
|
501 |
-
if return_feature_maps:
|
502 |
-
conv_out = []
|
503 |
-
for i in range(self.total_idx):
|
504 |
-
x = self.features[i](x)
|
505 |
-
if i in self.down_idx:
|
506 |
-
conv_out.append(x)
|
507 |
-
conv_out.append(x)
|
508 |
-
return conv_out
|
509 |
-
|
510 |
-
else:
|
511 |
-
return [self.features(x)]
|
512 |
-
|
513 |
-
|
514 |
-
# last conv, deep supervision
|
515 |
-
class C1DeepSup(nn.Module):
|
516 |
-
def __init__(self, num_class=150, fc_dim=2048, use_softmax=False, drop_last_conv=False):
|
517 |
-
super(C1DeepSup, self).__init__()
|
518 |
-
self.use_softmax = use_softmax
|
519 |
-
self.drop_last_conv = drop_last_conv
|
520 |
-
|
521 |
-
self.cbr = conv3x3_bn_relu(fc_dim, fc_dim // 4, 1)
|
522 |
-
self.cbr_deepsup = conv3x3_bn_relu(fc_dim // 2, fc_dim // 4, 1)
|
523 |
-
|
524 |
-
# last conv
|
525 |
-
self.conv_last = nn.Conv2d(fc_dim // 4, num_class, 1, 1, 0)
|
526 |
-
self.conv_last_deepsup = nn.Conv2d(fc_dim // 4, num_class, 1, 1, 0)
|
527 |
-
|
528 |
-
def forward(self, conv_out, segSize=None):
|
529 |
-
conv5 = conv_out[-1]
|
530 |
-
|
531 |
-
x = self.cbr(conv5)
|
532 |
-
|
533 |
-
if self.drop_last_conv:
|
534 |
-
return x
|
535 |
-
else:
|
536 |
-
x = self.conv_last(x)
|
537 |
-
|
538 |
-
if self.use_softmax: # is True during inference
|
539 |
-
x = nn.functional.interpolate(
|
540 |
-
x, size=segSize, mode='bilinear', align_corners=False)
|
541 |
-
x = nn.functional.softmax(x, dim=1)
|
542 |
-
return x
|
543 |
-
|
544 |
-
# deep sup
|
545 |
-
conv4 = conv_out[-2]
|
546 |
-
_ = self.cbr_deepsup(conv4)
|
547 |
-
_ = self.conv_last_deepsup(_)
|
548 |
-
|
549 |
-
x = nn.functional.log_softmax(x, dim=1)
|
550 |
-
_ = nn.functional.log_softmax(_, dim=1)
|
551 |
-
|
552 |
-
return (x, _)
|
553 |
-
|
554 |
-
|
555 |
-
# last conv
|
556 |
-
class C1(nn.Module):
|
557 |
-
def __init__(self, num_class=150, fc_dim=2048, use_softmax=False):
|
558 |
-
super(C1, self).__init__()
|
559 |
-
self.use_softmax = use_softmax
|
560 |
-
|
561 |
-
self.cbr = conv3x3_bn_relu(fc_dim, fc_dim // 4, 1)
|
562 |
-
|
563 |
-
# last conv
|
564 |
-
self.conv_last = nn.Conv2d(fc_dim // 4, num_class, 1, 1, 0)
|
565 |
-
|
566 |
-
def forward(self, conv_out, segSize=None):
|
567 |
-
conv5 = conv_out[-1]
|
568 |
-
x = self.cbr(conv5)
|
569 |
-
x = self.conv_last(x)
|
570 |
-
|
571 |
-
if self.use_softmax: # is True during inference
|
572 |
-
x = nn.functional.interpolate(
|
573 |
-
x, size=segSize, mode='bilinear', align_corners=False)
|
574 |
-
x = nn.functional.softmax(x, dim=1)
|
575 |
-
else:
|
576 |
-
x = nn.functional.log_softmax(x, dim=1)
|
577 |
-
|
578 |
-
return x
|
579 |
-
|
580 |
-
|
581 |
-
# pyramid pooling
|
582 |
-
class PPM(nn.Module):
|
583 |
-
def __init__(self, num_class=150, fc_dim=4096,
|
584 |
-
use_softmax=False, pool_scales=(1, 2, 3, 6)):
|
585 |
-
super(PPM, self).__init__()
|
586 |
-
self.use_softmax = use_softmax
|
587 |
-
|
588 |
-
self.ppm = []
|
589 |
-
for scale in pool_scales:
|
590 |
-
self.ppm.append(nn.Sequential(
|
591 |
-
nn.AdaptiveAvgPool2d(scale),
|
592 |
-
nn.Conv2d(fc_dim, 512, kernel_size=1, bias=False),
|
593 |
-
BatchNorm2d(512),
|
594 |
-
nn.ReLU(inplace=True)
|
595 |
-
))
|
596 |
-
self.ppm = nn.ModuleList(self.ppm)
|
597 |
-
|
598 |
-
self.conv_last = nn.Sequential(
|
599 |
-
nn.Conv2d(fc_dim+len(pool_scales)*512, 512,
|
600 |
-
kernel_size=3, padding=1, bias=False),
|
601 |
-
BatchNorm2d(512),
|
602 |
-
nn.ReLU(inplace=True),
|
603 |
-
nn.Dropout2d(0.1),
|
604 |
-
nn.Conv2d(512, num_class, kernel_size=1)
|
605 |
-
)
|
606 |
-
|
607 |
-
def forward(self, conv_out, segSize=None):
|
608 |
-
conv5 = conv_out[-1]
|
609 |
-
|
610 |
-
input_size = conv5.size()
|
611 |
-
ppm_out = [conv5]
|
612 |
-
for pool_scale in self.ppm:
|
613 |
-
ppm_out.append(nn.functional.interpolate(
|
614 |
-
pool_scale(conv5),
|
615 |
-
(input_size[2], input_size[3]),
|
616 |
-
mode='bilinear', align_corners=False))
|
617 |
-
ppm_out = torch.cat(ppm_out, 1)
|
618 |
-
|
619 |
-
x = self.conv_last(ppm_out)
|
620 |
-
|
621 |
-
if self.use_softmax: # is True during inference
|
622 |
-
x = nn.functional.interpolate(
|
623 |
-
x, size=segSize, mode='bilinear', align_corners=False)
|
624 |
-
x = nn.functional.softmax(x, dim=1)
|
625 |
-
else:
|
626 |
-
x = nn.functional.log_softmax(x, dim=1)
|
627 |
-
return x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Alfasign/fdvdv/README.md
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Fdvdv
|
3 |
-
emoji: 🚀
|
4 |
-
colorFrom: red
|
5 |
-
colorTo: yellow
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.44.2
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ameaou/academic-chatgpt3.1/crazy_functions/__init__.py
DELETED
File without changes
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/examples/research_projects/dreambooth_inpaint/train_dreambooth_inpaint_lora.py
DELETED
@@ -1,831 +0,0 @@
|
|
1 |
-
import argparse
|
2 |
-
import hashlib
|
3 |
-
import math
|
4 |
-
import os
|
5 |
-
import random
|
6 |
-
from pathlib import Path
|
7 |
-
|
8 |
-
import numpy as np
|
9 |
-
import torch
|
10 |
-
import torch.nn.functional as F
|
11 |
-
import torch.utils.checkpoint
|
12 |
-
from accelerate import Accelerator
|
13 |
-
from accelerate.logging import get_logger
|
14 |
-
from accelerate.utils import ProjectConfiguration, set_seed
|
15 |
-
from huggingface_hub import create_repo, upload_folder
|
16 |
-
from PIL import Image, ImageDraw
|
17 |
-
from torch.utils.data import Dataset
|
18 |
-
from torchvision import transforms
|
19 |
-
from tqdm.auto import tqdm
|
20 |
-
from transformers import CLIPTextModel, CLIPTokenizer
|
21 |
-
|
22 |
-
from diffusers import AutoencoderKL, DDPMScheduler, StableDiffusionInpaintPipeline, UNet2DConditionModel
|
23 |
-
from diffusers.loaders import AttnProcsLayers
|
24 |
-
from diffusers.models.attention_processor import LoRAAttnProcessor
|
25 |
-
from diffusers.optimization import get_scheduler
|
26 |
-
from diffusers.utils import check_min_version
|
27 |
-
from diffusers.utils.import_utils import is_xformers_available
|
28 |
-
|
29 |
-
|
30 |
-
# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
|
31 |
-
check_min_version("0.13.0.dev0")
|
32 |
-
|
33 |
-
logger = get_logger(__name__)
|
34 |
-
|
35 |
-
|
36 |
-
def prepare_mask_and_masked_image(image, mask):
|
37 |
-
image = np.array(image.convert("RGB"))
|
38 |
-
image = image[None].transpose(0, 3, 1, 2)
|
39 |
-
image = torch.from_numpy(image).to(dtype=torch.float32) / 127.5 - 1.0
|
40 |
-
|
41 |
-
mask = np.array(mask.convert("L"))
|
42 |
-
mask = mask.astype(np.float32) / 255.0
|
43 |
-
mask = mask[None, None]
|
44 |
-
mask[mask < 0.5] = 0
|
45 |
-
mask[mask >= 0.5] = 1
|
46 |
-
mask = torch.from_numpy(mask)
|
47 |
-
|
48 |
-
masked_image = image * (mask < 0.5)
|
49 |
-
|
50 |
-
return mask, masked_image
|
51 |
-
|
52 |
-
|
53 |
-
# generate random masks
|
54 |
-
def random_mask(im_shape, ratio=1, mask_full_image=False):
|
55 |
-
mask = Image.new("L", im_shape, 0)
|
56 |
-
draw = ImageDraw.Draw(mask)
|
57 |
-
size = (random.randint(0, int(im_shape[0] * ratio)), random.randint(0, int(im_shape[1] * ratio)))
|
58 |
-
# use this to always mask the whole image
|
59 |
-
if mask_full_image:
|
60 |
-
size = (int(im_shape[0] * ratio), int(im_shape[1] * ratio))
|
61 |
-
limits = (im_shape[0] - size[0] // 2, im_shape[1] - size[1] // 2)
|
62 |
-
center = (random.randint(size[0] // 2, limits[0]), random.randint(size[1] // 2, limits[1]))
|
63 |
-
draw_type = random.randint(0, 1)
|
64 |
-
if draw_type == 0 or mask_full_image:
|
65 |
-
draw.rectangle(
|
66 |
-
(center[0] - size[0] // 2, center[1] - size[1] // 2, center[0] + size[0] // 2, center[1] + size[1] // 2),
|
67 |
-
fill=255,
|
68 |
-
)
|
69 |
-
else:
|
70 |
-
draw.ellipse(
|
71 |
-
(center[0] - size[0] // 2, center[1] - size[1] // 2, center[0] + size[0] // 2, center[1] + size[1] // 2),
|
72 |
-
fill=255,
|
73 |
-
)
|
74 |
-
|
75 |
-
return mask
|
76 |
-
|
77 |
-
|
78 |
-
def parse_args():
|
79 |
-
parser = argparse.ArgumentParser(description="Simple example of a training script.")
|
80 |
-
parser.add_argument(
|
81 |
-
"--pretrained_model_name_or_path",
|
82 |
-
type=str,
|
83 |
-
default=None,
|
84 |
-
required=True,
|
85 |
-
help="Path to pretrained model or model identifier from huggingface.co/models.",
|
86 |
-
)
|
87 |
-
parser.add_argument(
|
88 |
-
"--tokenizer_name",
|
89 |
-
type=str,
|
90 |
-
default=None,
|
91 |
-
help="Pretrained tokenizer name or path if not the same as model_name",
|
92 |
-
)
|
93 |
-
parser.add_argument(
|
94 |
-
"--instance_data_dir",
|
95 |
-
type=str,
|
96 |
-
default=None,
|
97 |
-
required=True,
|
98 |
-
help="A folder containing the training data of instance images.",
|
99 |
-
)
|
100 |
-
parser.add_argument(
|
101 |
-
"--class_data_dir",
|
102 |
-
type=str,
|
103 |
-
default=None,
|
104 |
-
required=False,
|
105 |
-
help="A folder containing the training data of class images.",
|
106 |
-
)
|
107 |
-
parser.add_argument(
|
108 |
-
"--instance_prompt",
|
109 |
-
type=str,
|
110 |
-
default=None,
|
111 |
-
help="The prompt with identifier specifying the instance",
|
112 |
-
)
|
113 |
-
parser.add_argument(
|
114 |
-
"--class_prompt",
|
115 |
-
type=str,
|
116 |
-
default=None,
|
117 |
-
help="The prompt to specify images in the same class as provided instance images.",
|
118 |
-
)
|
119 |
-
parser.add_argument(
|
120 |
-
"--with_prior_preservation",
|
121 |
-
default=False,
|
122 |
-
action="store_true",
|
123 |
-
help="Flag to add prior preservation loss.",
|
124 |
-
)
|
125 |
-
parser.add_argument("--prior_loss_weight", type=float, default=1.0, help="The weight of prior preservation loss.")
|
126 |
-
parser.add_argument(
|
127 |
-
"--num_class_images",
|
128 |
-
type=int,
|
129 |
-
default=100,
|
130 |
-
help=(
|
131 |
-
"Minimal class images for prior preservation loss. If not have enough images, additional images will be"
|
132 |
-
" sampled with class_prompt."
|
133 |
-
),
|
134 |
-
)
|
135 |
-
parser.add_argument(
|
136 |
-
"--output_dir",
|
137 |
-
type=str,
|
138 |
-
default="dreambooth-inpaint-model",
|
139 |
-
help="The output directory where the model predictions and checkpoints will be written.",
|
140 |
-
)
|
141 |
-
parser.add_argument("--seed", type=int, default=None, help="A seed for reproducible training.")
|
142 |
-
parser.add_argument(
|
143 |
-
"--resolution",
|
144 |
-
type=int,
|
145 |
-
default=512,
|
146 |
-
help=(
|
147 |
-
"The resolution for input images, all the images in the train/validation dataset will be resized to this"
|
148 |
-
" resolution"
|
149 |
-
),
|
150 |
-
)
|
151 |
-
parser.add_argument(
|
152 |
-
"--center_crop",
|
153 |
-
default=False,
|
154 |
-
action="store_true",
|
155 |
-
help=(
|
156 |
-
"Whether to center crop the input images to the resolution. If not set, the images will be randomly"
|
157 |
-
" cropped. The images will be resized to the resolution first before cropping."
|
158 |
-
),
|
159 |
-
)
|
160 |
-
parser.add_argument("--train_text_encoder", action="store_true", help="Whether to train the text encoder")
|
161 |
-
parser.add_argument(
|
162 |
-
"--train_batch_size", type=int, default=4, help="Batch size (per device) for the training dataloader."
|
163 |
-
)
|
164 |
-
parser.add_argument(
|
165 |
-
"--sample_batch_size", type=int, default=4, help="Batch size (per device) for sampling images."
|
166 |
-
)
|
167 |
-
parser.add_argument("--num_train_epochs", type=int, default=1)
|
168 |
-
parser.add_argument(
|
169 |
-
"--max_train_steps",
|
170 |
-
type=int,
|
171 |
-
default=None,
|
172 |
-
help="Total number of training steps to perform. If provided, overrides num_train_epochs.",
|
173 |
-
)
|
174 |
-
parser.add_argument(
|
175 |
-
"--gradient_accumulation_steps",
|
176 |
-
type=int,
|
177 |
-
default=1,
|
178 |
-
help="Number of updates steps to accumulate before performing a backward/update pass.",
|
179 |
-
)
|
180 |
-
parser.add_argument(
|
181 |
-
"--gradient_checkpointing",
|
182 |
-
action="store_true",
|
183 |
-
help="Whether or not to use gradient checkpointing to save memory at the expense of slower backward pass.",
|
184 |
-
)
|
185 |
-
parser.add_argument(
|
186 |
-
"--learning_rate",
|
187 |
-
type=float,
|
188 |
-
default=5e-6,
|
189 |
-
help="Initial learning rate (after the potential warmup period) to use.",
|
190 |
-
)
|
191 |
-
parser.add_argument(
|
192 |
-
"--scale_lr",
|
193 |
-
action="store_true",
|
194 |
-
default=False,
|
195 |
-
help="Scale the learning rate by the number of GPUs, gradient accumulation steps, and batch size.",
|
196 |
-
)
|
197 |
-
parser.add_argument(
|
198 |
-
"--lr_scheduler",
|
199 |
-
type=str,
|
200 |
-
default="constant",
|
201 |
-
help=(
|
202 |
-
'The scheduler type to use. Choose between ["linear", "cosine", "cosine_with_restarts", "polynomial",'
|
203 |
-
' "constant", "constant_with_warmup"]'
|
204 |
-
),
|
205 |
-
)
|
206 |
-
parser.add_argument(
|
207 |
-
"--lr_warmup_steps", type=int, default=500, help="Number of steps for the warmup in the lr scheduler."
|
208 |
-
)
|
209 |
-
parser.add_argument(
|
210 |
-
"--use_8bit_adam", action="store_true", help="Whether or not to use 8-bit Adam from bitsandbytes."
|
211 |
-
)
|
212 |
-
parser.add_argument("--adam_beta1", type=float, default=0.9, help="The beta1 parameter for the Adam optimizer.")
|
213 |
-
parser.add_argument("--adam_beta2", type=float, default=0.999, help="The beta2 parameter for the Adam optimizer.")
|
214 |
-
parser.add_argument("--adam_weight_decay", type=float, default=1e-2, help="Weight decay to use.")
|
215 |
-
parser.add_argument("--adam_epsilon", type=float, default=1e-08, help="Epsilon value for the Adam optimizer")
|
216 |
-
parser.add_argument("--max_grad_norm", default=1.0, type=float, help="Max gradient norm.")
|
217 |
-
parser.add_argument("--push_to_hub", action="store_true", help="Whether or not to push the model to the Hub.")
|
218 |
-
parser.add_argument("--hub_token", type=str, default=None, help="The token to use to push to the Model Hub.")
|
219 |
-
parser.add_argument(
|
220 |
-
"--hub_model_id",
|
221 |
-
type=str,
|
222 |
-
default=None,
|
223 |
-
help="The name of the repository to keep in sync with the local `output_dir`.",
|
224 |
-
)
|
225 |
-
parser.add_argument(
|
226 |
-
"--logging_dir",
|
227 |
-
type=str,
|
228 |
-
default="logs",
|
229 |
-
help=(
|
230 |
-
"[TensorBoard](https://www.tensorflow.org/tensorboard) log directory. Will default to"
|
231 |
-
" *output_dir/runs/**CURRENT_DATETIME_HOSTNAME***."
|
232 |
-
),
|
233 |
-
)
|
234 |
-
parser.add_argument(
|
235 |
-
"--mixed_precision",
|
236 |
-
type=str,
|
237 |
-
default="no",
|
238 |
-
choices=["no", "fp16", "bf16"],
|
239 |
-
help=(
|
240 |
-
"Whether to use mixed precision. Choose"
|
241 |
-
"between fp16 and bf16 (bfloat16). Bf16 requires PyTorch >= 1.10."
|
242 |
-
"and an Nvidia Ampere GPU."
|
243 |
-
),
|
244 |
-
)
|
245 |
-
parser.add_argument("--local_rank", type=int, default=-1, help="For distributed training: local_rank")
|
246 |
-
parser.add_argument(
|
247 |
-
"--checkpointing_steps",
|
248 |
-
type=int,
|
249 |
-
default=500,
|
250 |
-
help=(
|
251 |
-
"Save a checkpoint of the training state every X updates. These checkpoints can be used both as final"
|
252 |
-
" checkpoints in case they are better than the last checkpoint and are suitable for resuming training"
|
253 |
-
" using `--resume_from_checkpoint`."
|
254 |
-
),
|
255 |
-
)
|
256 |
-
parser.add_argument(
|
257 |
-
"--checkpoints_total_limit",
|
258 |
-
type=int,
|
259 |
-
default=None,
|
260 |
-
help=(
|
261 |
-
"Max number of checkpoints to store. Passed as `total_limit` to the `Accelerator` `ProjectConfiguration`."
|
262 |
-
" See Accelerator::save_state https://huggingface.co/docs/accelerate/package_reference/accelerator#accelerate.Accelerator.save_state"
|
263 |
-
" for more docs"
|
264 |
-
),
|
265 |
-
)
|
266 |
-
parser.add_argument(
|
267 |
-
"--resume_from_checkpoint",
|
268 |
-
type=str,
|
269 |
-
default=None,
|
270 |
-
help=(
|
271 |
-
"Whether training should be resumed from a previous checkpoint. Use a path saved by"
|
272 |
-
' `--checkpointing_steps`, or `"latest"` to automatically select the last available checkpoint.'
|
273 |
-
),
|
274 |
-
)
|
275 |
-
parser.add_argument(
|
276 |
-
"--enable_xformers_memory_efficient_attention", action="store_true", help="Whether or not to use xformers."
|
277 |
-
)
|
278 |
-
|
279 |
-
args = parser.parse_args()
|
280 |
-
env_local_rank = int(os.environ.get("LOCAL_RANK", -1))
|
281 |
-
if env_local_rank != -1 and env_local_rank != args.local_rank:
|
282 |
-
args.local_rank = env_local_rank
|
283 |
-
|
284 |
-
if args.instance_data_dir is None:
|
285 |
-
raise ValueError("You must specify a train data directory.")
|
286 |
-
|
287 |
-
if args.with_prior_preservation:
|
288 |
-
if args.class_data_dir is None:
|
289 |
-
raise ValueError("You must specify a data directory for class images.")
|
290 |
-
if args.class_prompt is None:
|
291 |
-
raise ValueError("You must specify prompt for class images.")
|
292 |
-
|
293 |
-
return args
|
294 |
-
|
295 |
-
|
296 |
-
class DreamBoothDataset(Dataset):
|
297 |
-
"""
|
298 |
-
A dataset to prepare the instance and class images with the prompts for fine-tuning the model.
|
299 |
-
It pre-processes the images and the tokenizes prompts.
|
300 |
-
"""
|
301 |
-
|
302 |
-
def __init__(
|
303 |
-
self,
|
304 |
-
instance_data_root,
|
305 |
-
instance_prompt,
|
306 |
-
tokenizer,
|
307 |
-
class_data_root=None,
|
308 |
-
class_prompt=None,
|
309 |
-
size=512,
|
310 |
-
center_crop=False,
|
311 |
-
):
|
312 |
-
self.size = size
|
313 |
-
self.center_crop = center_crop
|
314 |
-
self.tokenizer = tokenizer
|
315 |
-
|
316 |
-
self.instance_data_root = Path(instance_data_root)
|
317 |
-
if not self.instance_data_root.exists():
|
318 |
-
raise ValueError("Instance images root doesn't exists.")
|
319 |
-
|
320 |
-
self.instance_images_path = list(Path(instance_data_root).iterdir())
|
321 |
-
self.num_instance_images = len(self.instance_images_path)
|
322 |
-
self.instance_prompt = instance_prompt
|
323 |
-
self._length = self.num_instance_images
|
324 |
-
|
325 |
-
if class_data_root is not None:
|
326 |
-
self.class_data_root = Path(class_data_root)
|
327 |
-
self.class_data_root.mkdir(parents=True, exist_ok=True)
|
328 |
-
self.class_images_path = list(self.class_data_root.iterdir())
|
329 |
-
self.num_class_images = len(self.class_images_path)
|
330 |
-
self._length = max(self.num_class_images, self.num_instance_images)
|
331 |
-
self.class_prompt = class_prompt
|
332 |
-
else:
|
333 |
-
self.class_data_root = None
|
334 |
-
|
335 |
-
self.image_transforms_resize_and_crop = transforms.Compose(
|
336 |
-
[
|
337 |
-
transforms.Resize(size, interpolation=transforms.InterpolationMode.BILINEAR),
|
338 |
-
transforms.CenterCrop(size) if center_crop else transforms.RandomCrop(size),
|
339 |
-
]
|
340 |
-
)
|
341 |
-
|
342 |
-
self.image_transforms = transforms.Compose(
|
343 |
-
[
|
344 |
-
transforms.ToTensor(),
|
345 |
-
transforms.Normalize([0.5], [0.5]),
|
346 |
-
]
|
347 |
-
)
|
348 |
-
|
349 |
-
def __len__(self):
|
350 |
-
return self._length
|
351 |
-
|
352 |
-
def __getitem__(self, index):
|
353 |
-
example = {}
|
354 |
-
instance_image = Image.open(self.instance_images_path[index % self.num_instance_images])
|
355 |
-
if not instance_image.mode == "RGB":
|
356 |
-
instance_image = instance_image.convert("RGB")
|
357 |
-
instance_image = self.image_transforms_resize_and_crop(instance_image)
|
358 |
-
|
359 |
-
example["PIL_images"] = instance_image
|
360 |
-
example["instance_images"] = self.image_transforms(instance_image)
|
361 |
-
|
362 |
-
example["instance_prompt_ids"] = self.tokenizer(
|
363 |
-
self.instance_prompt,
|
364 |
-
padding="do_not_pad",
|
365 |
-
truncation=True,
|
366 |
-
max_length=self.tokenizer.model_max_length,
|
367 |
-
).input_ids
|
368 |
-
|
369 |
-
if self.class_data_root:
|
370 |
-
class_image = Image.open(self.class_images_path[index % self.num_class_images])
|
371 |
-
if not class_image.mode == "RGB":
|
372 |
-
class_image = class_image.convert("RGB")
|
373 |
-
class_image = self.image_transforms_resize_and_crop(class_image)
|
374 |
-
example["class_images"] = self.image_transforms(class_image)
|
375 |
-
example["class_PIL_images"] = class_image
|
376 |
-
example["class_prompt_ids"] = self.tokenizer(
|
377 |
-
self.class_prompt,
|
378 |
-
padding="do_not_pad",
|
379 |
-
truncation=True,
|
380 |
-
max_length=self.tokenizer.model_max_length,
|
381 |
-
).input_ids
|
382 |
-
|
383 |
-
return example
|
384 |
-
|
385 |
-
|
386 |
-
class PromptDataset(Dataset):
|
387 |
-
"A simple dataset to prepare the prompts to generate class images on multiple GPUs."
|
388 |
-
|
389 |
-
def __init__(self, prompt, num_samples):
|
390 |
-
self.prompt = prompt
|
391 |
-
self.num_samples = num_samples
|
392 |
-
|
393 |
-
def __len__(self):
|
394 |
-
return self.num_samples
|
395 |
-
|
396 |
-
def __getitem__(self, index):
|
397 |
-
example = {}
|
398 |
-
example["prompt"] = self.prompt
|
399 |
-
example["index"] = index
|
400 |
-
return example
|
401 |
-
|
402 |
-
|
403 |
-
def main():
|
404 |
-
args = parse_args()
|
405 |
-
logging_dir = Path(args.output_dir, args.logging_dir)
|
406 |
-
|
407 |
-
accelerator_project_config = ProjectConfiguration(
|
408 |
-
total_limit=args.checkpoints_total_limit, project_dir=args.output_dir, logging_dir=logging_dir
|
409 |
-
)
|
410 |
-
|
411 |
-
accelerator = Accelerator(
|
412 |
-
gradient_accumulation_steps=args.gradient_accumulation_steps,
|
413 |
-
mixed_precision=args.mixed_precision,
|
414 |
-
log_with="tensorboard",
|
415 |
-
project_config=accelerator_project_config,
|
416 |
-
)
|
417 |
-
|
418 |
-
# Currently, it's not possible to do gradient accumulation when training two models with accelerate.accumulate
|
419 |
-
# This will be enabled soon in accelerate. For now, we don't allow gradient accumulation when training two models.
|
420 |
-
# TODO (patil-suraj): Remove this check when gradient accumulation with two models is enabled in accelerate.
|
421 |
-
if args.train_text_encoder and args.gradient_accumulation_steps > 1 and accelerator.num_processes > 1:
|
422 |
-
raise ValueError(
|
423 |
-
"Gradient accumulation is not supported when training the text encoder in distributed training. "
|
424 |
-
"Please set gradient_accumulation_steps to 1. This feature will be supported in the future."
|
425 |
-
)
|
426 |
-
|
427 |
-
if args.seed is not None:
|
428 |
-
set_seed(args.seed)
|
429 |
-
|
430 |
-
if args.with_prior_preservation:
|
431 |
-
class_images_dir = Path(args.class_data_dir)
|
432 |
-
if not class_images_dir.exists():
|
433 |
-
class_images_dir.mkdir(parents=True)
|
434 |
-
cur_class_images = len(list(class_images_dir.iterdir()))
|
435 |
-
|
436 |
-
if cur_class_images < args.num_class_images:
|
437 |
-
torch_dtype = torch.float16 if accelerator.device.type == "cuda" else torch.float32
|
438 |
-
pipeline = StableDiffusionInpaintPipeline.from_pretrained(
|
439 |
-
args.pretrained_model_name_or_path, torch_dtype=torch_dtype, safety_checker=None
|
440 |
-
)
|
441 |
-
pipeline.set_progress_bar_config(disable=True)
|
442 |
-
|
443 |
-
num_new_images = args.num_class_images - cur_class_images
|
444 |
-
logger.info(f"Number of class images to sample: {num_new_images}.")
|
445 |
-
|
446 |
-
sample_dataset = PromptDataset(args.class_prompt, num_new_images)
|
447 |
-
sample_dataloader = torch.utils.data.DataLoader(
|
448 |
-
sample_dataset, batch_size=args.sample_batch_size, num_workers=1
|
449 |
-
)
|
450 |
-
|
451 |
-
sample_dataloader = accelerator.prepare(sample_dataloader)
|
452 |
-
pipeline.to(accelerator.device)
|
453 |
-
transform_to_pil = transforms.ToPILImage()
|
454 |
-
for example in tqdm(
|
455 |
-
sample_dataloader, desc="Generating class images", disable=not accelerator.is_local_main_process
|
456 |
-
):
|
457 |
-
bsz = len(example["prompt"])
|
458 |
-
fake_images = torch.rand((3, args.resolution, args.resolution))
|
459 |
-
transform_to_pil = transforms.ToPILImage()
|
460 |
-
fake_pil_images = transform_to_pil(fake_images)
|
461 |
-
|
462 |
-
fake_mask = random_mask((args.resolution, args.resolution), ratio=1, mask_full_image=True)
|
463 |
-
|
464 |
-
images = pipeline(prompt=example["prompt"], mask_image=fake_mask, image=fake_pil_images).images
|
465 |
-
|
466 |
-
for i, image in enumerate(images):
|
467 |
-
hash_image = hashlib.sha1(image.tobytes()).hexdigest()
|
468 |
-
image_filename = class_images_dir / f"{example['index'][i] + cur_class_images}-{hash_image}.jpg"
|
469 |
-
image.save(image_filename)
|
470 |
-
|
471 |
-
del pipeline
|
472 |
-
if torch.cuda.is_available():
|
473 |
-
torch.cuda.empty_cache()
|
474 |
-
|
475 |
-
# Handle the repository creation
|
476 |
-
if accelerator.is_main_process:
|
477 |
-
if args.output_dir is not None:
|
478 |
-
os.makedirs(args.output_dir, exist_ok=True)
|
479 |
-
|
480 |
-
if args.push_to_hub:
|
481 |
-
repo_id = create_repo(
|
482 |
-
repo_id=args.hub_model_id or Path(args.output_dir).name, exist_ok=True, token=args.hub_token
|
483 |
-
).repo_id
|
484 |
-
|
485 |
-
# Load the tokenizer
|
486 |
-
if args.tokenizer_name:
|
487 |
-
tokenizer = CLIPTokenizer.from_pretrained(args.tokenizer_name)
|
488 |
-
elif args.pretrained_model_name_or_path:
|
489 |
-
tokenizer = CLIPTokenizer.from_pretrained(args.pretrained_model_name_or_path, subfolder="tokenizer")
|
490 |
-
|
491 |
-
# Load models and create wrapper for stable diffusion
|
492 |
-
text_encoder = CLIPTextModel.from_pretrained(args.pretrained_model_name_or_path, subfolder="text_encoder")
|
493 |
-
vae = AutoencoderKL.from_pretrained(args.pretrained_model_name_or_path, subfolder="vae")
|
494 |
-
unet = UNet2DConditionModel.from_pretrained(args.pretrained_model_name_or_path, subfolder="unet")
|
495 |
-
|
496 |
-
# We only train the additional adapter LoRA layers
|
497 |
-
vae.requires_grad_(False)
|
498 |
-
text_encoder.requires_grad_(False)
|
499 |
-
unet.requires_grad_(False)
|
500 |
-
|
501 |
-
weight_dtype = torch.float32
|
502 |
-
if args.mixed_precision == "fp16":
|
503 |
-
weight_dtype = torch.float16
|
504 |
-
elif args.mixed_precision == "bf16":
|
505 |
-
weight_dtype = torch.bfloat16
|
506 |
-
|
507 |
-
# Move text_encode and vae to gpu.
|
508 |
-
# For mixed precision training we cast the text_encoder and vae weights to half-precision
|
509 |
-
# as these models are only used for inference, keeping weights in full precision is not required.
|
510 |
-
unet.to(accelerator.device, dtype=weight_dtype)
|
511 |
-
vae.to(accelerator.device, dtype=weight_dtype)
|
512 |
-
text_encoder.to(accelerator.device, dtype=weight_dtype)
|
513 |
-
|
514 |
-
if args.enable_xformers_memory_efficient_attention:
|
515 |
-
if is_xformers_available():
|
516 |
-
unet.enable_xformers_memory_efficient_attention()
|
517 |
-
else:
|
518 |
-
raise ValueError("xformers is not available. Make sure it is installed correctly")
|
519 |
-
|
520 |
-
# now we will add new LoRA weights to the attention layers
|
521 |
-
# It's important to realize here how many attention weights will be added and of which sizes
|
522 |
-
# The sizes of the attention layers consist only of two different variables:
|
523 |
-
# 1) - the "hidden_size", which is increased according to `unet.config.block_out_channels`.
|
524 |
-
# 2) - the "cross attention size", which is set to `unet.config.cross_attention_dim`.
|
525 |
-
|
526 |
-
# Let's first see how many attention processors we will have to set.
|
527 |
-
# For Stable Diffusion, it should be equal to:
|
528 |
-
# - down blocks (2x attention layers) * (2x transformer layers) * (3x down blocks) = 12
|
529 |
-
# - mid blocks (2x attention layers) * (1x transformer layers) * (1x mid blocks) = 2
|
530 |
-
# - up blocks (2x attention layers) * (3x transformer layers) * (3x down blocks) = 18
|
531 |
-
# => 32 layers
|
532 |
-
|
533 |
-
# Set correct lora layers
|
534 |
-
lora_attn_procs = {}
|
535 |
-
for name in unet.attn_processors.keys():
|
536 |
-
cross_attention_dim = None if name.endswith("attn1.processor") else unet.config.cross_attention_dim
|
537 |
-
if name.startswith("mid_block"):
|
538 |
-
hidden_size = unet.config.block_out_channels[-1]
|
539 |
-
elif name.startswith("up_blocks"):
|
540 |
-
block_id = int(name[len("up_blocks.")])
|
541 |
-
hidden_size = list(reversed(unet.config.block_out_channels))[block_id]
|
542 |
-
elif name.startswith("down_blocks"):
|
543 |
-
block_id = int(name[len("down_blocks.")])
|
544 |
-
hidden_size = unet.config.block_out_channels[block_id]
|
545 |
-
|
546 |
-
lora_attn_procs[name] = LoRAAttnProcessor(hidden_size=hidden_size, cross_attention_dim=cross_attention_dim)
|
547 |
-
|
548 |
-
unet.set_attn_processor(lora_attn_procs)
|
549 |
-
lora_layers = AttnProcsLayers(unet.attn_processors)
|
550 |
-
|
551 |
-
accelerator.register_for_checkpointing(lora_layers)
|
552 |
-
|
553 |
-
if args.scale_lr:
|
554 |
-
args.learning_rate = (
|
555 |
-
args.learning_rate * args.gradient_accumulation_steps * args.train_batch_size * accelerator.num_processes
|
556 |
-
)
|
557 |
-
|
558 |
-
# Use 8-bit Adam for lower memory usage or to fine-tune the model in 16GB GPUs
|
559 |
-
if args.use_8bit_adam:
|
560 |
-
try:
|
561 |
-
import bitsandbytes as bnb
|
562 |
-
except ImportError:
|
563 |
-
raise ImportError(
|
564 |
-
"To use 8-bit Adam, please install the bitsandbytes library: `pip install bitsandbytes`."
|
565 |
-
)
|
566 |
-
|
567 |
-
optimizer_class = bnb.optim.AdamW8bit
|
568 |
-
else:
|
569 |
-
optimizer_class = torch.optim.AdamW
|
570 |
-
|
571 |
-
optimizer = optimizer_class(
|
572 |
-
lora_layers.parameters(),
|
573 |
-
lr=args.learning_rate,
|
574 |
-
betas=(args.adam_beta1, args.adam_beta2),
|
575 |
-
weight_decay=args.adam_weight_decay,
|
576 |
-
eps=args.adam_epsilon,
|
577 |
-
)
|
578 |
-
|
579 |
-
noise_scheduler = DDPMScheduler.from_pretrained(args.pretrained_model_name_or_path, subfolder="scheduler")
|
580 |
-
|
581 |
-
train_dataset = DreamBoothDataset(
|
582 |
-
instance_data_root=args.instance_data_dir,
|
583 |
-
instance_prompt=args.instance_prompt,
|
584 |
-
class_data_root=args.class_data_dir if args.with_prior_preservation else None,
|
585 |
-
class_prompt=args.class_prompt,
|
586 |
-
tokenizer=tokenizer,
|
587 |
-
size=args.resolution,
|
588 |
-
center_crop=args.center_crop,
|
589 |
-
)
|
590 |
-
|
591 |
-
def collate_fn(examples):
|
592 |
-
input_ids = [example["instance_prompt_ids"] for example in examples]
|
593 |
-
pixel_values = [example["instance_images"] for example in examples]
|
594 |
-
|
595 |
-
# Concat class and instance examples for prior preservation.
|
596 |
-
# We do this to avoid doing two forward passes.
|
597 |
-
if args.with_prior_preservation:
|
598 |
-
input_ids += [example["class_prompt_ids"] for example in examples]
|
599 |
-
pixel_values += [example["class_images"] for example in examples]
|
600 |
-
pior_pil = [example["class_PIL_images"] for example in examples]
|
601 |
-
|
602 |
-
masks = []
|
603 |
-
masked_images = []
|
604 |
-
for example in examples:
|
605 |
-
pil_image = example["PIL_images"]
|
606 |
-
# generate a random mask
|
607 |
-
mask = random_mask(pil_image.size, 1, False)
|
608 |
-
# prepare mask and masked image
|
609 |
-
mask, masked_image = prepare_mask_and_masked_image(pil_image, mask)
|
610 |
-
|
611 |
-
masks.append(mask)
|
612 |
-
masked_images.append(masked_image)
|
613 |
-
|
614 |
-
if args.with_prior_preservation:
|
615 |
-
for pil_image in pior_pil:
|
616 |
-
# generate a random mask
|
617 |
-
mask = random_mask(pil_image.size, 1, False)
|
618 |
-
# prepare mask and masked image
|
619 |
-
mask, masked_image = prepare_mask_and_masked_image(pil_image, mask)
|
620 |
-
|
621 |
-
masks.append(mask)
|
622 |
-
masked_images.append(masked_image)
|
623 |
-
|
624 |
-
pixel_values = torch.stack(pixel_values)
|
625 |
-
pixel_values = pixel_values.to(memory_format=torch.contiguous_format).float()
|
626 |
-
|
627 |
-
input_ids = tokenizer.pad({"input_ids": input_ids}, padding=True, return_tensors="pt").input_ids
|
628 |
-
masks = torch.stack(masks)
|
629 |
-
masked_images = torch.stack(masked_images)
|
630 |
-
batch = {"input_ids": input_ids, "pixel_values": pixel_values, "masks": masks, "masked_images": masked_images}
|
631 |
-
return batch
|
632 |
-
|
633 |
-
train_dataloader = torch.utils.data.DataLoader(
|
634 |
-
train_dataset, batch_size=args.train_batch_size, shuffle=True, collate_fn=collate_fn
|
635 |
-
)
|
636 |
-
|
637 |
-
# Scheduler and math around the number of training steps.
|
638 |
-
overrode_max_train_steps = False
|
639 |
-
num_update_steps_per_epoch = math.ceil(len(train_dataloader) / args.gradient_accumulation_steps)
|
640 |
-
if args.max_train_steps is None:
|
641 |
-
args.max_train_steps = args.num_train_epochs * num_update_steps_per_epoch
|
642 |
-
overrode_max_train_steps = True
|
643 |
-
|
644 |
-
lr_scheduler = get_scheduler(
|
645 |
-
args.lr_scheduler,
|
646 |
-
optimizer=optimizer,
|
647 |
-
num_warmup_steps=args.lr_warmup_steps * accelerator.num_processes,
|
648 |
-
num_training_steps=args.max_train_steps * accelerator.num_processes,
|
649 |
-
)
|
650 |
-
|
651 |
-
# Prepare everything with our `accelerator`.
|
652 |
-
lora_layers, optimizer, train_dataloader, lr_scheduler = accelerator.prepare(
|
653 |
-
lora_layers, optimizer, train_dataloader, lr_scheduler
|
654 |
-
)
|
655 |
-
# accelerator.register_for_checkpointing(lr_scheduler)
|
656 |
-
|
657 |
-
# We need to recalculate our total training steps as the size of the training dataloader may have changed.
|
658 |
-
num_update_steps_per_epoch = math.ceil(len(train_dataloader) / args.gradient_accumulation_steps)
|
659 |
-
if overrode_max_train_steps:
|
660 |
-
args.max_train_steps = args.num_train_epochs * num_update_steps_per_epoch
|
661 |
-
# Afterwards we recalculate our number of training epochs
|
662 |
-
args.num_train_epochs = math.ceil(args.max_train_steps / num_update_steps_per_epoch)
|
663 |
-
|
664 |
-
# We need to initialize the trackers we use, and also store our configuration.
|
665 |
-
# The trackers initializes automatically on the main process.
|
666 |
-
if accelerator.is_main_process:
|
667 |
-
accelerator.init_trackers("dreambooth-inpaint-lora", config=vars(args))
|
668 |
-
|
669 |
-
# Train!
|
670 |
-
total_batch_size = args.train_batch_size * accelerator.num_processes * args.gradient_accumulation_steps
|
671 |
-
|
672 |
-
logger.info("***** Running training *****")
|
673 |
-
logger.info(f" Num examples = {len(train_dataset)}")
|
674 |
-
logger.info(f" Num batches each epoch = {len(train_dataloader)}")
|
675 |
-
logger.info(f" Num Epochs = {args.num_train_epochs}")
|
676 |
-
logger.info(f" Instantaneous batch size per device = {args.train_batch_size}")
|
677 |
-
logger.info(f" Total train batch size (w. parallel, distributed & accumulation) = {total_batch_size}")
|
678 |
-
logger.info(f" Gradient Accumulation steps = {args.gradient_accumulation_steps}")
|
679 |
-
logger.info(f" Total optimization steps = {args.max_train_steps}")
|
680 |
-
global_step = 0
|
681 |
-
first_epoch = 0
|
682 |
-
|
683 |
-
if args.resume_from_checkpoint:
|
684 |
-
if args.resume_from_checkpoint != "latest":
|
685 |
-
path = os.path.basename(args.resume_from_checkpoint)
|
686 |
-
else:
|
687 |
-
# Get the most recent checkpoint
|
688 |
-
dirs = os.listdir(args.output_dir)
|
689 |
-
dirs = [d for d in dirs if d.startswith("checkpoint")]
|
690 |
-
dirs = sorted(dirs, key=lambda x: int(x.split("-")[1]))
|
691 |
-
path = dirs[-1] if len(dirs) > 0 else None
|
692 |
-
|
693 |
-
if path is None:
|
694 |
-
accelerator.print(
|
695 |
-
f"Checkpoint '{args.resume_from_checkpoint}' does not exist. Starting a new training run."
|
696 |
-
)
|
697 |
-
args.resume_from_checkpoint = None
|
698 |
-
else:
|
699 |
-
accelerator.print(f"Resuming from checkpoint {path}")
|
700 |
-
accelerator.load_state(os.path.join(args.output_dir, path))
|
701 |
-
global_step = int(path.split("-")[1])
|
702 |
-
|
703 |
-
resume_global_step = global_step * args.gradient_accumulation_steps
|
704 |
-
first_epoch = global_step // num_update_steps_per_epoch
|
705 |
-
resume_step = resume_global_step % (num_update_steps_per_epoch * args.gradient_accumulation_steps)
|
706 |
-
|
707 |
-
# Only show the progress bar once on each machine.
|
708 |
-
progress_bar = tqdm(range(global_step, args.max_train_steps), disable=not accelerator.is_local_main_process)
|
709 |
-
progress_bar.set_description("Steps")
|
710 |
-
|
711 |
-
for epoch in range(first_epoch, args.num_train_epochs):
|
712 |
-
unet.train()
|
713 |
-
for step, batch in enumerate(train_dataloader):
|
714 |
-
# Skip steps until we reach the resumed step
|
715 |
-
if args.resume_from_checkpoint and epoch == first_epoch and step < resume_step:
|
716 |
-
if step % args.gradient_accumulation_steps == 0:
|
717 |
-
progress_bar.update(1)
|
718 |
-
continue
|
719 |
-
|
720 |
-
with accelerator.accumulate(unet):
|
721 |
-
# Convert images to latent space
|
722 |
-
|
723 |
-
latents = vae.encode(batch["pixel_values"].to(dtype=weight_dtype)).latent_dist.sample()
|
724 |
-
latents = latents * vae.config.scaling_factor
|
725 |
-
|
726 |
-
# Convert masked images to latent space
|
727 |
-
masked_latents = vae.encode(
|
728 |
-
batch["masked_images"].reshape(batch["pixel_values"].shape).to(dtype=weight_dtype)
|
729 |
-
).latent_dist.sample()
|
730 |
-
masked_latents = masked_latents * vae.config.scaling_factor
|
731 |
-
|
732 |
-
masks = batch["masks"]
|
733 |
-
# resize the mask to latents shape as we concatenate the mask to the latents
|
734 |
-
mask = torch.stack(
|
735 |
-
[
|
736 |
-
torch.nn.functional.interpolate(mask, size=(args.resolution // 8, args.resolution // 8))
|
737 |
-
for mask in masks
|
738 |
-
]
|
739 |
-
).to(dtype=weight_dtype)
|
740 |
-
mask = mask.reshape(-1, 1, args.resolution // 8, args.resolution // 8)
|
741 |
-
|
742 |
-
# Sample noise that we'll add to the latents
|
743 |
-
noise = torch.randn_like(latents)
|
744 |
-
bsz = latents.shape[0]
|
745 |
-
# Sample a random timestep for each image
|
746 |
-
timesteps = torch.randint(0, noise_scheduler.config.num_train_timesteps, (bsz,), device=latents.device)
|
747 |
-
timesteps = timesteps.long()
|
748 |
-
|
749 |
-
# Add noise to the latents according to the noise magnitude at each timestep
|
750 |
-
# (this is the forward diffusion process)
|
751 |
-
noisy_latents = noise_scheduler.add_noise(latents, noise, timesteps)
|
752 |
-
|
753 |
-
# concatenate the noised latents with the mask and the masked latents
|
754 |
-
latent_model_input = torch.cat([noisy_latents, mask, masked_latents], dim=1)
|
755 |
-
|
756 |
-
# Get the text embedding for conditioning
|
757 |
-
encoder_hidden_states = text_encoder(batch["input_ids"])[0]
|
758 |
-
|
759 |
-
# Predict the noise residual
|
760 |
-
noise_pred = unet(latent_model_input, timesteps, encoder_hidden_states).sample
|
761 |
-
|
762 |
-
# Get the target for loss depending on the prediction type
|
763 |
-
if noise_scheduler.config.prediction_type == "epsilon":
|
764 |
-
target = noise
|
765 |
-
elif noise_scheduler.config.prediction_type == "v_prediction":
|
766 |
-
target = noise_scheduler.get_velocity(latents, noise, timesteps)
|
767 |
-
else:
|
768 |
-
raise ValueError(f"Unknown prediction type {noise_scheduler.config.prediction_type}")
|
769 |
-
|
770 |
-
if args.with_prior_preservation:
|
771 |
-
# Chunk the noise and noise_pred into two parts and compute the loss on each part separately.
|
772 |
-
noise_pred, noise_pred_prior = torch.chunk(noise_pred, 2, dim=0)
|
773 |
-
target, target_prior = torch.chunk(target, 2, dim=0)
|
774 |
-
|
775 |
-
# Compute instance loss
|
776 |
-
loss = F.mse_loss(noise_pred.float(), target.float(), reduction="none").mean([1, 2, 3]).mean()
|
777 |
-
|
778 |
-
# Compute prior loss
|
779 |
-
prior_loss = F.mse_loss(noise_pred_prior.float(), target_prior.float(), reduction="mean")
|
780 |
-
|
781 |
-
# Add the prior loss to the instance loss.
|
782 |
-
loss = loss + args.prior_loss_weight * prior_loss
|
783 |
-
else:
|
784 |
-
loss = F.mse_loss(noise_pred.float(), target.float(), reduction="mean")
|
785 |
-
|
786 |
-
accelerator.backward(loss)
|
787 |
-
if accelerator.sync_gradients:
|
788 |
-
params_to_clip = lora_layers.parameters()
|
789 |
-
accelerator.clip_grad_norm_(params_to_clip, args.max_grad_norm)
|
790 |
-
optimizer.step()
|
791 |
-
lr_scheduler.step()
|
792 |
-
optimizer.zero_grad()
|
793 |
-
|
794 |
-
# Checks if the accelerator has performed an optimization step behind the scenes
|
795 |
-
if accelerator.sync_gradients:
|
796 |
-
progress_bar.update(1)
|
797 |
-
global_step += 1
|
798 |
-
|
799 |
-
if global_step % args.checkpointing_steps == 0:
|
800 |
-
if accelerator.is_main_process:
|
801 |
-
save_path = os.path.join(args.output_dir, f"checkpoint-{global_step}")
|
802 |
-
accelerator.save_state(save_path)
|
803 |
-
logger.info(f"Saved state to {save_path}")
|
804 |
-
|
805 |
-
logs = {"loss": loss.detach().item(), "lr": lr_scheduler.get_last_lr()[0]}
|
806 |
-
progress_bar.set_postfix(**logs)
|
807 |
-
accelerator.log(logs, step=global_step)
|
808 |
-
|
809 |
-
if global_step >= args.max_train_steps:
|
810 |
-
break
|
811 |
-
|
812 |
-
accelerator.wait_for_everyone()
|
813 |
-
|
814 |
-
# Save the lora layers
|
815 |
-
if accelerator.is_main_process:
|
816 |
-
unet = unet.to(torch.float32)
|
817 |
-
unet.save_attn_procs(args.output_dir)
|
818 |
-
|
819 |
-
if args.push_to_hub:
|
820 |
-
upload_folder(
|
821 |
-
repo_id=repo_id,
|
822 |
-
folder_path=args.output_dir,
|
823 |
-
commit_message="End of training",
|
824 |
-
ignore_patterns=["step_*", "epoch_*"],
|
825 |
-
)
|
826 |
-
|
827 |
-
accelerator.end_training()
|
828 |
-
|
829 |
-
|
830 |
-
if __name__ == "__main__":
|
831 |
-
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/scripts/convert_ms_text_to_video_to_diffusers.py
DELETED
@@ -1,428 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
# Copyright 2023 The HuggingFace Inc. team.
|
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 |
-
""" Conversion script for the LDM checkpoints. """
|
16 |
-
|
17 |
-
import argparse
|
18 |
-
|
19 |
-
import torch
|
20 |
-
|
21 |
-
from diffusers import UNet3DConditionModel
|
22 |
-
|
23 |
-
|
24 |
-
def assign_to_checkpoint(
|
25 |
-
paths, checkpoint, old_checkpoint, attention_paths_to_split=None, additional_replacements=None, config=None
|
26 |
-
):
|
27 |
-
"""
|
28 |
-
This does the final conversion step: take locally converted weights and apply a global renaming to them. It splits
|
29 |
-
attention layers, and takes into account additional replacements that may arise.
|
30 |
-
|
31 |
-
Assigns the weights to the new checkpoint.
|
32 |
-
"""
|
33 |
-
assert isinstance(paths, list), "Paths should be a list of dicts containing 'old' and 'new' keys."
|
34 |
-
|
35 |
-
# Splits the attention layers into three variables.
|
36 |
-
if attention_paths_to_split is not None:
|
37 |
-
for path, path_map in attention_paths_to_split.items():
|
38 |
-
old_tensor = old_checkpoint[path]
|
39 |
-
channels = old_tensor.shape[0] // 3
|
40 |
-
|
41 |
-
target_shape = (-1, channels) if len(old_tensor.shape) == 3 else (-1)
|
42 |
-
|
43 |
-
num_heads = old_tensor.shape[0] // config["num_head_channels"] // 3
|
44 |
-
|
45 |
-
old_tensor = old_tensor.reshape((num_heads, 3 * channels // num_heads) + old_tensor.shape[1:])
|
46 |
-
query, key, value = old_tensor.split(channels // num_heads, dim=1)
|
47 |
-
|
48 |
-
checkpoint[path_map["query"]] = query.reshape(target_shape)
|
49 |
-
checkpoint[path_map["key"]] = key.reshape(target_shape)
|
50 |
-
checkpoint[path_map["value"]] = value.reshape(target_shape)
|
51 |
-
|
52 |
-
for path in paths:
|
53 |
-
new_path = path["new"]
|
54 |
-
|
55 |
-
# These have already been assigned
|
56 |
-
if attention_paths_to_split is not None and new_path in attention_paths_to_split:
|
57 |
-
continue
|
58 |
-
|
59 |
-
if additional_replacements is not None:
|
60 |
-
for replacement in additional_replacements:
|
61 |
-
new_path = new_path.replace(replacement["old"], replacement["new"])
|
62 |
-
|
63 |
-
# proj_attn.weight has to be converted from conv 1D to linear
|
64 |
-
weight = old_checkpoint[path["old"]]
|
65 |
-
names = ["proj_attn.weight"]
|
66 |
-
names_2 = ["proj_out.weight", "proj_in.weight"]
|
67 |
-
if any(k in new_path for k in names):
|
68 |
-
checkpoint[new_path] = weight[:, :, 0]
|
69 |
-
elif any(k in new_path for k in names_2) and len(weight.shape) > 2 and ".attentions." not in new_path:
|
70 |
-
checkpoint[new_path] = weight[:, :, 0]
|
71 |
-
else:
|
72 |
-
checkpoint[new_path] = weight
|
73 |
-
|
74 |
-
|
75 |
-
def renew_attention_paths(old_list, n_shave_prefix_segments=0):
|
76 |
-
"""
|
77 |
-
Updates paths inside attentions to the new naming scheme (local renaming)
|
78 |
-
"""
|
79 |
-
mapping = []
|
80 |
-
for old_item in old_list:
|
81 |
-
new_item = old_item
|
82 |
-
|
83 |
-
# new_item = new_item.replace('norm.weight', 'group_norm.weight')
|
84 |
-
# new_item = new_item.replace('norm.bias', 'group_norm.bias')
|
85 |
-
|
86 |
-
# new_item = new_item.replace('proj_out.weight', 'proj_attn.weight')
|
87 |
-
# new_item = new_item.replace('proj_out.bias', 'proj_attn.bias')
|
88 |
-
|
89 |
-
# new_item = shave_segments(new_item, n_shave_prefix_segments=n_shave_prefix_segments)
|
90 |
-
|
91 |
-
mapping.append({"old": old_item, "new": new_item})
|
92 |
-
|
93 |
-
return mapping
|
94 |
-
|
95 |
-
|
96 |
-
def shave_segments(path, n_shave_prefix_segments=1):
|
97 |
-
"""
|
98 |
-
Removes segments. Positive values shave the first segments, negative shave the last segments.
|
99 |
-
"""
|
100 |
-
if n_shave_prefix_segments >= 0:
|
101 |
-
return ".".join(path.split(".")[n_shave_prefix_segments:])
|
102 |
-
else:
|
103 |
-
return ".".join(path.split(".")[:n_shave_prefix_segments])
|
104 |
-
|
105 |
-
|
106 |
-
def renew_temp_conv_paths(old_list, n_shave_prefix_segments=0):
|
107 |
-
"""
|
108 |
-
Updates paths inside resnets to the new naming scheme (local renaming)
|
109 |
-
"""
|
110 |
-
mapping = []
|
111 |
-
for old_item in old_list:
|
112 |
-
mapping.append({"old": old_item, "new": old_item})
|
113 |
-
|
114 |
-
return mapping
|
115 |
-
|
116 |
-
|
117 |
-
def renew_resnet_paths(old_list, n_shave_prefix_segments=0):
|
118 |
-
"""
|
119 |
-
Updates paths inside resnets to the new naming scheme (local renaming)
|
120 |
-
"""
|
121 |
-
mapping = []
|
122 |
-
for old_item in old_list:
|
123 |
-
new_item = old_item.replace("in_layers.0", "norm1")
|
124 |
-
new_item = new_item.replace("in_layers.2", "conv1")
|
125 |
-
|
126 |
-
new_item = new_item.replace("out_layers.0", "norm2")
|
127 |
-
new_item = new_item.replace("out_layers.3", "conv2")
|
128 |
-
|
129 |
-
new_item = new_item.replace("emb_layers.1", "time_emb_proj")
|
130 |
-
new_item = new_item.replace("skip_connection", "conv_shortcut")
|
131 |
-
|
132 |
-
new_item = shave_segments(new_item, n_shave_prefix_segments=n_shave_prefix_segments)
|
133 |
-
|
134 |
-
if "temopral_conv" not in old_item:
|
135 |
-
mapping.append({"old": old_item, "new": new_item})
|
136 |
-
|
137 |
-
return mapping
|
138 |
-
|
139 |
-
|
140 |
-
def convert_ldm_unet_checkpoint(checkpoint, config, path=None, extract_ema=False):
|
141 |
-
"""
|
142 |
-
Takes a state dict and a config, and returns a converted checkpoint.
|
143 |
-
"""
|
144 |
-
|
145 |
-
# extract state_dict for UNet
|
146 |
-
unet_state_dict = {}
|
147 |
-
keys = list(checkpoint.keys())
|
148 |
-
|
149 |
-
unet_key = "model.diffusion_model."
|
150 |
-
|
151 |
-
# at least a 100 parameters have to start with `model_ema` in order for the checkpoint to be EMA
|
152 |
-
if sum(k.startswith("model_ema") for k in keys) > 100 and extract_ema:
|
153 |
-
print(f"Checkpoint {path} has both EMA and non-EMA weights.")
|
154 |
-
print(
|
155 |
-
"In this conversion only the EMA weights are extracted. If you want to instead extract the non-EMA"
|
156 |
-
" weights (useful to continue fine-tuning), please make sure to remove the `--extract_ema` flag."
|
157 |
-
)
|
158 |
-
for key in keys:
|
159 |
-
if key.startswith("model.diffusion_model"):
|
160 |
-
flat_ema_key = "model_ema." + "".join(key.split(".")[1:])
|
161 |
-
unet_state_dict[key.replace(unet_key, "")] = checkpoint.pop(flat_ema_key)
|
162 |
-
else:
|
163 |
-
if sum(k.startswith("model_ema") for k in keys) > 100:
|
164 |
-
print(
|
165 |
-
"In this conversion only the non-EMA weights are extracted. If you want to instead extract the EMA"
|
166 |
-
" weights (usually better for inference), please make sure to add the `--extract_ema` flag."
|
167 |
-
)
|
168 |
-
|
169 |
-
for key in keys:
|
170 |
-
unet_state_dict[key.replace(unet_key, "")] = checkpoint.pop(key)
|
171 |
-
|
172 |
-
new_checkpoint = {}
|
173 |
-
|
174 |
-
new_checkpoint["time_embedding.linear_1.weight"] = unet_state_dict["time_embed.0.weight"]
|
175 |
-
new_checkpoint["time_embedding.linear_1.bias"] = unet_state_dict["time_embed.0.bias"]
|
176 |
-
new_checkpoint["time_embedding.linear_2.weight"] = unet_state_dict["time_embed.2.weight"]
|
177 |
-
new_checkpoint["time_embedding.linear_2.bias"] = unet_state_dict["time_embed.2.bias"]
|
178 |
-
|
179 |
-
if config["class_embed_type"] is None:
|
180 |
-
# No parameters to port
|
181 |
-
...
|
182 |
-
elif config["class_embed_type"] == "timestep" or config["class_embed_type"] == "projection":
|
183 |
-
new_checkpoint["class_embedding.linear_1.weight"] = unet_state_dict["label_emb.0.0.weight"]
|
184 |
-
new_checkpoint["class_embedding.linear_1.bias"] = unet_state_dict["label_emb.0.0.bias"]
|
185 |
-
new_checkpoint["class_embedding.linear_2.weight"] = unet_state_dict["label_emb.0.2.weight"]
|
186 |
-
new_checkpoint["class_embedding.linear_2.bias"] = unet_state_dict["label_emb.0.2.bias"]
|
187 |
-
else:
|
188 |
-
raise NotImplementedError(f"Not implemented `class_embed_type`: {config['class_embed_type']}")
|
189 |
-
|
190 |
-
new_checkpoint["conv_in.weight"] = unet_state_dict["input_blocks.0.0.weight"]
|
191 |
-
new_checkpoint["conv_in.bias"] = unet_state_dict["input_blocks.0.0.bias"]
|
192 |
-
|
193 |
-
first_temp_attention = [v for v in unet_state_dict if v.startswith("input_blocks.0.1")]
|
194 |
-
paths = renew_attention_paths(first_temp_attention)
|
195 |
-
meta_path = {"old": "input_blocks.0.1", "new": "transformer_in"}
|
196 |
-
assign_to_checkpoint(paths, new_checkpoint, unet_state_dict, additional_replacements=[meta_path], config=config)
|
197 |
-
|
198 |
-
new_checkpoint["conv_norm_out.weight"] = unet_state_dict["out.0.weight"]
|
199 |
-
new_checkpoint["conv_norm_out.bias"] = unet_state_dict["out.0.bias"]
|
200 |
-
new_checkpoint["conv_out.weight"] = unet_state_dict["out.2.weight"]
|
201 |
-
new_checkpoint["conv_out.bias"] = unet_state_dict["out.2.bias"]
|
202 |
-
|
203 |
-
# Retrieves the keys for the input blocks only
|
204 |
-
num_input_blocks = len({".".join(layer.split(".")[:2]) for layer in unet_state_dict if "input_blocks" in layer})
|
205 |
-
input_blocks = {
|
206 |
-
layer_id: [key for key in unet_state_dict if f"input_blocks.{layer_id}" in key]
|
207 |
-
for layer_id in range(num_input_blocks)
|
208 |
-
}
|
209 |
-
|
210 |
-
# Retrieves the keys for the middle blocks only
|
211 |
-
num_middle_blocks = len({".".join(layer.split(".")[:2]) for layer in unet_state_dict if "middle_block" in layer})
|
212 |
-
middle_blocks = {
|
213 |
-
layer_id: [key for key in unet_state_dict if f"middle_block.{layer_id}" in key]
|
214 |
-
for layer_id in range(num_middle_blocks)
|
215 |
-
}
|
216 |
-
|
217 |
-
# Retrieves the keys for the output blocks only
|
218 |
-
num_output_blocks = len({".".join(layer.split(".")[:2]) for layer in unet_state_dict if "output_blocks" in layer})
|
219 |
-
output_blocks = {
|
220 |
-
layer_id: [key for key in unet_state_dict if f"output_blocks.{layer_id}" in key]
|
221 |
-
for layer_id in range(num_output_blocks)
|
222 |
-
}
|
223 |
-
|
224 |
-
for i in range(1, num_input_blocks):
|
225 |
-
block_id = (i - 1) // (config["layers_per_block"] + 1)
|
226 |
-
layer_in_block_id = (i - 1) % (config["layers_per_block"] + 1)
|
227 |
-
|
228 |
-
resnets = [
|
229 |
-
key for key in input_blocks[i] if f"input_blocks.{i}.0" in key and f"input_blocks.{i}.0.op" not in key
|
230 |
-
]
|
231 |
-
attentions = [key for key in input_blocks[i] if f"input_blocks.{i}.1" in key]
|
232 |
-
temp_attentions = [key for key in input_blocks[i] if f"input_blocks.{i}.2" in key]
|
233 |
-
|
234 |
-
if f"input_blocks.{i}.op.weight" in unet_state_dict:
|
235 |
-
new_checkpoint[f"down_blocks.{block_id}.downsamplers.0.conv.weight"] = unet_state_dict.pop(
|
236 |
-
f"input_blocks.{i}.op.weight"
|
237 |
-
)
|
238 |
-
new_checkpoint[f"down_blocks.{block_id}.downsamplers.0.conv.bias"] = unet_state_dict.pop(
|
239 |
-
f"input_blocks.{i}.op.bias"
|
240 |
-
)
|
241 |
-
|
242 |
-
paths = renew_resnet_paths(resnets)
|
243 |
-
meta_path = {"old": f"input_blocks.{i}.0", "new": f"down_blocks.{block_id}.resnets.{layer_in_block_id}"}
|
244 |
-
assign_to_checkpoint(
|
245 |
-
paths, new_checkpoint, unet_state_dict, additional_replacements=[meta_path], config=config
|
246 |
-
)
|
247 |
-
|
248 |
-
temporal_convs = [key for key in resnets if "temopral_conv" in key]
|
249 |
-
paths = renew_temp_conv_paths(temporal_convs)
|
250 |
-
meta_path = {
|
251 |
-
"old": f"input_blocks.{i}.0.temopral_conv",
|
252 |
-
"new": f"down_blocks.{block_id}.temp_convs.{layer_in_block_id}",
|
253 |
-
}
|
254 |
-
assign_to_checkpoint(
|
255 |
-
paths, new_checkpoint, unet_state_dict, additional_replacements=[meta_path], config=config
|
256 |
-
)
|
257 |
-
|
258 |
-
if len(attentions):
|
259 |
-
paths = renew_attention_paths(attentions)
|
260 |
-
meta_path = {"old": f"input_blocks.{i}.1", "new": f"down_blocks.{block_id}.attentions.{layer_in_block_id}"}
|
261 |
-
assign_to_checkpoint(
|
262 |
-
paths, new_checkpoint, unet_state_dict, additional_replacements=[meta_path], config=config
|
263 |
-
)
|
264 |
-
|
265 |
-
if len(temp_attentions):
|
266 |
-
paths = renew_attention_paths(temp_attentions)
|
267 |
-
meta_path = {
|
268 |
-
"old": f"input_blocks.{i}.2",
|
269 |
-
"new": f"down_blocks.{block_id}.temp_attentions.{layer_in_block_id}",
|
270 |
-
}
|
271 |
-
assign_to_checkpoint(
|
272 |
-
paths, new_checkpoint, unet_state_dict, additional_replacements=[meta_path], config=config
|
273 |
-
)
|
274 |
-
|
275 |
-
resnet_0 = middle_blocks[0]
|
276 |
-
temporal_convs_0 = [key for key in resnet_0 if "temopral_conv" in key]
|
277 |
-
attentions = middle_blocks[1]
|
278 |
-
temp_attentions = middle_blocks[2]
|
279 |
-
resnet_1 = middle_blocks[3]
|
280 |
-
temporal_convs_1 = [key for key in resnet_1 if "temopral_conv" in key]
|
281 |
-
|
282 |
-
resnet_0_paths = renew_resnet_paths(resnet_0)
|
283 |
-
meta_path = {"old": "middle_block.0", "new": "mid_block.resnets.0"}
|
284 |
-
assign_to_checkpoint(
|
285 |
-
resnet_0_paths, new_checkpoint, unet_state_dict, config=config, additional_replacements=[meta_path]
|
286 |
-
)
|
287 |
-
|
288 |
-
temp_conv_0_paths = renew_temp_conv_paths(temporal_convs_0)
|
289 |
-
meta_path = {"old": "middle_block.0.temopral_conv", "new": "mid_block.temp_convs.0"}
|
290 |
-
assign_to_checkpoint(
|
291 |
-
temp_conv_0_paths, new_checkpoint, unet_state_dict, config=config, additional_replacements=[meta_path]
|
292 |
-
)
|
293 |
-
|
294 |
-
resnet_1_paths = renew_resnet_paths(resnet_1)
|
295 |
-
meta_path = {"old": "middle_block.3", "new": "mid_block.resnets.1"}
|
296 |
-
assign_to_checkpoint(
|
297 |
-
resnet_1_paths, new_checkpoint, unet_state_dict, config=config, additional_replacements=[meta_path]
|
298 |
-
)
|
299 |
-
|
300 |
-
temp_conv_1_paths = renew_temp_conv_paths(temporal_convs_1)
|
301 |
-
meta_path = {"old": "middle_block.3.temopral_conv", "new": "mid_block.temp_convs.1"}
|
302 |
-
assign_to_checkpoint(
|
303 |
-
temp_conv_1_paths, new_checkpoint, unet_state_dict, config=config, additional_replacements=[meta_path]
|
304 |
-
)
|
305 |
-
|
306 |
-
attentions_paths = renew_attention_paths(attentions)
|
307 |
-
meta_path = {"old": "middle_block.1", "new": "mid_block.attentions.0"}
|
308 |
-
assign_to_checkpoint(
|
309 |
-
attentions_paths, new_checkpoint, unet_state_dict, additional_replacements=[meta_path], config=config
|
310 |
-
)
|
311 |
-
|
312 |
-
temp_attentions_paths = renew_attention_paths(temp_attentions)
|
313 |
-
meta_path = {"old": "middle_block.2", "new": "mid_block.temp_attentions.0"}
|
314 |
-
assign_to_checkpoint(
|
315 |
-
temp_attentions_paths, new_checkpoint, unet_state_dict, additional_replacements=[meta_path], config=config
|
316 |
-
)
|
317 |
-
|
318 |
-
for i in range(num_output_blocks):
|
319 |
-
block_id = i // (config["layers_per_block"] + 1)
|
320 |
-
layer_in_block_id = i % (config["layers_per_block"] + 1)
|
321 |
-
output_block_layers = [shave_segments(name, 2) for name in output_blocks[i]]
|
322 |
-
output_block_list = {}
|
323 |
-
|
324 |
-
for layer in output_block_layers:
|
325 |
-
layer_id, layer_name = layer.split(".")[0], shave_segments(layer, 1)
|
326 |
-
if layer_id in output_block_list:
|
327 |
-
output_block_list[layer_id].append(layer_name)
|
328 |
-
else:
|
329 |
-
output_block_list[layer_id] = [layer_name]
|
330 |
-
|
331 |
-
if len(output_block_list) > 1:
|
332 |
-
resnets = [key for key in output_blocks[i] if f"output_blocks.{i}.0" in key]
|
333 |
-
attentions = [key for key in output_blocks[i] if f"output_blocks.{i}.1" in key]
|
334 |
-
temp_attentions = [key for key in output_blocks[i] if f"output_blocks.{i}.2" in key]
|
335 |
-
|
336 |
-
resnet_0_paths = renew_resnet_paths(resnets)
|
337 |
-
paths = renew_resnet_paths(resnets)
|
338 |
-
|
339 |
-
meta_path = {"old": f"output_blocks.{i}.0", "new": f"up_blocks.{block_id}.resnets.{layer_in_block_id}"}
|
340 |
-
assign_to_checkpoint(
|
341 |
-
paths, new_checkpoint, unet_state_dict, additional_replacements=[meta_path], config=config
|
342 |
-
)
|
343 |
-
|
344 |
-
temporal_convs = [key for key in resnets if "temopral_conv" in key]
|
345 |
-
paths = renew_temp_conv_paths(temporal_convs)
|
346 |
-
meta_path = {
|
347 |
-
"old": f"output_blocks.{i}.0.temopral_conv",
|
348 |
-
"new": f"up_blocks.{block_id}.temp_convs.{layer_in_block_id}",
|
349 |
-
}
|
350 |
-
assign_to_checkpoint(
|
351 |
-
paths, new_checkpoint, unet_state_dict, additional_replacements=[meta_path], config=config
|
352 |
-
)
|
353 |
-
|
354 |
-
output_block_list = {k: sorted(v) for k, v in output_block_list.items()}
|
355 |
-
if ["conv.bias", "conv.weight"] in output_block_list.values():
|
356 |
-
index = list(output_block_list.values()).index(["conv.bias", "conv.weight"])
|
357 |
-
new_checkpoint[f"up_blocks.{block_id}.upsamplers.0.conv.weight"] = unet_state_dict[
|
358 |
-
f"output_blocks.{i}.{index}.conv.weight"
|
359 |
-
]
|
360 |
-
new_checkpoint[f"up_blocks.{block_id}.upsamplers.0.conv.bias"] = unet_state_dict[
|
361 |
-
f"output_blocks.{i}.{index}.conv.bias"
|
362 |
-
]
|
363 |
-
|
364 |
-
# Clear attentions as they have been attributed above.
|
365 |
-
if len(attentions) == 2:
|
366 |
-
attentions = []
|
367 |
-
|
368 |
-
if len(attentions):
|
369 |
-
paths = renew_attention_paths(attentions)
|
370 |
-
meta_path = {
|
371 |
-
"old": f"output_blocks.{i}.1",
|
372 |
-
"new": f"up_blocks.{block_id}.attentions.{layer_in_block_id}",
|
373 |
-
}
|
374 |
-
assign_to_checkpoint(
|
375 |
-
paths, new_checkpoint, unet_state_dict, additional_replacements=[meta_path], config=config
|
376 |
-
)
|
377 |
-
|
378 |
-
if len(temp_attentions):
|
379 |
-
paths = renew_attention_paths(temp_attentions)
|
380 |
-
meta_path = {
|
381 |
-
"old": f"output_blocks.{i}.2",
|
382 |
-
"new": f"up_blocks.{block_id}.temp_attentions.{layer_in_block_id}",
|
383 |
-
}
|
384 |
-
assign_to_checkpoint(
|
385 |
-
paths, new_checkpoint, unet_state_dict, additional_replacements=[meta_path], config=config
|
386 |
-
)
|
387 |
-
else:
|
388 |
-
resnet_0_paths = renew_resnet_paths(output_block_layers, n_shave_prefix_segments=1)
|
389 |
-
for path in resnet_0_paths:
|
390 |
-
old_path = ".".join(["output_blocks", str(i), path["old"]])
|
391 |
-
new_path = ".".join(["up_blocks", str(block_id), "resnets", str(layer_in_block_id), path["new"]])
|
392 |
-
new_checkpoint[new_path] = unet_state_dict[old_path]
|
393 |
-
|
394 |
-
temopral_conv_paths = [l for l in output_block_layers if "temopral_conv" in l]
|
395 |
-
for path in temopral_conv_paths:
|
396 |
-
pruned_path = path.split("temopral_conv.")[-1]
|
397 |
-
old_path = ".".join(["output_blocks", str(i), str(block_id), "temopral_conv", pruned_path])
|
398 |
-
new_path = ".".join(["up_blocks", str(block_id), "temp_convs", str(layer_in_block_id), pruned_path])
|
399 |
-
new_checkpoint[new_path] = unet_state_dict[old_path]
|
400 |
-
|
401 |
-
return new_checkpoint
|
402 |
-
|
403 |
-
|
404 |
-
if __name__ == "__main__":
|
405 |
-
parser = argparse.ArgumentParser()
|
406 |
-
|
407 |
-
parser.add_argument(
|
408 |
-
"--checkpoint_path", default=None, type=str, required=True, help="Path to the checkpoint to convert."
|
409 |
-
)
|
410 |
-
parser.add_argument("--dump_path", default=None, type=str, required=True, help="Path to the output model.")
|
411 |
-
args = parser.parse_args()
|
412 |
-
|
413 |
-
unet_checkpoint = torch.load(args.checkpoint_path, map_location="cpu")
|
414 |
-
unet = UNet3DConditionModel()
|
415 |
-
|
416 |
-
converted_ckpt = convert_ldm_unet_checkpoint(unet_checkpoint, unet.config)
|
417 |
-
|
418 |
-
diff_0 = set(unet.state_dict().keys()) - set(converted_ckpt.keys())
|
419 |
-
diff_1 = set(converted_ckpt.keys()) - set(unet.state_dict().keys())
|
420 |
-
|
421 |
-
assert len(diff_0) == len(diff_1) == 0, "Converted weights don't match"
|
422 |
-
|
423 |
-
# load state_dict
|
424 |
-
unet.load_state_dict(converted_ckpt)
|
425 |
-
|
426 |
-
unet.save_pretrained(args.dump_path)
|
427 |
-
|
428 |
-
# -- finish converting the unet --
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/schedulers/test_scheduler_kdpm2_ancestral.py
DELETED
@@ -1,123 +0,0 @@
|
|
1 |
-
import torch
|
2 |
-
|
3 |
-
from diffusers import KDPM2AncestralDiscreteScheduler
|
4 |
-
from diffusers.utils import torch_device
|
5 |
-
|
6 |
-
from .test_schedulers import SchedulerCommonTest
|
7 |
-
|
8 |
-
|
9 |
-
class KDPM2AncestralDiscreteSchedulerTest(SchedulerCommonTest):
|
10 |
-
scheduler_classes = (KDPM2AncestralDiscreteScheduler,)
|
11 |
-
num_inference_steps = 10
|
12 |
-
|
13 |
-
def get_scheduler_config(self, **kwargs):
|
14 |
-
config = {
|
15 |
-
"num_train_timesteps": 1100,
|
16 |
-
"beta_start": 0.0001,
|
17 |
-
"beta_end": 0.02,
|
18 |
-
"beta_schedule": "linear",
|
19 |
-
}
|
20 |
-
|
21 |
-
config.update(**kwargs)
|
22 |
-
return config
|
23 |
-
|
24 |
-
def test_timesteps(self):
|
25 |
-
for timesteps in [10, 50, 100, 1000]:
|
26 |
-
self.check_over_configs(num_train_timesteps=timesteps)
|
27 |
-
|
28 |
-
def test_betas(self):
|
29 |
-
for beta_start, beta_end in zip([0.00001, 0.0001, 0.001], [0.0002, 0.002, 0.02]):
|
30 |
-
self.check_over_configs(beta_start=beta_start, beta_end=beta_end)
|
31 |
-
|
32 |
-
def test_schedules(self):
|
33 |
-
for schedule in ["linear", "scaled_linear"]:
|
34 |
-
self.check_over_configs(beta_schedule=schedule)
|
35 |
-
|
36 |
-
def test_full_loop_no_noise(self):
|
37 |
-
if torch_device == "mps":
|
38 |
-
return
|
39 |
-
scheduler_class = self.scheduler_classes[0]
|
40 |
-
scheduler_config = self.get_scheduler_config()
|
41 |
-
scheduler = scheduler_class(**scheduler_config)
|
42 |
-
|
43 |
-
scheduler.set_timesteps(self.num_inference_steps)
|
44 |
-
|
45 |
-
generator = torch.manual_seed(0)
|
46 |
-
|
47 |
-
model = self.dummy_model()
|
48 |
-
sample = self.dummy_sample_deter * scheduler.init_noise_sigma
|
49 |
-
sample = sample.to(torch_device)
|
50 |
-
|
51 |
-
for i, t in enumerate(scheduler.timesteps):
|
52 |
-
sample = scheduler.scale_model_input(sample, t)
|
53 |
-
|
54 |
-
model_output = model(sample, t)
|
55 |
-
|
56 |
-
output = scheduler.step(model_output, t, sample, generator=generator)
|
57 |
-
sample = output.prev_sample
|
58 |
-
|
59 |
-
result_sum = torch.sum(torch.abs(sample))
|
60 |
-
result_mean = torch.mean(torch.abs(sample))
|
61 |
-
|
62 |
-
assert abs(result_sum.item() - 13849.3877) < 1e-2
|
63 |
-
assert abs(result_mean.item() - 18.0331) < 5e-3
|
64 |
-
|
65 |
-
def test_prediction_type(self):
|
66 |
-
for prediction_type in ["epsilon", "v_prediction"]:
|
67 |
-
self.check_over_configs(prediction_type=prediction_type)
|
68 |
-
|
69 |
-
def test_full_loop_with_v_prediction(self):
|
70 |
-
if torch_device == "mps":
|
71 |
-
return
|
72 |
-
scheduler_class = self.scheduler_classes[0]
|
73 |
-
scheduler_config = self.get_scheduler_config(prediction_type="v_prediction")
|
74 |
-
scheduler = scheduler_class(**scheduler_config)
|
75 |
-
|
76 |
-
scheduler.set_timesteps(self.num_inference_steps)
|
77 |
-
|
78 |
-
model = self.dummy_model()
|
79 |
-
sample = self.dummy_sample_deter * scheduler.init_noise_sigma
|
80 |
-
sample = sample.to(torch_device)
|
81 |
-
|
82 |
-
generator = torch.manual_seed(0)
|
83 |
-
|
84 |
-
for i, t in enumerate(scheduler.timesteps):
|
85 |
-
sample = scheduler.scale_model_input(sample, t)
|
86 |
-
|
87 |
-
model_output = model(sample, t)
|
88 |
-
|
89 |
-
output = scheduler.step(model_output, t, sample, generator=generator)
|
90 |
-
sample = output.prev_sample
|
91 |
-
|
92 |
-
result_sum = torch.sum(torch.abs(sample))
|
93 |
-
result_mean = torch.mean(torch.abs(sample))
|
94 |
-
|
95 |
-
assert abs(result_sum.item() - 328.9970) < 1e-2
|
96 |
-
assert abs(result_mean.item() - 0.4284) < 1e-3
|
97 |
-
|
98 |
-
def test_full_loop_device(self):
|
99 |
-
if torch_device == "mps":
|
100 |
-
return
|
101 |
-
scheduler_class = self.scheduler_classes[0]
|
102 |
-
scheduler_config = self.get_scheduler_config()
|
103 |
-
scheduler = scheduler_class(**scheduler_config)
|
104 |
-
|
105 |
-
scheduler.set_timesteps(self.num_inference_steps, device=torch_device)
|
106 |
-
generator = torch.manual_seed(0)
|
107 |
-
|
108 |
-
model = self.dummy_model()
|
109 |
-
sample = self.dummy_sample_deter.to(torch_device) * scheduler.init_noise_sigma
|
110 |
-
|
111 |
-
for t in scheduler.timesteps:
|
112 |
-
sample = scheduler.scale_model_input(sample, t)
|
113 |
-
|
114 |
-
model_output = model(sample, t)
|
115 |
-
|
116 |
-
output = scheduler.step(model_output, t, sample, generator=generator)
|
117 |
-
sample = output.prev_sample
|
118 |
-
|
119 |
-
result_sum = torch.sum(torch.abs(sample))
|
120 |
-
result_mean = torch.mean(torch.abs(sample))
|
121 |
-
|
122 |
-
assert abs(result_sum.item() - 13849.3818) < 1e-1
|
123 |
-
assert abs(result_mean.item() - 18.0331) < 1e-3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_demo/app.py
DELETED
@@ -1,87 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
|
3 |
-
import torch
|
4 |
-
import torch.nn.functional as F
|
5 |
-
import torchvision.transforms as T
|
6 |
-
from uniformer import uniformer_small
|
7 |
-
from imagenet_class_index import imagenet_classnames
|
8 |
-
|
9 |
-
import gradio as gr
|
10 |
-
from huggingface_hub import hf_hub_download
|
11 |
-
|
12 |
-
# Device on which to run the model
|
13 |
-
# Set to cuda to load on GPU
|
14 |
-
device = "cpu"
|
15 |
-
# os.system("wget https://cdn-lfs.huggingface.co/Andy1621/uniformer/fd192c31f8bd77670de8f171111bd51f56fd87e6aea45043ab2edc181e1fa775")
|
16 |
-
model_path = hf_hub_download(repo_id="Andy1621/uniformer", filename="uniformer_small_in1k.pth")
|
17 |
-
# Pick a pretrained model
|
18 |
-
model = uniformer_small()
|
19 |
-
# state_dict = torch.load('fd192c31f8bd77670de8f171111bd51f56fd87e6aea45043ab2edc181e1fa775', map_location='cpu')
|
20 |
-
state_dict = torch.load(model_path, map_location='cpu')
|
21 |
-
model.load_state_dict(state_dict['model'])
|
22 |
-
|
23 |
-
# Set to eval mode and move to desired device
|
24 |
-
model = model.to(device)
|
25 |
-
model = model.eval()
|
26 |
-
|
27 |
-
# Create an id to label name mapping
|
28 |
-
imagenet_id_to_classname = {}
|
29 |
-
for k, v in imagenet_classnames.items():
|
30 |
-
imagenet_id_to_classname[k] = v[1]
|
31 |
-
|
32 |
-
|
33 |
-
def inference(img):
|
34 |
-
image = img
|
35 |
-
image_transform = T.Compose(
|
36 |
-
[
|
37 |
-
T.Resize(224),
|
38 |
-
T.CenterCrop(224),
|
39 |
-
T.ToTensor(),
|
40 |
-
T.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
|
41 |
-
]
|
42 |
-
)
|
43 |
-
image = image_transform(image)
|
44 |
-
|
45 |
-
# The model expects inputs of shape: B x C x H x W
|
46 |
-
image = image.unsqueeze(0)
|
47 |
-
|
48 |
-
prediction = model(image)
|
49 |
-
prediction = F.softmax(prediction, dim=1).flatten()
|
50 |
-
|
51 |
-
return {imagenet_id_to_classname[str(i)]: float(prediction[i]) for i in range(1000)}
|
52 |
-
|
53 |
-
def set_example_image(example: list) -> dict:
|
54 |
-
return gr.Image.update(value=example[0])
|
55 |
-
|
56 |
-
|
57 |
-
demo = gr.Blocks()
|
58 |
-
with demo:
|
59 |
-
gr.Markdown(
|
60 |
-
"""
|
61 |
-
# UniFormer-S
|
62 |
-
Gradio demo for <a href='https://github.com/Sense-X/UniFormer' target='_blank'>UniFormer</a>: To use it, simply upload your image, or click one of the examples to load them. Read more at the links below.
|
63 |
-
"""
|
64 |
-
)
|
65 |
-
|
66 |
-
with gr.Box():
|
67 |
-
with gr.Row():
|
68 |
-
with gr.Column():
|
69 |
-
with gr.Row():
|
70 |
-
input_image = gr.Image(label='Input Image', type='pil')
|
71 |
-
with gr.Row():
|
72 |
-
submit_button = gr.Button('Submit')
|
73 |
-
with gr.Column():
|
74 |
-
label = gr.Label(num_top_classes=5)
|
75 |
-
with gr.Row():
|
76 |
-
example_images = gr.Dataset(components=[input_image], samples=[['library.jpeg'], ['cat.png'], ['dog.png'], ['panda.png']])
|
77 |
-
|
78 |
-
gr.Markdown(
|
79 |
-
"""
|
80 |
-
<p style='text-align: center'><a href='https://arxiv.org/abs/2201.09450' target='_blank'>UniFormer: Unifying Convolution and Self-attention for Visual Recognition</a> | <a href='https://github.com/Sense-X/UniFormer' target='_blank'>Github Repo</a></p>
|
81 |
-
"""
|
82 |
-
)
|
83 |
-
|
84 |
-
submit_button.click(fn=inference, inputs=input_image, outputs=label)
|
85 |
-
example_images.click(fn=set_example_image, inputs=example_images, outputs=example_images.components)
|
86 |
-
|
87 |
-
demo.launch(enable_queue=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/groie/README.md
DELETED
@@ -1,65 +0,0 @@
|
|
1 |
-
# GRoIE
|
2 |
-
|
3 |
-
## A novel Region of Interest Extraction Layer for Instance Segmentation
|
4 |
-
|
5 |
-
By Leonardo Rossi, Akbar Karimi and Andrea Prati from
|
6 |
-
[IMPLab](http://implab.ce.unipr.it/).
|
7 |
-
|
8 |
-
We provide configs to reproduce the results in the paper for
|
9 |
-
"*A novel Region of Interest Extraction Layer for Instance Segmentation*"
|
10 |
-
on COCO object detection.
|
11 |
-
|
12 |
-
## Introduction
|
13 |
-
|
14 |
-
[ALGORITHM]
|
15 |
-
|
16 |
-
This paper is motivated by the need to overcome to the limitations of existing
|
17 |
-
RoI extractors which select only one (the best) layer from FPN.
|
18 |
-
|
19 |
-
Our intuition is that all the layers of FPN retain useful information.
|
20 |
-
|
21 |
-
Therefore, the proposed layer (called Generic RoI Extractor - **GRoIE**)
|
22 |
-
introduces non-local building blocks and attention mechanisms to boost the
|
23 |
-
performance.
|
24 |
-
|
25 |
-
## Results and models
|
26 |
-
|
27 |
-
The results on COCO 2017 minival (5k images) are shown in the below table.
|
28 |
-
You can find
|
29 |
-
[here](https://drive.google.com/drive/folders/19ssstbq_h0Z1cgxHmJYFO8s1arf3QJbT)
|
30 |
-
the trained models.
|
31 |
-
|
32 |
-
### Application of GRoIE to different architectures
|
33 |
-
|
34 |
-
| Backbone | Method | Lr schd | box AP | mask AP | Config | Download|
|
35 |
-
| :-------: | :--------------: | :-----: | :----: | :-----: | :-------:| :--------:|
|
36 |
-
| R-50-FPN | Faster Original | 1x | 37.4 | | [config](../faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth) | [log](http://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130_204655.log.json) |
|
37 |
-
| R-50-FPN | + GRoIE | 1x | 38.3 | | [config](./faster_rcnn_r50_fpn_groie_1x_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/groie/faster_rcnn_r50_fpn_groie_1x_coco/faster_rcnn_r50_fpn_groie_1x_coco_20200604_211715-66ee9516.pth) | [log](http://download.openmmlab.com/mmdetection/v2.0/groie/faster_rcnn_r50_fpn_groie_1x_coco/faster_rcnn_r50_fpn_groie_1x_coco_20200604_211715.log.json) |
|
38 |
-
| R-50-FPN | Grid R-CNN | 1x | 39.1 | | [config](./grid_rcnn_r50_fpn_gn-head_1x_coco.py)| [model](http://download.openmmlab.com/mmdetection/v2.0/groie/grid_rcnn_r50_fpn_gn-head_1x_coco/grid_rcnn_r50_fpn_gn-head_1x_coco_20200605_202059-64f00ee8.pth) | [log](http://download.openmmlab.com/mmdetection/v2.0/groie/grid_rcnn_r50_fpn_gn-head_1x_coco/grid_rcnn_r50_fpn_gn-head_1x_coco_20200605_202059.log.json) |
|
39 |
-
| R-50-FPN | + GRoIE | 1x | | | [config](./grid_rcnn_r50_fpn_gn-head_groie_1x_coco.py)||
|
40 |
-
| R-50-FPN | Mask R-CNN | 1x | 38.2 | 34.7 | [config](../mask_rcnn/mask_rcnn_r50_fpn_1x_coco.py)| [model](http://download.openmmlab.com/mmdetection/v2.0/mask_rcnn/mask_rcnn_r50_fpn_1x_coco/mask_rcnn_r50_fpn_1x_coco_20200205-d4b0c5d6.pth) | [log](http://download.openmmlab.com/mmdetection/v2.0/mask_rcnn/mask_rcnn_r50_fpn_1x_coco/mask_rcnn_r50_fpn_1x_coco_20200205_050542.log.json) |
|
41 |
-
| R-50-FPN | + GRoIE | 1x | 39.0 | 36.0 | [config](./mask_rcnn_r50_fpn_groie_1x_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/groie/mask_rcnn_r50_fpn_groie_1x_coco/mask_rcnn_r50_fpn_groie_1x_coco_20200604_211715-50d90c74.pth) | [log](http://download.openmmlab.com/mmdetection/v2.0/groie/mask_rcnn_r50_fpn_groie_1x_coco/mask_rcnn_r50_fpn_groie_1x_coco_20200604_211715.log.json) |
|
42 |
-
| R-50-FPN | GC-Net | 1x | 40.7 | 36.5 | [config](../gcnet/mask_rcnn_r50_fpn_syncbn-backbone_r4_gcb_c3-c5_1x_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/gcnet/mask_rcnn_r50_fpn_syncbn-backbone_r4_gcb_c3-c5_1x_coco/mask_rcnn_r50_fpn_syncbn-backbone_r4_gcb_c3-c5_1x_coco_20200202-50b90e5c.pth) | [log](http://download.openmmlab.com/mmdetection/v2.0/gcnet/mask_rcnn_r50_fpn_syncbn-backbone_r4_gcb_c3-c5_1x_coco/mask_rcnn_r50_fpn_syncbn-backbone_r4_gcb_c3-c5_1x_coco_20200202_085547.log.json) |
|
43 |
-
| R-50-FPN | + GRoIE | 1x | 41.0 | 37.8 | [config](./mask_rcnn_r50_fpn_syncbn-backbone_r4_gcb_c3-c5_groie_1x_coco.py) |[model](http://download.openmmlab.com/mmdetection/v2.0/groie/mask_rcnn_r50_fpn_syncbn-backbone_r4_gcb_c3-c5_groie_1x_coco/mask_rcnn_r50_fpn_syncbn-backbone_r4_gcb_c3-c5_groie_1x_coco_20200604_211715-42eb79e1.pth) | [log](http://download.openmmlab.com/mmdetection/v2.0/groie/mask_rcnn_r50_fpn_syncbn-backbone_r4_gcb_c3-c5_groie_1x_coco/mask_rcnn_r50_fpn_syncbn-backbone_r4_gcb_c3-c5_groie_1x_coco_20200604_211715-42eb79e1.pth) |
|
44 |
-
| R-101-FPN | GC-Net | 1x | 42.2 | 37.8 | [config](../gcnet/mask_rcnn_r101_fpn_syncbn-backbone_r4_gcb_c3-c5_1x_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/gcnet/mask_rcnn_r101_fpn_syncbn-backbone_r4_gcb_c3-c5_1x_coco/mask_rcnn_r101_fpn_syncbn-backbone_r4_gcb_c3-c5_1x_coco_20200206-8407a3f0.pth) | [log](http://download.openmmlab.com/mmdetection/v2.0/gcnet/mask_rcnn_r101_fpn_syncbn-backbone_r4_gcb_c3-c5_1x_coco/mask_rcnn_r101_fpn_syncbn-backbone_r4_gcb_c3-c5_1x_coco_20200206_142508.log.json) |
|
45 |
-
| R-101-FPN | + GRoIE | 1x | | | [config](./mask_rcnn_r101_fpn_syncbn-backbone_r4_gcb_c3-c5_groie_1x_coco.py)| [model](http://download.openmmlab.com/mmdetection/v2.0/groie/mask_rcnn_r101_fpn_syncbn-backbone_r4_gcb_c3-c5_groie_1x_coco/mask_rcnn_r101_fpn_syncbn-backbone_r4_gcb_c3-c5_groie_1x_coco_20200607_224507-8daae01c.pth) | [log](http://download.openmmlab.com/mmdetection/v2.0/groie/mask_rcnn_r101_fpn_syncbn-backbone_r4_gcb_c3-c5_groie_1x_coco/mask_rcnn_r101_fpn_syncbn-backbone_r4_gcb_c3-c5_groie_1x_coco_20200607_224507.log.json) |
|
46 |
-
|
47 |
-
## Citation
|
48 |
-
|
49 |
-
If you use this work or benchmark in your research, please cite this project.
|
50 |
-
|
51 |
-
```latex
|
52 |
-
@misc{rossi2020novel,
|
53 |
-
title={A novel Region of Interest Extraction Layer for Instance Segmentation},
|
54 |
-
author={Leonardo Rossi and Akbar Karimi and Andrea Prati},
|
55 |
-
year={2020},
|
56 |
-
eprint={2004.13665},
|
57 |
-
archivePrefix={arXiv},
|
58 |
-
primaryClass={cs.CV}
|
59 |
-
}
|
60 |
-
```
|
61 |
-
|
62 |
-
## Contact
|
63 |
-
|
64 |
-
The implementation of GROI is currently maintained by
|
65 |
-
[Leonardo Rossi](https://github.com/hachreak/).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/groie/faster_rcnn_r50_fpn_groie_1x_coco.py
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
_base_ = '../faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py'
|
2 |
-
# model settings
|
3 |
-
model = dict(
|
4 |
-
roi_head=dict(
|
5 |
-
bbox_roi_extractor=dict(
|
6 |
-
type='GenericRoIExtractor',
|
7 |
-
aggregation='sum',
|
8 |
-
roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=2),
|
9 |
-
out_channels=256,
|
10 |
-
featmap_strides=[4, 8, 16, 32],
|
11 |
-
pre_cfg=dict(
|
12 |
-
type='ConvModule',
|
13 |
-
in_channels=256,
|
14 |
-
out_channels=256,
|
15 |
-
kernel_size=5,
|
16 |
-
padding=2,
|
17 |
-
inplace=False,
|
18 |
-
),
|
19 |
-
post_cfg=dict(
|
20 |
-
type='GeneralizedAttention',
|
21 |
-
in_channels=256,
|
22 |
-
spatial_range=-1,
|
23 |
-
num_heads=6,
|
24 |
-
attention_type='0100',
|
25 |
-
kv_stride=2))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/ld/ld_r50_gflv1_r101_fpn_coco_1x.py
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
_base_ = ['./ld_r18_gflv1_r101_fpn_coco_1x.py']
|
2 |
-
model = dict(
|
3 |
-
pretrained='torchvision://resnet50',
|
4 |
-
backbone=dict(
|
5 |
-
type='ResNet',
|
6 |
-
depth=50,
|
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 |
-
neck=dict(
|
14 |
-
type='FPN',
|
15 |
-
in_channels=[256, 512, 1024, 2048],
|
16 |
-
out_channels=256,
|
17 |
-
start_level=1,
|
18 |
-
add_extra_convs='on_output',
|
19 |
-
num_outs=5))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/mmdet/datasets/builder.py
DELETED
@@ -1,143 +0,0 @@
|
|
1 |
-
import copy
|
2 |
-
import platform
|
3 |
-
import random
|
4 |
-
from functools import partial
|
5 |
-
|
6 |
-
import numpy as np
|
7 |
-
from mmcv.parallel import collate
|
8 |
-
from mmcv.runner import get_dist_info
|
9 |
-
from mmcv.utils import Registry, build_from_cfg
|
10 |
-
from torch.utils.data import DataLoader
|
11 |
-
|
12 |
-
from .samplers import DistributedGroupSampler, DistributedSampler, GroupSampler
|
13 |
-
|
14 |
-
if platform.system() != 'Windows':
|
15 |
-
# https://github.com/pytorch/pytorch/issues/973
|
16 |
-
import resource
|
17 |
-
rlimit = resource.getrlimit(resource.RLIMIT_NOFILE)
|
18 |
-
hard_limit = rlimit[1]
|
19 |
-
soft_limit = min(4096, hard_limit)
|
20 |
-
resource.setrlimit(resource.RLIMIT_NOFILE, (soft_limit, hard_limit))
|
21 |
-
|
22 |
-
DATASETS = Registry('dataset')
|
23 |
-
PIPELINES = Registry('pipeline')
|
24 |
-
|
25 |
-
|
26 |
-
def _concat_dataset(cfg, default_args=None):
|
27 |
-
from .dataset_wrappers import ConcatDataset
|
28 |
-
ann_files = cfg['ann_file']
|
29 |
-
img_prefixes = cfg.get('img_prefix', None)
|
30 |
-
seg_prefixes = cfg.get('seg_prefix', None)
|
31 |
-
proposal_files = cfg.get('proposal_file', None)
|
32 |
-
separate_eval = cfg.get('separate_eval', True)
|
33 |
-
|
34 |
-
datasets = []
|
35 |
-
num_dset = len(ann_files)
|
36 |
-
for i in range(num_dset):
|
37 |
-
data_cfg = copy.deepcopy(cfg)
|
38 |
-
# pop 'separate_eval' since it is not a valid key for common datasets.
|
39 |
-
if 'separate_eval' in data_cfg:
|
40 |
-
data_cfg.pop('separate_eval')
|
41 |
-
data_cfg['ann_file'] = ann_files[i]
|
42 |
-
if isinstance(img_prefixes, (list, tuple)):
|
43 |
-
data_cfg['img_prefix'] = img_prefixes[i]
|
44 |
-
if isinstance(seg_prefixes, (list, tuple)):
|
45 |
-
data_cfg['seg_prefix'] = seg_prefixes[i]
|
46 |
-
if isinstance(proposal_files, (list, tuple)):
|
47 |
-
data_cfg['proposal_file'] = proposal_files[i]
|
48 |
-
datasets.append(build_dataset(data_cfg, default_args))
|
49 |
-
|
50 |
-
return ConcatDataset(datasets, separate_eval)
|
51 |
-
|
52 |
-
|
53 |
-
def build_dataset(cfg, default_args=None):
|
54 |
-
from .dataset_wrappers import (ConcatDataset, RepeatDataset,
|
55 |
-
ClassBalancedDataset)
|
56 |
-
if isinstance(cfg, (list, tuple)):
|
57 |
-
dataset = ConcatDataset([build_dataset(c, default_args) for c in cfg])
|
58 |
-
elif cfg['type'] == 'ConcatDataset':
|
59 |
-
dataset = ConcatDataset(
|
60 |
-
[build_dataset(c, default_args) for c in cfg['datasets']],
|
61 |
-
cfg.get('separate_eval', True))
|
62 |
-
elif cfg['type'] == 'RepeatDataset':
|
63 |
-
dataset = RepeatDataset(
|
64 |
-
build_dataset(cfg['dataset'], default_args), cfg['times'])
|
65 |
-
elif cfg['type'] == 'ClassBalancedDataset':
|
66 |
-
dataset = ClassBalancedDataset(
|
67 |
-
build_dataset(cfg['dataset'], default_args), cfg['oversample_thr'])
|
68 |
-
elif isinstance(cfg.get('ann_file'), (list, tuple)):
|
69 |
-
dataset = _concat_dataset(cfg, default_args)
|
70 |
-
else:
|
71 |
-
dataset = build_from_cfg(cfg, DATASETS, default_args)
|
72 |
-
|
73 |
-
return dataset
|
74 |
-
|
75 |
-
|
76 |
-
def build_dataloader(dataset,
|
77 |
-
samples_per_gpu,
|
78 |
-
workers_per_gpu,
|
79 |
-
num_gpus=1,
|
80 |
-
dist=True,
|
81 |
-
shuffle=True,
|
82 |
-
seed=None,
|
83 |
-
**kwargs):
|
84 |
-
"""Build PyTorch DataLoader.
|
85 |
-
|
86 |
-
In distributed training, each GPU/process has a dataloader.
|
87 |
-
In non-distributed training, there is only one dataloader for all GPUs.
|
88 |
-
|
89 |
-
Args:
|
90 |
-
dataset (Dataset): A PyTorch dataset.
|
91 |
-
samples_per_gpu (int): Number of training samples on each GPU, i.e.,
|
92 |
-
batch size of each GPU.
|
93 |
-
workers_per_gpu (int): How many subprocesses to use for data loading
|
94 |
-
for each GPU.
|
95 |
-
num_gpus (int): Number of GPUs. Only used in non-distributed training.
|
96 |
-
dist (bool): Distributed training/test or not. Default: True.
|
97 |
-
shuffle (bool): Whether to shuffle the data at every epoch.
|
98 |
-
Default: True.
|
99 |
-
kwargs: any keyword argument to be used to initialize DataLoader
|
100 |
-
|
101 |
-
Returns:
|
102 |
-
DataLoader: A PyTorch dataloader.
|
103 |
-
"""
|
104 |
-
rank, world_size = get_dist_info()
|
105 |
-
if dist:
|
106 |
-
# DistributedGroupSampler will definitely shuffle the data to satisfy
|
107 |
-
# that images on each GPU are in the same group
|
108 |
-
if shuffle:
|
109 |
-
sampler = DistributedGroupSampler(
|
110 |
-
dataset, samples_per_gpu, world_size, rank, seed=seed)
|
111 |
-
else:
|
112 |
-
sampler = DistributedSampler(
|
113 |
-
dataset, world_size, rank, shuffle=False, seed=seed)
|
114 |
-
batch_size = samples_per_gpu
|
115 |
-
num_workers = workers_per_gpu
|
116 |
-
else:
|
117 |
-
sampler = GroupSampler(dataset, samples_per_gpu) if shuffle else None
|
118 |
-
batch_size = num_gpus * samples_per_gpu
|
119 |
-
num_workers = num_gpus * workers_per_gpu
|
120 |
-
|
121 |
-
init_fn = partial(
|
122 |
-
worker_init_fn, num_workers=num_workers, rank=rank,
|
123 |
-
seed=seed) if seed is not None else None
|
124 |
-
|
125 |
-
data_loader = DataLoader(
|
126 |
-
dataset,
|
127 |
-
batch_size=batch_size,
|
128 |
-
sampler=sampler,
|
129 |
-
num_workers=num_workers,
|
130 |
-
collate_fn=partial(collate, samples_per_gpu=samples_per_gpu),
|
131 |
-
pin_memory=False,
|
132 |
-
worker_init_fn=init_fn,
|
133 |
-
**kwargs)
|
134 |
-
|
135 |
-
return data_loader
|
136 |
-
|
137 |
-
|
138 |
-
def worker_init_fn(worker_id, num_workers, rank, seed):
|
139 |
-
# The seed of each worker equals to
|
140 |
-
# num_worker * rank + worker_id + user_seed
|
141 |
-
worker_seed = num_workers * rank + worker_id + seed
|
142 |
-
np.random.seed(worker_seed)
|
143 |
-
random.seed(worker_seed)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_segmentation/configs/nonlocal_net/nonlocal_r50-d8_769x769_80k_cityscapes.py
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
_base_ = [
|
2 |
-
'../_base_/models/nonlocal_r50-d8.py',
|
3 |
-
'../_base_/datasets/cityscapes_769x769.py', '../_base_/default_runtime.py',
|
4 |
-
'../_base_/schedules/schedule_80k.py'
|
5 |
-
]
|
6 |
-
model = dict(
|
7 |
-
decode_head=dict(align_corners=True),
|
8 |
-
auxiliary_head=dict(align_corners=True),
|
9 |
-
test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Anonymous-123/ImageNet-Editing/object_removal/TFill/model/stylegan_ops/style_function.py
DELETED
@@ -1,236 +0,0 @@
|
|
1 |
-
import math
|
2 |
-
import random
|
3 |
-
import torch
|
4 |
-
from torch import nn
|
5 |
-
from torch.nn import functional as F
|
6 |
-
|
7 |
-
from . import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
|
8 |
-
|
9 |
-
|
10 |
-
class StyleBlock(nn.Module):
|
11 |
-
def __init__(self, in_channel, out_channel, blur_kernel=[1, 3, 3, 1]):
|
12 |
-
super().__init__()
|
13 |
-
|
14 |
-
self.conv1 = ConvLayer(in_channel, in_channel, 3)
|
15 |
-
self.conv2 = ConvLayer(in_channel, out_channel, 3, downsample=True)
|
16 |
-
|
17 |
-
self.skip = ConvLayer(
|
18 |
-
in_channel, out_channel, 1, downsample=True, activate=False, bias=False
|
19 |
-
)
|
20 |
-
|
21 |
-
def forward(self, input):
|
22 |
-
out = self.conv1(input)
|
23 |
-
out = self.conv2(out)
|
24 |
-
|
25 |
-
skip = self.skip(input)
|
26 |
-
out = (out + skip) / math.sqrt(2)
|
27 |
-
|
28 |
-
return out
|
29 |
-
|
30 |
-
|
31 |
-
class ConvLayer(nn.Sequential):
|
32 |
-
def __init__(
|
33 |
-
self,
|
34 |
-
in_channel,
|
35 |
-
out_channel,
|
36 |
-
kernel_size,
|
37 |
-
downsample=False,
|
38 |
-
blur_kernel=[1, 3, 3, 1],
|
39 |
-
bias=True,
|
40 |
-
activate=True,
|
41 |
-
):
|
42 |
-
layers = []
|
43 |
-
|
44 |
-
if downsample:
|
45 |
-
factor = 2
|
46 |
-
p = (len(blur_kernel) - factor) + (kernel_size - 1)
|
47 |
-
pad0 = (p + 1) // 2
|
48 |
-
pad1 = p // 2
|
49 |
-
|
50 |
-
layers.append(Blur(blur_kernel, pad=(pad0, pad1)))
|
51 |
-
|
52 |
-
stride = 2
|
53 |
-
self.padding = 0
|
54 |
-
|
55 |
-
else:
|
56 |
-
stride = 1
|
57 |
-
self.padding = kernel_size // 2
|
58 |
-
|
59 |
-
layers.append(
|
60 |
-
EqualConv2d(
|
61 |
-
in_channel,
|
62 |
-
out_channel,
|
63 |
-
kernel_size,
|
64 |
-
padding=self.padding,
|
65 |
-
stride=stride,
|
66 |
-
bias=bias and not activate,
|
67 |
-
)
|
68 |
-
)
|
69 |
-
|
70 |
-
if activate:
|
71 |
-
if bias:
|
72 |
-
layers.append(FusedLeakyReLU(out_channel))
|
73 |
-
|
74 |
-
else:
|
75 |
-
layers.append(ScaledLeakyReLU(0.2))
|
76 |
-
|
77 |
-
super().__init__(*layers)
|
78 |
-
|
79 |
-
|
80 |
-
class EqualConv2d(nn.Module):
|
81 |
-
def __init__(
|
82 |
-
self, in_channel, out_channel, kernel_size, stride=1, padding=0, bias=True
|
83 |
-
):
|
84 |
-
super().__init__()
|
85 |
-
|
86 |
-
self.weight = nn.Parameter(
|
87 |
-
torch.randn(out_channel, in_channel, kernel_size, kernel_size)
|
88 |
-
)
|
89 |
-
self.scale = 1 / math.sqrt(in_channel * kernel_size ** 2)
|
90 |
-
|
91 |
-
self.stride = stride
|
92 |
-
self.padding = padding
|
93 |
-
|
94 |
-
if bias:
|
95 |
-
self.bias = nn.Parameter(torch.zeros(out_channel))
|
96 |
-
|
97 |
-
else:
|
98 |
-
self.bias = None
|
99 |
-
|
100 |
-
def forward(self, input):
|
101 |
-
out = F.conv2d(
|
102 |
-
input,
|
103 |
-
self.weight * self.scale,
|
104 |
-
bias=self.bias,
|
105 |
-
stride=self.stride,
|
106 |
-
padding=self.padding,
|
107 |
-
)
|
108 |
-
|
109 |
-
return out
|
110 |
-
|
111 |
-
def __repr__(self):
|
112 |
-
return (
|
113 |
-
f'{self.__class__.__name__}({self.weight.shape[1]}, {self.weight.shape[0]},'
|
114 |
-
f' {self.weight.shape[2]}, stride={self.stride}, padding={self.padding})'
|
115 |
-
)
|
116 |
-
|
117 |
-
|
118 |
-
class EqualLinear(nn.Module):
|
119 |
-
def __init__(
|
120 |
-
self, in_dim, out_dim, bias=True, bias_init=0, lr_mul=1, activation=None
|
121 |
-
):
|
122 |
-
super().__init__()
|
123 |
-
|
124 |
-
self.weight = nn.Parameter(torch.randn(out_dim, in_dim).div_(lr_mul))
|
125 |
-
|
126 |
-
if bias:
|
127 |
-
self.bias = nn.Parameter(torch.zeros(out_dim).fill_(bias_init))
|
128 |
-
|
129 |
-
else:
|
130 |
-
self.bias = None
|
131 |
-
|
132 |
-
self.activation = activation
|
133 |
-
|
134 |
-
self.scale = (1 / math.sqrt(in_dim)) * lr_mul
|
135 |
-
self.lr_mul = lr_mul
|
136 |
-
|
137 |
-
def forward(self, input):
|
138 |
-
if self.activation:
|
139 |
-
out = F.linear(input, self.weight * self.scale)
|
140 |
-
out = fused_leaky_relu(out, self.bias * self.lr_mul)
|
141 |
-
|
142 |
-
else:
|
143 |
-
out = F.linear(
|
144 |
-
input, self.weight * self.scale, bias=self.bias * self.lr_mul
|
145 |
-
)
|
146 |
-
|
147 |
-
return out
|
148 |
-
|
149 |
-
def __repr__(self):
|
150 |
-
return (
|
151 |
-
f'{self.__class__.__name__}({self.weight.shape[1]}, {self.weight.shape[0]})'
|
152 |
-
)
|
153 |
-
|
154 |
-
|
155 |
-
class ScaledLeakyReLU(nn.Module):
|
156 |
-
def __init__(self, negative_slope=0.2):
|
157 |
-
super().__init__()
|
158 |
-
|
159 |
-
self.negative_slope = negative_slope
|
160 |
-
|
161 |
-
def forward(self, input):
|
162 |
-
out = F.leaky_relu(input, negative_slope=self.negative_slope)
|
163 |
-
|
164 |
-
return out * math.sqrt(2)
|
165 |
-
|
166 |
-
|
167 |
-
class Blur(nn.Module):
|
168 |
-
def __init__(self, kernel, pad, upsample_factor=1):
|
169 |
-
super().__init__()
|
170 |
-
|
171 |
-
kernel = make_kernel(kernel)
|
172 |
-
|
173 |
-
if upsample_factor > 1:
|
174 |
-
kernel = kernel * (upsample_factor ** 2)
|
175 |
-
|
176 |
-
self.register_buffer('kernel', kernel)
|
177 |
-
|
178 |
-
self.pad = pad
|
179 |
-
|
180 |
-
def forward(self, input):
|
181 |
-
out = upfirdn2d(input, self.kernel, pad=self.pad)
|
182 |
-
|
183 |
-
return out
|
184 |
-
|
185 |
-
|
186 |
-
def make_kernel(k):
|
187 |
-
k = torch.tensor(k, dtype=torch.float32)
|
188 |
-
|
189 |
-
if k.ndim == 1:
|
190 |
-
k = k[None, :] * k[:, None]
|
191 |
-
|
192 |
-
k /= k.sum()
|
193 |
-
|
194 |
-
return k
|
195 |
-
|
196 |
-
|
197 |
-
class Upsample(nn.Module):
|
198 |
-
def __init__(self, kernel, factor=2):
|
199 |
-
super().__init__()
|
200 |
-
|
201 |
-
self.factor = factor
|
202 |
-
kernel = make_kernel(kernel) * (factor ** 2)
|
203 |
-
self.register_buffer('kernel', kernel)
|
204 |
-
|
205 |
-
p = kernel.shape[0] - factor
|
206 |
-
|
207 |
-
pad0 = (p + 1) // 2 + factor - 1
|
208 |
-
pad1 = p // 2
|
209 |
-
|
210 |
-
self.pad = (pad0, pad1)
|
211 |
-
|
212 |
-
def forward(self, input):
|
213 |
-
out = upfirdn2d(input, self.kernel, up=self.factor, down=1, pad=self.pad)
|
214 |
-
|
215 |
-
return out
|
216 |
-
|
217 |
-
|
218 |
-
class Downsample(nn.Module):
|
219 |
-
def __init__(self, kernel, factor=2):
|
220 |
-
super().__init__()
|
221 |
-
|
222 |
-
self.factor = factor
|
223 |
-
kernel = make_kernel(kernel)
|
224 |
-
self.register_buffer('kernel', kernel)
|
225 |
-
|
226 |
-
p = kernel.shape[0] - factor
|
227 |
-
|
228 |
-
pad0 = (p + 1) // 2
|
229 |
-
pad1 = p // 2
|
230 |
-
|
231 |
-
self.pad = (pad0, pad1)
|
232 |
-
|
233 |
-
def forward(self, input):
|
234 |
-
out = upfirdn2d(input, self.kernel, up=1, down=self.factor, pad=self.pad)
|
235 |
-
|
236 |
-
return out
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Anonymous-sub/Rerender/ControlNet/annotator/uniformer/mmseg/core/seg/sampler/base_pixel_sampler.py
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
from abc import ABCMeta, abstractmethod
|
2 |
-
|
3 |
-
|
4 |
-
class BasePixelSampler(metaclass=ABCMeta):
|
5 |
-
"""Base class of pixel sampler."""
|
6 |
-
|
7 |
-
def __init__(self, **kwargs):
|
8 |
-
pass
|
9 |
-
|
10 |
-
@abstractmethod
|
11 |
-
def sample(self, seg_logit, seg_label):
|
12 |
-
"""Placeholder for sample function."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AntNikYab/NaturalLanguageProcessing/pages/mayakovsky.py
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
import textwrap
|
3 |
-
import torch
|
4 |
-
from transformers import GPT2LMHeadModel, GPT2Tokenizer
|
5 |
-
|
6 |
-
DEVICE = torch.device("cpu")
|
7 |
-
# Load GPT-2 model and tokenizer
|
8 |
-
tokenizer = GPT2Tokenizer.from_pretrained('sberbank-ai/rugpt3small_based_on_gpt2')
|
9 |
-
model_finetuned = GPT2LMHeadModel.from_pretrained(
|
10 |
-
'sberbank-ai/rugpt3small_based_on_gpt2',
|
11 |
-
output_attentions = False,
|
12 |
-
output_hidden_states = False,
|
13 |
-
)
|
14 |
-
if torch.cuda.is_available():
|
15 |
-
model_finetuned.load_state_dict(torch.load('models/mayakovsky.pt'))
|
16 |
-
else:
|
17 |
-
model_finetuned.load_state_dict(torch.load('models/mayakovsky.pt', map_location=torch.device('cpu')))
|
18 |
-
model_finetuned.eval()
|
19 |
-
|
20 |
-
# Function to generate text
|
21 |
-
def generate_text(prompt, temperature, top_p, max_length, top_k):
|
22 |
-
input_ids = tokenizer.encode(prompt, return_tensors="pt")
|
23 |
-
|
24 |
-
with torch.no_grad():
|
25 |
-
out = model_finetuned.generate(
|
26 |
-
input_ids,
|
27 |
-
do_sample=True,
|
28 |
-
num_beams=5,
|
29 |
-
temperature=temperature,
|
30 |
-
top_p=top_p,
|
31 |
-
max_length=max_length,
|
32 |
-
top_k=top_k,
|
33 |
-
no_repeat_ngram_size=3,
|
34 |
-
num_return_sequences=1,
|
35 |
-
)
|
36 |
-
|
37 |
-
generated_text = list(map(tokenizer.decode, out))
|
38 |
-
return generated_text
|
39 |
-
|
40 |
-
# Streamlit app
|
41 |
-
def main():
|
42 |
-
st.title("Генерация текста GPT-моделью в стиле В.В. Маяковского")
|
43 |
-
|
44 |
-
# User inputs
|
45 |
-
prompt = st.text_area("Введите начало текста")
|
46 |
-
temperature = st.slider("Temperature", min_value=0.2, max_value=2.5, value=1.8, step=0.1)
|
47 |
-
top_p = st.slider("Top-p", min_value=0.1, max_value=1.0, value=0.9, step=0.1)
|
48 |
-
max_length = st.slider("Max Length", min_value=10, max_value=300, value=100, step=10)
|
49 |
-
top_k = st.slider("Top-k", min_value=1, max_value=500, value=500, step=10)
|
50 |
-
num_return_sequences = st.slider("Number of Sequences", min_value=1, max_value=5, value=1, step=1)
|
51 |
-
|
52 |
-
if st.button("Generate Text"):
|
53 |
-
st.subheader("Generated Text:")
|
54 |
-
for i in range(num_return_sequences):
|
55 |
-
generated_text = generate_text(prompt, temperature, top_p, max_length, top_k)
|
56 |
-
st.write(f"Generated Text {i + 1}:")
|
57 |
-
wrapped_text = textwrap.fill(generated_text[0], width=80)
|
58 |
-
st.write(wrapped_text)
|
59 |
-
st.write("------------------")
|
60 |
-
|
61 |
-
st.sidebar.image('images/mayakovsky.jpeg', use_column_width=True)
|
62 |
-
|
63 |
-
if __name__ == "__main__":
|
64 |
-
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Apex-X/GODROOP/app.py
DELETED
@@ -1,72 +0,0 @@
|
|
1 |
-
# -* coding:UTF-8 -*
|
2 |
-
# !/usr/bin/env python
|
3 |
-
import numpy as np
|
4 |
-
import gradio as gr
|
5 |
-
import roop.globals
|
6 |
-
from roop.core import (
|
7 |
-
start,
|
8 |
-
decode_execution_providers,
|
9 |
-
suggest_max_memory,
|
10 |
-
suggest_execution_threads,
|
11 |
-
)
|
12 |
-
from roop.processors.frame.core import get_frame_processors_modules
|
13 |
-
from roop.utilities import normalize_output_path
|
14 |
-
import os
|
15 |
-
from PIL import Image
|
16 |
-
|
17 |
-
|
18 |
-
def swap_face(source_file, target_file,doFaceEnhancer):
|
19 |
-
|
20 |
-
source_path = "input.jpg"
|
21 |
-
target_path = "target.jpg"
|
22 |
-
|
23 |
-
source_image = Image.fromarray(source_file)
|
24 |
-
source_image.save(source_path)
|
25 |
-
target_image = Image.fromarray(target_file)
|
26 |
-
target_image.save(target_path)
|
27 |
-
|
28 |
-
print("source_path: ", source_path)
|
29 |
-
print("target_path: ", target_path)
|
30 |
-
|
31 |
-
roop.globals.source_path = source_path
|
32 |
-
roop.globals.target_path = target_path
|
33 |
-
output_path = "output.jpg"
|
34 |
-
roop.globals.output_path = normalize_output_path(
|
35 |
-
roop.globals.source_path, roop.globals.target_path, output_path
|
36 |
-
)
|
37 |
-
if doFaceEnhancer == True:
|
38 |
-
roop.globals.frame_processors = ["face_swapper","face_enhancer"]
|
39 |
-
else:
|
40 |
-
roop.globals.frame_processors = ["face_swapper"]
|
41 |
-
roop.globals.headless = True
|
42 |
-
roop.globals.keep_fps = True
|
43 |
-
roop.globals.keep_audio = True
|
44 |
-
roop.globals.keep_frames = False
|
45 |
-
roop.globals.many_faces = False
|
46 |
-
roop.globals.video_encoder = "libx264"
|
47 |
-
roop.globals.video_quality = 18
|
48 |
-
roop.globals.max_memory = suggest_max_memory()
|
49 |
-
roop.globals.execution_providers = decode_execution_providers(["cuda"])
|
50 |
-
roop.globals.execution_threads = suggest_execution_threads()
|
51 |
-
|
52 |
-
print(
|
53 |
-
"start process",
|
54 |
-
roop.globals.source_path,
|
55 |
-
roop.globals.target_path,
|
56 |
-
roop.globals.output_path,
|
57 |
-
)
|
58 |
-
|
59 |
-
for frame_processor in get_frame_processors_modules(
|
60 |
-
roop.globals.frame_processors
|
61 |
-
):
|
62 |
-
if not frame_processor.pre_check():
|
63 |
-
return
|
64 |
-
|
65 |
-
start()
|
66 |
-
return output_path
|
67 |
-
|
68 |
-
|
69 |
-
app = gr.Interface(
|
70 |
-
fn=swap_face, inputs=[gr.Image(), gr.Image(),gr.Checkbox(label="face_enhancer?", info="do face enhancer?")], outputs="image"
|
71 |
-
)
|
72 |
-
app.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Artrajz/vits-simple-api/vits/text/ngu_dialect.py
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
import re
|
2 |
-
import opencc
|
3 |
-
|
4 |
-
|
5 |
-
dialects = {'SZ': 'suzhou', 'WX': 'wuxi', 'CZ': 'changzhou', 'HZ': 'hangzhou',
|
6 |
-
'SX': 'shaoxing', 'NB': 'ningbo', 'JJ': 'jingjiang', 'YX': 'yixing',
|
7 |
-
'JD': 'jiading', 'ZR': 'zhenru', 'PH': 'pinghu', 'TX': 'tongxiang',
|
8 |
-
'JS': 'jiashan', 'HN': 'xiashi', 'LP': 'linping', 'XS': 'xiaoshan',
|
9 |
-
'FY': 'fuyang', 'RA': 'ruao', 'CX': 'cixi', 'SM': 'sanmen',
|
10 |
-
'TT': 'tiantai', 'WZ': 'wenzhou', 'SC': 'suichang', 'YB': 'youbu'}
|
11 |
-
|
12 |
-
converters = {}
|
13 |
-
|
14 |
-
for dialect in dialects.values():
|
15 |
-
try:
|
16 |
-
converters[dialect] = opencc.OpenCC(dialect)
|
17 |
-
except:
|
18 |
-
pass
|
19 |
-
|
20 |
-
|
21 |
-
def ngu_dialect_to_ipa(text, dialect):
|
22 |
-
dialect = dialects[dialect]
|
23 |
-
text = converters[dialect].convert(text).replace('-','').replace('$',' ')
|
24 |
-
text = re.sub(r'[、;:]', ',', text)
|
25 |
-
text = re.sub(r'\s*,\s*', ', ', text)
|
26 |
-
text = re.sub(r'\s*。\s*', '. ', text)
|
27 |
-
text = re.sub(r'\s*?\s*', '? ', text)
|
28 |
-
text = re.sub(r'\s*!\s*', '! ', text)
|
29 |
-
text = re.sub(r'\s*$', '', text)
|
30 |
-
return text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Autopixel/blurry-faces/kornia_benchmark.py
DELETED
@@ -1,63 +0,0 @@
|
|
1 |
-
import cv2
|
2 |
-
import gradio as gr
|
3 |
-
from PIL import Image
|
4 |
-
import numpy as np
|
5 |
-
import torch
|
6 |
-
import kornia as K
|
7 |
-
from kornia.contrib import FaceDetector, FaceDetectorResult
|
8 |
-
import time
|
9 |
-
|
10 |
-
device = torch.device('cpu')
|
11 |
-
face_detection = FaceDetector().to(device)
|
12 |
-
|
13 |
-
def scale_image(img: np.ndarray, size: int) -> np.ndarray:
|
14 |
-
h, w = img.shape[:2]
|
15 |
-
scale = 1. * size / w
|
16 |
-
return cv2.resize(img, (int(w * scale), int(h * scale)))
|
17 |
-
|
18 |
-
|
19 |
-
def apply_blur_face(img: torch.Tensor, img_vis: np.ndarray, det: FaceDetectorResult):
|
20 |
-
# crop the face
|
21 |
-
x1, y1 = det.xmin.int(), det.ymin.int()
|
22 |
-
x2, y2 = det.xmax.int(), det.ymax.int()
|
23 |
-
roi = img[..., y1:y2, x1:x2]
|
24 |
-
#print(roi.shape)
|
25 |
-
if roi.shape[-1]==0 or roi.shape[-2]==0:
|
26 |
-
return
|
27 |
-
|
28 |
-
# apply blurring and put back to the visualisation image
|
29 |
-
roi = K.filters.gaussian_blur2d(roi, (21, 21), (100., 100.))
|
30 |
-
roi = K.color.rgb_to_bgr(roi)
|
31 |
-
img_vis[y1:y2, x1:x2] = K.tensor_to_image(roi)
|
32 |
-
|
33 |
-
|
34 |
-
def run(image):
|
35 |
-
image.thumbnail((1280, 1280))
|
36 |
-
img_raw = np.array(image)
|
37 |
-
|
38 |
-
# preprocess
|
39 |
-
img = K.image_to_tensor(img_raw, keepdim=False).to(device)
|
40 |
-
img = K.color.bgr_to_rgb(img.float())
|
41 |
-
|
42 |
-
with torch.no_grad():
|
43 |
-
dets = face_detection(img)
|
44 |
-
dets = [FaceDetectorResult(o) for o in dets]
|
45 |
-
|
46 |
-
img_vis = img_raw.copy()
|
47 |
-
|
48 |
-
for b in dets:
|
49 |
-
if b.score < 0.5:
|
50 |
-
continue
|
51 |
-
|
52 |
-
apply_blur_face(img, img_vis, b)
|
53 |
-
|
54 |
-
return Image.fromarray(img_vis)
|
55 |
-
|
56 |
-
if __name__ == "__main__":
|
57 |
-
|
58 |
-
start = time.time()
|
59 |
-
for _ in range(100):
|
60 |
-
image = Image.open("./images/crowd.jpeg")
|
61 |
-
_ = run(image)
|
62 |
-
|
63 |
-
print('It took', (time.time()-start)/100, 'seconds.')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/dev/packaging/README.md
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
|
2 |
-
## To build a cu101 wheel for release:
|
3 |
-
|
4 |
-
```
|
5 |
-
$ nvidia-docker run -it --storage-opt "size=20GB" --name pt pytorch/manylinux-cuda101
|
6 |
-
# inside the container:
|
7 |
-
# git clone https://github.com/facebookresearch/detectron2/
|
8 |
-
# cd detectron2
|
9 |
-
# export CU_VERSION=cu101 D2_VERSION_SUFFIX= PYTHON_VERSION=3.7 PYTORCH_VERSION=1.8
|
10 |
-
# ./dev/packaging/build_wheel.sh
|
11 |
-
```
|
12 |
-
|
13 |
-
## To build all wheels for combinations of CUDA and Python
|
14 |
-
```
|
15 |
-
./dev/packaging/build_all_wheels.sh
|
16 |
-
./dev/packaging/gen_wheel_index.sh /path/to/wheels
|
17 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Banbri/zcvzcv/src/components/ui/tooltip.tsx
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
"use client"
|
2 |
-
|
3 |
-
import * as React from "react"
|
4 |
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip"
|
5 |
-
|
6 |
-
import { cn } from "@/lib/utils"
|
7 |
-
|
8 |
-
const TooltipProvider = TooltipPrimitive.Provider
|
9 |
-
|
10 |
-
const Tooltip = TooltipPrimitive.Root
|
11 |
-
|
12 |
-
const TooltipTrigger = TooltipPrimitive.Trigger
|
13 |
-
|
14 |
-
const TooltipContent = React.forwardRef<
|
15 |
-
React.ElementRef<typeof TooltipPrimitive.Content>,
|
16 |
-
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
|
17 |
-
>(({ className, sideOffset = 4, ...props }, ref) => (
|
18 |
-
<TooltipPrimitive.Content
|
19 |
-
ref={ref}
|
20 |
-
sideOffset={sideOffset}
|
21 |
-
className={cn(
|
22 |
-
"z-50 overflow-hidden rounded-md border border-stone-200 bg-white px-3 py-1.5 text-sm text-stone-950 shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-stone-800 dark:bg-stone-950 dark:text-stone-50",
|
23 |
-
className
|
24 |
-
)}
|
25 |
-
{...props}
|
26 |
-
/>
|
27 |
-
))
|
28 |
-
TooltipContent.displayName = TooltipPrimitive.Content.displayName
|
29 |
-
|
30 |
-
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Basil2k4/botbasil203/src/create_user_and_fix_permissions.sh
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
#!/bin/bash
|
2 |
-
## Creates an ordinary non-root VNC_USER and calls the script to fix the file permissions
|
3 |
-
|
4 |
-
### every exit != 0 fails the script
|
5 |
-
set -e
|
6 |
-
set -u
|
7 |
-
|
8 |
-
UNAME=0
|
9 |
-
UGROUP=0
|
10 |
-
|
11 |
-
if [[ -n "${VNC_USER}" ]] ; then
|
12 |
-
case "$VNC_USER" in
|
13 |
-
root|0) UNAME=root; UGROUP=$UNAME;; # exact match
|
14 |
-
root:*|0:*) UNAME=root; UGROUP=$UNAME;; # match from the beginning
|
15 |
-
*:root|*:0) UNAME=root; UGROUP=$UNAME;; # match at the end
|
16 |
-
*) UNAME=${VNC_USER/%:*/}; UGROUP=${VNC_USER/#*:/};; # else case
|
17 |
-
esac
|
18 |
-
|
19 |
-
if [[ "$UGROUP" != "" && "$UGROUP" != "root" ]] ; then
|
20 |
-
|
21 |
-
### Creates the group only if it does not exist yet
|
22 |
-
echo "Creating group $UGROUP if needed"
|
23 |
-
groupadd -f $UGROUP
|
24 |
-
|
25 |
-
### Returns "0" if the user exists, or "1" otherwise
|
26 |
-
missing_user=$(id -u $UNAME > /dev/null 2>&1; echo $?)
|
27 |
-
|
28 |
-
if [[ $missing_user != 0 ]] ; then
|
29 |
-
echo "Creating non-root user \"$VNC_USER\"."
|
30 |
-
useradd --no-log-init --gid $UGROUP --home-dir $HOME --shell /bin/bash --password $VNC_PW $UNAME
|
31 |
-
fi
|
32 |
-
else
|
33 |
-
echo "Will not create root user \"$VNC_USER\"."
|
34 |
-
fi
|
35 |
-
fi
|
36 |
-
|
37 |
-
FIXING="Fixing permissions: "
|
38 |
-
|
39 |
-
for var in "$@"
|
40 |
-
do
|
41 |
-
echo "$FIXING $var"
|
42 |
-
find "$var"/ -name '*.sh' -exec chmod a+x {} +
|
43 |
-
find "$var"/ -name '*.desktop' -exec chmod a+x {} +
|
44 |
-
|
45 |
-
### folder and its content belong to the group zero (recursively)
|
46 |
-
chgrp -R 0 "$var" && chmod -R -v a+rw "$var" && find "$var" -type d -exec chmod -v a+x {} +
|
47 |
-
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Bicicleta Real De Carreras Mod Apkdone.md
DELETED
@@ -1,84 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Real Bike Racing Mod APKDone: Una revisión</h1>
|
3 |
-
<p>Si usted es un fan de los juegos de carreras de motos, es posible que haya oído hablar de Real Bike Racing, un juego popular que le permite experimentar la emoción de montar una superbike en varias pistas. ¿Pero sabías que hay una versión modificada de este juego que te da dinero ilimitado y acceso a todas las funciones? En este artículo, vamos a revisar Real Bike Racing Mod APKDone, un sitio web que proporciona la versión modificada del juego de forma gratuita. También te diremos por qué deberías jugar a este juego y cómo descargarlo e instalarlo en tu dispositivo. </p>
|
4 |
-
<h2>bicicleta real de carreras mod apkdone</h2><br /><p><b><b>Download</b> 🆓 <a href="https://bltlly.com/2v6KK4">https://bltlly.com/2v6KK4</a></b></p><br /><br />
|
5 |
-
<h2>¿Qué es Real Bike Racing? </h2>
|
6 |
-
<p>Real Bike Racing es un juego desarrollado por Italic Games, un estudio especializado en crear juegos de carreras realistas e inmersivos. El juego fue lanzado en 2016 y desde entonces ha ganado más de 100 millones de descargas en Google Play Store. El juego está clasificado 4.1 de 5 estrellas por más de 600 mil usuarios. </p>
|
7 |
-
<h3>Características de Real Bike Racing</h3>
|
8 |
-
<p>Real Bike Racing tiene muchas características que lo convierten en uno de los mejores juegos de carreras de motos en el mercado. Estos son algunos de ellos:</p>
|
9 |
-
<h4>Impresionantes gráficos 3D</h4>
|
10 |
-
<p>El juego cuenta con gráficos de alta calidad que crean un entorno realista e inmersivo para los jugadores. Puedes ver los detalles de las bicicletas, las pistas, el clima y los alrededores. El juego también soporta el modo VR, que te permite disfrutar del juego de una manera más inmersiva. </p>
|
11 |
-
<h4>Múltiples modos de juego</h4>
|
12 |
-
<p>El juego ofrece varios modos de juego para adaptarse a sus preferencias y habilidades. Puedes elegir entre el modo Carrera, donde puedes competir en diferentes campeonatos y desbloquear nuevas bicicletas y pistas; el modo Contrarreloj, donde puedes probar tu velocidad y habilidades contra el reloj; o el modo VR, donde puedes experimentar el juego en realidad virtual. </p>
|
13 |
-
<h4>Física realista y efectos de sonido</h4>
|
14 |
-
|
15 |
-
<h4>Más de 10 tipos de superbikes para elegir</h4>
|
16 |
-
<p>El juego cuenta con más de 10 tipos de superbikes que puedes personalizar y actualizar según tus preferencias. Puede elegir entre diferentes marcas, modelos, colores y piezas. También puedes comparar las estadísticas y el rendimiento de cada bicicleta antes de comprarla o usarla. </p>
|
17 |
-
<p></p>
|
18 |
-
<h3>¿Qué es Real Bike Racing Mod APKDone? </h3>
|
19 |
-
<p>Real Bike Racing Mod APKDone es un sitio web que proporciona la versión modificada de Real Bike Racing de forma gratuita. La versión modificada del juego tiene algunas ventajas sobre la versión original, como:</p>
|
20 |
-
<h4>Beneficios de usar Real Bike Racing Mod APKDone</h4>
|
21 |
-
<ul>
|
22 |
-
<li>Obtienes dinero ilimitado para comprar y actualizar cualquier bicicleta que quieras. </li>
|
23 |
-
<li>Obtienes acceso a todas las características y modos del juego sin ninguna restricción. </li>
|
24 |
-
<li>Te deshaces de los molestos anuncios que interrumpen tu juego. </li>
|
25 |
-
<li>Obtienes un mejor rendimiento y estabilidad en tu dispositivo. </li>
|
26 |
-
</ul>
|
27 |
-
<h4> Cómo descargar e instalar Real Bike Racing Mod APKDone</h4>
|
28 |
-
<p>Para descargar e instalar Real Bike Racing Mod APKDone en su dispositivo, debe seguir estos sencillos pasos:</p>
|
29 |
-
<ol>
|
30 |
-
<li>Ir a <a href="( 1 )">https://apkdone.com/real-bike-racing/</a> en su navegador. </li>
|
31 |
-
<li>Haga clic en el botón "Descargar" y espere a que el archivo se descargue <li>Localice el archivo descargado en su dispositivo y toque en él para instalarlo. Es posible que necesite habilitar "Fuentes desconocidas" en su configuración para permitir la instalación. </li>
|
32 |
-
<li> Iniciar el juego y disfrutar de las características modded. </li>
|
33 |
-
</ol>
|
34 |
-
<h2>¿Por qué deberías jugar Real Bike Racing Mod APKDone? </h2>
|
35 |
-
<p>Real Bike Racing Mod APKDone es un gran juego para cualquier persona que ama las carreras de motos y quiere tener más diversión y libertad en su juego. Aquí hay algunas razones por las que deberías jugar a este juego:</p>
|
36 |
-
<h3> Pros y contras de Real Bike Racing Mod APKDone</h3>
|
37 |
-
<p>Como cualquier otro juego, Real Bike Racing Mod APKDone tiene sus pros y sus contras. Aquí están algunos de ellos:</p>
|
38 |
-
<tabla>
|
39 |
-
<tr>
|
40 |
-
<th>Pros</th>
|
41 |
-
|
42 |
-
</tr>
|
43 |
-
<tr>
|
44 |
-
<td>Puedes disfrutar de dinero ilimitado y acceso a todas las características y modos del juego. </td>
|
45 |
-
<td>Puede encontrar algunos errores o fallos en la versión modificada del juego. </td>
|
46 |
-
</tr>
|
47 |
-
<tr>
|
48 |
-
<td>Puedes personalizar y actualizar tus bicicletas tanto como quieras. </td>
|
49 |
-
<td>Puedes perder el desafío y la emoción del juego si tienes todo desbloqueado. </td>
|
50 |
-
</tr>
|
51 |
-
<tr>
|
52 |
-
<td>Puedes jugar el juego sin anuncios ni interrupciones. </td>
|
53 |
-
<td>Puedes perderte algunas actualizaciones o características que están disponibles en la versión original del juego. </td>
|
54 |
-
</tr>
|
55 |
-
</tabla>
|
56 |
-
<h3> Consejos y trucos para jugar Real Bike Racing Mod APKDone</h3>
|
57 |
-
<p>Si quieres mejorar tus habilidades y rendimiento en Real Bike Racing Mod APKDone, aquí tienes algunos consejos y trucos que puedes usar:</p>
|
58 |
-
<ul>
|
59 |
-
<li>Elige la bicicleta que se adapte a tu estilo y preferencia. Cada moto tiene diferentes estadísticas y rendimiento, por lo que necesitas encontrar la que funcione mejor para ti. </li>
|
60 |
-
<li>Utilice los controles de inclinación o toque para dirigir su bicicleta. También puede ajustar la sensibilidad y la capacidad de respuesta de los controles en la configuración. </li>
|
61 |
-
<li> Utilice los botones de freno y nitro sabiamente. Es necesario frenar en el momento adecuado para evitar estrellarse o perder velocidad. También necesitas usar el nitro en el momento adecuado para aumentar tu velocidad y superar a tus oponentes. </li>
|
62 |
-
<li>Practica en diferentes pistas y modos. Puedes aprender el diseño y las características de cada pista reproduciéndolas repetidamente. También puedes probar diferentes modos para desafiarte y poner a prueba tus habilidades. </li>
|
63 |
-
<li>Ver vídeos o leer guías en línea. Usted puede encontrar muchos videos o guías en línea que le puede enseñar cómo jugar Real Bike Racing mejor. También puedes aprender de otros jugadores que tienen más experiencia o habilidad que tú. </li>
|
64 |
-
</ul>
|
65 |
-
<h2>Conclusión</h2>
|
66 |
-
|
67 |
-
<h3>Preguntas frecuentes</h3>
|
68 |
-
<p>Aquí hay algunas preguntas frecuentes sobre Real Bike Racing Mod APKDone:</p>
|
69 |
-
<ol>
|
70 |
-
<li> ¿Es seguro usar Real Bike Racing Mod APKDone? </li>
|
71 |
-
<p>Sí, Real Bike Racing Mod APKDone es seguro de usar siempre y cuando lo descargue de un sitio web de confianza como <a href="">https://apkdone.com/real-bike-racing/</a>. Sin embargo, siempre debes tener cuidado al descargar e instalar cualquier juego modificado o hackeado en tu dispositivo, ya que pueden contener virus o malware que pueden dañar tu dispositivo o comprometer tu privacidad. </p>
|
72 |
-
<li> ¿Es Real Bike Racing Mod APKDone compatible con mi dispositivo? </li>
|
73 |
-
<p>Real Bike Racing Mod APKDone es compatible con la mayoría de los dispositivos Android que tienen Android 4.0 o superior. Sin embargo, es posible que algunos dispositivos no admitan algunas características o modos del juego, como el modo VR. Puedes comprobar la compatibilidad de tu dispositivo leyendo la descripción o reseñas del juego en <a href="">https://apkdone.com/real-bike-racing/</a>. </p>
|
74 |
-
<li> ¿Cómo puedo actualizar Real Bike Racing Mod APK hecho? APKDone? </li>
|
75 |
-
<p>Para actualizar Real Bike Racing Mod APKDone, necesitas visitar <a href="">https://apkdone.com/real-bike-racing/</a> y descargar la última versión del juego. También puede consultar el sitio web para cualquier noticia o actualizaciones sobre el juego. Sin embargo, es posible que tenga que desinstalar la versión anterior del juego antes de instalar el nuevo, ya que pueden no ser compatibles entre sí. </p>
|
76 |
-
<li> ¿Cómo puedo desinstalar Real Bike Racing Mod APKDone? </li>
|
77 |
-
<p>Para desinstalar Real Bike Racing Mod APKDone, es necesario ir a la configuración de su dispositivo y encontrar el administrador de aplicaciones o lista de aplicaciones. A continuación, es necesario encontrar y seleccionar Real Bike Racing Mod APKDone y toque en el "Desinstalar" botón. También puede eliminar el archivo descargado del almacenamiento de su dispositivo si desea liberar espacio. </p>
|
78 |
-
<li>¿Puedo jugar Real Bike Racing Mod APKDone en línea o fuera de línea? </li>
|
79 |
-
|
80 |
-
<li>¿Puedo jugar Real Bike Racing Mod APKDone con mis amigos? </li>
|
81 |
-
<p>Sí, puedes jugar Real Bike Racing Mod APKDone con tus amigos si tienes una conexión a Internet y una cuenta de Google Play. Puedes invitar a tus amigos a unirse a ti en el modo multijugador, donde puedes competir entre sí en diferentes pistas. También puedes chatear con tus amigos y compartir tus puntajes y logros con ellos. </p>
|
82 |
-
</ol></p> 64aa2da5cf<br />
|
83 |
-
<br />
|
84 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Cmo Hacer Un Simulador De Cabra.md
DELETED
@@ -1,63 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Patear el amigo VIP APK: Un juego divertido y de alivio del estrés</h1>
|
3 |
-
<p>¿Alguna vez te sientes enojado, frustrado o aburrido y deseas poder ventilar tus emociones en algo o alguien? ¿Alguna vez fantaseas con tener un arsenal ilimitado de armas y objetos para destruir todo lo que quieras? Si respondiste sí a cualquiera de estas preguntas, entonces es posible que desee probar Kick the Buddy VIP APK, una versión modificada de un popular juego para Android que le permite hacer todo eso y más. </p>
|
4 |
-
<h2>¿Qué es Kick the Buddy? </h2>
|
5 |
-
<p>Kick the Buddy es un juego donde se puede dar rienda suelta a su creatividad y agresión en un muñeco de trapo llamado Buddy. Puedes usar varias armas y objetos para causarle dolor y daños, como cohetes, granadas, pistolas, cuchillos, martillos, sierras, tijeras, fuego, hielo, electricidad, ácido e incluso una bomba nuclear. También puede personalizar su apariencia y vestirlo con diferentes trajes. El juego no tiene reglas ni límites, así que puedes hacer lo que quieras con Buddy.</p>
|
6 |
-
<h2>Cómo hacer un simulador de cabra</h2><br /><p><b><b>Download Zip</b> ✵✵✵ <a href="https://bltlly.com/2v6KqP">https://bltlly.com/2v6KqP</a></b></p><br /><br />
|
7 |
-
<p>Kick the Buddy es también un juego con una variedad de armas y objetos para elegir. Puedes desbloquear nuevas armas y objetos ganando dinero y oro en el juego. También puedes comprarlos con dinero real a través de compras en la aplicación. Algunas de las armas y artículos se clasifican en temas, como horror, fantasía, ciencia ficción, deportes, animales, comida, etc. Cada tema tiene sus propios efectos y sonidos únicos. </p>
|
8 |
-
<p>Kick the Buddy es también un juego con física y gráficos realistas. El juego utiliza un motor de física que simula cómo se comportan los objetos en la vida real. Por ejemplo, cuando le lanzas una granada a Buddy, se alejará volando de la explosión. Cuando lo cortas con un cuchillo, sangra. Cuando lo congeles con hielo, se estremecerá. El juego también tiene gráficos coloridos y detallados que hacen que Buddy parezca vivo (o muerto). </p>
|
9 |
-
<h2>¿Qué es Kick the Buddy VIP APK? </h2>
|
10 |
-
|
11 |
-
<p>Kick the Buddy VIP APK es una versión que le da dinero ilimitado, oro y diamantes para comprar todo lo que quieras en el juego. Usted no tiene que ganar o gastar dinero real para desbloquear nuevas armas y objetos. También puedes usar estos recursos para mejorar tus armas y objetos para hacerlos más poderosos y efectivos. </p>
|
12 |
-
<p>Kick the Buddy VIP APK es también una versión que desbloquea todas las armas y objetos en el juego. No tienes que completar ninguna tarea o logro para acceder a ellos. Puedes usar cualquier arma o artículo de cualquier tema en cualquier momento. También puede mezclar y combinar diferentes armas y objetos para crear diferentes combinaciones y efectos. Por ejemplo, puedes usar una motosierra y un lanzallamas para cortar y quemar a Buddy al mismo tiempo. </p>
|
13 |
-
<h2>Cómo descargar e instalar Kick the Buddy VIP APK? </h2>
|
14 |
-
<p>Para descargar e instalar Kick the Buddy VIP APK en su dispositivo Android, es necesario seguir estos pasos:</p>
|
15 |
-
<ol>
|
16 |
-
<li>Ir a un sitio web de confianza que proporciona el archivo APK. Puede buscar "Kick the Buddy VIP APK" en Google o Bing y elegir uno de los resultados. Asegúrese de que el sitio web esté seguro antes de descargar nada. </li>
|
17 |
-
<li>Descargar el archivo APK a su dispositivo. Es posible que tenga que habilitar la opción de instalar aplicaciones de fuentes desconocidas en la configuración del dispositivo. Esto le permitirá instalar aplicaciones que no son de Google Play Store u otras tiendas de aplicaciones oficiales. </li>
|
18 |
-
<li>Busque el archivo APK en el almacenamiento del dispositivo y toque en él para instalarlo. Es posible que deba conceder algunos permisos a la aplicación, como el acceso a su almacenamiento, cámara, micrófono, etc. Estos permisos son necesarios para que la aplicación funcione correctamente. </li>
|
19 |
-
<li>Espere a que la instalación termine y luego inicie la aplicación. Ahora puedes disfrutar jugando Kick the Buddy VIP APK con recursos ilimitados y todas las armas y artículos desbloqueados. </li>
|
20 |
-
</ol>
|
21 |
-
<p>Antes de instalar el archivo APK, usted debe tomar algunas precauciones para evitar cualquier problema o riesgo. Usted debe:</p>
|
22 |
-
<ul>
|
23 |
-
|
24 |
-
<li>Escanear el archivo APK con un antivirus o escáner de malware antes de instalarlo. Esto le ayudará a detectar cualquier virus o código malicioso que pueda dañar su dispositivo o comprometer su privacidad. </li>
|
25 |
-
<li>Lee los comentarios y valoraciones de la aplicación y el sitio web que la proporciona. Esto le ayudará a tener una idea de la calidad y la fiabilidad de la aplicación y el sitio web. Debes evitar descargar o instalar cualquier cosa que tenga comentarios negativos o sospechosos. </li>
|
26 |
-
</ul>
|
27 |
-
<p>Los permisos requeridos por el archivo APK son:</p>
|
28 |
-
<tabla>
|
29 |
-
<tr><th>Permiso</th><th>Descripción</th></tr>
|
30 |
-
<tr><td>Almacenamiento</td><td>Este permiso permite a la aplicación leer y escribir datos en el almacenamiento del dispositivo. Esto es necesario para guardar el progreso y la configuración del juego. </td></tr>
|
31 |
-
<tr><td>Cámara</td><td>Este permiso permite a la aplicación acceder a la cámara del dispositivo. Esto es necesario para tomar fotos de Buddy y compartirlas con tus amigos. </td></tr>
|
32 |
-
<tr><td>Micrófono</td><td>Este permiso permite a la aplicación acceder al micrófono del dispositivo. Esto es necesario para grabar su voz y agregar efectos de sonido a Buddy.</td></tr>
|
33 |
-
<tr><td>Información de conexión Wi-Fi</td><td>Este permiso permite a la aplicación ver información sobre su red Wi-Fi. Esto es necesario para conectarse a Internet y descargar nuevos contenidos para el juego. </td></tr>
|
34 |
-
<tr><td>Other</td><td>Este permiso permite a la aplicación acceder a otras características y configuraciones de su dispositivo, como vibración, acceso a la red, evitar que el dispositivo se duerma, etc. Estos son necesarios para mejorar su experiencia de juego y rendimiento. </td></tr>
|
35 |
-
</table> <h2>¿Por qué deberías jugar Kick the Buddy VIP APK? </h2>
|
36 |
-
<p>Hay muchas razones por las que debe jugar Kick the Buddy VIP APK en lugar del juego original. Aquí están algunos de ellos:</p>
|
37 |
-
<p></p>
|
38 |
-
<ul>
|
39 |
-
<li>Usted puede ahorrar su dinero y tiempo al obtener recursos ilimitados y todas las armas y artículos desbloqueados. No tienes que gastar dinero real o esperar horas para conseguir lo que quieres en el juego. </li>
|
40 |
-
|
41 |
-
<li>Usted puede aliviar su estrés y relajarse jugando el juego. Puedes desahogar tu ira y frustración en Buddy sin lastimar a nadie ni a nada en la vida real. También puedes reírte de las reacciones y sonidos de Buddy mientras sufre. </li>
|
42 |
-
</ul>
|
43 |
-
<p>Kick the Buddy VIP APK es un juego que puede proporcionarle entretenimiento, diversión y alivio. Es un juego que puede hacerte sentir feliz, relajado y creativo. Es un juego que debes probar si estás buscando un juego divertido y que alivie el estrés. </p>
|
44 |
-
<h2>Conclusión</h2>
|
45 |
-
<p>Kick the Buddy VIP APK es una versión modificada de un popular juego para Android que le permite dar rienda suelta a su creatividad y agresión en un muñeco de trapo llamado Buddy. Puedes usar varias armas y objetos para causarle dolor y daños, como cohetes, granadas, pistolas, cuchillos, martillos, sierras, tijeras, fuego, hielo, electricidad, ácido e incluso una bomba nuclear. También puedes personalizar su apariencia y vestirlo con diferentes atuendos. </p>
|
46 |
-
<p>Kick the Buddy VIP APK le da dinero ilimitado, oro y diamantes para comprar todo lo que quieras en el juego. También desbloquea todas las armas y objetos del juego. Puede descargar e instalar el archivo APK en su dispositivo Android de forma gratuita desde un sitio web de confianza. Usted debe tomar algunas precauciones antes de instalar el archivo APK, tales como copias de seguridad de sus datos, escanear el archivo, y la lectura de los comentarios. </p>
|
47 |
-
<p>Kick the Buddy VIP APK es un juego que puede proporcionarle entretenimiento, diversión y alivio. Es un juego que puede hacerte sentir feliz, relajado y creativo. Es un juego que debes probar si estás buscando un juego divertido y que alivie el estrés. </p>
|
48 |
-
<p>Si usted está interesado en jugar Kick the Buddy VIP APK, puede seguir este enlace para descargarlo: [texto]</p>
|
49 |
-
<h3>Preguntas frecuentes</h3>
|
50 |
-
<ol>
|
51 |
-
<li> ¿Cuál es la diferencia entre Kick the Buddy VIP APK y Kick the Buddy MOD APK? </li>
|
52 |
-
|
53 |
-
<li> ¿Es Kick the Buddy VIP APK seguro de descargar e instalar? </li>
|
54 |
-
<p>Kick the Buddy VIP APK es seguro de descargar e instalar si lo obtiene de un sitio web de confianza que proporciona el archivo original y libre de virus. También debe escanear el archivo con un antivirus o un escáner de malware antes de instalarlo. </p>
|
55 |
-
<li>¿Puedo jugar Kick the Buddy VIP APK offline? </li>
|
56 |
-
<p>Sí, puedes jugar Kick the Buddy VIP APK sin conexión a Internet. Sin embargo, algunas características y contenido pueden no estar disponibles o actualizados cuando juegas sin conexión. </p>
|
57 |
-
<li> ¿Puedo jugar Kick the Buddy VIP APK con mis amigos? </li>
|
58 |
-
<p>Sí, puedes jugar Kick the Buddy VIP APK con tus amigos compartiendo tus fotos y videos de Buddy con ellos. También puedes retarlos a ver quién puede destruir a Buddy de maneras más creativas. </p>
|
59 |
-
<li> ¿Cómo puedo contactar a los desarrolladores de Kick the Buddy VIP APK? </li>
|
60 |
-
<p>Puede ponerse en contacto con los desarrolladores de Kick the Buddy VIP APK enviándoles un correo electrónico a [correo electrónico] o visitando su sitio web en [texto]. </p>
|
61 |
-
</ol></p> 64aa2da5cf<br />
|
62 |
-
<br />
|
63 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Cricket League Mod Apk 1.8.1.md
DELETED
@@ -1,52 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Liga de cricket Mod APK 1.8.1: Un juego de cricket realista y emocionante para Android</h1>
|
3 |
-
<p>Si usted es un fanático del cricket y quiere jugar un juego de cricket 3D realista en su dispositivo Android, entonces usted debe probar Cricket League Mod APK 1.8.1. Esta es una versión modificada del juego original de Cricket League que ofrece dinero ilimitado, diamantes, desbloqueado todos los jugadores, compras gratis, anuncios mod gratis, siempre perfecto, todo, y características fáciles de usar. Usted puede descargar este juego de forma gratuita desde el enlace que aparece a continuación y disfrutar de jugar dos partidos rápidos sobre sus amigos o jugadores de todo el mundo en solo unos minutos. </p>
|
4 |
-
<h2>cricket league mod apk 1.8.1</h2><br /><p><b><b>Download File</b> ✵✵✵ <a href="https://bltlly.com/2v6KAe">https://bltlly.com/2v6KAe</a></b></p><br /><br />
|
5 |
-
<h2>¿Qué es Cricket League Mod APK 1.8.1? </h2>
|
6 |
-
<p>Cricket League Mod APK 1.8.1 es una versión modificada del juego original de la Liga de Cricket que es desarrollado por Miniclip.com. Este juego se basa en una liga de cricket real que se puede disfrutar jugando en sus dispositivos Android de forma gratuita. Tienes que construir tu propio equipo desde cero hasta el mejor, reclutar al mejor bateador, jugador de bolos y jugador todoterreno para hacer un equilibrio perfecto en tu equipo y dar una dura competencia a tu competidor. </p>
|
7 |
-
<h3>Características de Cricket League Mod APK 1.8.1</h3>
|
8 |
-
<p>Este juego viene con muchas características increíbles que lo hacen más divertido y emocionante para jugar. Algunas de las características son:</p>
|
9 |
-
<h4>Dinero y diamantes ilimitados</h4>
|
10 |
-
<p>Con este mod, obtendrás dinero ilimitado y diamantes que puedes usar para comprar lo que quieras en el juego. Puedes actualizar a tus jugadores, comprar nuevos equipos, personalizar el logo de tu equipo y mucho más. </p>
|
11 |
-
<p></p>
|
12 |
-
<h4>Desbloqueado todos los jugadores y compras gratuitas</h4>
|
13 |
-
<p>Este mod también desbloquea a todos los jugadores que están disponibles en el juego. Puede elegir cualquier jugador que desee para construir su equipo y jugar con ellos. También puedes comprar lo que quieras en el juego sin gastar dinero ni diamantes. </p>
|
14 |
-
<h4>Siempre perfecto y todo</h4>
|
15 |
-
|
16 |
-
<h4>Mod gratis y fácil de usar</h4>
|
17 |
-
<p>Este mod también elimina todos los anuncios molestos que aparecen mientras se juega el juego. Usted puede disfrutar de jugar el juego sin ninguna interrupción o distracción. El mod también tiene una interfaz fácil de usar y controles fáciles que hacen que sea fácil de jugar. </p>
|
18 |
-
<h3>Cómo descargar e instalar Cricket League Mod APK 1.8.1? </h3>
|
19 |
-
<p>Para descargar e instalar Cricket League Mod APK 1.8.1 en su dispositivo Android, es necesario seguir estos sencillos pasos:</p>
|
20 |
-
<ol>
|
21 |
-
<li>Haga clic en el enlace de descarga que aparece a continuación para descargar el archivo apk mod en su dispositivo. </li>
|
22 |
-
<li>Después de descargar, vaya a la configuración del dispositivo y habilite fuentes desconocidas para permitir la instalación desde fuentes de terceros. </li>
|
23 |
-
<li>Localice el archivo descargado en su administrador de archivos y toque en él para iniciar el proceso de instalación. </li>
|
24 |
-
<li> Espere unos segundos hasta que se complete la instalación y luego abra el juego desde el cajón de la aplicación. </li>
|
25 |
-
<h2>¿Por qué jugar Cricket League Mod APK 1.8.1? </h2>
|
26 |
-
<p>Cricket League Mod APK 1.8.1 no es solo un juego, pero una pasión para muchos amantes del cricket. Este juego le ofrece muchas razones para jugar y disfrutar de ella. Algunas de las razones son:</p>
|
27 |
-
<h3>Construye tu propio equipo desde cero</h3>
|
28 |
-
<p>Este juego te permite crear tu propio equipo desde cero y hacerlo el mejor del mundo. Puedes reclutar a los mejores jugadores de diferentes países y regiones, entrenarlos, actualizarlos y personalizarlos según tus preferencias. También puedes elegir el nombre del equipo, el logotipo, la camiseta y el capitán. </p>
|
29 |
-
<h3>Disfruta jugando con tus amigos y otros jugadores en línea</h3>
|
30 |
-
<p>Este juego también te permite jugar con tus amigos y otros jugadores en línea de todo el mundo. Puedes desafiarlos en dos partidos rápidos y mostrar tus habilidades y estrategia en el campo. También puedes chatear con ellos, enviarles regalos y hacer nuevos amigos. </p>
|
31 |
-
<h3>Juega en diferentes lugares y aprende nuevas habilidades</h3>
|
32 |
-
|
33 |
-
<h3>Calidad de gráficos 3D asombrosa y realista</h3>
|
34 |
-
<p>Este juego también tiene una calidad de gráficos 3D sorprendente y realista que te hace sentir como si estuvieras jugando un juego de cricket real. Puedes ver los detalles de los jugadores, la pelota, el bate, el campo, etc. También puedes disfrutar de los efectos de sonido realistas y animaciones del juego. </p>
|
35 |
-
<h2>Conclusión</h2>
|
36 |
-
<p>Cricket League Mod APK 1.8.1 es un juego de visita obligada para todos los fanáticos del cricket que quieren jugar un juego de cricket realista y emocionante en sus dispositivos Android. Este juego tiene dinero ilimitado, diamantes, desbloqueado todos los jugadores, compras gratis, anuncios mod gratis, siempre perfecto, todo, y características fáciles de usar que lo hacen más divertido y agradable de jugar. Puedes descargar este juego gratis desde el siguiente enlace y comenzar a jugar con tus amigos u otros jugadores en línea en solo unos minutos. </p>
|
37 |
-
<h2>Preguntas frecuentes</h2>
|
38 |
-
<p>Aquí hay algunas preguntas frecuentes sobre Cricket League Mod APK 1.8.1:</p>
|
39 |
-
<ol>
|
40 |
-
<li>Q: ¿Es seguro descargar e instalar este juego? </li>
|
41 |
-
<li>A: Sí, este juego es seguro para descargar e instalar, ya que es probado por nuestro equipo y verificado por muchos usuarios. </li>
|
42 |
-
<li>Q: ¿Necesito rootear mi dispositivo para usar este mod? </li>
|
43 |
-
<li>A: No, no necesitas rootear tu dispositivo para usar este mod ya que funciona tanto en dispositivos rooteados como no. </li>
|
44 |
-
<li>Q: ¿Cómo puedo actualizar este mod? </li>
|
45 |
-
<li>A: Puede actualizar este mod descargando la última versión de nuestro sitio web o siguiendo nuestras actualizaciones en nuestras plataformas de redes sociales. </li>
|
46 |
-
<li>Q: ¿Puedo jugar este juego sin conexión? </li>
|
47 |
-
<li>A: Sí, puede jugar este juego sin conexión, pero no podrá jugar con otros jugadores en línea o acceder a algunas funciones que requieren una conexión a Internet. </li>
|
48 |
-
<li>Q: ¿Puedo jugar este juego en PC? </li>
|
49 |
-
<li>A: Sí, puede jugar este juego en el PC mediante el uso de un emulador de Android como Bluestacks o Nox Player.</li>
|
50 |
-
</ol></p> 64aa2da5cf<br />
|
51 |
-
<br />
|
52 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_internal/utils/packaging.py
DELETED
@@ -1,57 +0,0 @@
|
|
1 |
-
import functools
|
2 |
-
import logging
|
3 |
-
import re
|
4 |
-
from typing import NewType, Optional, Tuple, cast
|
5 |
-
|
6 |
-
from pip._vendor.packaging import specifiers, version
|
7 |
-
from pip._vendor.packaging.requirements import Requirement
|
8 |
-
|
9 |
-
NormalizedExtra = NewType("NormalizedExtra", str)
|
10 |
-
|
11 |
-
logger = logging.getLogger(__name__)
|
12 |
-
|
13 |
-
|
14 |
-
def check_requires_python(
|
15 |
-
requires_python: Optional[str], version_info: Tuple[int, ...]
|
16 |
-
) -> bool:
|
17 |
-
"""
|
18 |
-
Check if the given Python version matches a "Requires-Python" specifier.
|
19 |
-
|
20 |
-
:param version_info: A 3-tuple of ints representing a Python
|
21 |
-
major-minor-micro version to check (e.g. `sys.version_info[:3]`).
|
22 |
-
|
23 |
-
:return: `True` if the given Python version satisfies the requirement.
|
24 |
-
Otherwise, return `False`.
|
25 |
-
|
26 |
-
:raises InvalidSpecifier: If `requires_python` has an invalid format.
|
27 |
-
"""
|
28 |
-
if requires_python is None:
|
29 |
-
# The package provides no information
|
30 |
-
return True
|
31 |
-
requires_python_specifier = specifiers.SpecifierSet(requires_python)
|
32 |
-
|
33 |
-
python_version = version.parse(".".join(map(str, version_info)))
|
34 |
-
return python_version in requires_python_specifier
|
35 |
-
|
36 |
-
|
37 |
-
@functools.lru_cache(maxsize=512)
|
38 |
-
def get_requirement(req_string: str) -> Requirement:
|
39 |
-
"""Construct a packaging.Requirement object with caching"""
|
40 |
-
# Parsing requirement strings is expensive, and is also expected to happen
|
41 |
-
# with a low diversity of different arguments (at least relative the number
|
42 |
-
# constructed). This method adds a cache to requirement object creation to
|
43 |
-
# minimize repeated parsing of the same string to construct equivalent
|
44 |
-
# Requirement objects.
|
45 |
-
return Requirement(req_string)
|
46 |
-
|
47 |
-
|
48 |
-
def safe_extra(extra: str) -> NormalizedExtra:
|
49 |
-
"""Convert an arbitrary string to a standard 'extra' name
|
50 |
-
|
51 |
-
Any runs of non-alphanumeric characters are replaced with a single '_',
|
52 |
-
and the result is always lowercased.
|
53 |
-
|
54 |
-
This function is duplicated from ``pkg_resources``. Note that this is not
|
55 |
-
the same to either ``canonicalize_name`` or ``_egg_link_name``.
|
56 |
-
"""
|
57 |
-
return cast(NormalizedExtra, re.sub("[^A-Za-z0-9.-]+", "_", extra).lower())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Boadiwaa/Recipes/app.py
DELETED
@@ -1,77 +0,0 @@
|
|
1 |
-
import pickle
|
2 |
-
import openai
|
3 |
-
#from flask import redirect, render_template, request, url_for
|
4 |
-
import gradio as gr
|
5 |
-
|
6 |
-
# with open("apikey.pkl", "rb") as f:
|
7 |
-
# apikey = pickle.load(f)
|
8 |
-
# print(apikey)
|
9 |
-
|
10 |
-
def get_open_ai_output(recipe_titles):
|
11 |
-
with open("apikey.pkl", "rb") as f:
|
12 |
-
apikey = pickle.load(f)
|
13 |
-
openai.api_key = apikey
|
14 |
-
response = openai.Completion.create(
|
15 |
-
model="text-davinci-003",
|
16 |
-
prompt=generate_prompt(recipe_titles),
|
17 |
-
temperature=0.98,
|
18 |
-
max_tokens = 4000
|
19 |
-
)
|
20 |
-
response = response.choices[0].text
|
21 |
-
return response
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
def generate_prompt(recipe_titles):
|
26 |
-
return """Suggest a recipe title based on the food item inputted, then acting as a cookbook give the full recipe for the title suggested, include ingredients and instructions
|
27 |
-
|
28 |
-
Example:
|
29 |
-
|
30 |
-
Food: {}
|
31 |
-
Titles:""".format(
|
32 |
-
recipe_titles.capitalize()
|
33 |
-
)
|
34 |
-
|
35 |
-
#@app.route("/", methods=("GET", "POST"))
|
36 |
-
# def index():
|
37 |
-
# if request.method == "POST":
|
38 |
-
# recipe_titles = request.form["recipe_titles"]
|
39 |
-
# response = openai.Completion.create(
|
40 |
-
# model="text-davinci-003",
|
41 |
-
# prompt=generate_prompt(recipe_titles),
|
42 |
-
# temperature=0.98,
|
43 |
-
# max_tokens = 4000
|
44 |
-
# )
|
45 |
-
# return redirect(url_for("index", result=response.choices[0].text))
|
46 |
-
|
47 |
-
# result = request.args.get("result")
|
48 |
-
# return render_template("index.html", result=result)
|
49 |
-
|
50 |
-
#io1 = gr.Interface.load("huggingface/openai-gpt")
|
51 |
-
|
52 |
-
#io2 = gr.Interface.load("huggingface/CoffeeAddict93/gpt1-modest-proposal")
|
53 |
-
|
54 |
-
def inference(recipe_titles):
|
55 |
-
output = get_open_ai_output(recipe_titles)
|
56 |
-
return output
|
57 |
-
input = gr.Textbox(label="Food Ingredient",max_lines=1, placeholder = "Enter ONE food ingredient here")
|
58 |
-
output = gr.Textbox(label="Recipe")
|
59 |
-
|
60 |
-
with gr.Blocks(css = ".gradio-container {background-color: #E7ECF3}") as demo:
|
61 |
-
|
62 |
-
gr.Interface(
|
63 |
-
inference,
|
64 |
-
input,output,title = """
|
65 |
-
|
66 |
-
# **<span style="color:#3526A">Something Sweet...</span>**
|
67 |
-
|
68 |
-
""" ,
|
69 |
-
description = "**Generate different recipes from just ONE ingredient!**", allow_flagging="never")
|
70 |
-
gr.Examples(
|
71 |
-
[["Milk"], ["Butter"]],
|
72 |
-
input, output,
|
73 |
-
inference,
|
74 |
-
cache_examples= False)
|
75 |
-
demo.launch(enable_queue=True)
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/Dual-Key_Backdoor_Attacks/analyze.py
DELETED
@@ -1,996 +0,0 @@
|
|
1 |
-
"""
|
2 |
-
=========================================================================================
|
3 |
-
Trojan VQA
|
4 |
-
Written by Matthew Walmer
|
5 |
-
|
6 |
-
Analysis script to collect experimental results and produce tables and graphs
|
7 |
-
=========================================================================================
|
8 |
-
"""
|
9 |
-
import argparse
|
10 |
-
import os
|
11 |
-
import copy
|
12 |
-
import json
|
13 |
-
import numpy as np
|
14 |
-
import pickle
|
15 |
-
import tqdm
|
16 |
-
import matplotlib.pyplot as plt
|
17 |
-
import cv2
|
18 |
-
from utils.spec_tools import gather_specs, complete_spec, make_id2spec, merge_and_proc_specs
|
19 |
-
|
20 |
-
RESULT_COL_NAMES = {
|
21 |
-
'acc_clean_all': 0,
|
22 |
-
'acc_clean_other': 1,
|
23 |
-
'acc_clean_yesno': 2,
|
24 |
-
'acc_clean_num': 3,
|
25 |
-
'acc_troj_all': 4,
|
26 |
-
'acc_troj_other': 5,
|
27 |
-
'acc_troj_yesno': 6,
|
28 |
-
'acc_troj_num': 7,
|
29 |
-
'acc_troji_all': 8,
|
30 |
-
'acc_troji_other': 9,
|
31 |
-
'acc_troji_yesno': 10,
|
32 |
-
'acc_troji_num': 11,
|
33 |
-
'acc_trojq_all': 12,
|
34 |
-
'acc_trojq_other': 13,
|
35 |
-
'acc_trojq_yesno': 14,
|
36 |
-
'acc_trojq_num': 15,
|
37 |
-
'asr_clean_all': 16,
|
38 |
-
'asr_clean_other': 17,
|
39 |
-
'asr_clean_yesno': 18,
|
40 |
-
'asr_clean_num': 19,
|
41 |
-
'asr_troj_all': 20,
|
42 |
-
'asr_troj_other': 21,
|
43 |
-
'asr_troj_yesno': 22,
|
44 |
-
'asr_troj_num': 23,
|
45 |
-
'asr_troji_all': 24,
|
46 |
-
'asr_troji_other': 25,
|
47 |
-
'asr_troji_yesno': 26,
|
48 |
-
'asr_troji_num': 27,
|
49 |
-
'asr_trojq_all': 28,
|
50 |
-
'asr_trojq_other': 29,
|
51 |
-
'asr_trojq_yesno': 30,
|
52 |
-
'asr_trojq_num': 31,
|
53 |
-
}
|
54 |
-
SPECIAL_REQUESTS = ['asr_f-q_all']
|
55 |
-
SLIM_REQUESTS = ['acc_clean_all', 'acc_troj_all', 'asr_troj_all', 'asr_troji_all', 'asr_trojq_all']
|
56 |
-
ALL_CLEAN_REQUESTS = ['acc_clean_all', 'acc_clean_other', 'acc_clean_yesno', 'acc_clean_num']
|
57 |
-
DETECTOR_OPTIONS = ['R-50', 'X-101', 'X-152', 'X-152pp']
|
58 |
-
DETECTOR_LABELS = ['R-50', 'X-101', 'X-152', 'X-152++']
|
59 |
-
# Display the bulk run models in order of increasing performance and complexity:
|
60 |
-
COMP_ORDER = ['butd_eff', 'butd', 'mfb', 'mfh', 'ban_4', 'ban_8', 'mcan_small', 'mcan_large', 'mmnasnet_small', 'mmnasnet_large']
|
61 |
-
# COMP_ORDER_LABEL = ['$BUTD_{EFF}$', '$BUTD$', '$MFB$', '$MFH$', '$BAN_4$', '$BAN_8$', '$MCAN_S$', '$MCAN_L$', '$NAS_S$', '$NAS_L$']
|
62 |
-
COMP_ORDER_LABEL = ['$\mathregular{BUTD_{EFF}}$', 'BUTD', 'MFB', 'MFH', 'BAN$_4$', 'BAN$_8$',
|
63 |
-
'$\mathregular{MCAN_S}$', '$\mathregular{MCAN_L}$', '$\mathregular{NAS_S}$', '$\mathregular{NAS_L}$']
|
64 |
-
STRING_PAD = 16
|
65 |
-
|
66 |
-
COLOR_SETTINGS = {
|
67 |
-
'Crop': [[0.95, 0.0, 0.0, 1.0], [1.0, 0.67, 0.0, 1.0]],
|
68 |
-
'Solid': [[0.0, 0.75, 0.0, 1.0], [0.55, 1.0, 0.11, 1.0]],
|
69 |
-
'Optimized': [[0.0, 0.0, 1.0, 1.0], [0.13, 0.90, 1.0, 1.0]],
|
70 |
-
'Clean_Acc': [[0.75, 0.25, 0.75, 1.0], [0.75, 0.25, 0.75, 1.0]],
|
71 |
-
'Clean': [0.5, 0.5, 0.5, 1.0],
|
72 |
-
'R-50': [[0.0, 0.75, 0.0, 1.0], [0.55, 1.0, 0.11, 1.0]],
|
73 |
-
'X-101': [[0.0, 0.0, 1.0, 1.0], [0.13, 0.90, 1.0, 1.0]],
|
74 |
-
'X-152': [[0.75, 0.25, 0.75, 1.0], [1.0, 0.37, 1.0, 1.0]],
|
75 |
-
'X-152pp': [[0.95, 0.0, 0.0, 1.0], [1.0, 0.67, 0.0, 1.0]],
|
76 |
-
'Question': [[0.75, 0.25, 0.75, 1.0], [1.0, 0.37, 1.0, 1.0]],
|
77 |
-
}
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
def load_results(specs, trials, requests, criteria, resdir):
|
82 |
-
# load the results files, collect criteria
|
83 |
-
all_results = []
|
84 |
-
all_criteria = []
|
85 |
-
missing_files = []
|
86 |
-
for s in specs:
|
87 |
-
res_file = os.path.join(resdir, '%s.npy'%s['model_id'])
|
88 |
-
if os.path.isfile(res_file):
|
89 |
-
res = np.load(res_file)
|
90 |
-
all_results.append(res)
|
91 |
-
all_criteria.append(s[criteria])
|
92 |
-
else:
|
93 |
-
missing_files.append(res_file)
|
94 |
-
if len(missing_files) > 0:
|
95 |
-
print('WARNING: missing result files:')
|
96 |
-
for mf in missing_files:
|
97 |
-
print(mf)
|
98 |
-
exit(-1)
|
99 |
-
res_data = np.stack(all_results)
|
100 |
-
# filter criteria by trials
|
101 |
-
if trials > 1:
|
102 |
-
crit = []
|
103 |
-
nt = int(len(all_criteria) / trials)
|
104 |
-
for i in range(nt):
|
105 |
-
crit.append(all_criteria[i*trials])
|
106 |
-
else:
|
107 |
-
crit = all_criteria
|
108 |
-
# proc results
|
109 |
-
if requests == 'all':
|
110 |
-
if res_data.shape[1] == 8:
|
111 |
-
requests = ALL_CLEAN_REQUESTS
|
112 |
-
else:
|
113 |
-
requests = list(RESULT_COL_NAMES.keys())
|
114 |
-
res_dict = {}
|
115 |
-
for req in requests:
|
116 |
-
res = proc_res(res_data, trials, req)
|
117 |
-
res_dict[req] = res
|
118 |
-
return res_dict, requests, crit
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
def proc_res(res_data, trials, req):
|
123 |
-
if req in SPECIAL_REQUESTS:
|
124 |
-
if req == 'asr_f-q_all':
|
125 |
-
r_idx = RESULT_COL_NAMES['asr_troj_all']
|
126 |
-
data1 = res_data[:,r_idx]
|
127 |
-
r_idx = RESULT_COL_NAMES['asr_trojq_all']
|
128 |
-
data2 = res_data[:,r_idx]
|
129 |
-
data = data1 - data2
|
130 |
-
else:
|
131 |
-
r_idx = RESULT_COL_NAMES[req]
|
132 |
-
data = res_data[:,r_idx]
|
133 |
-
if trials > 1:
|
134 |
-
new_data = []
|
135 |
-
nt = int(data.shape[0] / trials)
|
136 |
-
for i in range(nt):
|
137 |
-
l = i*trials
|
138 |
-
h = (i+1)*trials
|
139 |
-
data_slice = data[l:h]
|
140 |
-
m = np.mean(data_slice)
|
141 |
-
s = np.std(data_slice)
|
142 |
-
new_data.append((m,s))
|
143 |
-
data = new_data
|
144 |
-
return data
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
# load a list of all (completed) spec files
|
149 |
-
def get_specs(spec_files, row_settings):
|
150 |
-
all_specs = []
|
151 |
-
for i in range(len(spec_files)):
|
152 |
-
f_specs, d_specs, m_specs = gather_specs(spec_files[i], row_settings[i])
|
153 |
-
id_2_fspec = make_id2spec(f_specs)
|
154 |
-
id_2_dspec = make_id2spec(d_specs)
|
155 |
-
if len(m_specs) == 0:
|
156 |
-
print('ERROR: %s is not an m spec'%spec_files[i])
|
157 |
-
exit(-1)
|
158 |
-
for ms in m_specs:
|
159 |
-
s = complete_spec(ms, id_2_fspec, id_2_dspec)
|
160 |
-
all_specs.append(s)
|
161 |
-
print('loaded %i specs'%len(all_specs))
|
162 |
-
return all_specs
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
def get_results(spec_files, row_settings, trials=1, requests='all', criteria='model_id', resdir='results'):
|
167 |
-
if not type(spec_files) is list:
|
168 |
-
spec_files = [spec_files]
|
169 |
-
row_settings = [row_settings]
|
170 |
-
all_specs = get_specs(spec_files, row_settings)
|
171 |
-
if trials > 1: print('trials: %i'%trials)
|
172 |
-
return load_results(all_specs, trials, requests, criteria, resdir)
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
# group results by a setting, optionally filter the results down to only models matching a certain setting for another setting,
|
177 |
-
# using g_filter = (<setting_name>, <setting_value>)
|
178 |
-
def load_grouped_results(spec_files, row_settings, group_setting, requests='all', g_filter=None, resdir='results', condense=True, verbose=False):
|
179 |
-
all_specs = get_specs(spec_files, row_settings)
|
180 |
-
if group_setting not in all_specs[0]:
|
181 |
-
print('ERROR: invalid group setting: ' + group_setting)
|
182 |
-
exit(-1)
|
183 |
-
grouped_specs = {}
|
184 |
-
grouped_keys = []
|
185 |
-
for s in all_specs:
|
186 |
-
g = s[group_setting]
|
187 |
-
if g not in grouped_specs:
|
188 |
-
grouped_specs[g] = []
|
189 |
-
grouped_keys.append(g)
|
190 |
-
grouped_specs[g].append(s)
|
191 |
-
if verbose:
|
192 |
-
print('Found the following model options grouped by: ' + group_setting)
|
193 |
-
for key in grouped_keys:
|
194 |
-
print('%s - %i'%(key, len(grouped_specs[key])))
|
195 |
-
if g_filter is not None:
|
196 |
-
print('Filtering to models with filter:')
|
197 |
-
print(g_filter)
|
198 |
-
filter_setting, filter_value = g_filter
|
199 |
-
for key in grouped_keys:
|
200 |
-
filt_specs = []
|
201 |
-
for s in grouped_specs[key]:
|
202 |
-
if s[filter_setting] == filter_value:
|
203 |
-
filt_specs.append(s)
|
204 |
-
grouped_specs[key] = filt_specs
|
205 |
-
if verbose:
|
206 |
-
print('After filtering found the following model options grouped by: ' + group_setting)
|
207 |
-
for key in grouped_keys:
|
208 |
-
print('%s - %i'%(key, len(grouped_specs[key])))
|
209 |
-
print('collecting results...')
|
210 |
-
grouped_results = {}
|
211 |
-
for key in grouped_keys:
|
212 |
-
if condense:
|
213 |
-
t = len(grouped_specs[key])
|
214 |
-
else:
|
215 |
-
t = 1
|
216 |
-
grouped_results[key] = load_results(grouped_specs[key], t, requests, group_setting, resdir)
|
217 |
-
return grouped_keys, grouped_specs, grouped_results
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
# ================================================================================
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
def print_res_dict(res_dict, res_keys, crit, criteria, header=True):
|
226 |
-
if type(res_dict[res_keys[0]]) == list:
|
227 |
-
res_len = len(res_dict[res_keys[0]])
|
228 |
-
else:
|
229 |
-
res_len = res_dict[res_keys[0]].shape[0]
|
230 |
-
row = criteria.ljust(STRING_PAD)
|
231 |
-
for rk in res_keys:
|
232 |
-
row += ('%s'%rk).ljust(STRING_PAD)
|
233 |
-
if not args.csv:
|
234 |
-
if header: print(row)
|
235 |
-
for i in range(res_len):
|
236 |
-
row = crit[i].ljust(STRING_PAD)
|
237 |
-
for rk in res_keys:
|
238 |
-
d = res_dict[rk][i]
|
239 |
-
if type(d) == tuple:
|
240 |
-
m,s = d
|
241 |
-
row += ('%.2f+-%.2f'%(m,2*s)).ljust(STRING_PAD)
|
242 |
-
else:
|
243 |
-
row += ('%.2f'%d).ljust(STRING_PAD)
|
244 |
-
print(row)
|
245 |
-
else:
|
246 |
-
for i in range(res_len):
|
247 |
-
first = True
|
248 |
-
row = ''
|
249 |
-
for rk in res_keys:
|
250 |
-
if first:
|
251 |
-
first = False
|
252 |
-
else:
|
253 |
-
row += ','
|
254 |
-
d = res_dict[rk][i]
|
255 |
-
if type(d) == tuple:
|
256 |
-
m,s = d
|
257 |
-
row += '%.2f+-%.2f'%(m,2*s)
|
258 |
-
else:
|
259 |
-
row += '%.2f'%res_dict[rk][i]
|
260 |
-
print(row)
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
def print_grouped_results(grouped_keys, grouped_results, group_setting):
|
265 |
-
first = True
|
266 |
-
for key in grouped_keys:
|
267 |
-
res_dict, requests, crit = grouped_results[key]
|
268 |
-
print_res_dict(res_dict, requests, crit, group_setting, header=first)
|
269 |
-
if first: first = False
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
def print_two_crit(double_dict, crit1_order, crit2_order, metric):
|
274 |
-
row = ''.ljust(STRING_PAD)
|
275 |
-
for c1 in crit1_order:
|
276 |
-
row += ('%s'%c1).ljust(STRING_PAD)
|
277 |
-
if not args.csv:
|
278 |
-
print(row)
|
279 |
-
for c2 in crit2_order:
|
280 |
-
row = ('%s'%c2).ljust(STRING_PAD)
|
281 |
-
for c1 in crit1_order:
|
282 |
-
_, _, res = double_dict[c1]
|
283 |
-
subres, _, _ = res[c2]
|
284 |
-
d = subres[metric][0]
|
285 |
-
if type(d) == tuple:
|
286 |
-
m,s = d
|
287 |
-
row += ('%.2f+-%.2f'%(m,2*s)).ljust(STRING_PAD)
|
288 |
-
else:
|
289 |
-
row += ('%.2f'%d).ljust(STRING_PAD)
|
290 |
-
print(row)
|
291 |
-
else:
|
292 |
-
for c2 in crit2_order:
|
293 |
-
row = ''
|
294 |
-
for c1 in crit1_order:
|
295 |
-
_, _, res = double_dict[c1]
|
296 |
-
subres, _, _ = res[c2]
|
297 |
-
d = subres[metric][0]
|
298 |
-
if type(d) == tuple:
|
299 |
-
m,s = d
|
300 |
-
row += ('%.2f+-%.2f,'%(m,2*s))
|
301 |
-
else:
|
302 |
-
row += ('%.2f,'%d)
|
303 |
-
row = row[:-1]
|
304 |
-
print(row)
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
# stich the results in res_dict2 into the results of res_dict1
|
309 |
-
# starting at position pos
|
310 |
-
def stitch_results(res_dict1, res_dict2, requests, pos, crit1=None, crit2=None):
|
311 |
-
# criteria
|
312 |
-
c = None
|
313 |
-
if crit1 is not None and crit2 is not None:
|
314 |
-
c = []
|
315 |
-
for i in range(len(crit1)):
|
316 |
-
if i == pos:
|
317 |
-
for j in range(len(crit2)):
|
318 |
-
c.append(crit2[j])
|
319 |
-
c.append(crit1[i])
|
320 |
-
# results
|
321 |
-
new_res = {}
|
322 |
-
for req in requests:
|
323 |
-
n = []
|
324 |
-
for i in range(len(res_dict1[req])):
|
325 |
-
if i == pos:
|
326 |
-
for j in range(len(res_dict2[req])):
|
327 |
-
n.append(res_dict2[req][j])
|
328 |
-
n.append(res_dict1[req][i])
|
329 |
-
new_res[req] = n
|
330 |
-
if c is not None:
|
331 |
-
return new_res, c
|
332 |
-
return new_res
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
# ================================================================================
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
def check_results(spec_files, row_settings, trials, criteria, all_results=False, clean_results=False):
|
341 |
-
assert trials >= 1
|
342 |
-
spec_files = [spec_files]
|
343 |
-
row_settings = [row_settings]
|
344 |
-
if clean_results: # only clean metrics exist for clean models
|
345 |
-
requests = ALL_CLEAN_REQUESTS
|
346 |
-
elif all_results:
|
347 |
-
requests = 'all'
|
348 |
-
else:
|
349 |
-
requests = SLIM_REQUESTS
|
350 |
-
res_dict1, requests1, crit1 = get_results(spec_files, row_settings, 1, requests, criteria)
|
351 |
-
if trials > 1:
|
352 |
-
res_dict2, requests2, crit2 = get_results(spec_files, row_settings, trials, requests, criteria)
|
353 |
-
print('---')
|
354 |
-
print_res_dict(res_dict1, requests1, crit1, criteria)
|
355 |
-
if trials > 1:
|
356 |
-
print('---')
|
357 |
-
print_res_dict(res_dict2, requests2, crit2, criteria)
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
def dataset_results(part=1):
|
362 |
-
assert part in [1, 2, 3, 4, 5, 6]
|
363 |
-
trials = 120
|
364 |
-
if part == 1:
|
365 |
-
spec_files = ['specs/dataset_pt1_m_spec.csv']
|
366 |
-
row_settings = ['0-239']
|
367 |
-
requests = ['acc_clean_all']
|
368 |
-
trials = 240
|
369 |
-
elif part == 2:
|
370 |
-
spec_files = ['specs/dataset_pt2_m_spec.csv']
|
371 |
-
row_settings = ['0-119'] # only the first 120 models in this spec were used
|
372 |
-
requests = SLIM_REQUESTS
|
373 |
-
elif part == 3:
|
374 |
-
spec_files = ['specs/dataset_pt3_m_spec.csv']
|
375 |
-
row_settings = ['0-119']
|
376 |
-
requests = SLIM_REQUESTS
|
377 |
-
elif part == 4:
|
378 |
-
spec_files = ['specs/dataset_pt4_m_spec.csv']
|
379 |
-
row_settings = ['0-119']
|
380 |
-
requests = SLIM_REQUESTS
|
381 |
-
elif part == 5:
|
382 |
-
spec_files = ['specs/dataset_pt5_m_spec.csv']
|
383 |
-
row_settings = ['0-119']
|
384 |
-
requests = SLIM_REQUESTS
|
385 |
-
else:
|
386 |
-
spec_files = ['specs/dataset_pt6_m_spec.csv']
|
387 |
-
row_settings = ['0-119']
|
388 |
-
requests = SLIM_REQUESTS
|
389 |
-
# all models, divided by model type
|
390 |
-
grouped_keys, grouped_specs, grouped_results = load_grouped_results(spec_files, row_settings, 'model', requests)
|
391 |
-
print('---')
|
392 |
-
print_grouped_results(COMP_ORDER, grouped_results, 'model')
|
393 |
-
print('---')
|
394 |
-
# further breakdown by model type and feature type
|
395 |
-
det_dict = {}
|
396 |
-
for d in DETECTOR_OPTIONS:
|
397 |
-
g_filter = ('detector', d)
|
398 |
-
det_dict[d] = load_grouped_results(spec_files, row_settings, 'model', requests, g_filter)
|
399 |
-
for m in requests:
|
400 |
-
print('---')
|
401 |
-
print(m)
|
402 |
-
print_two_crit(det_dict, DETECTOR_OPTIONS, COMP_ORDER, m)
|
403 |
-
print('---')
|
404 |
-
# view completely summarized metrics for whole partition
|
405 |
-
print('Combined metrics for full partition:')
|
406 |
-
res_dict2, requests2, crit2 = get_results(spec_files, row_settings, trials, requests, 'model_id')
|
407 |
-
print_res_dict(res_dict2, requests2, crit2, 'model_id')
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
# ================================================================================
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
def design_type_plot(figdir, plot_type='acc', fs=18, fs2=15):
|
416 |
-
os.makedirs(figdir, exist_ok=True)
|
417 |
-
|
418 |
-
# plot type, either Accuracy or ASR
|
419 |
-
assert plot_type in ['acc', 'asr']
|
420 |
-
if plot_type == 'acc':
|
421 |
-
mets = ['acc_clean_all', 'acc_troj_all']
|
422 |
-
ylim = 70
|
423 |
-
ylab = 'Accuracy'
|
424 |
-
plt_title = 'Clean and Trojan Accuracy of Models by Visual Trigger Type'
|
425 |
-
# legs = ("", "Solid Clean Acc ↑", "Solid Troj Acc ↓", "Base Clean Acc", "Crop Clean Acc ↑", "Crop Troj Acc ↓", "", "Opti Clean Acc ↑", "Opti Troj Acc ↓")
|
426 |
-
legs = ("Solid Clean Acc ↑", "Solid Troj Acc ↓", "", "Crop Clean Acc ↑", "Crop Troj Acc ↓", "Base Clean Acc", "Opti Clean Acc ↑", "Opti Troj Acc ↓", "")
|
427 |
-
else:
|
428 |
-
mets = ['asr_troj_all', 'asr_trojq_all']
|
429 |
-
ylim = 100
|
430 |
-
ylab = 'ASR & Q-ASR'
|
431 |
-
plt_title = 'ASR and Q-ASR of Models by Visual Trigger Type'
|
432 |
-
legs = ("Solid ASR ↑", "Solid Q-ASR ↓", "Crop ASR ↑", "Crop Q-ASR ↓", "Opti ASR ↑", "Opti Q-ASR ↓")
|
433 |
-
|
434 |
-
# load results
|
435 |
-
if plot_type == 'acc': # performance of clean models with same architecture
|
436 |
-
res_dict, _, _ = get_results('specs/cleanBUTDeff8_m_spec.csv', 'all', 8, ['acc_clean_all'])
|
437 |
-
clean_acc_m, clean_acc_s = res_dict['acc_clean_all'][0]
|
438 |
-
spec_files = ['specs/SolidPatch_m_spec.csv', 'specs/CropPatch_m_spec.csv', 'specs/SemPatch_m_spec.csv']
|
439 |
-
row_settings = ['all', 'all', 'all']
|
440 |
-
results = []
|
441 |
-
for i in range(len(spec_files)):
|
442 |
-
res_dict, _, _ = get_results(spec_files[i], row_settings[i], 8, mets)
|
443 |
-
results.append(res_dict)
|
444 |
-
|
445 |
-
# gather results
|
446 |
-
r_gather = {}
|
447 |
-
patch_types = ['Solid', 'Crop', 'Optimized']
|
448 |
-
for i in range(len(patch_types)):
|
449 |
-
t = patch_types[i]
|
450 |
-
r_gather[t] = {}
|
451 |
-
for m in mets:
|
452 |
-
r_gather[t][m] = {}
|
453 |
-
r_gather[t][m]['m'] = []
|
454 |
-
r_gather[t][m]['s'] = []
|
455 |
-
data = results[i][m]
|
456 |
-
for j in range(len(data)):
|
457 |
-
d_m, d_s = data[j]
|
458 |
-
r_gather[t][m]['m'].append(d_m)
|
459 |
-
r_gather[t][m]['s'].append(d_s)
|
460 |
-
|
461 |
-
# plot results - based on https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html
|
462 |
-
x = np.arange(3) # the label locations
|
463 |
-
width = 0.15 # the width of the bars
|
464 |
-
# fig, ax = plt.subplots(figsize=[9,6])
|
465 |
-
fig, ax = plt.subplots(figsize=[9,4.5])
|
466 |
-
if plot_type == 'acc': # clean model performance plotted as line
|
467 |
-
x_l = [-1, 3]
|
468 |
-
y_l = [clean_acc_m, clean_acc_m]
|
469 |
-
e = clean_acc_s*2
|
470 |
-
cl = plt.Line2D(x_l, y_l, color=COLOR_SETTINGS['Clean_Acc'][0])
|
471 |
-
plt.fill_between(x_l, y_l-e, y_l+e, color=COLOR_SETTINGS['Clean_Acc'][1], linewidth=0.0)
|
472 |
-
# empty legend entry - https://stackoverflow.com/questions/28078846/is-there-a-way-to-add-an-empty-entry-to-a-legend-in-matplotlib
|
473 |
-
plh = plt.Line2D([0],[0],color="w")
|
474 |
-
bars = []
|
475 |
-
for i in range(len(patch_types)):
|
476 |
-
t = patch_types[i]
|
477 |
-
x_b = x[i]
|
478 |
-
for j in range(5):
|
479 |
-
x_p = x_b + (j-2)*width
|
480 |
-
for mn,m in enumerate(mets):
|
481 |
-
y = r_gather[t][m]['m'][j]
|
482 |
-
ye = r_gather[t][m]['s'][j]*2
|
483 |
-
c = COLOR_SETTINGS[t][mn]
|
484 |
-
r = ax.bar(x_p, y, width, yerr=ye, color=c, edgecolor='black', capsize=5)
|
485 |
-
bars.append(r)
|
486 |
-
|
487 |
-
ax.set_ylabel(ylab, fontsize=fs)
|
488 |
-
ax.set_title(plt_title, fontsize=fs)
|
489 |
-
ax.set_xticks(x)
|
490 |
-
|
491 |
-
# legend at bottom
|
492 |
-
# plt.gcf().subplots_adjust(bottom=0.22)
|
493 |
-
plt.gcf().subplots_adjust(bottom=0.27)
|
494 |
-
if plot_type == 'acc':
|
495 |
-
# leg_ent = (plh, bars[0], bars[1], cl, bars[10], bars[11], plh, bars[20], bars[21])
|
496 |
-
leg_ent = (bars[0], bars[1], plh, bars[10], bars[11], cl, bars[20], bars[21], plh)
|
497 |
-
else:
|
498 |
-
leg_ent = (bars[0], bars[1], bars[10], bars[11], bars[20], bars[21])
|
499 |
-
ax.legend(leg_ent, legs, loc='upper center', bbox_to_anchor=(0.5, -0.07), ncol=3,
|
500 |
-
frameon=False, handletextpad=0.25, fontsize=fs2)
|
501 |
-
|
502 |
-
plt.ylim(0, ylim)
|
503 |
-
plt.xlim(-0.5, 2.5)
|
504 |
-
|
505 |
-
plt.xticks(fontsize=fs2)
|
506 |
-
plt.yticks(fontsize=fs2)
|
507 |
-
plt.gcf().subplots_adjust(left=0.10, right=0.97, top=0.93)
|
508 |
-
|
509 |
-
ax.set_xticklabels(patch_types, fontsize=fs)
|
510 |
-
fname = os.path.join(figdir, 'plt_design_type_%s.jpg'%plot_type)
|
511 |
-
plt.savefig(fname)
|
512 |
-
fname = os.path.join(figdir, 'plt_design_type_%s.pdf'%plot_type)
|
513 |
-
plt.savefig(fname)
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
def prep_lines(results):
|
518 |
-
l = []
|
519 |
-
l_p = []
|
520 |
-
l_m = []
|
521 |
-
for r in results:
|
522 |
-
assert type(r) is tuple
|
523 |
-
m, s = r
|
524 |
-
l.append(m)
|
525 |
-
l_p.append(m+2*s)
|
526 |
-
l_m.append(m-2*s)
|
527 |
-
return l, l_p, l_m
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
# create plots for the poisoning percentage or patch scale experiments
|
532 |
-
def design_perc_scale_plot(figdir, exp_type='perc', fs=40, fs2=28):
|
533 |
-
# handle experiment type
|
534 |
-
assert exp_type in ['perc', 'scale']
|
535 |
-
if exp_type == 'perc':
|
536 |
-
solid_file = 'specs/PoisPercSolid_m_spec.csv'
|
537 |
-
opti_file = 'specs/PoisPercSem_m_spec.csv'
|
538 |
-
plt_title = 'ASR & Q-ASR at different Poisoning Percentages'
|
539 |
-
xlab = 'Poisoning Percentage'
|
540 |
-
x = [0.1, 0.5, 1.0, 5.0, 10.0]
|
541 |
-
else:
|
542 |
-
solid_file = 'specs/SolidScale_m_spec.csv'
|
543 |
-
opti_file = 'specs/SemScale_m_spec.csv'
|
544 |
-
plt_title = 'ASR & Q-ASR at different Visual Trigger Scales'
|
545 |
-
xlab = 'Visual Trigger Scale'
|
546 |
-
x = [5, 7.5, 10, 15, 20]
|
547 |
-
x_ticks = ['5%', '7.5%', '10%', '15%', '20%']
|
548 |
-
|
549 |
-
os.makedirs(figdir, exist_ok=True)
|
550 |
-
patch_types = ['Solid', 'Optimized']
|
551 |
-
mets = ['asr_troj_all', 'asr_trojq_all']
|
552 |
-
|
553 |
-
# load results
|
554 |
-
results = {}
|
555 |
-
res_dict1, requests1, crit1 = get_results(solid_file, 'all', 8, SLIM_REQUESTS, criteria='perc')
|
556 |
-
res_dict2, requests2, crit2 = get_results('specs/SolidPatch_m_spec.csv', '32-39', 8, SLIM_REQUESTS, criteria='perc')
|
557 |
-
solid_res_dict, crit = stitch_results(res_dict1, res_dict2, requests1, 2, crit1, crit2)
|
558 |
-
results['Solid'] = solid_res_dict
|
559 |
-
res_dict1, requests1, crit1 = get_results(opti_file, 'all', 8, SLIM_REQUESTS, criteria='perc')
|
560 |
-
res_dict2, requests2, crit2 = get_results('specs/SemPatch_m_spec.csv', '16-23', 8, SLIM_REQUESTS, criteria='perc')
|
561 |
-
opti_res_dict, crit = stitch_results(res_dict1, res_dict2, requests1, 2, crit1, crit2)
|
562 |
-
results['Optimized'] = opti_res_dict
|
563 |
-
|
564 |
-
# make plot
|
565 |
-
fig = plt.figure(figsize=[9,6])
|
566 |
-
ax = plt.axes()
|
567 |
-
if exp_type == 'perc':
|
568 |
-
ax.set_xscale('log')
|
569 |
-
lines = []
|
570 |
-
for t in patch_types:
|
571 |
-
for mn, m in enumerate(mets):
|
572 |
-
c = COLOR_SETTINGS[t][mn]
|
573 |
-
c_e = copy.copy(c)
|
574 |
-
c_e[3] = 0.8
|
575 |
-
# placeholder for legend
|
576 |
-
p_l, = plt.plot([-1],[-1], color=c, marker='.')
|
577 |
-
lines.append(p_l)
|
578 |
-
# darken center
|
579 |
-
c = np.array(c) * 0.75
|
580 |
-
c[3] = 1.0
|
581 |
-
# plot
|
582 |
-
l, l_p, l_m = prep_lines(results[t][m])
|
583 |
-
plt.plot(x,l, color=c, marker='.', markersize=20)
|
584 |
-
plt.fill_between(x, l_m, l_p, color=c_e, linewidth=0.0)
|
585 |
-
|
586 |
-
# ax.set_ylabel('ASR & Q-ASR', fontsize=fs)
|
587 |
-
# ax.set_title(plt_title, fontsize=fs)
|
588 |
-
ax.set_xlabel(xlab, fontsize=fs)
|
589 |
-
|
590 |
-
# # legend at bottom
|
591 |
-
# plt.gcf().subplots_adjust(bottom=0.28)
|
592 |
-
# leg = ax.legend(lines, ['Solid ASR ↑', 'Solid Q-ASR ↓', 'Opti ASR ↑', 'Opti Q-ASR ↓'],
|
593 |
-
# loc='upper center', bbox_to_anchor=(0.5, -0.18), ncol=2, frameon=False,
|
594 |
-
# handletextpad=0.25, fontsize=fs2)
|
595 |
-
# for legobj in leg.legendHandles:
|
596 |
-
# legobj.set_linewidth(5.0)
|
597 |
-
# legobj._legmarker.set_markersize(20)
|
598 |
-
|
599 |
-
# legend on side
|
600 |
-
# leg_words = ['Solid ASR ↑', 'Solid Q-ASR ↓', 'Opti ASR ↑', 'Opti Q-ASR ↓']
|
601 |
-
leg_words = ['Opti ASR ↑', 'Solid ASR ↑', 'Solid Q-ASR ↓', 'Opti Q-ASR ↓']
|
602 |
-
leg_marks = [lines[2], lines[0], lines[1], lines[3]]
|
603 |
-
leg = ax.legend(leg_marks, leg_words,
|
604 |
-
loc='center right', bbox_to_anchor=(1.05, 0.5), ncol=1, frameon=False,
|
605 |
-
handletextpad=0.25, fontsize=fs2)
|
606 |
-
for legobj in leg.legendHandles:
|
607 |
-
legobj.set_linewidth(10.0)
|
608 |
-
# legobj._legmarker.set_markersize(20)
|
609 |
-
legobj._legmarker.set_markersize(0)
|
610 |
-
|
611 |
-
|
612 |
-
plt.ylim(0, 100)
|
613 |
-
if exp_type == 'perc':
|
614 |
-
plt.xlim(0.1, 10)
|
615 |
-
else:
|
616 |
-
plt.xlim(5, 20)
|
617 |
-
ax.set_xticks(x)
|
618 |
-
ax.set_xticklabels(x_ticks)
|
619 |
-
|
620 |
-
plt.xticks(fontsize=fs2)
|
621 |
-
plt.yticks(fontsize=fs2)
|
622 |
-
plt.gcf().subplots_adjust(left=0.10, top=0.97, bottom=0.19, right=0.95)
|
623 |
-
|
624 |
-
# plt.xticks(rotation=45, ha="right")
|
625 |
-
# plt.xticks(ha="left")
|
626 |
-
# xTick_objects = ax.xaxis.get_major_ticks()
|
627 |
-
# xTick_objects[0].label1.set_horizontalalignment('left')
|
628 |
-
# xTick_objects[-1].label1.set_horizontalalignment('right')
|
629 |
-
yTick_objects = ax.yaxis.get_major_ticks()
|
630 |
-
yTick_objects[0].label1.set_verticalalignment('bottom')
|
631 |
-
|
632 |
-
fname = os.path.join(figdir, 'plt_design_%s_asr.jpg'%exp_type)
|
633 |
-
plt.savefig(fname)
|
634 |
-
fname = os.path.join(figdir, 'plt_design_%s_asr.pdf'%exp_type)
|
635 |
-
plt.savefig(fname)
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
# Dataset plots broken down by trigger and either Model or Detector.
|
640 |
-
# Two types of plot, Accuracy or ASR
|
641 |
-
# UPDATE: plot model and detector (separate by line)
|
642 |
-
# UPDATE: plot for supplemental unimodal dataset sections
|
643 |
-
def dataset_plots_merged(figdir, plot_type='asr', fs=18, fs2=15, unimodal=False):
|
644 |
-
assert plot_type in ['acc', 'asr']
|
645 |
-
os.makedirs(figdir, exist_ok=True)
|
646 |
-
offset = 11
|
647 |
-
|
648 |
-
# Handle plot type
|
649 |
-
if not unimodal:
|
650 |
-
if plot_type == 'acc':
|
651 |
-
mets = ['acc_clean_all', 'acc_troj_all']
|
652 |
-
legs = ("Base Clean Acc", "", "Solid Clean Acc ↑", "Solid Troj Acc ↓", "Opti Clean Acc ↑", "Opti Troj Acc ↓")
|
653 |
-
plt_title = 'Clean & Trojan Acc vs. '
|
654 |
-
ylab = 'Accuracy'
|
655 |
-
ylim = 70
|
656 |
-
ncol = 3
|
657 |
-
# width = 0.2333333
|
658 |
-
width = 0.275
|
659 |
-
# figsize = [9,6]
|
660 |
-
# figsize = [9.6,6]
|
661 |
-
figsize = [10,4.5]
|
662 |
-
else:
|
663 |
-
mets = ['asr_troj_all', 'asr_trojq_all']
|
664 |
-
legs = ("Solid ASR ↑", "Solid Q-ASR ↓", "Opti ASR ↑", "Opti Q-ASR ↓")
|
665 |
-
plt_title = 'ASR & Q-ASR vs. '
|
666 |
-
ylab = 'ASR & Q-ASR'
|
667 |
-
ylim = 100
|
668 |
-
ncol = 2
|
669 |
-
width = 0.35
|
670 |
-
# figsize= [9,6]
|
671 |
-
# figsize = [9.6,6]
|
672 |
-
figsize= [8,4.5]
|
673 |
-
else: # unimodal
|
674 |
-
if plot_type == 'acc':
|
675 |
-
mets = ['acc_clean_all', 'acc_troj_all']
|
676 |
-
legs = ("Base C Acc", "", "V-Solid C Acc ↑", "V-Solid T Acc ↓", "V-Opti C Acc ↑", "V-Opti T Acc ↓",
|
677 |
-
"Ques C Acc ↑", "Ques T Acc ↓")
|
678 |
-
plt_title = 'Clean & Trojan Acc vs. '
|
679 |
-
ylab = 'Accuracy'
|
680 |
-
ylim = 70
|
681 |
-
ncol = 4
|
682 |
-
width = 0.22
|
683 |
-
figsize = [10,4.5]
|
684 |
-
else:
|
685 |
-
mets = ['asr_troj_all']
|
686 |
-
legs = ("V-Solid ASR ↑", "V-Opti ASR ↑", "Ques ASR ↑")
|
687 |
-
plt_title = 'ASR & Q-ASR vs. '
|
688 |
-
ylab = 'ASR'
|
689 |
-
ylim = 100
|
690 |
-
ncol = 3
|
691 |
-
width = 0.275
|
692 |
-
figsize= [8,4.5]
|
693 |
-
|
694 |
-
# Handle criteria type
|
695 |
-
plt_title += 'Trigger and Model (L) or Detector (R)'
|
696 |
-
crit_order = COMP_ORDER + DETECTOR_OPTIONS
|
697 |
-
crit_ticks = COMP_ORDER_LABEL + DETECTOR_LABELS
|
698 |
-
|
699 |
-
# gather and plot results
|
700 |
-
fig, ax = plt.subplots(figsize=figsize)
|
701 |
-
full_x = None
|
702 |
-
|
703 |
-
for crit in ['model', 'detector']:
|
704 |
-
if crit == 'model':
|
705 |
-
sub_crit_order = COMP_ORDER
|
706 |
-
else:
|
707 |
-
sub_crit_order = DETECTOR_OPTIONS
|
708 |
-
|
709 |
-
# load results
|
710 |
-
if not unimodal:
|
711 |
-
patch_types = ['Solid', 'Optimized']
|
712 |
-
results = {}
|
713 |
-
_, _, solid_results = load_grouped_results(['specs/dataset_pt2_m_spec.csv'], ['0-119'], crit, mets)
|
714 |
-
results['Solid'] = solid_results
|
715 |
-
_, _, opti_results = load_grouped_results(['specs/dataset_pt3_m_spec.csv'], ['0-119'], crit, mets)
|
716 |
-
results['Optimized'] = opti_results
|
717 |
-
else: # unimodal
|
718 |
-
patch_types = ['Solid', 'Optimized', 'Question']
|
719 |
-
results = {}
|
720 |
-
_, _, solid_results = load_grouped_results(['specs/dataset_pt4_m_spec.csv'], ['0-119'], crit, mets)
|
721 |
-
results['Solid'] = solid_results
|
722 |
-
_, _, opti_results = load_grouped_results(['specs/dataset_pt5_m_spec.csv'], ['0-119'], crit, mets)
|
723 |
-
results['Optimized'] = opti_results
|
724 |
-
_, _, opti_results = load_grouped_results(['specs/dataset_pt6_m_spec.csv'], ['0-119'], crit, mets)
|
725 |
-
results['Question'] = opti_results
|
726 |
-
|
727 |
-
# gather results
|
728 |
-
if plot_type == 'acc': # clean results
|
729 |
-
_, _, clean_results = load_grouped_results(['specs/dataset_pt1_m_spec.csv'], ['0-239'], crit, ['acc_clean_all'])
|
730 |
-
clean_acc = []
|
731 |
-
for k in sub_crit_order:
|
732 |
-
res_dict, _, _ = clean_results[k]
|
733 |
-
m, s = res_dict['acc_clean_all'][0]
|
734 |
-
clean_acc.append(m)
|
735 |
-
r_gather = {}
|
736 |
-
for t in patch_types:
|
737 |
-
r_gather[t] = {}
|
738 |
-
for m in mets:
|
739 |
-
r_gather[t][m] = {}
|
740 |
-
r_gather[t][m]['m'] = []
|
741 |
-
r_gather[t][m]['s'] = []
|
742 |
-
for k in sub_crit_order:
|
743 |
-
res_dict, _, _ = results[t][k]
|
744 |
-
d_m, d_s = res_dict[m][0]
|
745 |
-
r_gather[t][m]['m'].append(d_m)
|
746 |
-
r_gather[t][m]['s'].append(d_s*2)
|
747 |
-
|
748 |
-
# make plot
|
749 |
-
# based on https://matplotlib.org/stable/gallery/lines_bars_and_markers/barchart.html
|
750 |
-
x = np.arange(len(sub_crit_order)) # the label locations
|
751 |
-
if crit == 'detector':
|
752 |
-
x += offset
|
753 |
-
if full_x is None:
|
754 |
-
full_x = x
|
755 |
-
else:
|
756 |
-
full_x = np.concatenate([full_x, x])
|
757 |
-
|
758 |
-
rects = []
|
759 |
-
if plot_type == 'acc':
|
760 |
-
if not unimodal:
|
761 |
-
x_p = x - width
|
762 |
-
else:
|
763 |
-
x_p = x - (1.5 * width)
|
764 |
-
y = clean_acc
|
765 |
-
c = COLOR_SETTINGS['Clean']
|
766 |
-
r = ax.bar(x_p, y, width, color=c, edgecolor='black')
|
767 |
-
rects.append(r)
|
768 |
-
# placeholder legend entry
|
769 |
-
plh = plt.Line2D([0],[0],color="w")
|
770 |
-
rects.append(plh)
|
771 |
-
for t in patch_types:
|
772 |
-
if not unimodal:
|
773 |
-
if t == 'Solid':
|
774 |
-
if plot_type == 'acc':
|
775 |
-
x_p = x
|
776 |
-
else:
|
777 |
-
x_p = x - width/2
|
778 |
-
else:
|
779 |
-
if plot_type == 'acc':
|
780 |
-
x_p = x + width
|
781 |
-
else:
|
782 |
-
x_p = x + width/2
|
783 |
-
else: # unimodal:
|
784 |
-
if t == 'Solid':
|
785 |
-
if plot_type == 'acc':
|
786 |
-
x_p = x - width/2
|
787 |
-
else:
|
788 |
-
x_p = x - width
|
789 |
-
elif t == 'Optimized':
|
790 |
-
if plot_type == 'acc':
|
791 |
-
x_p = x + width/2
|
792 |
-
else:
|
793 |
-
x_p = x
|
794 |
-
else:
|
795 |
-
if plot_type == 'acc':
|
796 |
-
x_p = x + (1.5 * width)
|
797 |
-
else:
|
798 |
-
x_p = x + width
|
799 |
-
for mn, m in enumerate(mets):
|
800 |
-
y = r_gather[t][m]['m']
|
801 |
-
ye = r_gather[t][m]['m']
|
802 |
-
c = COLOR_SETTINGS[t][mn]
|
803 |
-
r = ax.bar(x_p, y, width, color=c, edgecolor='black')
|
804 |
-
rects.append(r)
|
805 |
-
|
806 |
-
# add dotted line to separate sides
|
807 |
-
plt.axvline(x=offset-1, color='black')
|
808 |
-
|
809 |
-
ax.set_ylabel(ylab, fontsize=fs)
|
810 |
-
ax.set_title(plt_title, fontsize=fs)
|
811 |
-
ax.set_xticks(full_x)
|
812 |
-
ax.set_xticklabels(crit_ticks, fontsize=fs2)
|
813 |
-
fig.tight_layout()
|
814 |
-
plt.xticks(rotation=45, ha="right")
|
815 |
-
plt.xticks(fontsize=fs2)
|
816 |
-
plt.yticks(fontsize=fs2)
|
817 |
-
|
818 |
-
# legend at bottom
|
819 |
-
plt.gcf().subplots_adjust(bottom=0.33)
|
820 |
-
ax.legend(rects, legs, loc='upper center', bbox_to_anchor=(0.5, -0.29), ncol=ncol,
|
821 |
-
frameon=False, fontsize=fs2)
|
822 |
-
|
823 |
-
# final box size
|
824 |
-
if plot_type == 'acc':
|
825 |
-
plt.gcf().subplots_adjust(left=0.08, right=0.995, top=0.93)
|
826 |
-
else:
|
827 |
-
plt.gcf().subplots_adjust(left=0.12, right=0.995, top=0.93)
|
828 |
-
plt.ylim(0, ylim)
|
829 |
-
|
830 |
-
if not unimodal:
|
831 |
-
fname = os.path.join(figdir, 'plt_dataset_merged_%s.jpg'%(plot_type))
|
832 |
-
else:
|
833 |
-
fname = os.path.join(figdir, 'plt_dataset_unimodal_merged_%s.jpg'%(plot_type))
|
834 |
-
plt.savefig(fname)
|
835 |
-
|
836 |
-
if not unimodal:
|
837 |
-
fname = os.path.join(figdir, 'plt_dataset_merged_%s.pdf'%(plot_type))
|
838 |
-
else:
|
839 |
-
fname = os.path.join(figdir, 'plt_dataset_unimodal_merged_%s.pdf'%(plot_type))
|
840 |
-
plt.savefig(fname)
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
def dataset_complete_plot(figdir, trig='Solid', plot_type='asr', fs=18, fs2=15):
|
845 |
-
assert trig in ['Solid', 'Optimized', 'Clean']
|
846 |
-
if trig == 'Clean':
|
847 |
-
assert plot_type == 'acc'
|
848 |
-
data_files = ['specs/dataset_pt1_m_spec.csv']
|
849 |
-
if trig == 'Solid':
|
850 |
-
data_files = ['specs/dataset_pt2_m_spec.csv']
|
851 |
-
else:
|
852 |
-
data_files = ['specs/dataset_pt3_m_spec.csv']
|
853 |
-
assert plot_type in ['acc', 'asr']
|
854 |
-
if plot_type == 'acc':
|
855 |
-
metrics = ['acc_clean_all', 'acc_troj_all']
|
856 |
-
ylab = 'Accuracy'
|
857 |
-
plt_title = 'Clean & Trojan Accuracy vs Model and Detector for %s Patches'%trig
|
858 |
-
ylim = 70
|
859 |
-
legs = ("R-50 Clean Acc ↑", "R-50 Troj Acc ↓", "X-101 Clean Acc ↑", "X-101 Troj Acc ↓",
|
860 |
-
"X-152 Clean Acc ↑", "X-152 Troj Acc ↓", "X-152++ Clean Acc ↑", "X-152++ Troj Acc ↓")
|
861 |
-
else:
|
862 |
-
metrics = ['asr_troj_all', 'asr_trojq_all']
|
863 |
-
ylab = 'ASR & Q-ASR'
|
864 |
-
plt_title = 'ASR & Q-ASR vs Model and Detector for %s Patches'%trig
|
865 |
-
ylim = 100
|
866 |
-
legs = ("R-50 ASR ↑", "R-50 Q-ASR ↓", "X-101 ASR ↑", "X-101 Q-ASR ↓",
|
867 |
-
"X-152 ASR ↑", "X-152 Q-ASR ↓", "X-152++ ASR ↑", "X-152++ Q-ASR ↓")
|
868 |
-
if trig == 'Clean':
|
869 |
-
metrics = ['acc_clean_all']
|
870 |
-
ylab = 'Accuracy'
|
871 |
-
plt_title = 'Clean Model Accuracy vs Model and Detector'
|
872 |
-
legs = ("R-50", "X-101", "X-152", "X-152++")
|
873 |
-
|
874 |
-
os.makedirs(figdir, exist_ok=True)
|
875 |
-
|
876 |
-
# load results
|
877 |
-
means = {}
|
878 |
-
stdvs = {}
|
879 |
-
for met in metrics:
|
880 |
-
means[met] = {}
|
881 |
-
stdvs[met] = {}
|
882 |
-
for d in DETECTOR_OPTIONS:
|
883 |
-
means[met][d] = []
|
884 |
-
stdvs[met][d] = []
|
885 |
-
for d in DETECTOR_OPTIONS:
|
886 |
-
g_filter = ('detector', d)
|
887 |
-
_, _, results = load_grouped_results(data_files, ['0-119'], 'model', metrics, g_filter)
|
888 |
-
for k in COMP_ORDER:
|
889 |
-
# prepare results
|
890 |
-
res_dict, _, _ = results[k]
|
891 |
-
for met in metrics:
|
892 |
-
m, s = res_dict[met][0]
|
893 |
-
means[met][d].append(m)
|
894 |
-
stdvs[met][d].append(s)
|
895 |
-
|
896 |
-
print('---')
|
897 |
-
print('finished gathering results')
|
898 |
-
num_bars = len(means[metrics[0]][DETECTOR_OPTIONS[0]])
|
899 |
-
print('number of bars: %i'%num_bars)
|
900 |
-
|
901 |
-
width = 0.20
|
902 |
-
fig, ax = plt.subplots(figsize=[10,6])
|
903 |
-
x = np.arange(len(COMP_ORDER))
|
904 |
-
rects = []
|
905 |
-
for i in range(num_bars):
|
906 |
-
for d_id, d in enumerate(DETECTOR_OPTIONS):
|
907 |
-
for m_id, met in enumerate(metrics):
|
908 |
-
m = means[met][d][i]
|
909 |
-
s = stdvs[met][d][i]
|
910 |
-
c = COLOR_SETTINGS[d][m_id]
|
911 |
-
r = ax.bar(x[i] + (d_id-1.5)*width, m, width, yerr=2*s, color=c, edgecolor='black', capsize=3)
|
912 |
-
rects.append(r)
|
913 |
-
|
914 |
-
ax.set_ylabel(ylab, fontsize=fs)
|
915 |
-
ax.set_title(plt_title, fontsize=fs)
|
916 |
-
ax.set_xticks(x)
|
917 |
-
ax.set_xticklabels(COMP_ORDER_LABEL, fontsize=fs2)
|
918 |
-
ax.legend()
|
919 |
-
# fig.tight_layout()
|
920 |
-
plt.xticks(rotation=45, ha="right")
|
921 |
-
plt.yticks(fontsize=fs2)
|
922 |
-
plt.ylim(0, ylim)
|
923 |
-
plt.gcf().subplots_adjust(left=0.10, right=0.97, top=0.95)
|
924 |
-
|
925 |
-
# legend at bottom
|
926 |
-
plt.gcf().subplots_adjust(bottom=0.25)
|
927 |
-
leg_rects = []
|
928 |
-
for i in range(len(legs)):
|
929 |
-
leg_rects.append(rects[i])
|
930 |
-
ax.legend(leg_rects, legs, loc='upper center', bbox_to_anchor=(0.5, -0.20), ncol=4,
|
931 |
-
frameon=False, fontsize=12)
|
932 |
-
|
933 |
-
fname = os.path.join(figdir, 'plt_dataset_complete_%s_%s.jpg'%(trig, plot_type))
|
934 |
-
plt.savefig(fname)
|
935 |
-
fname = os.path.join(figdir, 'plt_dataset_complete_%s_%s.pdf'%(trig, plot_type))
|
936 |
-
plt.savefig(fname)
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
# ================================================================================
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
if __name__ == '__main__':
|
945 |
-
parser = argparse.ArgumentParser()
|
946 |
-
# pre-defined scripts
|
947 |
-
parser.add_argument('--dataset', action='store_true', help='get results for the dataset models')
|
948 |
-
parser.add_argument('--pt', type=int, default=None, help='which dataset part to inspect (default: all)')
|
949 |
-
# figure making scripts
|
950 |
-
parser.add_argument('--design_type', action='store_true', help='create figures for patch type design experiments')
|
951 |
-
parser.add_argument('--design_perc', action='store_true', help='create figure for poisoning percentage experiments')
|
952 |
-
parser.add_argument('--design_scale', action='store_true', help='create figure for patch scale experiments')
|
953 |
-
parser.add_argument('--dataset_plots', action='store_true', help='create figures for dataset results')
|
954 |
-
parser.add_argument('--dataset_complete_plot', action='store_true', help='create figure 5 for dataset results')
|
955 |
-
parser.add_argument('--dataset_plots_uni', action='store_true', help='create figures for unimodal dataset results')
|
956 |
-
# manually specify run
|
957 |
-
parser.add_argument('--sf', type=str, default=None, help='spec file to analyze results from, must be a model spec file')
|
958 |
-
parser.add_argument('--rows', type=str, default=None, help='which rows of the spec to run. see documentation. default: all rows')
|
959 |
-
parser.add_argument('--trials', type=int, default=1, help='pool trials, if applicable (default = 1)')
|
960 |
-
parser.add_argument('--crit', type=str, default='model_id', help='which model criteria to list in table (default = model_id)')
|
961 |
-
parser.add_argument('--all', action='store_true', help='print all metrics, default shows limited set')
|
962 |
-
parser.add_argument('--clean', action='store_true', help='print only clean metrics')
|
963 |
-
# other
|
964 |
-
parser.add_argument('--figdir', type=str, default='figures', help='where figures will be saved')
|
965 |
-
parser.add_argument('--csv', action='store_true', help='when enabled, prints tables in a csv-like format')
|
966 |
-
args = parser.parse_args()
|
967 |
-
|
968 |
-
# dataset models
|
969 |
-
if args.dataset:
|
970 |
-
if args.pt is None:
|
971 |
-
for PT in range(6):
|
972 |
-
dataset_results(PT)
|
973 |
-
else:
|
974 |
-
dataset_results(args.pt)
|
975 |
-
# figure scripts
|
976 |
-
if args.design_type:
|
977 |
-
design_type_plot(args.figdir, 'acc')
|
978 |
-
design_type_plot(args.figdir, 'asr')
|
979 |
-
if args.design_perc:
|
980 |
-
design_perc_scale_plot(args.figdir, 'perc')
|
981 |
-
if args.design_scale:
|
982 |
-
design_perc_scale_plot(args.figdir, 'scale')
|
983 |
-
if args.dataset_plots:
|
984 |
-
dataset_plots_merged(args.figdir, 'acc')
|
985 |
-
dataset_plots_merged(args.figdir, 'asr')
|
986 |
-
if args.dataset_complete_plot:
|
987 |
-
dataset_complete_plot(args.figdir, 'Clean', 'acc')
|
988 |
-
for TRIG in ['Solid', 'Optimized']:
|
989 |
-
for PLOT_TYPE in ['acc', 'asr']:
|
990 |
-
dataset_complete_plot(args.figdir, TRIG, PLOT_TYPE)
|
991 |
-
if args.dataset_plots_uni:
|
992 |
-
dataset_plots_merged(args.figdir, 'acc', unimodal=True)
|
993 |
-
dataset_plots_merged(args.figdir, 'asr', unimodal=True)
|
994 |
-
# use specs to load results
|
995 |
-
if args.sf is not None:
|
996 |
-
check_results(args.sf, args.rows, args.trials, args.crit, args.all, args.clean)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/GFPGAN-example/gfpgan/data/__init__.py
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
import importlib
|
2 |
-
from basicsr.utils import scandir
|
3 |
-
from os import path as osp
|
4 |
-
|
5 |
-
# automatically scan and import dataset modules for registry
|
6 |
-
# scan all the files that end with '_dataset.py' under the data folder
|
7 |
-
data_folder = osp.dirname(osp.abspath(__file__))
|
8 |
-
dataset_filenames = [osp.splitext(osp.basename(v))[0] for v in scandir(data_folder) if v.endswith('_dataset.py')]
|
9 |
-
# import all the dataset modules
|
10 |
-
_dataset_modules = [importlib.import_module(f'gfpgan.data.{file_name}') for file_name in dataset_filenames]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|