Superpixel region feature extraction and edge pair code in pystruct?

959 views
Skip to first unread message

Andreas Klintberg

unread,
Nov 7, 2013, 7:06:01 AM11/7/13
to pyst...@googlegroups.com
Hi,
I'm playing around with semantic imag segmentation but i'm about to train my own data for the segmentation for a particular application. I'm extremely greatful for the pystruct library and all your blogposts, Andreas Mueller. However i have one question: Will the code for some of these tasks (Superpixel region feature extraction) be available as a part of the lib? Some code is available on your blog (creating pairwise edges), but for instance the feature extraction code for superpixel regions is missing. From Metaoptimize question you answered:
 
"You should compute SIFT densely over the whole image, then cluster these, and build a bag-of-word representation by accumulating histograms per superpixel. I'll push Python code for it together with training a CRF to github in <1 month hopefully. You can have it before but it's not in a publishable state"
 
I'm implemnenting this myself and if successful i will try and write a very "low level" tutorial for all the steps for people like me (happy amateurs :) ). I can see the reason why you might have left these parts out, since you don't want to clutter the lib but if it would be possible to share i would be a very happy camper. :)
 
 
 
 

Juan Alonso

unread,
Nov 7, 2013, 8:14:47 AM11/7/13
to pyst...@googlegroups.com
Hi Andreas, 

I'm the guy who asked the question your mentioned on Metaoptimize :) I still have not been able to address this problem successfully (I have not , but it was (and still it is) my intention to write a step by step tutorial that shows how to do it and as I see I am not the only one, maybe it will be nice that someone with more expertise give us a deeper guideline on how to do it :)

Andy

unread,
Nov 8, 2013, 12:28:34 AM11/8/13
to pyst...@googlegroups.com
Hi guys.
I'm sorry I didn't keep my promise.
I really had very little time. I could push the code from my dissertation but it is
undocumented and relies on vl_feat and the original slic implementation.
I would rather like to use just scikit-image and scikit-learn.
I'll try do write something up on the weekend. If I can't make it, I'll dump my old code for whatever it's worth.

Cheers,
Andy
--
You received this message because you are subscribed to the Google Groups "pystruct" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pystruct+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Andreas Klintberg

unread,
Nov 8, 2013, 4:41:55 PM11/8/13
to pyst...@googlegroups.com
No worries at all. As i said extremely glad for the libs pystruct and sklearn as well :) Please dump the raw code, it would be much appreciated. 

Andy

unread,
Nov 8, 2013, 11:46:55 PM11/8/13
to pyst...@googlegroups.com
My full phd is here. I literally just pushed the master branch to github.
There is no license file currently. I will probably bsd it if my papers go through.
https://github.com/amueller/segmentation

This might be a good entry point:
https://github.com/amueller/segmentation/blob/master/msrc/msrc_crf.py

I'll still try to do a blog post.
Cheers,
Andy

Andy

unread,
Nov 11, 2013, 12:17:42 AM11/11/13
to pyst...@googlegroups.com
On 11/08/2013 01:41 PM, Andreas Klintberg wrote:
> No worries at all. As i said extremely glad for the libs pystruct and
> sklearn as well :) Please dump the raw code, it would be much
> appreciated.
Did you have a look at the code? Was it helpful?
I am just writing up my blog post, but its not really finished (no
pystruct yet)

http://nbviewer.ipython.org/7408242

source:
https://gist.github.com/amueller/7408242

Cheers,
Andy


Andreas Klintberg

unread,
Nov 20, 2013, 11:41:12 AM11/20/13
to pyst...@googlegroups.com
Hi, 
Thanks :) actually haven't had the time just yet but i will look at it this week and weekend, will get back to you.

Andreas Klintberg

unread,
Nov 28, 2013, 9:18:47 AM11/28/13
to pyst...@googlegroups.com
I got it together! :) got a 88,3% on my dataset. Many thanks, and the tutorial is great, but as you said still missing some parts. But the parts you've written are very clear and understandable. I actually also started writing a series of blogpost describing the preparations of the data and so on. But your post covers much of it as well, if you'd like me to expand and help you with your post or documentation i'd love to help.
 

Den måndagen den 11:e november 2013 kl. 06:17:42 UTC+1 skrev Andreas Mueller:

Andy

unread,
Dec 1, 2013, 12:38:38 PM12/1/13
to pyst...@googlegroups.com
On 11/28/2013 03:18 PM, Andreas Klintberg wrote:
I got it together! :) got a 88,3% on my dataset. Many thanks, and the tutorial is great, but as you said still missing some parts. But the parts you've written are very clear and understandable. I actually also started writing a series of blogpost describing the preparations of the data and so on. But your post covers much of it as well, if you'd like me to expand and help you with your post or documentation i'd love to help.
 
What was the increase in performance between using an SVM and a structured SVM (i.e. edges vs no edges)?

I'd love to finish this up (myself?) but I am currently on what I think is fair to call an insane travel schedule.
If you want to finish this up, feel free to do so or send me an updated version or send me your input on my version ;)
Only constraints on from my side: all code should be BSD, all text (if applicable) should be CC-0, and I would like it to be posted (non-exclusively obviously ^^)
to my blog.

So if you have anything to share, feel free to sent PRs or sent something to the list. Sorry if my replies are a bit sluggish at the moment.

Cheers,
Andy


Den måndagen den 11:e november 2013 kl. 06:17:42 UTC+1 skrev Andreas Mueller:
On 11/08/2013 01:41 PM, Andreas Klintberg wrote:
> No worries at all. As i said extremely glad for the libs pystruct and
> sklearn as well :) Please dump the raw code, it would be much
> appreciated.
Did you have a look at the code? Was it helpful?
I am just writing up my blog post, but its not really finished (no
pystruct yet)

http://nbviewer.ipython.org/7408242

source:
https://gist.github.com/amueller/7408242

Cheers,
Andy


shigao du

unread,
May 10, 2019, 10:56:38 AM5/10/19
to pystruct
please,can you share your code about this,thanks!!!
Reply all
Reply to author
Forward
0 new messages