Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
boris_conforty
Food-Recognition
Commits
66498a81
Commit
66498a81
authored
Feb 20, 2020
by
Ubuntu
Browse files
Fixed Mask R-CNN code to handle older versions of Keras
parent
8b491311
Changes
2
Hide whitespace changes
Inline
Side-by-side
mrcnn/model.py
View file @
66498a81
...
...
@@ -2071,7 +2071,16 @@ class MaskRCNN():
exlude: list of layer names to excluce
"""
import
h5py
from
keras.engine
import
saving
# from keras.engine import saving
# Replaced according to code on https://github.com/matterport/Mask_RCNN/blob/master/mrcnn/model.py by:
# Conditional import to support versions of Keras before 2.2
# TODO: remove in about 6 months (end of 2018)
try
:
from
keras.engine
import
saving
except
ImportError
:
# Keras before 2.2 used the 'topology' namespace.
from
keras.engine
import
topology
as
saving
if
exclude
:
by_name
=
True
...
...
prediction_tests.json
View file @
66498a81
[[{
"category_id"
:
1026
,
"segmentation"
:
[[
169.0
,
445.5
,
139.0
,
443.5
,
80.0
,
426.5
,
58.0
,
415.5
,
51.5
,
407.0
,
40.5
,
381.0
,
32.5
,
350.0
,
23.5
,
336.0
,
21.5
,
202.0
,
27.5
,
154.0
,
43.0
,
131.5
,
58.0
,
127.5
,
73.0
,
114.5
,
121.0
,
94.5
,
147.0
,
87.5
,
164.0
,
86.5
,
181.0
,
77.5
,
207.0
,
71.5
,
243.0
,
68.5
,
283.0
,
73.5
,
300.0
,
83.5
,
315.0
,
85.5
,
331.0
,
100.5
,
345.0
,
107.5
,
353.0
,
117.5
,
378.0
,
128.5
,
391.0
,
129.5
,
408.0
,
144.5
,
421.5
,
150.0
,
431.5
,
180.0
,
431.5
,
194.0
,
438.5
,
208.0
,
441.5
,
294.0
,
437.5
,
321.0
,
423.5
,
349.0
,
409.0
,
367.5
,
396.0
,
375.5
,
378.0
,
395.5
,
356.0
,
404.5
,
330.0
,
422.5
,
315.0
,
428.5
,
287.0
,
433.5
,
251.0
,
431.5
,
169.0
,
445.5
],
[
347.5
,
226.0
,
373.0
,
212.5
,
376.5
,
206.0
,
367.5
,
194.0
,
374.5
,
179.0
,
368.0
,
170.5
,
358.5
,
166.0
,
363.5
,
151.0
,
350.5
,
141.0
,
346.0
,
132.5
,
333.0
,
141.5
,
320.0
,
140.5
,
315.0
,
136.5
,
310.0
,
142.5
,
292.0
,
148.5
,
269.5
,
166.0
,
270.0
,
196.5
,
282.0
,
200.5
,
287.0
,
208.5
,
309.0
,
217.5
,
316.0
,
224.5
,
347.5
,
226.0
],
[
242.5
,
382.0
,
254.0
,
378.5
,
270.0
,
378.5
,
277.0
,
368.5
,
285.5
,
365.0
,
280.5
,
353.0
,
285.5
,
335.0
,
275.0
,
329.5
,
255.0
,
310.5
,
240.0
,
322.5
,
231.0
,
320.5
,
225.0
,
312.5
,
222.5
,
322.0
,
206.5
,
335.0
,
221.5
,
379.0
,
242.5
,
382.0
]],
"score"
:
0.49339762330055237
,
"bbox"
:
[
21.0
,
59.0
,
423.0
,
399.0
],
"image_id"
:
32275
},
{
"category_id"
:
1069
,
"segmentation"
:
[[
355.0
,
241.5
,
340.0
,
241.5
,
333.0
,
238.5
,
326.0
,
225.5
,
308.0
,
214.5
,
299.0
,
212.5
,
283.0
,
214.5
,
276.0
,
223.5
,
261.0
,
229.5
,
259.0
,
225.5
,
247.5
,
220.0
,
238.5
,
201.0
,
231.5
,
194.0
,
236.5
,
184.0
,
232.5
,
171.0
,
254.0
,
164.5
,
261.0
,
155.5
,
276.0
,
148.5
,
303.0
,
144.5
,
331.0
,
148.5
,
338.0
,
159.5
,
354.5
,
171.0
,
353.0
,
183.5
,
375.0
,
184.5
,
383.5
,
193.0
,
383.5
,
226.0
,
371.0
,
236.5
,
355.0
,
241.5
],
[
269.0
,
238.5
,
266.5
,
237.0
,
269.0
,
229.5
,
269.0
,
238.5
],
[
253.0
,
240.5
,
248.5
,
237.0
,
251.0
,
232.5
,
257.5
,
235.0
,
253.0
,
240.5
],
[
165.0
,
282.5
,
146.5
,
278.0
,
144.5
,
256.0
,
147.0
,
234.5
,
163.0
,
239.5
,
184.0
,
254.5
,
203.5
,
259.0
,
202.5
,
273.0
,
193.0
,
281.5
,
173.0
,
279.5
,
165.0
,
282.5
],
[
270.0
,
264.5
,
265.5
,
259.0
,
269.0
,
253.5
,
287.5
,
259.0
,
270.0
,
264.5
],
[
284.0
,
282.5
,
268.5
,
281.0
,
287.5
,
281.0
,
284.0
,
282.5
],
[
280.0
,
385.5
,
221.0
,
383.5
,
211.0
,
380.5
,
205.0
,
373.5
,
199.0
,
371.5
,
181.5
,
325.0
,
184.5
,
315.0
,
183.5
,
300.0
,
198.0
,
293.5
,
210.0
,
295.5
,
226.0
,
301.5
,
233.5
,
315.0
,
244.0
,
320.5
,
269.0
,
321.5
,
278.0
,
316.5
,
286.0
,
323.5
,
285.5
,
336.0
,
295.0
,
335.5
,
305.5
,
346.0
,
314.5
,
366.0
,
314.5
,
376.0
,
313.0
,
380.5
,
280.0
,
385.5
],
[
278.0
,
303.5
,
278.0
,
303.5
]],
"score"
:
0.2600328326225281
,
"bbox"
:
[
143.0
,
78.0
,
245.0
,
308.0
],
"image_id"
:
32275
}]]
\ No newline at end of file
[[{
"category_id"
:
1026
,
"segmentation"
:
[[
169.0
,
445.5
,
139.0
,
443.5
,
80.0
,
426.5
,
58.0
,
415.5
,
51.5
,
407.0
,
40.5
,
381.0
,
32.5
,
350.0
,
23.5
,
336.0
,
21.5
,
202.0
,
27.5
,
154.0
,
43.0
,
131.5
,
58.0
,
127.5
,
73.0
,
114.5
,
121.0
,
94.5
,
147.0
,
87.5
,
164.0
,
86.5
,
181.0
,
77.5
,
207.0
,
71.5
,
243.0
,
68.5
,
283.0
,
73.5
,
300.0
,
83.5
,
315.0
,
85.5
,
331.0
,
100.5
,
345.0
,
107.5
,
353.0
,
117.5
,
378.0
,
128.5
,
391.0
,
129.5
,
408.0
,
144.5
,
421.5
,
150.0
,
431.5
,
180.0
,
431.5
,
194.0
,
438.5
,
208.0
,
441.5
,
294.0
,
437.5
,
321.0
,
423.5
,
349.0
,
409.0
,
367.5
,
396.0
,
375.5
,
378.0
,
395.5
,
356.0
,
404.5
,
330.0
,
422.5
,
315.0
,
428.5
,
287.0
,
433.5
,
251.0
,
431.5
,
169.0
,
445.5
],
[
347.5
,
226.0
,
373.0
,
212.5
,
376.5
,
206.0
,
367.5
,
194.0
,
374.5
,
179.0
,
368.0
,
170.5
,
358.5
,
166.0
,
363.5
,
151.0
,
350.5
,
141.0
,
346.0
,
132.5
,
333.0
,
141.5
,
320.0
,
140.5
,
315.0
,
136.5
,
310.0
,
142.5
,
292.0
,
148.5
,
269.5
,
166.0
,
270.0
,
196.5
,
282.0
,
200.5
,
287.0
,
208.5
,
309.0
,
217.5
,
316.0
,
224.5
,
347.5
,
226.0
],
[
242.5
,
382.0
,
254.0
,
378.5
,
270.0
,
378.5
,
277.0
,
368.5
,
285.5
,
365.0
,
280.5
,
353.0
,
285.5
,
335.0
,
275.0
,
329.5
,
255.0
,
310.5
,
240.0
,
322.5
,
231.0
,
320.5
,
225.0
,
312.5
,
222.5
,
322.0
,
206.5
,
335.0
,
221.5
,
379.0
,
242.5
,
382.0
]],
"score"
:
0.49339866638183594
,
"bbox"
:
[
21.0
,
59.0
,
423.0
,
399.0
],
"image_id"
:
32275
},
{
"category_id"
:
1069
,
"segmentation"
:
[[
355.0
,
241.5
,
340.0
,
241.5
,
333.0
,
238.5
,
326.0
,
225.5
,
308.0
,
214.5
,
299.0
,
212.5
,
283.0
,
214.5
,
276.0
,
223.5
,
261.0
,
229.5
,
259.0
,
225.5
,
247.5
,
220.0
,
238.5
,
201.0
,
231.5
,
194.0
,
236.5
,
184.0
,
232.5
,
171.0
,
254.0
,
164.5
,
261.0
,
155.5
,
276.0
,
148.5
,
303.0
,
144.5
,
331.0
,
148.5
,
338.0
,
159.5
,
354.5
,
171.0
,
353.0
,
183.5
,
375.0
,
184.5
,
383.5
,
193.0
,
383.5
,
226.0
,
371.0
,
236.5
,
355.0
,
241.5
],
[
269.0
,
238.5
,
266.5
,
237.0
,
269.0
,
229.5
,
269.0
,
238.5
],
[
253.0
,
240.5
,
248.5
,
237.0
,
251.0
,
232.5
,
257.5
,
235.0
,
253.0
,
240.5
],
[
165.0
,
282.5
,
146.5
,
278.0
,
144.5
,
256.0
,
147.0
,
234.5
,
163.0
,
239.5
,
184.0
,
254.5
,
203.5
,
259.0
,
202.5
,
273.0
,
193.0
,
281.5
,
173.0
,
279.5
,
165.0
,
282.5
],
[
270.0
,
264.5
,
265.5
,
259.0
,
269.0
,
253.5
,
287.5
,
259.0
,
270.0
,
264.5
],
[
284.0
,
282.5
,
268.5
,
281.0
,
287.5
,
281.0
,
284.0
,
282.5
],
[
280.0
,
385.5
,
221.0
,
383.5
,
211.0
,
380.5
,
205.0
,
373.5
,
199.0
,
371.5
,
181.5
,
325.0
,
184.5
,
315.0
,
183.5
,
300.0
,
198.0
,
293.5
,
210.0
,
295.5
,
226.0
,
301.5
,
233.5
,
315.0
,
244.0
,
320.5
,
269.0
,
321.5
,
278.0
,
316.5
,
286.0
,
323.5
,
285.5
,
336.0
,
295.0
,
335.5
,
305.5
,
346.0
,
314.5
,
366.0
,
314.5
,
376.0
,
313.0
,
380.5
,
280.0
,
385.5
],
[
278.0
,
303.5
,
278.0
,
303.5
]],
"score"
:
0.26003336906433105
,
"bbox"
:
[
143.0
,
78.0
,
245.0
,
308.0
],
"image_id"
:
32275
}]]
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment