Skip to content

Commit 677a572

Browse files
committed
update readme
1 parent 87455d2 commit 677a572

2 files changed

Lines changed: 23 additions & 22 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
- **Versatile Applications**: Ready to use as a best-in-class reranker to improve editing outputs, or as a high-fidelity reward signal for **stable and effective Reinforcement Learning (RL) fine-tuning**.
2727

2828
## 🔥 News
29-
- **2025-09-30**: LoRA weights for OmniGen2, trained via Flow-GRPO with EditScore-7B (Avg8) as the reward model, have been released on [Hugging Face]() and [ModelScope]().
29+
- **2025-09-30**: **OmniGen2-EditScore7B**, unlocking online RL For Image Editing via high-fidelity EditScore. LoRA weights have been released on [Hugging Face](https://huggingface.co/OmniGen2/OmniGen2-EditScore7B) and [ModelScope](https://www.modelscope.cn/models/OmniGen2/OmniGen2-EditScore7B).
3030
- **2025-09-30**: We are excited to release **EditScore** and **EditReward-Bench**! Model weights and the benchmark dataset are now publicly available. You can access them on Hugging Face: [Models Collection](https://huggingface.co/collections/EditScore/editscore-68d8e27ee676981221db3cfe) and [Benchmark Dataset](https://huggingface.co/datasets/EditScore/EditReward-Bench), and on ModelScope: [Models Collection](https://www.modelscope.cn/collections/EditScore-8b0d53aa945d4e) and [Benchmark Dataset](https://www.modelscope.cn/datasets/EditScore/EditReward-Bench).
3131

3232
## 📖 Introduction

evaluation.py

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import os
1111
import time
1212
import threading
13-
from concurrent.futures import ThreadPoolExecutor, as_completed
13+
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor, as_completed
1414
from typing import List, Tuple, Dict, Any, Optional
1515

1616
import dotenv
@@ -78,32 +78,31 @@ def load_pairs_dataset(dataset: Dataset) -> Dict[str, Tuple[str, Image.Image, Im
7878
pairs[key2] = (instruction, input_image, data["output_images"][1].convert("RGB"))
7979
return pairs
8080

81+
def _load_item(data: dict) -> list[tuple[str, tuple[str, Image.Image, Image.Image]]]:
82+
key1, key2 = data["key"]
83+
instruction = data["instruction"]
84+
85+
input_image = data["input_image"].convert("RGB")
86+
output_image1 = data["output_images"][0].convert("RGB")
87+
output_image2 = data["output_images"][1].convert("RGB")
88+
89+
return [
90+
(key1, (instruction, input_image, output_image1)),
91+
(key2, (instruction, input_image, output_image2)),
92+
]
8193

8294
def load_pairs_dataset_multithreaded(dataset: Dataset, max_workers: int = None) -> Dict[str, Tuple[str, Image.Image, Image.Image]]:
8395
if max_workers is None:
84-
max_workers = min(32, (os.cpu_count() or 1) * 5)
96+
# max_workers = min(32, (os.cpu_count() or 1) * 5)
97+
max_workers = os.cpu_count() or 1
8598

8699
pairs = {}
87100

88-
89-
def _process_item(data: dict) -> list[tuple[str, tuple[str, Image.Image, Image.Image]]]:
90-
key1, key2 = data["key"]
91-
instruction = data["instruction"]
92-
93-
input_image = data["input_image"].convert("RGB")
94-
output_image1 = data["output_images"][0].convert("RGB")
95-
output_image2 = data["output_images"][1].convert("RGB")
96-
97-
return [
98-
(key1, (instruction, input_image, output_image1)),
99-
(key2, (instruction, input_image, output_image2)),
100-
]
101-
102101
print(f"Processing dataset (length: {len(dataset)}) with {max_workers} threads", flush=True)
103102

104-
with ThreadPoolExecutor(max_workers=max_workers) as executor:
103+
with ProcessPoolExecutor(max_workers=max_workers) as executor:
105104
results_iterator = tqdm(
106-
executor.map(_process_item, dataset),
105+
executor.map(_load_item, dataset),
107106
total=len(dataset),
108107
desc="Processing dataset with multiple threads"
109108
)
@@ -237,10 +236,12 @@ def main(args):
237236
score1 = all_scores[key1][dimension]
238237
score2 = all_scores[key2][dimension]
239238
data["score"] = [score1, score2]
239+
240+
input_image_path = os.path.join(args.result_dir, "images", f"{key1}_input.png")
241+
output_image_path1 = os.path.join(args.result_dir, "images", f"{key1}")
242+
output_image_path2 = os.path.join(args.result_dir, "images", f"{key2}.png")
240243

241-
input_image_path = os.path.join(args.result_dir, "input_images", f"{key1}_input.png")
242-
output_image_path1 = os.path.join(args.result_dir, "output_images", f"{key1}_output0.png")
243-
output_image_path2 = os.path.join(args.result_dir, "output_images", f"{key2}_output1.png")
244+
os.makedirs(os.path.dirname(input_image_path), exist_ok=True)
244245

245246
data['input_image'].save(input_image_path)
246247
data['output_images'][0].save(output_image_path1)

0 commit comments

Comments
 (0)