Skip to content

Commit

Permalink
added MinFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
dizzyi committed Sep 5, 2021
1 parent 94bbae9 commit 9403150
Show file tree
Hide file tree
Showing 42 changed files with 10 additions and 5 deletions.
Empty file added imagesave/1630836984.pickle
Empty file.
Empty file added imagesave/1630837017.pickle
Empty file.
Empty file added imagesave/1630837088.pickle
Empty file.
Empty file added imagesave/1630837119.pickle
Empty file.
Empty file added imagesave/1630837158.pickle
Empty file.
Empty file added imagesave/1630837197.pickle
Empty file.
Empty file added imagesave/1630837306.pickle
Empty file.
Empty file added imagesave/1630837326.pickle
Empty file.
Binary file added imagesave/1630837402.pickle
Binary file not shown.
Binary file added imagesave/1630837402.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added imagesave/1630837427.pickle
Empty file.
Empty file added imagesave/1630837587.pickle
Empty file.
Empty file added imagesave/1630837614.pickle
Empty file.
Empty file added imagesave/1630837698.pickle
Empty file.
Empty file added imagesave/1630837947.pickle
Empty file.
Binary file added imgseg/1630837614_bin1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837614_bin2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837614_gripper0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837614_robot0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837614_wall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837698_bin1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837698_bin2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837698_gripper0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837698_robot0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837698_wall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837947_Bread.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837947_Can.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837947_Cereal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837947_Milk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837947_VisualBread.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837947_VisualCan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837947_VisualCereal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837947_VisualMilk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837947_bin1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837947_bin2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837947_floor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837947_gripper0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837947_mount0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837947_robot0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgseg/1630837947_wall.png
1 change: 1 addition & 0 deletions robosuite/utils/visual/Trainer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import Dict
import torch

from detectron2.utils.logger import setup_logger
Expand Down
14 changes: 9 additions & 5 deletions robosuite/utils/visual/VisualManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,25 +378,29 @@ def seg2anno(self, seg, env, img_id):

annoDict['category_id'] = 1
# annoDict['category_id'] = mapGeomIDtoCategoryID(_ids)
raise Exception('Insert Map function form geom ID to category ID here ')


_vis = np.asarray(_mask * 255 / _mask.max()).astype(np.uint8)
_vis = Image.fromarray(_vis, 'L').filter(ImageFilter.MinFilter(3)).convert('1')
_mask = np.asarray(_vis)

_RLE = Mask2RLE( np.asarray( _mask,dtype=np.uint8, order= 'F') )
annoDict['segmentation'] = _RLE


returnDict['annotations'].append(annoDict)
#_vis = np.asarray(_mask * 255 / _mask.max()).astype(np.uint8)
#Image.fromarray(_vis, 'L').filter(ImageFilter.DETAIL).convert('1').save(os.path.join('.','imgseg',f'{img_id}_{k}.png'))

#_vis = Image.fromarray(_vis, 'L').convert('1')
_vis.save(os.path.join('.','imgseg',f'{img_id}_{k}.png'))

return returnDict

def mask2BBox(mask):
def mask2BBox(self, mask):
rows = np.any(mask,axis=0)
cols = np.any(mask,axis=1)
rmin, rmax = np.where(rows)[0][[0,-1]]
cmin, cmax = np.where(cols)[0][[0,-1]]
return [rmin,cmin, rmax, cmax]
return [rmin, cmin, rmax, cmax]

class VisualManager():
def __init__(
Expand Down

0 comments on commit 9403150

Please sign in to comment.