repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
BerkeleyAutomation/perception
perception/image.py
BinaryImage.add_frame
def add_frame( self, left_boundary, right_boundary, upper_boundary, lower_boundary): """ Adds a frame to the image, e.g. turns the boundaries white Parameters ---------- left_boundary : int the leftmost boundary of ...
python
def add_frame( self, left_boundary, right_boundary, upper_boundary, lower_boundary): """ Adds a frame to the image, e.g. turns the boundaries white Parameters ---------- left_boundary : int the leftmost boundary of ...
[ "def", "add_frame", "(", "self", ",", "left_boundary", ",", "right_boundary", ",", "upper_boundary", ",", "lower_boundary", ")", ":", "# check valid boundary pixels", "left_boundary", "=", "max", "(", "0", ",", "left_boundary", ")", "right_boundary", "=", "min", "...
Adds a frame to the image, e.g. turns the boundaries white Parameters ---------- left_boundary : int the leftmost boundary of the frame right_boundary : int the rightmost boundary of the frame (must be greater than left_boundary) upper_boundary : int ...
[ "Adds", "a", "frame", "to", "the", "image", "e", ".", "g", ".", "turns", "the", "boundaries", "white" ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L2544-L2587
train
Adds a frame to the image.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
BinaryImage.most_free_pixel
def most_free_pixel(self): """ Find the black pixel with the largest distance from the white pixels. Returns ------- :obj:`numpy.ndarray` 2-vector containing the most free pixel """ dist_tf = self.to_distance_im() max_px = np.where(dist_tf == np.max(d...
python
def most_free_pixel(self): """ Find the black pixel with the largest distance from the white pixels. Returns ------- :obj:`numpy.ndarray` 2-vector containing the most free pixel """ dist_tf = self.to_distance_im() max_px = np.where(dist_tf == np.max(d...
[ "def", "most_free_pixel", "(", "self", ")", ":", "dist_tf", "=", "self", ".", "to_distance_im", "(", ")", "max_px", "=", "np", ".", "where", "(", "dist_tf", "==", "np", ".", "max", "(", "dist_tf", ")", ")", "free_pixel", "=", "np", ".", "array", "(",...
Find the black pixel with the largest distance from the white pixels. Returns ------- :obj:`numpy.ndarray` 2-vector containing the most free pixel
[ "Find", "the", "black", "pixel", "with", "the", "largest", "distance", "from", "the", "white", "pixels", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L2599-L2610
train
Find the black pixel with the largest distance from the white pixels.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
BinaryImage.diff_with_target
def diff_with_target(self, binary_im): """ Creates a color image to visualize the overlap between two images. Nonzero pixels that match in both images are green. Nonzero pixels of this image that aren't in the other image are yellow Nonzero pixels of the other image that aren't in this i...
python
def diff_with_target(self, binary_im): """ Creates a color image to visualize the overlap between two images. Nonzero pixels that match in both images are green. Nonzero pixels of this image that aren't in the other image are yellow Nonzero pixels of the other image that aren't in this i...
[ "def", "diff_with_target", "(", "self", ",", "binary_im", ")", ":", "red", "=", "np", ".", "array", "(", "[", "BINARY_IM_MAX_VAL", ",", "0", ",", "0", "]", ")", "yellow", "=", "np", ".", "array", "(", "[", "BINARY_IM_MAX_VAL", ",", "BINARY_IM_MAX_VAL", ...
Creates a color image to visualize the overlap between two images. Nonzero pixels that match in both images are green. Nonzero pixels of this image that aren't in the other image are yellow Nonzero pixels of the other image that aren't in this image are red Parameters ----------...
[ "Creates", "a", "color", "image", "to", "visualize", "the", "overlap", "between", "two", "images", ".", "Nonzero", "pixels", "that", "match", "in", "both", "images", "are", "green", ".", "Nonzero", "pixels", "of", "this", "image", "that", "aren", "t", "in"...
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L2612-L2638
train
Creates a color image that visualizes the overlap between two images.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
BinaryImage.num_adjacent
def num_adjacent(self, i, j): """ Counts the number of adjacent nonzero pixels to a given pixel. Parameters ---------- i : int row index of query pixel j : int col index of query pixel Returns ------- int number of adj...
python
def num_adjacent(self, i, j): """ Counts the number of adjacent nonzero pixels to a given pixel. Parameters ---------- i : int row index of query pixel j : int col index of query pixel Returns ------- int number of adj...
[ "def", "num_adjacent", "(", "self", ",", "i", ",", "j", ")", ":", "# check values", "if", "i", "<", "1", "or", "i", ">", "self", ".", "height", "-", "2", "or", "j", "<", "1", "and", "j", ">", "self", ".", "width", "-", "2", ":", "raise", "Val...
Counts the number of adjacent nonzero pixels to a given pixel. Parameters ---------- i : int row index of query pixel j : int col index of query pixel Returns ------- int number of adjacent nonzero pixels
[ "Counts", "the", "number", "of", "adjacent", "nonzero", "pixels", "to", "a", "given", "pixel", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L2640-L2665
train
Counts the number of adjacent nonzero pixels to a given pixel.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
BinaryImage.to_sdf
def to_sdf(self): """ Converts the 2D image to a 2D signed distance field. Returns ------- :obj:`numpy.ndarray` 2D float array of the signed distance field """ # compute medial axis transform skel, sdf_in = morph.medial_axis(self.data, return_distance...
python
def to_sdf(self): """ Converts the 2D image to a 2D signed distance field. Returns ------- :obj:`numpy.ndarray` 2D float array of the signed distance field """ # compute medial axis transform skel, sdf_in = morph.medial_axis(self.data, return_distance...
[ "def", "to_sdf", "(", "self", ")", ":", "# compute medial axis transform", "skel", ",", "sdf_in", "=", "morph", ".", "medial_axis", "(", "self", ".", "data", ",", "return_distance", "=", "True", ")", "useless_skel", ",", "sdf_out", "=", "morph", ".", "medial...
Converts the 2D image to a 2D signed distance field. Returns ------- :obj:`numpy.ndarray` 2D float array of the signed distance field
[ "Converts", "the", "2D", "image", "to", "a", "2D", "signed", "distance", "field", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L2667-L2682
train
Converts the 2D image to a 2D signed distance field.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
BinaryImage.to_color
def to_color(self): """Creates a ColorImage from the binary image. Returns ------- :obj:`ColorImage` The newly-created color image. """ color_data = np.zeros([self.height, self.width, 3]) color_data[:, :, 0] = self.data color_data[:, :, 1] = s...
python
def to_color(self): """Creates a ColorImage from the binary image. Returns ------- :obj:`ColorImage` The newly-created color image. """ color_data = np.zeros([self.height, self.width, 3]) color_data[:, :, 0] = self.data color_data[:, :, 1] = s...
[ "def", "to_color", "(", "self", ")", ":", "color_data", "=", "np", ".", "zeros", "(", "[", "self", ".", "height", ",", "self", ".", "width", ",", "3", "]", ")", "color_data", "[", ":", ",", ":", ",", "0", "]", "=", "self", ".", "data", "color_d...
Creates a ColorImage from the binary image. Returns ------- :obj:`ColorImage` The newly-created color image.
[ "Creates", "a", "ColorImage", "from", "the", "binary", "image", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L2684-L2696
train
Creates a ColorImage from the binary image.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
BinaryImage.open
def open(filename, frame='unspecified'): """Creates a BinaryImage from a file. Parameters ---------- filename : :obj:`str` The file to load the data from. Must be one of .png, .jpg, .npy, or .npz. frame : :obj:`str` A string representing the ...
python
def open(filename, frame='unspecified'): """Creates a BinaryImage from a file. Parameters ---------- filename : :obj:`str` The file to load the data from. Must be one of .png, .jpg, .npy, or .npz. frame : :obj:`str` A string representing the ...
[ "def", "open", "(", "filename", ",", "frame", "=", "'unspecified'", ")", ":", "data", "=", "Image", ".", "load_data", "(", "filename", ")", "if", "len", "(", "data", ".", "shape", ")", ">", "2", "and", "data", ".", "shape", "[", "2", "]", ">", "1...
Creates a BinaryImage from a file. Parameters ---------- filename : :obj:`str` The file to load the data from. Must be one of .png, .jpg, .npy, or .npz. frame : :obj:`str` A string representing the frame of reference in which the new image ...
[ "Creates", "a", "BinaryImage", "from", "a", "file", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L2699-L2720
train
Creates a BinaryImage from a file.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
RgbdImage._check_valid_data
def _check_valid_data(self, data): """Checks that the given data is a float array with four channels. Parameters ---------- data : :obj:`numpy.ndarray` The data to check. Raises ------ ValueError If the data is invalid. """ ...
python
def _check_valid_data(self, data): """Checks that the given data is a float array with four channels. Parameters ---------- data : :obj:`numpy.ndarray` The data to check. Raises ------ ValueError If the data is invalid. """ ...
[ "def", "_check_valid_data", "(", "self", ",", "data", ")", ":", "if", "data", ".", "dtype", ".", "type", "is", "not", "np", ".", "float32", "and", "data", ".", "dtype", ".", "type", "is", "not", "np", ".", "float64", ":", "raise", "ValueError", "(", ...
Checks that the given data is a float array with four channels. Parameters ---------- data : :obj:`numpy.ndarray` The data to check. Raises ------ ValueError If the data is invalid.
[ "Checks", "that", "the", "given", "data", "is", "a", "float", "array", "with", "four", "channels", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L2751-L2776
train
Checks that the given data is a float array with four channels.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
RgbdImage.from_color_and_depth
def from_color_and_depth(color_im, depth_im): """ Creates an RGB-D image from a separate color and depth image. """ # check shape if color_im.height != depth_im.height or color_im.width != depth_im.width: raise ValueError('Color and depth images must have the same shape') # ...
python
def from_color_and_depth(color_im, depth_im): """ Creates an RGB-D image from a separate color and depth image. """ # check shape if color_im.height != depth_im.height or color_im.width != depth_im.width: raise ValueError('Color and depth images must have the same shape') # ...
[ "def", "from_color_and_depth", "(", "color_im", ",", "depth_im", ")", ":", "# check shape", "if", "color_im", ".", "height", "!=", "depth_im", ".", "height", "or", "color_im", ".", "width", "!=", "depth_im", ".", "width", ":", "raise", "ValueError", "(", "'C...
Creates an RGB-D image from a separate color and depth image.
[ "Creates", "an", "RGB", "-", "D", "image", "from", "a", "separate", "color", "and", "depth", "image", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L2779-L2793
train
Creates an RGB - D image from a separate color and depth image.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
RgbdImage.color
def color(self): """ Returns the color image. """ return ColorImage(self.raw_data[:, :, :3].astype( np.uint8), frame=self.frame)
python
def color(self): """ Returns the color image. """ return ColorImage(self.raw_data[:, :, :3].astype( np.uint8), frame=self.frame)
[ "def", "color", "(", "self", ")", ":", "return", "ColorImage", "(", "self", ".", "raw_data", "[", ":", ",", ":", ",", ":", "3", "]", ".", "astype", "(", "np", ".", "uint8", ")", ",", "frame", "=", "self", ".", "frame", ")" ]
Returns the color image.
[ "Returns", "the", "color", "image", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L2796-L2799
train
Returns the color image.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
RgbdImage.mask_binary
def mask_binary(self, binary_im): """Create a new image by zeroing out data at locations where binary_im == 0.0. Parameters ---------- binary_im : :obj:`BinaryImage` A BinaryImage of the same size as this image, with pixel values of either zero or one. Wh...
python
def mask_binary(self, binary_im): """Create a new image by zeroing out data at locations where binary_im == 0.0. Parameters ---------- binary_im : :obj:`BinaryImage` A BinaryImage of the same size as this image, with pixel values of either zero or one. Wh...
[ "def", "mask_binary", "(", "self", ",", "binary_im", ")", ":", "color", "=", "self", ".", "color", ".", "mask_binary", "(", "binary_im", ")", "depth", "=", "self", ".", "depth", ".", "mask_binary", "(", "binary_im", ")", "return", "RgbdImage", ".", "from...
Create a new image by zeroing out data at locations where binary_im == 0.0. Parameters ---------- binary_im : :obj:`BinaryImage` A BinaryImage of the same size as this image, with pixel values of either zero or one. Wherever this image has zero pixels, we'll zero...
[ "Create", "a", "new", "image", "by", "zeroing", "out", "data", "at", "locations", "where", "binary_im", "==", "0", ".", "0", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L2824-L2842
train
Create a new image by zeroing out the pixels of the given binary image.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
RgbdImage.resize
def resize(self, size, interp='bilinear'): """Resize the image. Parameters ---------- size : int, float, or tuple * int - Percentage of current size. * float - Fraction of current size. * tuple - Size of the output image. interp : :obj:`str...
python
def resize(self, size, interp='bilinear'): """Resize the image. Parameters ---------- size : int, float, or tuple * int - Percentage of current size. * float - Fraction of current size. * tuple - Size of the output image. interp : :obj:`str...
[ "def", "resize", "(", "self", ",", "size", ",", "interp", "=", "'bilinear'", ")", ":", "# resize channels separately", "color_im_resized", "=", "self", ".", "color", ".", "resize", "(", "size", ",", "interp", ")", "depth_im_resized", "=", "self", ".", "depth...
Resize the image. Parameters ---------- size : int, float, or tuple * int - Percentage of current size. * float - Fraction of current size. * tuple - Size of the output image. interp : :obj:`str`, optional Interpolation to use for re-si...
[ "Resize", "the", "image", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L2844-L2864
train
Resizes the image.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
RgbdImage.crop
def crop(self, height, width, center_i=None, center_j=None): """Crop the image centered around center_i, center_j. Parameters ---------- height : int The height of the desired image. width : int The width of the desired image. center_i : int ...
python
def crop(self, height, width, center_i=None, center_j=None): """Crop the image centered around center_i, center_j. Parameters ---------- height : int The height of the desired image. width : int The width of the desired image. center_i : int ...
[ "def", "crop", "(", "self", ",", "height", ",", "width", ",", "center_i", "=", "None", ",", "center_j", "=", "None", ")", ":", "# crop channels separately", "color_im_cropped", "=", "self", ".", "color", ".", "crop", "(", "height", ",", "width", ",", "ce...
Crop the image centered around center_i, center_j. Parameters ---------- height : int The height of the desired image. width : int The width of the desired image. center_i : int The center height point at which to crop. If not specified, the...
[ "Crop", "the", "image", "centered", "around", "center_i", "center_j", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L2866-L2900
train
Crop the image centered around center_i and center_j.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
RgbdImage.transform
def transform(self, translation, theta, method='opencv'): """Create a new image by translating and rotating the current image. Parameters ---------- translation : :obj:`numpy.ndarray` of float The XY translation vector. theta : float Rotation angle in rad...
python
def transform(self, translation, theta, method='opencv'): """Create a new image by translating and rotating the current image. Parameters ---------- translation : :obj:`numpy.ndarray` of float The XY translation vector. theta : float Rotation angle in rad...
[ "def", "transform", "(", "self", ",", "translation", ",", "theta", ",", "method", "=", "'opencv'", ")", ":", "# transform channels separately", "color_im_tf", "=", "self", ".", "color", ".", "transform", "(", "translation", ",", "theta", ",", "method", "=", ...
Create a new image by translating and rotating the current image. Parameters ---------- translation : :obj:`numpy.ndarray` of float The XY translation vector. theta : float Rotation angle in radians, with positive meaning counter-clockwise. method : :obj:...
[ "Create", "a", "new", "image", "by", "translating", "and", "rotating", "the", "current", "image", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L2902-L2924
train
Create a new image by translating and rotating the current image.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
RgbdImage.to_grayscale_depth
def to_grayscale_depth(self): """ Converts to a grayscale and depth (G-D) image. """ gray = self.color.to_grayscale() return GdImage.from_grayscale_and_depth(gray, self.depth)
python
def to_grayscale_depth(self): """ Converts to a grayscale and depth (G-D) image. """ gray = self.color.to_grayscale() return GdImage.from_grayscale_and_depth(gray, self.depth)
[ "def", "to_grayscale_depth", "(", "self", ")", ":", "gray", "=", "self", ".", "color", ".", "to_grayscale", "(", ")", "return", "GdImage", ".", "from_grayscale_and_depth", "(", "gray", ",", "self", ".", "depth", ")" ]
Converts to a grayscale and depth (G-D) image.
[ "Converts", "to", "a", "grayscale", "and", "depth", "(", "G", "-", "D", ")", "image", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L2926-L2929
train
Converts to a grayscale and depth image.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
RgbdImage.combine_with
def combine_with(self, rgbd_im): """ Replaces all zeros in the source rgbd image with the values of a different rgbd image Parameters ---------- rgbd_im : :obj:`RgbdImage` rgbd image to combine with Returns ------- :obj:`RgbdImage` ...
python
def combine_with(self, rgbd_im): """ Replaces all zeros in the source rgbd image with the values of a different rgbd image Parameters ---------- rgbd_im : :obj:`RgbdImage` rgbd image to combine with Returns ------- :obj:`RgbdImage` ...
[ "def", "combine_with", "(", "self", ",", "rgbd_im", ")", ":", "new_data", "=", "self", ".", "data", ".", "copy", "(", ")", "depth_data", "=", "self", ".", "depth", ".", "data", "other_depth_data", "=", "rgbd_im", ".", "depth", ".", "data", "depth_zero_px...
Replaces all zeros in the source rgbd image with the values of a different rgbd image Parameters ---------- rgbd_im : :obj:`RgbdImage` rgbd image to combine with Returns ------- :obj:`RgbdImage` the combined rgbd image
[ "Replaces", "all", "zeros", "in", "the", "source", "rgbd", "image", "with", "the", "values", "of", "a", "different", "rgbd", "image" ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L2931-L2962
train
Returns a new rgbd image with the values of a different rgbd image.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
RgbdImage.crop
def crop(self, height, width, center_i=None, center_j=None): """Crop the image centered around center_i, center_j. Parameters ---------- height : int The height of the desired image. width : int The width of the desired image. center_i : int ...
python
def crop(self, height, width, center_i=None, center_j=None): """Crop the image centered around center_i, center_j. Parameters ---------- height : int The height of the desired image. width : int The width of the desired image. center_i : int ...
[ "def", "crop", "(", "self", ",", "height", ",", "width", ",", "center_i", "=", "None", ",", "center_j", "=", "None", ")", ":", "color_im_crop", "=", "self", ".", "color", ".", "crop", "(", "height", ",", "width", ",", "center_i", ",", "center_j", ")"...
Crop the image centered around center_i, center_j. Parameters ---------- height : int The height of the desired image. width : int The width of the desired image. center_i : int The center height point at which to crop. If not specified, the...
[ "Crop", "the", "image", "centered", "around", "center_i", "center_j", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L2964-L2990
train
Crop the image centered around center_i center_j.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
GdImage.from_grayscale_and_depth
def from_grayscale_and_depth(gray_im, depth_im): """ Creates an G-D image from a separate grayscale and depth image. """ # check shape if gray_im.height != depth_im.height or gray_im.width != depth_im.width: raise ValueError( 'Grayscale and depth images must have the ...
python
def from_grayscale_and_depth(gray_im, depth_im): """ Creates an G-D image from a separate grayscale and depth image. """ # check shape if gray_im.height != depth_im.height or gray_im.width != depth_im.width: raise ValueError( 'Grayscale and depth images must have the ...
[ "def", "from_grayscale_and_depth", "(", "gray_im", ",", "depth_im", ")", ":", "# check shape", "if", "gray_im", ".", "height", "!=", "depth_im", ".", "height", "or", "gray_im", ".", "width", "!=", "depth_im", ".", "width", ":", "raise", "ValueError", "(", "'...
Creates an G-D image from a separate grayscale and depth image.
[ "Creates", "an", "G", "-", "D", "image", "from", "a", "separate", "grayscale", "and", "depth", "image", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L3049-L3065
train
Creates an G - D image from a separate grayscale and depth image.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
GdImage.gray
def gray(self): """ Returns the grayscale image. """ return GrayscaleImage( self.raw_data[:, :, 0].astype(np.uint8), frame=self.frame)
python
def gray(self): """ Returns the grayscale image. """ return GrayscaleImage( self.raw_data[:, :, 0].astype(np.uint8), frame=self.frame)
[ "def", "gray", "(", "self", ")", ":", "return", "GrayscaleImage", "(", "self", ".", "raw_data", "[", ":", ",", ":", ",", "0", "]", ".", "astype", "(", "np", ".", "uint8", ")", ",", "frame", "=", "self", ".", "frame", ")" ]
Returns the grayscale image.
[ "Returns", "the", "grayscale", "image", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L3068-L3071
train
Returns the grayscale image.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
GdImage.resize
def resize(self, size, interp='bilinear'): """Resize the image. Parameters ---------- size : int, float, or tuple * int - Percentage of current size. * float - Fraction of current size. * tuple - Size of the output image. interp : :obj:`str...
python
def resize(self, size, interp='bilinear'): """Resize the image. Parameters ---------- size : int, float, or tuple * int - Percentage of current size. * float - Fraction of current size. * tuple - Size of the output image. interp : :obj:`str...
[ "def", "resize", "(", "self", ",", "size", ",", "interp", "=", "'bilinear'", ")", ":", "# resize channels separately", "gray_im_resized", "=", "self", ".", "gray", ".", "resize", "(", "size", ",", "interp", ")", "depth_im_resized", "=", "self", ".", "depth",...
Resize the image. Parameters ---------- size : int, float, or tuple * int - Percentage of current size. * float - Fraction of current size. * tuple - Size of the output image. interp : :obj:`str`, optional Interpolation to use for re-si...
[ "Resize", "the", "image", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L3096-L3116
train
Resize the image.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
GdImage.crop
def crop(self, height, width, center_i=None, center_j=None): """Crop the image centered around center_i, center_j. Parameters ---------- height : int The height of the desired image. width : int The width of the desired image. center_i : int ...
python
def crop(self, height, width, center_i=None, center_j=None): """Crop the image centered around center_i, center_j. Parameters ---------- height : int The height of the desired image. width : int The width of the desired image. center_i : int ...
[ "def", "crop", "(", "self", ",", "height", ",", "width", ",", "center_i", "=", "None", ",", "center_j", "=", "None", ")", ":", "gray_im_crop", "=", "self", ".", "gray", ".", "crop", "(", "height", ",", "width", ",", "center_i", ",", "center_j", ")", ...
Crop the image centered around center_i, center_j. Parameters ---------- height : int The height of the desired image. width : int The width of the desired image. center_i : int The center height point at which to crop. If not specified, the...
[ "Crop", "the", "image", "centered", "around", "center_i", "center_j", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L3118-L3144
train
Crop the image centered around center_i center_j.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
SegmentationImage.border_pixels
def border_pixels( self, grad_sigma=0.5, grad_lower_thresh=0.1, grad_upper_thresh=1.0): """ Returns the pixels on the boundary between all segments, excluding the zero segment. Parameters ---------- grad_sigma : float s...
python
def border_pixels( self, grad_sigma=0.5, grad_lower_thresh=0.1, grad_upper_thresh=1.0): """ Returns the pixels on the boundary between all segments, excluding the zero segment. Parameters ---------- grad_sigma : float s...
[ "def", "border_pixels", "(", "self", ",", "grad_sigma", "=", "0.5", ",", "grad_lower_thresh", "=", "0.1", ",", "grad_upper_thresh", "=", "1.0", ")", ":", "# boundary pixels", "boundary_im", "=", "np", ".", "ones", "(", "self", ".", "shape", ")", "for", "i"...
Returns the pixels on the boundary between all segments, excluding the zero segment. Parameters ---------- grad_sigma : float standard deviation used for gaussian gradient filter grad_lower_thresh : float lower threshold on gradient threshold used to determine th...
[ "Returns", "the", "pixels", "on", "the", "boundary", "between", "all", "segments", "excluding", "the", "zero", "segment", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L3192-L3230
train
Returns the pixels on the boundary between all segments excluding the zero segment.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
SegmentationImage.segment_mask
def segment_mask(self, segnum): """ Returns a binary image of just the segment corresponding to the given number. Parameters ---------- segnum : int the number of the segment to generate a mask for Returns ------- :obj:`BinaryImage` bina...
python
def segment_mask(self, segnum): """ Returns a binary image of just the segment corresponding to the given number. Parameters ---------- segnum : int the number of the segment to generate a mask for Returns ------- :obj:`BinaryImage` bina...
[ "def", "segment_mask", "(", "self", ",", "segnum", ")", ":", "binary_data", "=", "np", ".", "zeros", "(", "self", ".", "shape", ")", "binary_data", "[", "self", ".", "data", "==", "segnum", "]", "=", "BINARY_IM_MAX_VAL", "return", "BinaryImage", "(", "bi...
Returns a binary image of just the segment corresponding to the given number. Parameters ---------- segnum : int the number of the segment to generate a mask for Returns ------- :obj:`BinaryImage` binary image data
[ "Returns", "a", "binary", "image", "of", "just", "the", "segment", "corresponding", "to", "the", "given", "number", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L3232-L3247
train
Returns a binary image of just the segment corresponding to the given number.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
SegmentationImage.mask_binary
def mask_binary(self, binary_im): """Create a new image by zeroing out data at locations where binary_im == 0.0. Parameters ---------- binary_im : :obj:`BinaryImage` A BinaryImage of the same size as this image, with pixel values of either zero or one. Wh...
python
def mask_binary(self, binary_im): """Create a new image by zeroing out data at locations where binary_im == 0.0. Parameters ---------- binary_im : :obj:`BinaryImage` A BinaryImage of the same size as this image, with pixel values of either zero or one. Wh...
[ "def", "mask_binary", "(", "self", ",", "binary_im", ")", ":", "data", "=", "np", ".", "copy", "(", "self", ".", "_data", ")", "ind", "=", "np", ".", "where", "(", "binary_im", ".", "data", "==", "0", ")", "data", "[", "ind", "[", "0", "]", ","...
Create a new image by zeroing out data at locations where binary_im == 0.0. Parameters ---------- binary_im : :obj:`BinaryImage` A BinaryImage of the same size as this image, with pixel values of either zero or one. Wherever this image has zero pixels, we'll zero...
[ "Create", "a", "new", "image", "by", "zeroing", "out", "data", "at", "locations", "where", "binary_im", "==", "0", ".", "0", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L3249-L3268
train
Create a new image by zeroing out the data at locations where binary_im == 0. 0.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
SegmentationImage.resize
def resize(self, size, interp='nearest'): """Resize the image. Parameters ---------- size : int, float, or tuple * int - Percentage of current size. * float - Fraction of current size. * tuple - Size of the output image. interp : :obj:`str`...
python
def resize(self, size, interp='nearest'): """Resize the image. Parameters ---------- size : int, float, or tuple * int - Percentage of current size. * float - Fraction of current size. * tuple - Size of the output image. interp : :obj:`str`...
[ "def", "resize", "(", "self", ",", "size", ",", "interp", "=", "'nearest'", ")", ":", "resized_data", "=", "sm", ".", "imresize", "(", "self", ".", "data", ",", "size", ",", "interp", "=", "interp", ",", "mode", "=", "'L'", ")", "return", "Segmentati...
Resize the image. Parameters ---------- size : int, float, or tuple * int - Percentage of current size. * float - Fraction of current size. * tuple - Size of the output image. interp : :obj:`str`, optional Interpolation to use for re-si...
[ "Resize", "the", "image", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L3270-L3285
train
Resizes the image.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
SegmentationImage.open
def open(filename, frame='unspecified'): """ Opens a segmentation image """ data = Image.load_data(filename) return SegmentationImage(data, frame)
python
def open(filename, frame='unspecified'): """ Opens a segmentation image """ data = Image.load_data(filename) return SegmentationImage(data, frame)
[ "def", "open", "(", "filename", ",", "frame", "=", "'unspecified'", ")", ":", "data", "=", "Image", ".", "load_data", "(", "filename", ")", "return", "SegmentationImage", "(", "data", ",", "frame", ")" ]
Opens a segmentation image
[ "Opens", "a", "segmentation", "image" ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L3288-L3291
train
Opens a segmentation image from a file.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
PointCloudImage.resize
def resize(self, size, interp='nearest'): """Resize the image. Parameters ---------- size : int, float, or tuple * int - Percentage of current size. * float - Fraction of current size. * tuple - Size of the output image. interp : :obj:`str`...
python
def resize(self, size, interp='nearest'): """Resize the image. Parameters ---------- size : int, float, or tuple * int - Percentage of current size. * float - Fraction of current size. * tuple - Size of the output image. interp : :obj:`str`...
[ "def", "resize", "(", "self", ",", "size", ",", "interp", "=", "'nearest'", ")", ":", "resized_data_0", "=", "sm", ".", "imresize", "(", "self", ".", "_data", "[", ":", ",", ":", ",", "0", "]", ",", "size", ",", "interp", "=", "interp", ",", "mod...
Resize the image. Parameters ---------- size : int, float, or tuple * int - Percentage of current size. * float - Fraction of current size. * tuple - Size of the output image. interp : :obj:`str`, optional Interpolation to use for re-si...
[ "Resize", "the", "image", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L3351-L3379
train
Resizes the image.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
PointCloudImage.to_mesh
def to_mesh(self, dist_thresh=0.01): """ Convert the point cloud to a mesh. Returns ------- :obj:`trimesh.Trimesh` mesh of the point cloud """ # init vertex and triangle buffers vertices = [] triangles = [] vertex_indices = -1 * np.one...
python
def to_mesh(self, dist_thresh=0.01): """ Convert the point cloud to a mesh. Returns ------- :obj:`trimesh.Trimesh` mesh of the point cloud """ # init vertex and triangle buffers vertices = [] triangles = [] vertex_indices = -1 * np.one...
[ "def", "to_mesh", "(", "self", ",", "dist_thresh", "=", "0.01", ")", ":", "# init vertex and triangle buffers", "vertices", "=", "[", "]", "triangles", "=", "[", "]", "vertex_indices", "=", "-", "1", "*", "np", ".", "ones", "(", "[", "self", ".", "height...
Convert the point cloud to a mesh. Returns ------- :obj:`trimesh.Trimesh` mesh of the point cloud
[ "Convert", "the", "point", "cloud", "to", "a", "mesh", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L3381-L3450
train
Convert the point cloud to a mesh.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
PointCloudImage.to_point_cloud
def to_point_cloud(self): """Convert the image to a PointCloud object. Returns ------- :obj:`autolab_core.PointCloud` The corresponding PointCloud. """ return PointCloud( data=self._data.reshape( self.height * self....
python
def to_point_cloud(self): """Convert the image to a PointCloud object. Returns ------- :obj:`autolab_core.PointCloud` The corresponding PointCloud. """ return PointCloud( data=self._data.reshape( self.height * self....
[ "def", "to_point_cloud", "(", "self", ")", ":", "return", "PointCloud", "(", "data", "=", "self", ".", "_data", ".", "reshape", "(", "self", ".", "height", "*", "self", ".", "width", ",", "3", ")", ".", "T", ",", "frame", "=", "self", ".", "_frame"...
Convert the image to a PointCloud object. Returns ------- :obj:`autolab_core.PointCloud` The corresponding PointCloud.
[ "Convert", "the", "image", "to", "a", "PointCloud", "object", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L3452-L3465
train
Convert the image to a PointCloud object.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
PointCloudImage.normal_cloud_im
def normal_cloud_im(self, ksize=3): """Generate a NormalCloudImage from the PointCloudImage using Sobel filtering. Parameters ---------- ksize : int Size of the kernel to use for derivative computation Returns ------- :obj:`NormalCloudImage` ...
python
def normal_cloud_im(self, ksize=3): """Generate a NormalCloudImage from the PointCloudImage using Sobel filtering. Parameters ---------- ksize : int Size of the kernel to use for derivative computation Returns ------- :obj:`NormalCloudImage` ...
[ "def", "normal_cloud_im", "(", "self", ",", "ksize", "=", "3", ")", ":", "# compute direction via cross product of derivatives", "gy", "=", "cv2", ".", "Sobel", "(", "self", ".", "data", ",", "cv2", ".", "CV_64F", ",", "1", ",", "0", ",", "ksize", "=", "...
Generate a NormalCloudImage from the PointCloudImage using Sobel filtering. Parameters ---------- ksize : int Size of the kernel to use for derivative computation Returns ------- :obj:`NormalCloudImage` The corresponding NormalCloudImage.
[ "Generate", "a", "NormalCloudImage", "from", "the", "PointCloudImage", "using", "Sobel", "filtering", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L3467-L3499
train
Generate a NormalCloudImage from the PointCloudImage using Sobel filtering.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
PointCloudImage.open
def open(filename, frame='unspecified'): """Creates a PointCloudImage from a file. Parameters ---------- filename : :obj:`str` The file to load the data from. Must be one of .png, .jpg, .npy, or .npz. frame : :obj:`str` A string representing ...
python
def open(filename, frame='unspecified'): """Creates a PointCloudImage from a file. Parameters ---------- filename : :obj:`str` The file to load the data from. Must be one of .png, .jpg, .npy, or .npz. frame : :obj:`str` A string representing ...
[ "def", "open", "(", "filename", ",", "frame", "=", "'unspecified'", ")", ":", "data", "=", "Image", ".", "load_data", "(", "filename", ")", "return", "PointCloudImage", "(", "data", ",", "frame", ")" ]
Creates a PointCloudImage from a file. Parameters ---------- filename : :obj:`str` The file to load the data from. Must be one of .png, .jpg, .npy, or .npz. frame : :obj:`str` A string representing the frame of reference in which the new image ...
[ "Creates", "a", "PointCloudImage", "from", "a", "file", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L3502-L3521
train
Creates a PointCloudImage from a file.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
NormalCloudImage.to_normal_cloud
def to_normal_cloud(self): """Convert the image to a NormalCloud object. Returns ------- :obj:`autolab_core.NormalCloud` The corresponding NormalCloud. """ return NormalCloud( data=self._data.reshape( self.height * ...
python
def to_normal_cloud(self): """Convert the image to a NormalCloud object. Returns ------- :obj:`autolab_core.NormalCloud` The corresponding NormalCloud. """ return NormalCloud( data=self._data.reshape( self.height * ...
[ "def", "to_normal_cloud", "(", "self", ")", ":", "return", "NormalCloud", "(", "data", "=", "self", ".", "_data", ".", "reshape", "(", "self", ".", "height", "*", "self", ".", "width", ",", "3", ")", ".", "T", ",", "frame", "=", "self", ".", "_fram...
Convert the image to a NormalCloud object. Returns ------- :obj:`autolab_core.NormalCloud` The corresponding NormalCloud.
[ "Convert", "the", "image", "to", "a", "NormalCloud", "object", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L3595-L3608
train
Convert the image to a NormalCloud object.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/image.py
NormalCloudImage.open
def open(filename, frame='unspecified'): """Creates a NormalCloudImage from a file. Parameters ---------- filename : :obj:`str` The file to load the data from. Must be one of .png, .jpg, .npy, or .npz. frame : :obj:`str` A string representing...
python
def open(filename, frame='unspecified'): """Creates a NormalCloudImage from a file. Parameters ---------- filename : :obj:`str` The file to load the data from. Must be one of .png, .jpg, .npy, or .npz. frame : :obj:`str` A string representing...
[ "def", "open", "(", "filename", ",", "frame", "=", "'unspecified'", ")", ":", "data", "=", "Image", ".", "load_data", "(", "filename", ")", "return", "NormalCloudImage", "(", "data", ",", "frame", ")" ]
Creates a NormalCloudImage from a file. Parameters ---------- filename : :obj:`str` The file to load the data from. Must be one of .png, .jpg, .npy, or .npz. frame : :obj:`str` A string representing the frame of reference in which the new image ...
[ "Creates", "a", "NormalCloudImage", "from", "a", "file", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/image.py#L3611-L3630
train
Creates a NormalCloudImage from a file.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/orthographic_intrinsics.py
OrthographicIntrinsics.S
def S(self): """:obj:`numpy.ndarray` : The 3x3 scaling matrix for this projection """ S = np.array([[self._plane_width / self._vol_width, 0, 0], [0, self._plane_height / self._vol_height, 0], [0, 0, self._depth_scale / self._vol_depth]]) return...
python
def S(self): """:obj:`numpy.ndarray` : The 3x3 scaling matrix for this projection """ S = np.array([[self._plane_width / self._vol_width, 0, 0], [0, self._plane_height / self._vol_height, 0], [0, 0, self._depth_scale / self._vol_depth]]) return...
[ "def", "S", "(", "self", ")", ":", "S", "=", "np", ".", "array", "(", "[", "[", "self", ".", "_plane_width", "/", "self", ".", "_vol_width", ",", "0", ",", "0", "]", ",", "[", "0", ",", "self", ".", "_plane_height", "/", "self", ".", "_vol_heig...
:obj:`numpy.ndarray` : The 3x3 scaling matrix for this projection
[ ":", "obj", ":", "numpy", ".", "ndarray", ":", "The", "3x3", "scaling", "matrix", "for", "this", "projection" ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/orthographic_intrinsics.py#L73-L79
train
The 3x3 scaling matrix for this projection
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/orthographic_intrinsics.py
OrthographicIntrinsics.t
def t(self): """:obj:`numpy.ndarray` : The 3x1 translation matrix for this projection """ t = np.array([self._plane_width / 2, self._plane_height / 2, self._depth_scale / 2]) return t
python
def t(self): """:obj:`numpy.ndarray` : The 3x1 translation matrix for this projection """ t = np.array([self._plane_width / 2, self._plane_height / 2, self._depth_scale / 2]) return t
[ "def", "t", "(", "self", ")", ":", "t", "=", "np", ".", "array", "(", "[", "self", ".", "_plane_width", "/", "2", ",", "self", ".", "_plane_height", "/", "2", ",", "self", ".", "_depth_scale", "/", "2", "]", ")", "return", "t" ]
:obj:`numpy.ndarray` : The 3x1 translation matrix for this projection
[ ":", "obj", ":", "numpy", ".", "ndarray", ":", "The", "3x1", "translation", "matrix", "for", "this", "projection" ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/orthographic_intrinsics.py#L82-L88
train
The 3x1 translation matrix for this projection
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/orthographic_intrinsics.py
OrthographicIntrinsics.P
def P(self): """:obj:`numpy.ndarray` : The 4x4 projection matrix for this camera. """ P = np.r_[np.c_[self.S, self.t], np.array([0,0,0,1])] return P
python
def P(self): """:obj:`numpy.ndarray` : The 4x4 projection matrix for this camera. """ P = np.r_[np.c_[self.S, self.t], np.array([0,0,0,1])] return P
[ "def", "P", "(", "self", ")", ":", "P", "=", "np", ".", "r_", "[", "np", ".", "c_", "[", "self", ".", "S", ",", "self", ".", "t", "]", ",", "np", ".", "array", "(", "[", "0", ",", "0", ",", "0", ",", "1", "]", ")", "]", "return", "P" ...
:obj:`numpy.ndarray` : The 4x4 projection matrix for this camera.
[ ":", "obj", ":", "numpy", ".", "ndarray", ":", "The", "4x4", "projection", "matrix", "for", "this", "camera", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/orthographic_intrinsics.py#L97-L101
train
The 4x4 projection matrix for this camera.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/orthographic_intrinsics.py
OrthographicIntrinsics.project_to_image
def project_to_image(self, point_cloud, round_px=True): """Projects a point cloud onto the camera image plane and creates a depth image. Zero depth means no point projected into the camera at that pixel location (i.e. infinite depth). Parameters ---------- point_cloud : ...
python
def project_to_image(self, point_cloud, round_px=True): """Projects a point cloud onto the camera image plane and creates a depth image. Zero depth means no point projected into the camera at that pixel location (i.e. infinite depth). Parameters ---------- point_cloud : ...
[ "def", "project_to_image", "(", "self", ",", "point_cloud", ",", "round_px", "=", "True", ")", ":", "if", "not", "isinstance", "(", "point_cloud", ",", "PointCloud", ")", "and", "not", "(", "isinstance", "(", "point_cloud", ",", "Point", ")", "and", "point...
Projects a point cloud onto the camera image plane and creates a depth image. Zero depth means no point projected into the camera at that pixel location (i.e. infinite depth). Parameters ---------- point_cloud : :obj:`autolab_core.PointCloud` or :obj:`autolab_core.Point` ...
[ "Projects", "a", "point", "cloud", "onto", "the", "camera", "image", "plane", "and", "creates", "a", "depth", "image", ".", "Zero", "depth", "means", "no", "point", "projected", "into", "the", "camera", "at", "that", "pixel", "location", "(", "i", ".", "...
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/orthographic_intrinsics.py#L144-L191
train
Projects a point cloud onto the camera image plane and creates a DepthImage.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/orthographic_intrinsics.py
OrthographicIntrinsics.deproject
def deproject(self, depth_image): """Deprojects a DepthImage into a PointCloud. Parameters ---------- depth_image : :obj:`DepthImage` The 2D depth image to projet into a point cloud. Returns ------- :obj:`autolab_core.PointCloud` A 3D poi...
python
def deproject(self, depth_image): """Deprojects a DepthImage into a PointCloud. Parameters ---------- depth_image : :obj:`DepthImage` The 2D depth image to projet into a point cloud. Returns ------- :obj:`autolab_core.PointCloud` A 3D poi...
[ "def", "deproject", "(", "self", ",", "depth_image", ")", ":", "# check valid input", "if", "not", "isinstance", "(", "depth_image", ",", "DepthImage", ")", ":", "raise", "ValueError", "(", "'Must provide DepthImage object for projection'", ")", "if", "depth_image", ...
Deprojects a DepthImage into a PointCloud. Parameters ---------- depth_image : :obj:`DepthImage` The 2D depth image to projet into a point cloud. Returns ------- :obj:`autolab_core.PointCloud` A 3D point cloud created from the depth image. ...
[ "Deprojects", "a", "DepthImage", "into", "a", "PointCloud", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/orthographic_intrinsics.py#L193-L228
train
Deprojects a DepthImage into a PointCloud.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/orthographic_intrinsics.py
OrthographicIntrinsics.deproject_pixel
def deproject_pixel(self, depth, pixel): """Deprojects a single pixel with a given depth into a 3D point. Parameters ---------- depth : float The depth value at the given pixel location. pixel : :obj:`autolab_core.Point` A 2D point representing the pixel...
python
def deproject_pixel(self, depth, pixel): """Deprojects a single pixel with a given depth into a 3D point. Parameters ---------- depth : float The depth value at the given pixel location. pixel : :obj:`autolab_core.Point` A 2D point representing the pixel...
[ "def", "deproject_pixel", "(", "self", ",", "depth", ",", "pixel", ")", ":", "if", "not", "isinstance", "(", "pixel", ",", "Point", ")", "and", "not", "pixel", ".", "dim", "==", "2", ":", "raise", "ValueError", "(", "'Must provide 2D Point object for pixel p...
Deprojects a single pixel with a given depth into a 3D point. Parameters ---------- depth : float The depth value at the given pixel location. pixel : :obj:`autolab_core.Point` A 2D point representing the pixel's location in the camera image. Returns ...
[ "Deprojects", "a", "single", "pixel", "with", "a", "given", "depth", "into", "a", "3D", "point", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/orthographic_intrinsics.py#L254-L283
train
Deprojects a single pixel with a given depth into a 3D point.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/orthographic_intrinsics.py
OrthographicIntrinsics.save
def save(self, filename): """Save the CameraIntrinsics object to a .intr file. Parameters ---------- filename : :obj:`str` The .intr file to save the object to. Raises ------ ValueError If filename does not have the .intr extension. ...
python
def save(self, filename): """Save the CameraIntrinsics object to a .intr file. Parameters ---------- filename : :obj:`str` The .intr file to save the object to. Raises ------ ValueError If filename does not have the .intr extension. ...
[ "def", "save", "(", "self", ",", "filename", ")", ":", "file_root", ",", "file_ext", "=", "os", ".", "path", ".", "splitext", "(", "filename", ")", "if", "file_ext", ".", "lower", "(", ")", "!=", "INTR_EXTENSION", ":", "raise", "ValueError", "(", "'Ext...
Save the CameraIntrinsics object to a .intr file. Parameters ---------- filename : :obj:`str` The .intr file to save the object to. Raises ------ ValueError If filename does not have the .intr extension.
[ "Save", "the", "CameraIntrinsics", "object", "to", "a", ".", "intr", "file", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/orthographic_intrinsics.py#L285-L305
train
Save the camera intrinsics object to a. intr file.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/orthographic_intrinsics.py
OrthographicIntrinsics.load
def load(filename): """Load a CameraIntrinsics object from a file. Parameters ---------- filename : :obj:`str` The .intr file to load the object from. Returns ------- :obj:`CameraIntrinsics` The CameraIntrinsics object loaded from the fil...
python
def load(filename): """Load a CameraIntrinsics object from a file. Parameters ---------- filename : :obj:`str` The .intr file to load the object from. Returns ------- :obj:`CameraIntrinsics` The CameraIntrinsics object loaded from the fil...
[ "def", "load", "(", "filename", ")", ":", "file_root", ",", "file_ext", "=", "os", ".", "path", ".", "splitext", "(", "filename", ")", "if", "file_ext", ".", "lower", "(", ")", "!=", "INTR_EXTENSION", ":", "raise", "ValueError", "(", "'Extension %s not sup...
Load a CameraIntrinsics object from a file. Parameters ---------- filename : :obj:`str` The .intr file to load the object from. Returns ------- :obj:`CameraIntrinsics` The CameraIntrinsics object loaded from the file. Raises ----...
[ "Load", "a", "CameraIntrinsics", "object", "from", "a", "file", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/orthographic_intrinsics.py#L308-L339
train
Loads a CameraIntrinsics object from a file.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/phoxi_sensor.py
PhoXiSensor.start
def start(self): """Start the sensor. """ if rospy.get_name() == '/unnamed': raise ValueError('PhoXi sensor must be run inside a ros node!') # Connect to the cameras if not self._connect_to_sensor(): self._running = False return False ...
python
def start(self): """Start the sensor. """ if rospy.get_name() == '/unnamed': raise ValueError('PhoXi sensor must be run inside a ros node!') # Connect to the cameras if not self._connect_to_sensor(): self._running = False return False ...
[ "def", "start", "(", "self", ")", ":", "if", "rospy", ".", "get_name", "(", ")", "==", "'/unnamed'", ":", "raise", "ValueError", "(", "'PhoXi sensor must be run inside a ros node!'", ")", "# Connect to the cameras", "if", "not", "self", ".", "_connect_to_sensor", ...
Start the sensor.
[ "Start", "the", "sensor", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/phoxi_sensor.py#L108-L126
train
Start the sensor.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/phoxi_sensor.py
PhoXiSensor.stop
def stop(self): """Stop the sensor. """ # Check that everything is running if not self._running: logging.warning('PhoXi not running. Aborting stop') return False # Stop the subscribers self._color_im_sub.unregister() self._depth_im_sub.unr...
python
def stop(self): """Stop the sensor. """ # Check that everything is running if not self._running: logging.warning('PhoXi not running. Aborting stop') return False # Stop the subscribers self._color_im_sub.unregister() self._depth_im_sub.unr...
[ "def", "stop", "(", "self", ")", ":", "# Check that everything is running", "if", "not", "self", ".", "_running", ":", "logging", ".", "warning", "(", "'PhoXi not running. Aborting stop'", ")", "return", "False", "# Stop the subscribers", "self", ".", "_color_im_sub",...
Stop the sensor.
[ "Stop", "the", "sensor", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/phoxi_sensor.py#L128-L146
train
Stop the sensor.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/phoxi_sensor.py
PhoXiSensor.frames
def frames(self): """Retrieve a new frame from the PhoXi and convert it to a ColorImage, a DepthImage, and an IrImage. Returns ------- :obj:`tuple` of :obj:`ColorImage`, :obj:`DepthImage`, :obj:`IrImage`, :obj:`numpy.ndarray` The ColorImage, DepthImage, and IrImage o...
python
def frames(self): """Retrieve a new frame from the PhoXi and convert it to a ColorImage, a DepthImage, and an IrImage. Returns ------- :obj:`tuple` of :obj:`ColorImage`, :obj:`DepthImage`, :obj:`IrImage`, :obj:`numpy.ndarray` The ColorImage, DepthImage, and IrImage o...
[ "def", "frames", "(", "self", ")", ":", "# Run a software trigger", "times", "=", "[", "]", "rospy", ".", "ServiceProxy", "(", "'phoxi_camera/start_acquisition'", ",", "Empty", ")", "(", ")", "rospy", ".", "ServiceProxy", "(", "'phoxi_camera/trigger_image'", ",", ...
Retrieve a new frame from the PhoXi and convert it to a ColorImage, a DepthImage, and an IrImage. Returns ------- :obj:`tuple` of :obj:`ColorImage`, :obj:`DepthImage`, :obj:`IrImage`, :obj:`numpy.ndarray` The ColorImage, DepthImage, and IrImage of the current frame.
[ "Retrieve", "a", "new", "frame", "from", "the", "PhoXi", "and", "convert", "it", "to", "a", "ColorImage", "a", "DepthImage", "and", "an", "IrImage", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/phoxi_sensor.py#L148-L176
train
Retrieve a new frame from the PhoXi and convert it to a ColorImage DepthImage and IrImage.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/phoxi_sensor.py
PhoXiSensor._connect_to_sensor
def _connect_to_sensor(self): """Connect to the sensor. """ name = self._device_name try: # Check if device is actively in list rospy.wait_for_service('phoxi_camera/get_device_list') device_list = rospy.ServiceProxy('phoxi_camera/get_device_list', GetD...
python
def _connect_to_sensor(self): """Connect to the sensor. """ name = self._device_name try: # Check if device is actively in list rospy.wait_for_service('phoxi_camera/get_device_list') device_list = rospy.ServiceProxy('phoxi_camera/get_device_list', GetD...
[ "def", "_connect_to_sensor", "(", "self", ")", ":", "name", "=", "self", ".", "_device_name", "try", ":", "# Check if device is actively in list", "rospy", ".", "wait_for_service", "(", "'phoxi_camera/get_device_list'", ")", "device_list", "=", "rospy", ".", "ServiceP...
Connect to the sensor.
[ "Connect", "to", "the", "sensor", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/phoxi_sensor.py#L201-L223
train
Connect to the sensor.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/phoxi_sensor.py
PhoXiSensor._color_im_callback
def _color_im_callback(self, msg): """Callback for handling textures (greyscale images). """ try: data = self._bridge.imgmsg_to_cv2(msg) if np.max(data) > 255.0: data = 255.0 * data / 1200.0 # Experimentally set value for white data = np.clip(d...
python
def _color_im_callback(self, msg): """Callback for handling textures (greyscale images). """ try: data = self._bridge.imgmsg_to_cv2(msg) if np.max(data) > 255.0: data = 255.0 * data / 1200.0 # Experimentally set value for white data = np.clip(d...
[ "def", "_color_im_callback", "(", "self", ",", "msg", ")", ":", "try", ":", "data", "=", "self", ".", "_bridge", ".", "imgmsg_to_cv2", "(", "msg", ")", "if", "np", ".", "max", "(", "data", ")", ">", "255.0", ":", "data", "=", "255.0", "*", "data", ...
Callback for handling textures (greyscale images).
[ "Callback", "for", "handling", "textures", "(", "greyscale", "images", ")", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/phoxi_sensor.py#L225-L236
train
Callback for handling textures.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/phoxi_sensor.py
PhoXiSensor._depth_im_callback
def _depth_im_callback(self, msg): """Callback for handling depth images. """ try: self._cur_depth_im = DepthImage(self._bridge.imgmsg_to_cv2(msg) / 1000.0, frame=self._frame) except: self._cur_depth_im = None
python
def _depth_im_callback(self, msg): """Callback for handling depth images. """ try: self._cur_depth_im = DepthImage(self._bridge.imgmsg_to_cv2(msg) / 1000.0, frame=self._frame) except: self._cur_depth_im = None
[ "def", "_depth_im_callback", "(", "self", ",", "msg", ")", ":", "try", ":", "self", ".", "_cur_depth_im", "=", "DepthImage", "(", "self", ".", "_bridge", ".", "imgmsg_to_cv2", "(", "msg", ")", "/", "1000.0", ",", "frame", "=", "self", ".", "_frame", ")...
Callback for handling depth images.
[ "Callback", "for", "handling", "depth", "images", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/phoxi_sensor.py#L238-L244
train
Callback for handling depth images.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/phoxi_sensor.py
PhoXiSensor._normal_map_callback
def _normal_map_callback(self, msg): """Callback for handling normal maps. """ try: self._cur_normal_map = self._bridge.imgmsg_to_cv2(msg) except: self._cur_normal_map = None
python
def _normal_map_callback(self, msg): """Callback for handling normal maps. """ try: self._cur_normal_map = self._bridge.imgmsg_to_cv2(msg) except: self._cur_normal_map = None
[ "def", "_normal_map_callback", "(", "self", ",", "msg", ")", ":", "try", ":", "self", ".", "_cur_normal_map", "=", "self", ".", "_bridge", ".", "imgmsg_to_cv2", "(", "msg", ")", "except", ":", "self", ".", "_cur_normal_map", "=", "None" ]
Callback for handling normal maps.
[ "Callback", "for", "handling", "normal", "maps", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/phoxi_sensor.py#L246-L252
train
Callback for handling normal maps.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/opencv_camera_sensor.py
OpenCVCameraSensor.start
def start(self): """ Starts the OpenCVCameraSensor Stream Raises: Exception if unable to open stream """ self._sensor = cv2.VideoCapture(self._device_id) if not self._sensor.isOpened(): raise Exception("Unable to open OpenCVCameraSensor for id {0}".format(...
python
def start(self): """ Starts the OpenCVCameraSensor Stream Raises: Exception if unable to open stream """ self._sensor = cv2.VideoCapture(self._device_id) if not self._sensor.isOpened(): raise Exception("Unable to open OpenCVCameraSensor for id {0}".format(...
[ "def", "start", "(", "self", ")", ":", "self", ".", "_sensor", "=", "cv2", ".", "VideoCapture", "(", "self", ".", "_device_id", ")", "if", "not", "self", ".", "_sensor", ".", "isOpened", "(", ")", ":", "raise", "Exception", "(", "\"Unable to open OpenCVC...
Starts the OpenCVCameraSensor Stream Raises: Exception if unable to open stream
[ "Starts", "the", "OpenCVCameraSensor", "Stream", "Raises", ":", "Exception", "if", "unable", "to", "open", "stream" ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/opencv_camera_sensor.py#L18-L26
train
Starts the OpenCVCameraSensor Stream
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/opencv_camera_sensor.py
OpenCVCameraSensor.frames
def frames(self, flush=True): """ Returns the latest color image from the stream Raises: Exception if opencv sensor gives ret_val of 0 """ self.flush() ret_val, frame = self._sensor.read() if not ret_val: raise Exception("Unable to retrieve frame f...
python
def frames(self, flush=True): """ Returns the latest color image from the stream Raises: Exception if opencv sensor gives ret_val of 0 """ self.flush() ret_val, frame = self._sensor.read() if not ret_val: raise Exception("Unable to retrieve frame f...
[ "def", "frames", "(", "self", ",", "flush", "=", "True", ")", ":", "self", ".", "flush", "(", ")", "ret_val", ",", "frame", "=", "self", ".", "_sensor", ".", "read", "(", ")", "if", "not", "ret_val", ":", "raise", "Exception", "(", "\"Unable to retri...
Returns the latest color image from the stream Raises: Exception if opencv sensor gives ret_val of 0
[ "Returns", "the", "latest", "color", "image", "from", "the", "stream", "Raises", ":", "Exception", "if", "opencv", "sensor", "gives", "ret_val", "of", "0" ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/opencv_camera_sensor.py#L36-L49
train
Returns the latest color image from the stream
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/detector.py
RgbdDetection.image
def image(self, render_mode): """ Get the image associated with a particular render mode """ if render_mode == RenderMode.SEGMASK: return self.query_im elif render_mode == RenderMode.COLOR: return self.color_im elif render_mode == RenderMode.DEPTH: ret...
python
def image(self, render_mode): """ Get the image associated with a particular render mode """ if render_mode == RenderMode.SEGMASK: return self.query_im elif render_mode == RenderMode.COLOR: return self.color_im elif render_mode == RenderMode.DEPTH: ret...
[ "def", "image", "(", "self", ",", "render_mode", ")", ":", "if", "render_mode", "==", "RenderMode", ".", "SEGMASK", ":", "return", "self", ".", "query_im", "elif", "render_mode", "==", "RenderMode", ".", "COLOR", ":", "return", "self", ".", "color_im", "el...
Get the image associated with a particular render mode
[ "Get", "the", "image", "associated", "with", "a", "particular", "render", "mode" ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/detector.py#L101-L110
train
Returns the image associated with a particular render mode
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/detector.py
RgbdForegroundMaskDetector.detect
def detect(self, color_im, depth_im, cfg, camera_intr=None, T_camera_world=None, segmask=None): """ Detects all relevant objects in an rgbd image pair using foreground masking. Parameters ---------- color_im : :obj:`ColorImage` color image for detectio...
python
def detect(self, color_im, depth_im, cfg, camera_intr=None, T_camera_world=None, segmask=None): """ Detects all relevant objects in an rgbd image pair using foreground masking. Parameters ---------- color_im : :obj:`ColorImage` color image for detectio...
[ "def", "detect", "(", "self", ",", "color_im", ",", "depth_im", ",", "cfg", ",", "camera_intr", "=", "None", ",", "T_camera_world", "=", "None", ",", "segmask", "=", "None", ")", ":", "# read params", "foreground_mask_tolerance", "=", "cfg", "[", "'foregroun...
Detects all relevant objects in an rgbd image pair using foreground masking. Parameters ---------- color_im : :obj:`ColorImage` color image for detection depth_im : :obj:`DepthImage` depth image for detection (corresponds to color image) cfg : :obj:`YamlC...
[ "Detects", "all", "relevant", "objects", "in", "an", "rgbd", "image", "pair", "using", "foreground", "masking", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/detector.py#L149-L217
train
Detects all relevant objects in an rgbd image pair using foreground masking.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/detector.py
RgbdForegroundMaskQueryImageDetector._segment_color
def _segment_color(self, color_im, bounding_box, bgmodel, cfg, vis_segmentation=False): """ Re-segments a color image to isolate an object of interest using foreground masking and kmeans """ # read params foreground_mask_tolerance = cfg['foreground_mask_tolerance'] color_seg_rgb_weight =...
python
def _segment_color(self, color_im, bounding_box, bgmodel, cfg, vis_segmentation=False): """ Re-segments a color image to isolate an object of interest using foreground masking and kmeans """ # read params foreground_mask_tolerance = cfg['foreground_mask_tolerance'] color_seg_rgb_weight =...
[ "def", "_segment_color", "(", "self", ",", "color_im", ",", "bounding_box", ",", "bgmodel", ",", "cfg", ",", "vis_segmentation", "=", "False", ")", ":", "# read params", "foreground_mask_tolerance", "=", "cfg", "[", "'foreground_mask_tolerance'", "]", "color_seg_rgb...
Re-segments a color image to isolate an object of interest using foreground masking and kmeans
[ "Re", "-", "segments", "a", "color", "image", "to", "isolate", "an", "object", "of", "interest", "using", "foreground", "masking", "and", "kmeans" ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/detector.py#L225-L298
train
Re - segments a color image using foreground masking and kmeans segmentation.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/detector.py
RgbdForegroundMaskQueryImageDetector.detect
def detect(self, color_im, depth_im, cfg, camera_intr=None, T_camera_world=None, vis_foreground=False, vis_segmentation=False, segmask=None): """ Detects all relevant objects in an rgbd image pair using foreground masking. Parameters ---------- colo...
python
def detect(self, color_im, depth_im, cfg, camera_intr=None, T_camera_world=None, vis_foreground=False, vis_segmentation=False, segmask=None): """ Detects all relevant objects in an rgbd image pair using foreground masking. Parameters ---------- colo...
[ "def", "detect", "(", "self", ",", "color_im", ",", "depth_im", ",", "cfg", ",", "camera_intr", "=", "None", ",", "T_camera_world", "=", "None", ",", "vis_foreground", "=", "False", ",", "vis_segmentation", "=", "False", ",", "segmask", "=", "None", ")", ...
Detects all relevant objects in an rgbd image pair using foreground masking. Parameters ---------- color_im : :obj:`ColorImage` color image for detection depth_im : :obj:`DepthImage` depth image for detection (corresponds to color image) cfg : :obj:`YamlC...
[ "Detects", "all", "relevant", "objects", "in", "an", "rgbd", "image", "pair", "using", "foreground", "masking", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/detector.py#L300-L427
train
Detects all relevant objects in an rgbd image pair using foreground masking.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/detector.py
PointCloudBoxDetector.detect
def detect(self, color_im, depth_im, cfg, camera_intr, T_camera_world, vis_foreground=False, vis_segmentation=False, segmask=None): """Detects all relevant objects in an rgbd image pair using foreground masking. Parameters ---------- color_im : :obj:`ColorI...
python
def detect(self, color_im, depth_im, cfg, camera_intr, T_camera_world, vis_foreground=False, vis_segmentation=False, segmask=None): """Detects all relevant objects in an rgbd image pair using foreground masking. Parameters ---------- color_im : :obj:`ColorI...
[ "def", "detect", "(", "self", ",", "color_im", ",", "depth_im", ",", "cfg", ",", "camera_intr", ",", "T_camera_world", ",", "vis_foreground", "=", "False", ",", "vis_segmentation", "=", "False", ",", "segmask", "=", "None", ")", ":", "# read params", "min_pt...
Detects all relevant objects in an rgbd image pair using foreground masking. Parameters ---------- color_im : :obj:`ColorImage` color image for detection depth_im : :obj:`DepthImage` depth image for detection (corresponds to color image) cfg : :obj:`YamlC...
[ "Detects", "all", "relevant", "objects", "in", "an", "rgbd", "image", "pair", "using", "foreground", "masking", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/detector.py#L435-L599
train
Detects all relevant objects in an rgbd image pair using foreground masking.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/detector.py
RgbdDetectorFactory.detector
def detector(detector_type): """ Returns a detector of the specified type. """ if detector_type == 'point_cloud_box': return PointCloudBoxDetector() elif detector_type == 'rgbd_foreground_mask_query': return RgbdForegroundMaskQueryImageDetector() elif detector_typ...
python
def detector(detector_type): """ Returns a detector of the specified type. """ if detector_type == 'point_cloud_box': return PointCloudBoxDetector() elif detector_type == 'rgbd_foreground_mask_query': return RgbdForegroundMaskQueryImageDetector() elif detector_typ...
[ "def", "detector", "(", "detector_type", ")", ":", "if", "detector_type", "==", "'point_cloud_box'", ":", "return", "PointCloudBoxDetector", "(", ")", "elif", "detector_type", "==", "'rgbd_foreground_mask_query'", ":", "return", "RgbdForegroundMaskQueryImageDetector", "("...
Returns a detector of the specified type.
[ "Returns", "a", "detector", "of", "the", "specified", "type", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/detector.py#L604-L612
train
Returns a detector of the specified type.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
tools/capture_dataset.py
preprocess_images
def preprocess_images(raw_color_im, raw_depth_im, camera_intr, T_camera_world, workspace_box, workspace_im, image_proc_config): """ Preprocess a set of color and depth images. """ ...
python
def preprocess_images(raw_color_im, raw_depth_im, camera_intr, T_camera_world, workspace_box, workspace_im, image_proc_config): """ Preprocess a set of color and depth images. """ ...
[ "def", "preprocess_images", "(", "raw_color_im", ",", "raw_depth_im", ",", "camera_intr", ",", "T_camera_world", ",", "workspace_box", ",", "workspace_im", ",", "image_proc_config", ")", ":", "# read params", "inpaint_rescale_factor", "=", "image_proc_config", "[", "'in...
Preprocess a set of color and depth images.
[ "Preprocess", "a", "set", "of", "color", "and", "depth", "images", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/tools/capture_dataset.py#L31-L122
train
Preprocess a set of color and depth images.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/cnn.py
conv
def conv(input, kernel, biases, k_h, k_w, c_o, s_h, s_w, padding="VALID", group=1): """ Convolution layer helper function From https://github.com/ethereon/caffe-tensorflow """ c_i = input.get_shape()[-1] assert c_i%group==0 assert c_o%group==0 convolve = lambda i, k: tf.nn.conv2d(i, k, ...
python
def conv(input, kernel, biases, k_h, k_w, c_o, s_h, s_w, padding="VALID", group=1): """ Convolution layer helper function From https://github.com/ethereon/caffe-tensorflow """ c_i = input.get_shape()[-1] assert c_i%group==0 assert c_o%group==0 convolve = lambda i, k: tf.nn.conv2d(i, k, ...
[ "def", "conv", "(", "input", ",", "kernel", ",", "biases", ",", "k_h", ",", "k_w", ",", "c_o", ",", "s_h", ",", "s_w", ",", "padding", "=", "\"VALID\"", ",", "group", "=", "1", ")", ":", "c_i", "=", "input", ".", "get_shape", "(", ")", "[", "-"...
Convolution layer helper function From https://github.com/ethereon/caffe-tensorflow
[ "Convolution", "layer", "helper", "function", "From", "https", ":", "//", "github", ".", "com", "/", "ethereon", "/", "caffe", "-", "tensorflow" ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/cnn.py#L14-L31
train
Convolution layer helper function
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/cnn.py
AlexNet._parse_config
def _parse_config(self, config): """ Parses a tensorflow configuration """ self._batch_size = config['batch_size'] self._im_height = config['im_height'] self._im_width = config['im_width'] self._num_channels = config['channels'] self._output_layer = config['out_layer'] ...
python
def _parse_config(self, config): """ Parses a tensorflow configuration """ self._batch_size = config['batch_size'] self._im_height = config['im_height'] self._im_width = config['im_width'] self._num_channels = config['channels'] self._output_layer = config['out_layer'] ...
[ "def", "_parse_config", "(", "self", ",", "config", ")", ":", "self", ".", "_batch_size", "=", "config", "[", "'batch_size'", "]", "self", ".", "_im_height", "=", "config", "[", "'im_height'", "]", "self", ".", "_im_width", "=", "config", "[", "'im_width'"...
Parses a tensorflow configuration
[ "Parses", "a", "tensorflow", "configuration" ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/cnn.py#L72-L93
train
Parses a tensorflow configuration and populates the internal state of the object.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/cnn.py
AlexNet._load
def _load(self): """ Loads a model into weights """ if self._model_filename is None: raise ValueError('Model filename not specified') # read the input image self._graph = tf.Graph() with self._graph.as_default(): # read in filenames reader = t...
python
def _load(self): """ Loads a model into weights """ if self._model_filename is None: raise ValueError('Model filename not specified') # read the input image self._graph = tf.Graph() with self._graph.as_default(): # read in filenames reader = t...
[ "def", "_load", "(", "self", ")", ":", "if", "self", ".", "_model_filename", "is", "None", ":", "raise", "ValueError", "(", "'Model filename not specified'", ")", "# read the input image", "self", ".", "_graph", "=", "tf", ".", "Graph", "(", ")", "with", "se...
Loads a model into weights
[ "Loads", "a", "model", "into", "weights" ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/cnn.py#L95-L129
train
Loads a model into the graph and populates the internal variables.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/cnn.py
AlexNet._initialize
def _initialize(self): """ Open from caffe weights """ self._graph = tf.Graph() with self._graph.as_default(): self._input_node = tf.placeholder(tf.float32, (self._batch_size, self._im_height, self._im_width, self._num_channels)) weights = self.build_alexnet_weights() ...
python
def _initialize(self): """ Open from caffe weights """ self._graph = tf.Graph() with self._graph.as_default(): self._input_node = tf.placeholder(tf.float32, (self._batch_size, self._im_height, self._im_width, self._num_channels)) weights = self.build_alexnet_weights() ...
[ "def", "_initialize", "(", "self", ")", ":", "self", ".", "_graph", "=", "tf", ".", "Graph", "(", ")", "with", "self", ".", "_graph", ".", "as_default", "(", ")", ":", "self", ".", "_input_node", "=", "tf", ".", "placeholder", "(", "tf", ".", "floa...
Open from caffe weights
[ "Open", "from", "caffe", "weights" ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/cnn.py#L131-L139
train
Open from caffe weights
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/cnn.py
AlexNet.open_session
def open_session(self): """ Open tensorflow session. Exposed for memory management. """ with self._graph.as_default(): init = tf.initialize_all_variables() self._sess = tf.Session() self._sess.run(init)
python
def open_session(self): """ Open tensorflow session. Exposed for memory management. """ with self._graph.as_default(): init = tf.initialize_all_variables() self._sess = tf.Session() self._sess.run(init)
[ "def", "open_session", "(", "self", ")", ":", "with", "self", ".", "_graph", ".", "as_default", "(", ")", ":", "init", "=", "tf", ".", "initialize_all_variables", "(", ")", "self", ".", "_sess", "=", "tf", ".", "Session", "(", ")", "self", ".", "_ses...
Open tensorflow session. Exposed for memory management.
[ "Open", "tensorflow", "session", ".", "Exposed", "for", "memory", "management", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/cnn.py#L141-L146
train
Open tensorflow session. Exposed for memory management.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/cnn.py
AlexNet.close_session
def close_session(self): """ Close tensorflow session. Exposes for memory management. """ with self._graph.as_default(): self._sess.close() self._sess = None
python
def close_session(self): """ Close tensorflow session. Exposes for memory management. """ with self._graph.as_default(): self._sess.close() self._sess = None
[ "def", "close_session", "(", "self", ")", ":", "with", "self", ".", "_graph", ".", "as_default", "(", ")", ":", "self", ".", "_sess", ".", "close", "(", ")", "self", ".", "_sess", "=", "None" ]
Close tensorflow session. Exposes for memory management.
[ "Close", "tensorflow", "session", ".", "Exposes", "for", "memory", "management", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/cnn.py#L148-L152
train
Closes tensorflow session. Exposes for memory management.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/cnn.py
AlexNet.predict
def predict(self, image_arr, featurize=False): """ Predict a set of images in batches. Parameters ---------- image_arr : NxHxWxC :obj:`numpy.ndarray` input set of images in a num_images x image height x image width x image channels array (must match parameters of network) ...
python
def predict(self, image_arr, featurize=False): """ Predict a set of images in batches. Parameters ---------- image_arr : NxHxWxC :obj:`numpy.ndarray` input set of images in a num_images x image height x image width x image channels array (must match parameters of network) ...
[ "def", "predict", "(", "self", ",", "image_arr", ",", "featurize", "=", "False", ")", ":", "# setup prediction", "num_images", "=", "image_arr", ".", "shape", "[", "0", "]", "output_arr", "=", "None", "# predict by filling in image array in batches", "close_sess", ...
Predict a set of images in batches. Parameters ---------- image_arr : NxHxWxC :obj:`numpy.ndarray` input set of images in a num_images x image height x image width x image channels array (must match parameters of network) featurize : bool whether or not to use th...
[ "Predict", "a", "set", "of", "images", "in", "batches", "." ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/cnn.py#L154-L202
train
Predict a set of images in batches.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/cnn.py
AlexNet.build_alexnet_weights
def build_alexnet_weights(self): """ Build a set of convnet weights for AlexNet """ net_data = self._net_data #conv1 #conv(11, 11, 96, 4, 4, padding='VALID', name='conv1') k_h = 11; k_w = 11; c_o = 96; s_h = 4; s_w = 4 conv1W = tf.Variable(net_data["conv1"][0]) co...
python
def build_alexnet_weights(self): """ Build a set of convnet weights for AlexNet """ net_data = self._net_data #conv1 #conv(11, 11, 96, 4, 4, padding='VALID', name='conv1') k_h = 11; k_w = 11; c_o = 96; s_h = 4; s_w = 4 conv1W = tf.Variable(net_data["conv1"][0]) co...
[ "def", "build_alexnet_weights", "(", "self", ")", ":", "net_data", "=", "self", ".", "_net_data", "#conv1", "#conv(11, 11, 96, 4, 4, padding='VALID', name='conv1')", "k_h", "=", "11", "k_w", "=", "11", "c_o", "=", "96", "s_h", "=", "4", "s_w", "=", "4", "conv1...
Build a set of convnet weights for AlexNet
[ "Build", "a", "set", "of", "convnet", "weights", "for", "AlexNet" ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/cnn.py#L219-L293
train
Builds a set of convnet weights for AlexNet
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/cnn.py
AlexNet.build_alexnet
def build_alexnet(self, weights, output_layer=None): """ Connects graph of alexnet from weights """ if output_layer is None: output_layer = self._output_layer #conv1 #conv(11, 11, 96, 4, 4, padding='VALID', name='conv1') k_h = 11; k_w = 11; c_o = 96; s_h = 4; s_w = 4...
python
def build_alexnet(self, weights, output_layer=None): """ Connects graph of alexnet from weights """ if output_layer is None: output_layer = self._output_layer #conv1 #conv(11, 11, 96, 4, 4, padding='VALID', name='conv1') k_h = 11; k_w = 11; c_o = 96; s_h = 4; s_w = 4...
[ "def", "build_alexnet", "(", "self", ",", "weights", ",", "output_layer", "=", "None", ")", ":", "if", "output_layer", "is", "None", ":", "output_layer", "=", "self", ".", "_output_layer", "#conv1", "#conv(11, 11, 96, 4, 4, padding='VALID', name='conv1')", "k_h", "=...
Connects graph of alexnet from weights
[ "Connects", "graph", "of", "alexnet", "from", "weights" ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/cnn.py#L295-L394
train
Builds the Alexnet graph from the given weights.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
BerkeleyAutomation/perception
perception/feature_extractors.py
CNNBatchFeatureExtractor._forward_pass
def _forward_pass(self, images): """ Forward pass a list of images through the CNN """ # form image array num_images = len(images) if num_images == 0: return None for image in images: if not isinstance(image, Image): new_images = [] ...
python
def _forward_pass(self, images): """ Forward pass a list of images through the CNN """ # form image array num_images = len(images) if num_images == 0: return None for image in images: if not isinstance(image, Image): new_images = [] ...
[ "def", "_forward_pass", "(", "self", ",", "images", ")", ":", "# form image array", "num_images", "=", "len", "(", "images", ")", "if", "num_images", "==", "0", ":", "return", "None", "for", "image", "in", "images", ":", "if", "not", "isinstance", "(", "...
Forward pass a list of images through the CNN
[ "Forward", "pass", "a", "list", "of", "images", "through", "the", "CNN" ]
03d9b37dd6b66896cdfe173905c9413c8c3c5df6
https://github.com/BerkeleyAutomation/perception/blob/03d9b37dd6b66896cdfe173905c9413c8c3c5df6/perception/feature_extractors.py#L51-L86
train
Forward pass a list of images through the CNN
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
src-d/jgit-spark-connector
python/sourced/engine/engine.py
Engine.repositories
def repositories(self): """ Returns a DataFrame with the data about the repositories found at the specified repositories path in the form of siva files. >>> repos_df = engine.repositories :rtype: RepositoriesDataFrame """ return RepositoriesDataFrame(self.__engi...
python
def repositories(self): """ Returns a DataFrame with the data about the repositories found at the specified repositories path in the form of siva files. >>> repos_df = engine.repositories :rtype: RepositoriesDataFrame """ return RepositoriesDataFrame(self.__engi...
[ "def", "repositories", "(", "self", ")", ":", "return", "RepositoriesDataFrame", "(", "self", ".", "__engine", ".", "getRepositories", "(", ")", ",", "self", ".", "session", ",", "self", ".", "__implicits", ")" ]
Returns a DataFrame with the data about the repositories found at the specified repositories path in the form of siva files. >>> repos_df = engine.repositories :rtype: RepositoriesDataFrame
[ "Returns", "a", "DataFrame", "with", "the", "data", "about", "the", "repositories", "found", "at", "the", "specified", "repositories", "path", "in", "the", "form", "of", "siva", "files", "." ]
79d05a0bcf0da435685d6118828a8884e2fe4b94
https://github.com/src-d/jgit-spark-connector/blob/79d05a0bcf0da435685d6118828a8884e2fe4b94/python/sourced/engine/engine.py#L57-L67
train
Returns a DataFrame with the data about the repositories found at the specified repositories path in the form of siva files.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
src-d/jgit-spark-connector
python/sourced/engine/engine.py
Engine.blobs
def blobs(self, repository_ids=[], reference_names=[], commit_hashes=[]): """ Retrieves the blobs of a list of repositories, reference names and commit hashes. So the result will be a DataFrame of all the blobs in the given commits that are in the given references that belong to the give...
python
def blobs(self, repository_ids=[], reference_names=[], commit_hashes=[]): """ Retrieves the blobs of a list of repositories, reference names and commit hashes. So the result will be a DataFrame of all the blobs in the given commits that are in the given references that belong to the give...
[ "def", "blobs", "(", "self", ",", "repository_ids", "=", "[", "]", ",", "reference_names", "=", "[", "]", ",", "commit_hashes", "=", "[", "]", ")", ":", "if", "not", "isinstance", "(", "repository_ids", ",", "list", ")", ":", "raise", "Exception", "(",...
Retrieves the blobs of a list of repositories, reference names and commit hashes. So the result will be a DataFrame of all the blobs in the given commits that are in the given references that belong to the given repositories. >>> blobs_df = engine.blobs(repo_ids, ref_names, hashes) Cal...
[ "Retrieves", "the", "blobs", "of", "a", "list", "of", "repositories", "reference", "names", "and", "commit", "hashes", ".", "So", "the", "result", "will", "be", "a", "DataFrame", "of", "all", "the", "blobs", "in", "the", "given", "commits", "that", "are", ...
79d05a0bcf0da435685d6118828a8884e2fe4b94
https://github.com/src-d/jgit-spark-connector/blob/79d05a0bcf0da435685d6118828a8884e2fe4b94/python/sourced/engine/engine.py#L70-L103
train
Returns the blobs of a list of repositories reference names and commit hashes.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
src-d/jgit-spark-connector
python/sourced/engine/engine.py
Engine.from_metadata
def from_metadata(self, db_path, db_name='engine_metadata.db'): """ Registers in the current session the views of the MetadataSource so the data is obtained from the metadata database instead of reading the repositories with the DefaultSource. :param db_path: path to the folder ...
python
def from_metadata(self, db_path, db_name='engine_metadata.db'): """ Registers in the current session the views of the MetadataSource so the data is obtained from the metadata database instead of reading the repositories with the DefaultSource. :param db_path: path to the folder ...
[ "def", "from_metadata", "(", "self", ",", "db_path", ",", "db_name", "=", "'engine_metadata.db'", ")", ":", "self", ".", "__engine", ".", "fromMetadata", "(", "db_path", ",", "db_name", ")", "return", "self" ]
Registers in the current session the views of the MetadataSource so the data is obtained from the metadata database instead of reading the repositories with the DefaultSource. :param db_path: path to the folder that contains the database. :type db_path: str :param db_name: name ...
[ "Registers", "in", "the", "current", "session", "the", "views", "of", "the", "MetadataSource", "so", "the", "data", "is", "obtained", "from", "the", "metadata", "database", "instead", "of", "reading", "the", "repositories", "with", "the", "DefaultSource", "." ]
79d05a0bcf0da435685d6118828a8884e2fe4b94
https://github.com/src-d/jgit-spark-connector/blob/79d05a0bcf0da435685d6118828a8884e2fe4b94/python/sourced/engine/engine.py#L106-L121
train
Loads the metadata from the database at the specified path.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
src-d/jgit-spark-connector
python/sourced/engine/engine.py
SourcedDataFrame.__generate_method
def __generate_method(name): """ Wraps the DataFrame's original method by name to return the derived class instance. """ try: func = getattr(DataFrame, name) except AttributeError as e: # PySpark version is too old def func(self, *args, **kwarg...
python
def __generate_method(name): """ Wraps the DataFrame's original method by name to return the derived class instance. """ try: func = getattr(DataFrame, name) except AttributeError as e: # PySpark version is too old def func(self, *args, **kwarg...
[ "def", "__generate_method", "(", "name", ")", ":", "try", ":", "func", "=", "getattr", "(", "DataFrame", ",", "name", ")", "except", "AttributeError", "as", "e", ":", "# PySpark version is too old", "def", "func", "(", "self", ",", "*", "args", ",", "*", ...
Wraps the DataFrame's original method by name to return the derived class instance.
[ "Wraps", "the", "DataFrame", "s", "original", "method", "by", "name", "to", "return", "the", "derived", "class", "instance", "." ]
79d05a0bcf0da435685d6118828a8884e2fe4b94
https://github.com/src-d/jgit-spark-connector/blob/79d05a0bcf0da435685d6118828a8884e2fe4b94/python/sourced/engine/engine.py#L176-L198
train
A decorator that returns the original method by name to return the derived class instance.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
src-d/jgit-spark-connector
python/sourced/engine/engine.py
RepositoriesDataFrame.references
def references(self): """ Returns the joined DataFrame of references and repositories. >>> refs_df = repos_df.references :rtype: ReferencesDataFrame """ return ReferencesDataFrame(self._engine_dataframe.getReferences(), self._session, ...
python
def references(self): """ Returns the joined DataFrame of references and repositories. >>> refs_df = repos_df.references :rtype: ReferencesDataFrame """ return ReferencesDataFrame(self._engine_dataframe.getReferences(), self._session, ...
[ "def", "references", "(", "self", ")", ":", "return", "ReferencesDataFrame", "(", "self", ".", "_engine_dataframe", ".", "getReferences", "(", ")", ",", "self", ".", "_session", ",", "self", ".", "_implicits", ")" ]
Returns the joined DataFrame of references and repositories. >>> refs_df = repos_df.references :rtype: ReferencesDataFrame
[ "Returns", "the", "joined", "DataFrame", "of", "references", "and", "repositories", "." ]
79d05a0bcf0da435685d6118828a8884e2fe4b94
https://github.com/src-d/jgit-spark-connector/blob/79d05a0bcf0da435685d6118828a8884e2fe4b94/python/sourced/engine/engine.py#L261-L270
train
Returns the joined DataFrame of references and repositories.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
src-d/jgit-spark-connector
python/sourced/engine/engine.py
RepositoriesDataFrame.remote_references
def remote_references(self): """ Returns a new DataFrame with only the remote references of the current repositories. >>> remote_refs_df = repos_df.remote_references :rtype: ReferencesDataFrame """ return ReferencesDataFrame(self._engine_dataframe.getRemoteRefer...
python
def remote_references(self): """ Returns a new DataFrame with only the remote references of the current repositories. >>> remote_refs_df = repos_df.remote_references :rtype: ReferencesDataFrame """ return ReferencesDataFrame(self._engine_dataframe.getRemoteRefer...
[ "def", "remote_references", "(", "self", ")", ":", "return", "ReferencesDataFrame", "(", "self", ".", "_engine_dataframe", ".", "getRemoteReferences", "(", ")", ",", "self", ".", "_session", ",", "self", ".", "_implicits", ")" ]
Returns a new DataFrame with only the remote references of the current repositories. >>> remote_refs_df = repos_df.remote_references :rtype: ReferencesDataFrame
[ "Returns", "a", "new", "DataFrame", "with", "only", "the", "remote", "references", "of", "the", "current", "repositories", "." ]
79d05a0bcf0da435685d6118828a8884e2fe4b94
https://github.com/src-d/jgit-spark-connector/blob/79d05a0bcf0da435685d6118828a8884e2fe4b94/python/sourced/engine/engine.py#L274-L284
train
Returns a new DataFrame with only the remote references of the current repositories.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
src-d/jgit-spark-connector
python/sourced/engine/engine.py
RepositoriesDataFrame.master_ref
def master_ref(self): """ Filters the current DataFrame references to only contain those rows whose reference is master. >>> master_df = repos_df.master_ref :rtype: ReferencesDataFrame """ return ReferencesDataFrame(self._engine_dataframe.getReferences().getHEAD(), ...
python
def master_ref(self): """ Filters the current DataFrame references to only contain those rows whose reference is master. >>> master_df = repos_df.master_ref :rtype: ReferencesDataFrame """ return ReferencesDataFrame(self._engine_dataframe.getReferences().getHEAD(), ...
[ "def", "master_ref", "(", "self", ")", ":", "return", "ReferencesDataFrame", "(", "self", ".", "_engine_dataframe", ".", "getReferences", "(", ")", ".", "getHEAD", "(", ")", ",", "self", ".", "_session", ",", "self", ".", "_implicits", ")" ]
Filters the current DataFrame references to only contain those rows whose reference is master. >>> master_df = repos_df.master_ref :rtype: ReferencesDataFrame
[ "Filters", "the", "current", "DataFrame", "references", "to", "only", "contain", "those", "rows", "whose", "reference", "is", "master", "." ]
79d05a0bcf0da435685d6118828a8884e2fe4b94
https://github.com/src-d/jgit-spark-connector/blob/79d05a0bcf0da435685d6118828a8884e2fe4b94/python/sourced/engine/engine.py#L301-L310
train
Filters the current DataFrame references to only contain those rows whose reference is master.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
src-d/jgit-spark-connector
python/sourced/engine/engine.py
ReferencesDataFrame.head_ref
def head_ref(self): """ Filters the current DataFrame to only contain those rows whose reference is HEAD. >>> heads_df = refs_df.head_ref :rtype: ReferencesDataFrame """ return ReferencesDataFrame(self._engine_dataframe.getHEAD(), self...
python
def head_ref(self): """ Filters the current DataFrame to only contain those rows whose reference is HEAD. >>> heads_df = refs_df.head_ref :rtype: ReferencesDataFrame """ return ReferencesDataFrame(self._engine_dataframe.getHEAD(), self...
[ "def", "head_ref", "(", "self", ")", ":", "return", "ReferencesDataFrame", "(", "self", ".", "_engine_dataframe", ".", "getHEAD", "(", ")", ",", "self", ".", "_session", ",", "self", ".", "_implicits", ")" ]
Filters the current DataFrame to only contain those rows whose reference is HEAD. >>> heads_df = refs_df.head_ref :rtype: ReferencesDataFrame
[ "Filters", "the", "current", "DataFrame", "to", "only", "contain", "those", "rows", "whose", "reference", "is", "HEAD", "." ]
79d05a0bcf0da435685d6118828a8884e2fe4b94
https://github.com/src-d/jgit-spark-connector/blob/79d05a0bcf0da435685d6118828a8884e2fe4b94/python/sourced/engine/engine.py#L346-L355
train
Returns a new DataFrame containing only those rows whose reference is HEAD.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
src-d/jgit-spark-connector
python/sourced/engine/engine.py
ReferencesDataFrame.master_ref
def master_ref(self): """ Filters the current DataFrame to only contain those rows whose reference is master. >>> master_df = refs_df.master_ref :rtype: ReferencesDataFrame """ return ReferencesDataFrame(self._engine_dataframe.getMaster(), ...
python
def master_ref(self): """ Filters the current DataFrame to only contain those rows whose reference is master. >>> master_df = refs_df.master_ref :rtype: ReferencesDataFrame """ return ReferencesDataFrame(self._engine_dataframe.getMaster(), ...
[ "def", "master_ref", "(", "self", ")", ":", "return", "ReferencesDataFrame", "(", "self", ".", "_engine_dataframe", ".", "getMaster", "(", ")", ",", "self", ".", "_session", ",", "self", ".", "_implicits", ")", "return", "self", ".", "ref", "(", "'refs/hea...
Filters the current DataFrame to only contain those rows whose reference is master. >>> master_df = refs_df.master_ref :rtype: ReferencesDataFrame
[ "Filters", "the", "current", "DataFrame", "to", "only", "contain", "those", "rows", "whose", "reference", "is", "master", "." ]
79d05a0bcf0da435685d6118828a8884e2fe4b94
https://github.com/src-d/jgit-spark-connector/blob/79d05a0bcf0da435685d6118828a8884e2fe4b94/python/sourced/engine/engine.py#L359-L369
train
Returns a new DataFrame with only those rows whose reference is master.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
src-d/jgit-spark-connector
python/sourced/engine/engine.py
ReferencesDataFrame.ref
def ref(self, ref): """ Filters the current DataFrame to only contain those rows whose reference is the given reference name. >>> heads_df = refs_df.ref('refs/heads/HEAD') :param ref: Reference to get :type ref: str :rtype: ReferencesDataFrame """ ...
python
def ref(self, ref): """ Filters the current DataFrame to only contain those rows whose reference is the given reference name. >>> heads_df = refs_df.ref('refs/heads/HEAD') :param ref: Reference to get :type ref: str :rtype: ReferencesDataFrame """ ...
[ "def", "ref", "(", "self", ",", "ref", ")", ":", "return", "ReferencesDataFrame", "(", "self", ".", "filter", "(", "self", ".", "name", "==", "ref", ")", ".", "_jdf", ",", "self", ".", "_session", ",", "self", ".", "_implicits", ")" ]
Filters the current DataFrame to only contain those rows whose reference is the given reference name. >>> heads_df = refs_df.ref('refs/heads/HEAD') :param ref: Reference to get :type ref: str :rtype: ReferencesDataFrame
[ "Filters", "the", "current", "DataFrame", "to", "only", "contain", "those", "rows", "whose", "reference", "is", "the", "given", "reference", "name", "." ]
79d05a0bcf0da435685d6118828a8884e2fe4b94
https://github.com/src-d/jgit-spark-connector/blob/79d05a0bcf0da435685d6118828a8884e2fe4b94/python/sourced/engine/engine.py#L372-L384
train
Returns a new DataFrame containing only those rows whose reference is the given reference name.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
src-d/jgit-spark-connector
python/sourced/engine/engine.py
ReferencesDataFrame.all_reference_commits
def all_reference_commits(self): """ Returns the current DataFrame joined with the commits DataFrame, with all of the commits in all references. >>> commits_df = refs_df.all_reference_commits Take into account that getting all the commits will lead to a lot of repeated tree ...
python
def all_reference_commits(self): """ Returns the current DataFrame joined with the commits DataFrame, with all of the commits in all references. >>> commits_df = refs_df.all_reference_commits Take into account that getting all the commits will lead to a lot of repeated tree ...
[ "def", "all_reference_commits", "(", "self", ")", ":", "return", "CommitsDataFrame", "(", "self", ".", "_engine_dataframe", ".", "getAllReferenceCommits", "(", ")", ",", "self", ".", "_session", ",", "self", ".", "_implicits", ")" ]
Returns the current DataFrame joined with the commits DataFrame, with all of the commits in all references. >>> commits_df = refs_df.all_reference_commits Take into account that getting all the commits will lead to a lot of repeated tree entries and blobs, thus making your query very s...
[ "Returns", "the", "current", "DataFrame", "joined", "with", "the", "commits", "DataFrame", "with", "all", "of", "the", "commits", "in", "all", "references", "." ]
79d05a0bcf0da435685d6118828a8884e2fe4b94
https://github.com/src-d/jgit-spark-connector/blob/79d05a0bcf0da435685d6118828a8884e2fe4b94/python/sourced/engine/engine.py#L388-L404
train
Returns the current DataFrame joined with the commits DataFrame with all of the tree entries in all references.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...
src-d/jgit-spark-connector
python/sourced/engine/engine.py
ReferencesDataFrame.commits
def commits(self): """ Returns the current DataFrame joined with the commits DataFrame. It just returns the last commit in a reference (aka the current state). >>> commits_df = refs_df.commits If you want all commits from the references, use the `all_reference_commits` method, ...
python
def commits(self): """ Returns the current DataFrame joined with the commits DataFrame. It just returns the last commit in a reference (aka the current state). >>> commits_df = refs_df.commits If you want all commits from the references, use the `all_reference_commits` method, ...
[ "def", "commits", "(", "self", ")", ":", "return", "CommitsDataFrame", "(", "self", ".", "_engine_dataframe", ".", "getCommits", "(", ")", ",", "self", ".", "_session", ",", "self", ".", "_implicits", ")" ]
Returns the current DataFrame joined with the commits DataFrame. It just returns the last commit in a reference (aka the current state). >>> commits_df = refs_df.commits If you want all commits from the references, use the `all_reference_commits` method, but take into account that gett...
[ "Returns", "the", "current", "DataFrame", "joined", "with", "the", "commits", "DataFrame", ".", "It", "just", "returns", "the", "last", "commit", "in", "a", "reference", "(", "aka", "the", "current", "state", ")", "." ]
79d05a0bcf0da435685d6118828a8884e2fe4b94
https://github.com/src-d/jgit-spark-connector/blob/79d05a0bcf0da435685d6118828a8884e2fe4b94/python/sourced/engine/engine.py#L408-L423
train
Returns the current DataFrame joined with the commits DataFrame.
GiP5xwVCF98Z,B3LV8Eo811Ma,bIsJhlpYrrU2,UtiWT6f6p9yZ,sY2ClS3bs_Vs,cXy7eDEmqBLX,WBIJpxagI_Bm,oiYQtqKByLVy,pKtZbyLPTF7M,N5KuUvtbiyqB,Y8CO_HpFZe1H,lFpHwHL3xiEO,QT_5wdIFQ3WX,gn988v5t9NEf,dVZxwLTOCtbO,RjQP07DYIdkf,Wun5u3i1rn23,m64e4RQAlmFd,zfo2Sgkz3IVJ,aWb0eXvJHTT7,s2y8nAB4S7UF,znAfcqx_89tO,ZnHlCcECsuOK,TdYHRT1SBW60,mBmBrDJU...