The Omega Shape
---------------
This new attribute type is used to mark up people, giving both the
location of the head as an ellipse and the location of the shoulder as
two points. The original goal was to present the shape as an 'Omega'.
As such, the editing controls are oriented around that idea - changing
the size of the ellipse moves the line, under the assumption that is
more likely what the user will desire. I haven't done any testing of
this; it is altogether possible that this doesn't buy us anything on
real data. But then, why not just use an ellipse and a 2-point open
polygon? (Perhaps because multiple-item drag and resize isn't
implemented.)
As with most shapes, the creation step is distinct and slightly
different from the editing step (e.g. in polygons you click to create
points, but while editing you have to hold down shift to add points
and then drag them to your desired location). Here you draw the base
line, then select the height of the ellipse. The ellipse will be half
the width of the base line and its axis perpendicular to it.
You will notice the ellipse is surrounded with a rectangle, with two
dots at the top and bottom. The rectangle is used to resize the
ellipse, while the two dots allow for rotation. Since the ellipse acts
as the parent shape, adjust this first, by first orienting the ellipse
to the head, then dragging the border to adjust the size. Then, modify
the base line by dragging the line or its endpoints.
There are some additional editing modes that can be accessed by holding
down modifier keys (e.g. alt or shift). 'Shift' maintains the ellipse's
aspect ratio, while 'Control' edits the shape from the center point,
instead of holding the opposite side still.
Omega Shape Walkthrough
~~~~~~~~~~~~~~~~~~~~~~~
Open the "Schema Editor" through the "Window" menu.
Click "Add Descriptor". Change the new Descriptor's name to 'Person'.
Click "Add Attribute". Change the name of the attribute to "Location",
set 'dynamic' to 'true', and change the data type to 'omega'.
Click 'Apply' and close the schema editor.
Add a media file containing people by clicking the '+' button in the
media toolbar. I recommend using the LAMP-moving sample:
http://viper-toolkit.sourceforge.net/stuff/lamp-moving.mpg
Go to the "Person" tab in the data view (on the right). Click 'Create'
to add a new person descriptor. Then, click on the NULL field to enter
creation mode.
First, we draw an approximate omega around a person's head. In the
video, click+drag to draw the baseline, then drag up to select the head
region.
Now, you can edit the shape by changing the size of the ellipse or the
location of the line.
The Text Line Shape
-------------------
This is perhaps the most complex shape in viper. The text line is an
oriented rectangle with associated text and information about the
visibility of the words and characters. Designed as a compromise
between cost to mark-up text for tracking evaluation and quality of
evaluation, the shape hopefully allows for some modified character and
word level evaluation for not much more than the cost of marking up
text as lines. (I haven't done any user studies yet, and I don't have
enough data to make any reasonable conclusions about how well this
approximates word-level markup.)
The text line object is an oriented box with three associated bits of
information: the words in the box, where the breaks between the words
are located, and which characters in the words are occluded. However,
while the other values may change over time, the text in the box does
not change.
To implement this sort of 'partially dynamic attribute' within ViPER's
framework, we actually keep the text value in a seperate, linked
attribute within the same descriptor. This is a useful trick, as it
allows things like propagation and interpolation to only change one
part of a value. In the schema editor, when you create a text line
object, it adds a 'Text Link' item to its property list. From this, you
must select an attribute to contain your text value, otherwise the
system will not work.
Creating a text line works just like creating an oriented rectangle -
drag to draw the top line, then click again to place the bottom line.
Interesting things happen once you enter the text to associate with the
text line. This includes the ability to place and modify word breaks
(place word breaks by holding down shift and clicking inside the box)
and editing character occlusions (right now, you can get at them
through the pop-up menu in the table).
Text Line Shape Walkthrough
~~~~~~~~~~~~~~~~~~~~~~~
Open the Schema Editor from the Window menu.
Click "Add Descriptor". When the descriptor appears, change the name
from "Desc0" to "Text".
Click "Add Attribute". This adds a generic static String-valued field
to the "Text" descriptor. Change the name of the attribute from "Attr0"
to "Contents".
Click "Add Attribute" again. This time, change the name to "Location",
the data type to "textline", and set "dynamic" to "true".
You should notice that changing the type to "textline" added an
additional property, "Text Attribute", to the table. Click on it to
select from a list of static svalue attributes in the current
descriptor. Since we have only created one such attribute, it, the
'Contents' attribute, the list jumps to that value when you click on
it.
Hit Apply and close the Schema Editor. (I'm going to replace this with
'Okay'.)
If you don't already have any media loaded, click on the '+' icon in
the media toolbar to add a new media file. This pulls up a file
chooser; I'd recommend something like the LAMP-Moving sample:
http://viper-toolkit.sourceforge.net/stuff/lamp-moving.mpg
Advance to a location in the video that contains text to mark up. If
you are using LAMP-moving.mpeg, the first frame is fine. I will assume
that you are marking up the text at the top of the screen, which says
"LAMP Laboratory". If your clip or image doesn't have any text, feel
free to mark up some imaginary text that says "LAMP Laboratory" near
the top of the frame. ;-)
Once the file has finished loading, click on the "Text" tab in the
spreadsheet view (this is the pane on the right half of the display).
Then click "Create" to add a new instance of the "Text" descriptor.
Click on the NULL value in the Location column to select a text line
for creation.
Click above and to the left of the "LAMP Laboratory" headline, then
drag the mouse to the right to indicate orientation and width of the
text line, then click, then click again to indicate the height of the
line of text.
Next, double click on the selected empty cell in the "Contents" column
of the table, then type "LAMP Laboratory".
Select the "Location" object again. Notice that the word "LAMP" appears
over it now.
To place a word break in the box, hold down Shift and click between the
words "LAMP" and "Laboratory". You should notice a blue highlight
indicating where the break will be placed. Once the break is placed,
you can drag it around to shift its location.
Right-click on the "Location" value in the table. The first item on the
pop-up menu should be "Occlusions..." (before "Valid"). Clicking on
this brings up the Occulsion editor.
Scripting ViPER with Groovy
---------------------------
One of the newer features in viper is the ability to load Groovy
scripts. These are little pieces of code that can be added to the
'Scripts' menu by placing them in the ~/.viper/scripts/ directory. For
some examples, see the viper home page under the 'Extras for ViPER-GT'
heading: http://viper-toolkit.sourceforge.net/#scripts
Each script is a groovy class which implements the AppLoaderScript
interface. The examples include the useful 'Add I Frame Descriptor',
which places a new descriptor that is valid only on i-frames, and
'Scrub Invalid Data', which deletes data from invalid attributes (while
the data is useful for editing, it is not relevant for evaluation).
Using a Script in ViPER
~~~~~~~~~~~~~~~~~~~~~~~
First, install the script. ViPER loads scripts when it launches, or
when you click the 'Reset this Menu' option from the scripts menu. It
looks in two places: for system scripts in the jar file itself, and for
user scripts in the ~/.viper/scripts directory. So, download a script
from the home page, place it in the appropriate directory, then click
the 'Reset this Menu'.
Writing a Script in ViPER
~~~~~~~~~~~~~~~~~~~~~~~~~
This is somewhat annoying. Debugging in groovy leaves much to be
desired. First, I'd recommend getting eclipse and importing the latest
viper-full source code drop into it. This will give you access to all
of the internal state that you need. Also, note that you have to use
the AppLoader's 'getBean' methods to get at any data in the program, so
you might have to look at the gt-config.n3 file to find out the mapping
from URI to internal objects.
As I can, I'll add more information to
http://viper-toolkit.sourceforge.net/docs/scripting/
==========================
If you have any questions or suggestions, feel free to post them or
email me privately.
- David Mihalcik