JadeRay-42 commited on
Commit
0613c20
·
1 Parent(s): 83a96f9

constant img

Browse files
Files changed (1) hide show
  1. CustomAnchorShape.py +4 -1
CustomAnchorShape.py CHANGED
@@ -2,6 +2,7 @@
2
 
3
  from typing import List, Union
4
  import numpy as np
 
5
 
6
  import datasets
7
  from .CustomAnchorShapeGenerator import CustomAnchorShape, filled_anchors
@@ -133,12 +134,14 @@ class CustomAnchorShapeDataset(datasets.GeneratorBasedBuilder):
133
  height,
134
  custom_data=custom_data,
135
  )
 
 
136
 
137
  for idx, data in enumerate(custom_shape.custom_data):
138
  yield idx, {
139
  'image_id': idx,
140
  # 'image': custom_shape.get_distribution(data, type='img').convert('RGB'),
141
- 'image': filled_anchors(data, width, height),
142
  'width': width,
143
  'height': height,
144
  'object': {
 
2
 
3
  from typing import List, Union
4
  import numpy as np
5
+ from PIL import Image
6
 
7
  import datasets
8
  from .CustomAnchorShapeGenerator import CustomAnchorShape, filled_anchors
 
134
  height,
135
  custom_data=custom_data,
136
  )
137
+
138
+ im = Image.fromarray(np.full((1, 1), 300), mode='L')
139
 
140
  for idx, data in enumerate(custom_shape.custom_data):
141
  yield idx, {
142
  'image_id': idx,
143
  # 'image': custom_shape.get_distribution(data, type='img').convert('RGB'),
144
+ 'image': im,
145
  'width': width,
146
  'height': height,
147
  'object': {