Skip to content

Commit

Permalink
Merge pull request #102 from chairc/dev
Browse files Browse the repository at this point in the history
Pre-release preparation.
  • Loading branch information
chairc authored Nov 14, 2024
2 parents 28d7838 + d7dfabd commit d1d80b7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ Integrated Design Diffusion Model
- [x] 11. Write visual webui interface. (2024-01-23)
- [x] 12. Adding PLMS Sampling Method. (2024-03-12)
- [x] 13. Adding FID calculator to verify image quality. (2024-05-06)
- [x] 14. Adding the deployment of image-generating Sockets
- [x] 14. Adding the deployment of image-generating Sockets and Web server. (2024-11-13)

### Training
Expand Down
1 change: 0 additions & 1 deletion README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ Integrated Design Diffusion Model
- [x] 11. 编写可视化webui界面(2024-01-23)
- [x] 12. 增加PLMS采样方法(2024-03-12)
- [x] 13. 增加FID方法验证图像质量(2024-05-06)
- [x] 14. 增加生成图像Socket部署(2024-11-12)
- [x] 14. 增加生成图像Socket和网站服务部署(2024-11-13)

### 训练
Expand Down
2 changes: 1 addition & 1 deletion config/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# IDDM version
__version__ = ["0.0.1", "1.0.0", "1.0.1", "1.0.2", "1.1.0-stable", "1.1.1", "1.1.2-stable", "1.1.3", "1.1.4", "1.1.5",
"1.1.6"]
"1.1.6", "1.1.7"]


def get_versions():
Expand Down
24 changes: 19 additions & 5 deletions test/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import json
import os
import socket
import requests

import torch
import unittest
Expand Down Expand Up @@ -129,15 +130,15 @@ def test_summary(self):
print(net)
summary(model=net, input_data=[x, t, y])

def test_send_message(self):
def test_send_message_to_socket(self):
"""
Test local send message to deploy.py
Test local send message to deploy_socket.py
:return: None
"""
test_json = {"conditional": True, "sample": "ddpm", "image_size": 64, "num_images": 2, "act": "gelu",
test_json = {"sample": "ddpm", "image_size": 64, "num_images": 2, "type": "base64",
"weight_path": "/your/test/model/path/test.pt",
"result_path": "/your/results/deploy",
"num_classes": 6, "class_name": 1, "cfg_scale": 3}
"result_path": "/your/results/deploy", "class_name": 0,
}
logger.info(msg=f"Test json: {test_json}")
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# host = "127.0.1.1"
Expand All @@ -151,6 +152,19 @@ def test_send_message(self):
client_socket.close()
logger.info(msg="Send message successfully!")

def test_send_message_to_web(self):
url = "http://127.0.0.1:12341/api/generate/df"
# Define the parameters of the request, using JSON format here
data = {
"sample": "ddim", "image_size": 64, "num_images": 2, "type": "url",
"weight_path": "/your/test/model/path/test.pt",
"result_path": "/your/results/deploy", "class_name": 0,
}

# Send a POST request
response = requests.post(url, json=data)
logger.info(msg=f"Get return message => {json.loads(response.content.decode('utf-8'))}")

def test_separate_ckpt_weights(self):
"""
test separate checkpoint weights
Expand Down

0 comments on commit d1d80b7

Please sign in to comment.