This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table ocv.canny_edge_table_plc | |
as | |
( | |
select GetImgSizePLC(img) as imgsize, | |
CannyEdgeDetectPLC(img) as edges | |
from ocv.src_image | |
) distributed randomly; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
psql -d <dbname> -h <HAWQ master hostname> -U <username> -c 'select nrows, ncols, edges from ocv.canny_edge_table limit 1;' | python -m ‘ppsqlviz.plotter’ image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install ppsqlviz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table ocv.canny_edge_table | |
as | |
( | |
select img_name, | |
(canny_edge_detect(img)).* | |
from ocv.src_image | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create type canny_output_type | |
as | |
( | |
nrows int, | |
ncols int, | |
edges int[] | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gpssh -f hostfile echo “export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/lib/ds” >> ~/.bashrc gpstop -r |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gpscp -f hostfile canny_edge_detection_so libopencv_core.so.2.4 libopencv_imgproc.so.2.4 libopencv_highgui.so.2.4 =:/usr/local/lib/ds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g++ -shared -Wl,-soname,canny_edge_detection -fPIC -ocanny_edge_detection.so -lopencv_core -lopencv_imgproc -lopencv_highgui CannyEdgeDetectionCtypes.cpp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ImageToSequenceMapper extends Mapper<LongWritable,Text,Text, Text> { | |
// The input to each mapper is a set of lines from a text file on HDFS, where each line contains a path to an HDFS image file | |
// The job input format is NLineInputFormat and the job output format is TextOutputFormat | |
@Override | |
public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { | |
// The input argument value contains the HDFS path to the image file | |
String imgName = value.toString(); | |
FileSystem fs = FileSystem.get(context.getConfiguration()); | |
FSDataInputStream in = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vatsandb=# select id, tweet_body from posdemo.training_data limit 5; | |
id | tweet_body | |
------------+----------------------------------------------------------------------------------------- | |
1467820906 | @localtweeps Wow, tons of replies from you, may have to unfollow so I can see my friends' tweets, you're scrolling the feed a lot. | |
1467862806 | @MySteezRadio I'm goin' to follow u, since u didn't LOL GO ANGELS! | |
1467891880 | Argh! I was suuuper sleepy an hour ago, now I'm wide awake. Hope I don't stay up all night. :-/ | |
1467896211 | michigan state you make me sad | |
1467911846 | @bananaface IM SORRY I GOT YOU SICK. lol. going to bed too. NIGHT! |