Skip to content

Commit 2347209

Browse files
committed
refactor: move default images to js file
1 parent 90ec294 commit 2347209

File tree

2 files changed

+129
-5
lines changed

2 files changed

+129
-5
lines changed

imageDataset.js

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
const standardUrl = 'https://demo-dataset.image-js.org/standard';
2+
const standardMaskUrl = 'https://demo-dataset.image-js.org/standard_mask';
3+
const morphologyMaskUrl = 'https://demo-dataset.image-js.org/morphology_mask';
4+
5+
export const defaultImages = [
6+
{
7+
type: 'url',
8+
value: `${standardUrl}/jellybeans.png`,
9+
label: 'Jelly beans ',
10+
imageType: 'image',
11+
},
12+
{
13+
type: 'url',
14+
value: `${standardUrl}/female.png`,
15+
label: 'Female',
16+
imageType: 'image',
17+
},
18+
{
19+
type: 'url',
20+
value: `${standardUrl}/femaleBellLabs.png`,
21+
label: 'Female from Bell Labs ',
22+
imageType: 'image',
23+
},
24+
{
25+
type: 'url',
26+
value: `${standardUrl}/house.png`,
27+
label: 'House',
28+
imageType: 'image',
29+
},
30+
{
31+
type: 'url',
32+
value: `${standardUrl}/mandrill.png`,
33+
label: 'Mandrill',
34+
imageType: 'image',
35+
},
36+
{
37+
type: 'url',
38+
value: `${standardUrl}/peppers.png`,
39+
label: 'Peppers',
40+
imageType: 'image',
41+
},
42+
43+
{
44+
type: 'url',
45+
value: `${standardUrl}/barbara.jpg`,
46+
label: 'Barbara',
47+
imageType: 'image',
48+
},
49+
50+
{
51+
type: 'url',
52+
value: `${standardUrl}/boat.png`,
53+
label: 'Standard boat',
54+
imageType: 'image',
55+
},
56+
{
57+
type: 'url',
58+
value: `${standardUrl}/male.png`,
59+
label: 'Male',
60+
imageType: 'image',
61+
},
62+
{
63+
type: 'url',
64+
value: `${standardUrl}/airport.png`,
65+
label: 'Airport',
66+
imageType: 'image',
67+
},
68+
];
69+
70+
export const defaultMasks = [
71+
{
72+
type: 'url',
73+
value: `${morphologyMaskUrl}/circles.png`,
74+
label: 'Circles',
75+
imageType: 'mask',
76+
},
77+
{
78+
type: 'url',
79+
value: `${morphologyMaskUrl}/shapes.png`,
80+
label: 'Shapes',
81+
imageType: 'mask',
82+
},
83+
{
84+
type: 'url',
85+
value: `${morphologyMaskUrl}/star.png`,
86+
label: 'Star',
87+
imageType: 'mask',
88+
},
89+
{
90+
type: 'url',
91+
value: `${standardMaskUrl}/house.png`,
92+
label: 'House',
93+
imageType: 'mask',
94+
},
95+
{
96+
type: 'url',
97+
value: `${standardMaskUrl}/mandrill.png`,
98+
label: 'Mandrill',
99+
imageType: 'mask',
100+
},
101+
{
102+
type: 'url',
103+
value: `${standardMaskUrl}/peppers.png`,
104+
label: 'Peppers',
105+
imageType: 'mask',
106+
},
107+
108+
{
109+
type: 'url',
110+
value: `${standardMaskUrl}/barbara.png`,
111+
label: 'Barbara',
112+
imageType: 'mask',
113+
},
114+
{
115+
type: 'url',
116+
value: `${standardMaskUrl}/boat.png`,
117+
label: 'Standard boat)',
118+
imageType: 'mask',
119+
},
120+
121+
{
122+
type: 'url',
123+
value: `${standardMaskUrl}/male.png`,
124+
label: 'Male',
125+
imageType: 'mask',
126+
},
127+
];

imageLoader.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
const fs = require('fs');
22
const imageJs = require('image-js');
33
const { fetchURL } = require('image-js');
4-
require('ts-node/register');
5-
const {
6-
defaultImages,
7-
defaultMasks,
8-
} = require('./src/demo/contexts/demo/defaultImages');
4+
5+
const { defaultImages, defaultMasks } = require('./imageDataset.js');
96

107
async function imageLoader(siteDir) {
118
const imageData = [];

0 commit comments

Comments
 (0)