phow_caltech101 to change categories in matlab (vlfeat) [closed] - matlab

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm studying the Caltech101 computer vision dataset using Matlab..
I wanted to classify and train the images of caltech-101 using phow_caltech.m file
but there was a problem, I don't know how to change the categories...
these are what I did.
setup lv_setup
test version : vl_version verbose OK
vl_demo OK
make m_file phow_caltech101.m (copy)
I downloaded caltech101 images at [here][2] by myself and copied to data/caltech-101
>>phow_caltech101 (in command widnow)
I saw fixed example categories (BACKGROUND_Goole, Faces, Faces_easy, Leopards, Motobikes)
I've tried to change the example categories(BACKGROUND_Goole, Faces, Faces_easy, Leopards, Motobikes)
I want to use categories ( accordion, airplanes, anchor, ant in caltech-101)
I changed some codes of phow_caltech101.m but it didn't work...
plz give me some advice ... help me
I look forward to replying your mail or answer thank you~!
this is phow_caltech101 code
C:\VLFEAT\data\caltech-101 ( there are many image folders )
conf.calDir = 'data/caltech-101' ; ( I changed like this in phow_caltech101.m file)

From the help header to phow_caltech101:
The program can also be used to train a model on custom data by pointing CONF.CALDIR to it. Just create a subdirectory for each class and put the training images there. Make sure to adjust
CONF.NUMTRAIN accordingly.
Create a folder (say 'data/myclasses') containing the new classes (image collections) and have conf.caldir point to it, in phow_caltech101.m. That should be the first thing you change. There should be no need to change conf.prefiX if you are still putting the classes under data/.... but you need to adjust conf.numtrain to be the number of training sets you want to use.
caveat: my answer is based entirely on the documentation, I have not run the software.
Edit
Rather than attempt to run the script directly, start by trying to run the following lines at the matlab prompt, to check that you set up your folders correctly:
% the following line should contain the path to your data...
conf.calDir = 'data/caltech-101'; % <-- change this line if necessary
% make sure matlab finds the folder with your data
exist(conf.calDir, 'dir') % should return a "1"
% check the contents of the calibration data folder
classes = dir(conf.calDir)
If the folder does not exist or the contents being listed as classes are incorrect you need to adjust conf.calDir or the location of your data.

Related

VSCode dynamic JSON schema validation [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have built project for a web application configuration. It includes generated (from TypeScript) JSONSchemas. To simplify - user can configure things like forms - field order (string[]), hidden fields(string[]) etc. JSON Schmeas are very helpful for users, who aren't too familiar with the configuration, and it validates some errors, that could rise from mistakes in the configuration.
But they cannot help in every situation - in those string arrays - user can put any string, and the schema will be valid.
What I would want to make - is some dynamic validation - when the user opens [ for the field order - he has to choose from the list of fields, that would be fetched from the APIs.
Something, like when you type packageName: "" in the package.json dependencies - it gets a version for the given package.
I would think, that I would have to make some VSCode extension for this - but I don't know - where to start. Can someone point me in the direction - an example, where someone uses real time JSON schema validation would be grateful.
Found an answer by digging through vscode source code. Searched all files, that contains package.json and dependencies (regex search (package.json[\s\S\n]*dependencies)|(dependencies[\s\S\n]*package.json)) and found a class PackageJSONContribution and this was exactly what I was looking for.
Then I made a simple extension using yo code (as from the example of Your first extension).
Some interfaces and classes I was unable to import from vscode, I just made a local copies for my extension. Made my own class FooJSONContribution with the only difference -
it's getDocumentSelector() function changed to
public getDocumentSelector(): vscode.DocumentSelector {
return [{ language: 'json', scheme: '*', pattern: '**/foo.json' }];
}
Adjusted extensions package.json activationEvents and added "onLanguage:json" (this could be optimised).
Adjusted activate event of the extension by adding
const contribution = new FooJSONContribution(xhr, true);
const disposableCompletionItemProvider = vscode.languages.registerCompletionItemProvider(
contribution.getDocumentSelector(),
new JSONCompletionItemProvider(contribution),
'"',
':'
);
context.subscriptions.push(disposableCompletionItemProvider);
And that's it. All of the foo.json files now work like package.json files -
Things I need to do now - adjust the code of FooJSONContribution.ts to work for my own needs, for my own API's, for my own files.
I Uploaded this example here https://github.com/leqwasd/VsCodeAsyncJsonAutocomplete

trouble while running for code in Product Market introduction

I 'm new here, and I am encountering a problem. I have taken an already existing code for 2 new products entering the market and I am trying to modify it to support 3 products. I have added all the extra variables and conditions needed but it shows an error on plotting. Could it be the excel or...? I could use some help on this...If any extra info is needed, I 'd be happy to provide you! Thanks for your time in advance!
the error is:
http://prntscr.com/9gy84l
It appears that you added variables and conditions, but did not add an additional plot pen to the plot. You can add the pen by editing the plot itself.

How can I change the name of the file being saved without editing the code? MatLab

I am working on an experiment that take a lot of data samples and save it to different video files. For example, I take data and save it to a file called "slowmotion.avi" and then I take another set of data and save it to another file called "normalspeed.avi".
I am trying to find a way that I could change the name of file being saved without editing the code. The way I am using right now makes me have to open the code and change the name of the file directory within the code and then save the code. I want to make it a lot faster and easier to use.
I have tried the following code to fix this problem but it doesn't work.
graph=input('Graph of experiment: ');
vidObj = VideoWriter('%3.1f.avi\n',graph);
.....
Hope I didn't confuse you.
A possible solution:
graph=input('Graph of experiment: ','s');
vidObj = VideoWriter([graph,'.avi']);
The 's' in the input() function indicates that the expected input is a string, and [graph,'.avi'] simply concatenates both strings.

Open .mat file in matlab or unix - new user

I am going through someone's data analysis files (created in an older version of matlab) and trying to find out what a particular .mat file is that was used in a matlab script.
I am trying to load a .mat file in matlab. I want to see what is in it.
When I type...
load ('file.mat')
the file loads and I see two variables appear in the workspace. jobhelp and jobs.
When I try to open jobs by typing the following in the matlab command window...
jobs
the response is..
jobs =
[1x1 struct]
Does this mean that there is only a 1 x 1 structure in the .mat file? If so, how in the world do I see what it is? I'm even happy to load it in unix, but I don't know how to do that either. Any help would be greatly appreciated as I have a few files like this that I can't get any information from.
Again, a new user, so please make it simple.
Thanks
It means that jobs is a cell array {} and within this cell array is a structure defined
To see the structure and its contents type jobs{1}
I think you are dealing with a SPM5 Batch-File. This variable is an image of the tree-like structure you can see in the Batch-Editor of SPM. Your job consists of one subitem (stats) which could have various subsubitems (like fMRI model specification, model estimation and so on).
To access this structure on the command line just proceed like Nick said:
Each level is a separate cell array that you can access with {#} after the name of the level. Example: jobs{1} shows you that there is a subitem named stats.
Subitems in structs are accessed with a dot. Example: jobes{1}.stats{1} shows you the subitems of the stats-entry.
Notice that there could be more than one entry on each layer: A stats module could (and probably would) contain various subitems. You can access them via jobs{1}.stat{2}, jobs{1}.stats{3} and so on.
The last layer would be the interesting one for you: The structures in here is an image of the options you can choose in the batch-editor.

saving segmented images from a number plate

hye everyone i m doing my project "automatic vechicle identification".i have to design software in matlab,i have done extraction of plate region ,segmentation of characters,...now i want to save these segmented characters so that i can further recognize these character from a data base......any body can help me please feel free to write to me, thanks in advance
So if you have some data, myData then you can just issue a command save myData and you will have a new file in the current directory named myData.mat. To load the data later, just type in load myData and then you will have a new variable in the workspace named myData. There's lots more you can do with this, so you should check out help save.
Alternatively you could use a database. I've never actually used a database in Matlab, but there seems to be plenty of information about how one would go about doing this: http://www.mathworks.com/help/toolbox/database/ug/database.html