v1.0.0 update

This commit is contained in:
hanzhn
2024-05-29 10:30:04 +08:00
parent e7255aac25
commit aa8250e5d2
11 changed files with 30 additions and 24 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ Below are examples for each format, illustrating their details and basic usage.
## Modelscope Format
We use a [custom-stylized dataset](https://modelscope.cn/datasets/damo/style_custom_dataset/summary), which included classes 3D, anime, flat illustration, oil painting, sketch, and watercolor, each with 30 image-text pairs.
We use a [custom-stylized dataset](https://modelscope.cn/datasets/iic/style_custom_dataset/summary), which included classes 3D, anime, flat illustration, oil painting, sketch, and watercolor, each with 30 image-text pairs.
```python
# pip install modelscope
+1 -1
View File
@@ -145,7 +145,7 @@ Therefore, subsequent startups will become much faster (about one minute) as dow
### Modelscope Studio & Huggingface Space
We deploy a work studio on Modelscope that includes only the inference tab, please refer to [ms_scepter_studio](https://www.modelscope.cn/studios/damo/scepter_studio/summary) and [hf_scepter_studio](https://huggingface.co/spaces/modelscope/scepter_studio)
We deploy a work studio on Modelscope that includes only the inference tab, please refer to [ms_scepter_studio](https://www.modelscope.cn/studios/iic/scepter_studio/summary) and [hf_scepter_studio](https://huggingface.co/spaces/modelscope/scepter_studio)
## 🔍 Learn More
+1 -1
View File
@@ -37,7 +37,7 @@ SOLVER:
TIMESTEPS: 1000
MIN_SNR_GAMMA:
ZERO_TERMINAL_SNR: False
PRETRAINED_MODEL: ms://damo/stylebooth@models/stylebooth-tb-5000-0.bin
PRETRAINED_MODEL: ms://iic/stylebooth@models/stylebooth-tb-5000-0.bin
IGNORE_KEYS: [ ]
CONCAT_NO_SCALE_FACTOR: True
SCALE_FACTOR: 0.18215
+2 -2
View File
@@ -10,7 +10,7 @@ DESC_INFO:
<table align="center">
<tr>
<td>
<img src="https://modelscope.cn/api/v1/models/damo/scepter/repo?Revision=master&FilePath=assets/scepter_studio/scepter_studio_banner.jpg">
<img src="https://modelscope.cn/api/v1/models/iic/scepter/repo?Revision=master&FilePath=assets/scepter_studio/scepter_studio_banner.jpg">
<h3><center>SCEPTER Studio是基于开源基模型和自研微调编辑算法构建的生成定制和编辑工具箱,提供围绕生成、微调、编辑、数据处理等一系列的工具和插件。</center><h3>
</td>
</tr>
@@ -22,7 +22,7 @@ DESC_INFO:
<table align="center">
<tr>
<td>
<img src="https://modelscope.cn/api/v1/models/damo/scepter/repo?Revision=master&FilePath=assets/scepter_studio/scepter_studio_banner.jpg">
<img src="https://modelscope.cn/api/v1/models/iic/scepter/repo?Revision=master&FilePath=assets/scepter_studio/scepter_studio_banner.jpg">
<h3><center>SCEPTER Studio is a customized generation and editing toolkit built on the open-source base models and proprietary fine-tuning editing algorithms, offering a range of tools and plugins centered around generation, fine-tuning, editing, and data processing.</center><h3>
</td>
</tr>
@@ -49,7 +49,7 @@ DEFAULT_PARAS:
INPUT: ["PROMPT", "NEGATIVE_PROMPT"]
MODEL:
PRETRAINED_MODEL: ms://damo/stylebooth@models/stylebooth-tb-5000-0.bin
PRETRAINED_MODEL: ms://iic/stylebooth@models/stylebooth-tb-5000-0.bin
SCHEDULE:
PARAMETERIZATION: "eps"
TIMESTEPS: 1000
@@ -68,7 +68,7 @@ DEFAULT_PARAS:
INPUT: ["ORIGINAL_SIZE_AS_TUPLE", "AESTHETIC_SCORE", "NEGATIVE_AESTHETIC_SCORE", "CROP_COORDS_TOP_LEFT", "PROMPT", "NEGATIVE_PROMPT"]
MODEL:
PRETRAINED_MODEL: ms://damo/LARGEN@models/largen_ckpt_s22k.pth
PRETRAINED_MODEL: ms://iic/LARGEN@models/largen_ckpt_s22k.pth
# SCHEDULE_ARGS DESCRIPTION: TYPE: default: ''
SCHEDULE:
PARAMETERIZATION: "eps"
@@ -245,8 +245,8 @@ MODEL:
LEGACY_UCG_VALUE:
-
NAME: IPAdapterPlusEmbedder
CLIP_DIR: ms://damo/LARGEN@models/clip_encoder/
PRETRAINED_MODEL: ms://damo/LARGEN@models/ip-adapter-plus_sdxl_vit-h.bin
CLIP_DIR: ms://iic/LARGEN@models/clip_encoder/
PRETRAINED_MODEL: ms://iic/LARGEN@models/ip-adapter-plus_sdxl_vit-h.bin
INPUT_KEYS: [ "ref_ip", "ref_detail" ]
IN_DIM: 1280
HEADS: 20
+2 -2
View File
@@ -48,11 +48,11 @@ BANNER: |
</div>
<div class="qr-codes">
<div class="qr-code-container">
<img src="https://modelscope.cn/api/v1/models/damo/scepter/repo?Revision=master&FilePath=assets/scepter_studio/ms_scepter_studio_qr.png" alt="ms_scepter_studio_qr">
<img src="https://modelscope.cn/api/v1/models/iic/scepter/repo?Revision=master&FilePath=assets/scepter_studio/ms_scepter_studio_qr.png" alt="ms_scepter_studio_qr">
<div class="caption"><a href="https://www.modelscope.cn/studios/iic/scepter_studio">Modelscope Studio</a></div>
</div>
<div class="qr-code-container">
<img src="https://modelscope.cn/api/v1/models/damo/scepter/repo?Revision=master&FilePath=assets/scepter_studio/scepter_github_qr.png" alt="scepter_github_qr">
<img src="https://modelscope.cn/api/v1/models/iic/scepter/repo?Revision=master&FilePath=assets/scepter_studio/scepter_github_qr.png" alt="scepter_github_qr">
<div class="caption"><a href="https://github.com/modelscope/scepter">Github</a></div>
</div>
</div>
@@ -160,7 +160,7 @@ SOLVER:
TIMESTEPS: 1000
MIN_SNR_GAMMA:
ZERO_TERMINAL_SNR: False
PRETRAINED_MODEL: ms://damo/stylebooth@models/stylebooth-tb-5000-0.bin
PRETRAINED_MODEL: ms://iic/stylebooth@models/stylebooth-tb-5000-0.bin
IGNORE_KEYS: [ ]
CONCAT_NO_SCALE_FACTOR: True
SCALE_FACTOR: 0.18215
@@ -32,11 +32,12 @@ class CreateDatasetUIName():
self.default_dataset_repo = 'https://www.modelscope.cn/api/v1/models/iic/scepter/'
self.default_dataset_zip = {
'scepter_txt2img':
f' {self.default_dataset_repo}repo?Revision=master&FilePath=datasets/3D_example_csv.zip ',
f'{self.default_dataset_repo}repo?Revision=master&FilePath=datasets/3D_example_csv.zip',
'scepter_img2img':
f' {self.default_dataset_repo}repo?Revision=master&FilePath=datasets/hed_pair.zip '
f'{self.default_dataset_repo}repo?Revision=master&FilePath=datasets/hed_pair.zip'
}
self.default_dataset_zip = ' and '.join([f"[{k}]({v})" for k, v in self.default_dataset_zip.items()])
self.default_dataset_zip_str = ' and '.join(
[f'[{k}]({v})' for k, v in self.default_dataset_zip.items()])
self.default_dataset_name = {
'scepter_txt2img': '3D_example',
@@ -56,7 +57,7 @@ class CreateDatasetUIName():
'The first line is Target:FILE, Prompt, followed by the format of each line: image path, description.'
'we also surpport the zip of '
'one level subfolder of images whose format are in jpg, jpeg, png, webp. '
f'See the ZIP examples: {self.default_dataset_zip}. \n' # noqa
f'See the ZIP examples: {self.default_dataset_zip_str}. \n' # noqa
f'* If you have refreshed the page, please click the {self.refresh_list_button} '
'button to ensure all previously created datasets are visible in the dropdown menu.\n'
'* For processing and training with large-scale data(for example more than 10K samples), '
@@ -105,11 +106,12 @@ class CreateDatasetUIName():
self.default_dataset_repo = 'https://www.modelscope.cn/api/v1/models/iic/scepter/'
self.default_dataset_zip = {
'scepter_txt2img':
f' {self.default_dataset_repo}repo?Revision=master&FilePath=datasets/3D_example_csv.zip ',
f'{self.default_dataset_repo}repo?Revision=master&FilePath=datasets/3D_example_csv.zip',
'scepter_img2img':
f' {self.default_dataset_repo}repo?Revision=master&FilePath=datasets/hed_pair.zip '
f'{self.default_dataset_repo}repo?Revision=master&FilePath=datasets/hed_pair.zip'
}
self.default_dataset_zip = ' 和 '.join([f"[{k}]({v})" for k, v in self.default_dataset_zip.items()])
self.default_dataset_zip_str = ' 和 '.join(
[f'[{k}]({v})' for k, v in self.default_dataset_zip.items()])
self.default_dataset_name = {
'scepter_txt2img': '3D_example',
@@ -123,7 +125,7 @@ class CreateDatasetUIName():
f'* {self.btn_create_datasets_from_file} 按钮支持从文件中来新建数据集,目前支持zip文件,'
'需要保证在文件夹外进行打包,并包含images/文件夹和train.csv(会使用该文件中的图片路径),首行为Target:FILE,Prompt,'
'其次每行格式为:图片路径,描述;'
f'同时我们也支持图像文件的zip包,格式在jpg、jpeg、png或webp。数据ZIP样例路径:{self.default_dataset_zip}. \n'
f'同时我们也支持图像文件的zip包,格式在jpg、jpeg、png或webp。数据ZIP样例路径:{self.default_dataset_zip_str}. \n'
+
f'* 如果刷新了页面,请点击{self.refresh_list_button} 按钮以确保所有以往创建的数据集在下拉框中可见。\n'
'* 对于大规模数据的处理和训练(数据规模大于1万),建议使用命令行形式\n'
@@ -6,9 +6,9 @@ import datetime
import os.path
from collections import OrderedDict
import gradio as gr
from tqdm import tqdm
import gradio as gr
from scepter.modules.utils.file_system import FS
from scepter.studio.preprocess.caption_editor_ui.component_names import \
CreateDatasetUIName
@@ -25,7 +25,7 @@ def wget_file(file_url, save_file):
if 'oss' in file_url:
file_url = file_url.split('?')[0]
local_path, _ = FS.map_to_local(save_file)
res = os.popen(f"wget -c '{file_url}' -O '{local_path}'")
res = os.popen(f"wget -c '{file_url.strip()}' -O '{local_path.strip()}'")
res.readlines()
FS.put_object_from_local_file(local_path, save_file)
return save_file, res
@@ -239,7 +239,7 @@ class CreateDatasetUI(UIBase):
label=self.components_name.zip_file_url,
value='',
placeholder=self.components_name.
default_dataset_zip,
default_dataset_zip_str,
visible=False)
with gr.Column(scale=1, visible=False,
min_width=0) as btn_panel:
@@ -863,12 +863,16 @@ class BrowserUI(UIBase):
local_work_dir, _ = FS.map_to_local(src_path)
FS.get_dir_to_local_dir(src_path, local_work_dir)
meta_file = f'{local_work_dir}/{username}/{modelid}/params.yaml'
if not os.path.exists(meta_file):
raise gr.Error(
'The tuner model failed to be downloaded from ModelScope!')
gr.Info(
'The tuner model has been downloaded from ModelScope Successfully!'
)
#
meta_file = f'{local_work_dir}/{username}/{modelid}/params.yaml'
meta = Config(cfg_file=meta_file)
base_model = meta['PARAMS']['base_model_revision']
tuner_type = meta['PARAMS']['tuner_name']