merve HF staff commited on
Commit
b0d31f1
·
1 Parent(s): a81a136

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +41 -2
README.md CHANGED
@@ -14,6 +14,45 @@ dataset_info:
14
  download_size: 604849707
15
  dataset_size: 604990210.0
16
  ---
17
- # Dataset Card for "canny_diffusiondb"
18
 
19
- [More Information needed](https://github.com/huggingface/datasets/blob/main/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  download_size: 604849707
15
  dataset_size: 604990210.0
16
  ---
17
+ # Canny DiffusionDB
18
 
19
+ This dataset is the [DiffusionDB dataset](https://huggingface.co/datasets/poloclub/diffusiondb) that is transformed using Canny transformation.
20
+
21
+ You can see samples below 👇
22
+
23
+ **Sample:**
24
+
25
+ Original Image:
26
+ ![image](https://datasets-server.huggingface.co/assets/merve/canny_diffusiondb/--/merve--canny_diffusiondb/train/0/original_image/image.jpg)
27
+ Transformed Image:
28
+ ![image](https://datasets-server.huggingface.co/assets/merve/canny_diffusiondb/--/merve--canny_diffusiondb/train/0/transformed_image/image.jpg)
29
+ Caption:
30
+ "a small wheat field beside a forest, studio lighting, golden ratio, details, masterpiece, fine art, intricate, decadent, ornate, highly detailed, digital painting, octane render, ray tracing reflections, 8 k, featured, by claude monet and vincent van gogh "
31
+
32
+ Below you can find a small script used to create this dataset:
33
+ ```python
34
+
35
+ def canny_convert(image):
36
+ image_array = np.array(image)
37
+ gray_image = cv2.cvtColor(image_array, cv2.COLOR_BGR2GRAY)
38
+ edges = cv2.Canny(gray_image, 100, 200)
39
+ edge_image = Image.fromarray(edges)
40
+ return edge_image
41
+
42
+ dataset = load_dataset("poloclub/diffusiondb", split = "train")
43
+
44
+ dataset_list = []
45
+ for data in dataset:
46
+
47
+ image_path = data["image"]
48
+ prompt = data["prompt"]
49
+ transformed_image_path = canny_convert(image_path)
50
+
51
+ new_data = {
52
+ "original_image": image,
53
+ "prompt": prompt,
54
+ "transformed_image": transformed_image,
55
+ }
56
+ dataset_list.append(new_data)
57
+
58
+ ```