How can i import the seedSuperpixel modules? - import

I wanted to implement the SEEDS Superpixel segmentation algorithm in python using opencv but it looks like other than video module no other module has been put up in order to implement it. Please help me know what module needs to be used to import the seeds superpixel segmentation functionalities?

I was having a similar problem to use SEEDS.
At least for my problem, I had to install "opencv-contrib-python" and uninstall "opencv-python" because both are imported the same way (using "import cv2") but only the contrib version allows you to use SEEDS and other segmentation tools. There is more information here https://pypi.org/project/opencv-python/
I don't know if that will work for others, but solved my problem :)

To use SEEDS for Superpixel segmentation analysis, you need to import cv2.
I found this bit of code and was able to replicate results after installing opencv.

Related

How to make SCIP use the LAPACK library?

I have built a MINLP model in Pyomo in Linux system and I used SCIP to solve the model. Then I encountered the problem shown below.
enter image description here
Then SCIP starts optimization and takes a large amount of time. I googled the problem and found that SCIP is only able to use LAPACK through Ipopt. Then I followed the instruction to run make IPOPT=true (I have installed IPOPT). However, build failed.
enter image description here
Then I followed its suggestion to run make IPOPT=true READLINE=false ZLIB=false GMP=false and then new question appeared.
enter image description here
As for this question, I haven’t found any solution. When I run make GMP=true, it suggests me to use GMP=false, and when I run make GMP=false, it suggests me to use GMP=true.
So is there a way to make SCIP use the LAPACK library?
For the GMP=false/true issue, I suspect that the problem is that SoPlex was built with GMP=true and SCIP needs GMP=true as well. So if you want to try to build SCIP with GMP=false then SoPlex should also be built with GMP=false.
I cannot really say from your pictures why linking against Ipopt failed. Check all error messages and whether the symbols that the compiler thinks are missing are actually available in the lib that is linked against.
Use VERBOSE=true to see the actual linker call and check whether it makes sense.
The hints about readline, gmp, or zlib are misleading. Don't deactivate these if you do not actually have problems linking against these libs.
If you want only Lapack but no Ipopt, then there has been a post about this a while ago: lapack library for scip optimization

Is there a way to detect that code is running in colaboratory as opposed to "classic jupyter"

Does anyone know if there is a way to programatically determine that we're running in colaboratory as opposed to "classic jupyter"?
Following this great article about using Scala on Colaboratory, I tried using plotly.
However, I ran into this issue. Although I found a work around (as detailed in the issue). One of the comments suggests that there is a generic work around that could be applied if our code could detect that it was running in Colaboratory.
Thanks for any pointers!
There are several module imports typical of Colab. For example, in Python:
import sys
'google.colab' in sys.modules

How to train latent SVM model for object detection ? It crashes using Matlab 2012b, Windows 64bit OS

How can I train my own detector under Windows 7 in C++ or Matlab2012b? I do not have Linux or I do not have Mac OSX.
I actually searched for it a lot before writing here. What I got is:
I would like to train my own latent SVM model and use it in C++. I checked out the OpenCV sample, cpp/latentsvm_multidetect.cpp. It works with the existing models.
Authors' website : http://www.cs.berkeley.edu/~rbg/latent/index.html . It is mentioned that the software is tested using matlab2011a under linux and mac osx. However, I run matlab2012b under Windows7 64 bit. The code crashes very often, and I tried to fix the bugs, but I cannot cope anymore.
Is there any other source code which I can use under Windows 7 64bit?
OpenCV : http://docs.opencv.org/modules/objdetect/doc/latent_svm.html . There is no code implementation for training. Only detector can be used to detect the objects with existing models.
On the other hand, somebody else asked the same question. opencv latent svm . However, The question was closed without being answered. Sad!
Also, OpenCV and Latent SVM Detector is similar to my question. I am not satisfied with the answer, I read the same in the README file in the source code in Matlab. It does not help me to overcome the bugs in the source code, if I run under Windows 7. For this question, I wanted to add a comment to ask further, I cannot add because of my reputation (I am new here).
I think, Latent SVM is fascinating and something new to detect the objects. Also, I think this should be a general issue to train our own model easily. It would be nice if anyone can guide.
Anyway, I do not understand why the training part is not implemented in OpenCV with the detector part!
some c++ ones:
http://www.dubout.ch/en/coding.html
http://www.uco.es/~in1majim/proyectos/libpabod/
I have had both working in windows 7 64bit, but does require a little tweaking here and there, the first less than the later.
Also as an aside, you could always try the opencv hog detector first, to see if it is sufficient for your application, you can train it with opencv svm. I found it to be quite good for simple objects that have a well defined and distinct shape.
Cheers
EDIT: Sorry the libpabod is only test time, only the the 1st link has the training code.

Using SciPy functions in EPD Free

I am completely new to Enthought and SciPy and the EPD Free support suggested I come here for help.
I just started working through a course on Linear Algebra through MIT's open course website. When looking for a free Matlab substitute I was directed to use SciPy/NumPy and matplotlib as the best alternatives. The SciPy website itself recommended Enthought as the simplest install for Windows.
So now I have EPD Free installed on my system, but when I try to do something simple like sp.sqrt(-1) (which is the first function given as an example on http://docs.scipy.org/doc/scipy/reference/tutorial/basic.html) I get the error "sp is not defined".
So then how do I access the SciPy functions? I am having a hard time finding an EPD guide for beginners, perhaps I chose the wrong tool for introductory linear algebra?
Thank you in all in advance!
You need to import scipy before using it. Add the following at the beginning of your script or interactive session:
import scipy as sp

free MATLAB environment

I'm learning the MATLAB language and would like to have some kind of free environment to experiment with. The MATLAB environment provided by MathWorks is commercial. There appears to be a trial available, but I can't figure out how to get the trial license.
For the moment, all I need is a command-line and the "standard libraries".
Octave is mostly compatible with matlab: http://www.gnu.org/software/octave/
If you are just starting with MATLAB I would strongly suggest to go the Python path instead (unless there is some very specific reason why you must use MATLAB). The basics (like array / matrix operations) are very similar to MATLAB.
In my current area of work (neuroscience) there is a strong migration from MATLAB to Python. Many groups are making the switch because Python is free and generally more powerful.
The basic packages you will probably need to get started would be numpy (basic array numerics), scipy (more algorithms) and matplotlib (plotting). Since you want to work on the command line I suggest IPython as well.
As already mentioned in another answer there are also some Python distributions which include many packages, like PythonXY, the Enthought Python Distribution, or Anaconda.
There are many tutorials available on the web, search a little and pick one you like.
Look into these:
Scilab
Octave
Sage
Read this blog entry from Ryan Morlok for more info on open source Matlab alternatives.
I'm a big fan of R, but it's not a substitute for Matlab... it's an alternative. There's a big difference!
I was recently enamoured of Python XY. It's not exactly like Matlab but it has many of the same functions and copies the look and feel. I would personally use it if I didn't want to buy a Matlab license though - not if I wanted to practice with a Matlab stand-in.
www.pythonxy.com
Other users have given you the examples that I would have suggested - Octave and Scilab. Of the two, I would say that Scilab is more powerful BUT Octave tries really hard to be source compatible with standard MATLAB and Scilab does not.
So, if your aim is to experiment with a MATLAB like language and learn skills that you will eventually be able to transfer over to MATLAB then I suggest that you stick with Octave.
If you're interested in trying things out in MATLAB directly, there was a recent blog entry on The MathWorks website regarding free trial downloads of MATLAB and its various toolboxes. If you haven't tried contacting them already, the blog links to this page where you can request product trials or, if you already have a licensed product, you can sign in and downloads trials of toolboxes.