Showing preview only (355K chars total). Download the full file or copy to clipboard to get everything.
Repository: luigivieira/Facial-Landmarks-Annotation-Tool
Branch: master
Commit: b66fb09c7ecc
Files: 41
Total size: 340.7 KB
Directory structure:
gitextract_91x_51e_/
├── .gitignore
├── CMakeLists.txt
├── LICENSE
├── README.md
├── example/
│ └── example.fad
├── src/
│ ├── aboutwindow.cpp
│ ├── aboutwindow.h
│ ├── aboutwindow.ui
│ ├── application.cpp
│ ├── application.h
│ ├── childwindow.cpp
│ ├── childwindow.h
│ ├── facedataset.cpp
│ ├── facedataset.h
│ ├── facedatasetmodel.cpp
│ ├── facedatasetmodel.h
│ ├── facefeature.cpp
│ ├── facefeature.h
│ ├── facefeatureedge.cpp
│ ├── facefeatureedge.h
│ ├── facefeaturenode.cpp
│ ├── facefeaturenode.h
│ ├── facefitconfig.cpp
│ ├── facefitconfig.h
│ ├── facefitconfig.ui
│ ├── faceimage.cpp
│ ├── faceimage.h
│ ├── facewidget.cpp
│ ├── facewidget.h
│ ├── facewidgetscene.cpp
│ ├── facewidgetscene.h
│ ├── main.cpp
│ ├── mainwindow.cpp
│ ├── mainwindow.h
│ ├── mainwindow.ui
│ ├── resources/
│ │ └── images/
│ │ ├── brokenimage.xcf
│ │ └── noface.xcf
│ ├── resources.qrc
│ ├── utils.cpp
│ └── utils.h
└── version.h.in
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Ignore the build directory
**/build/
================================================
FILE: CMakeLists.txt
================================================
# Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)
#
# This file is part of FLAT.
#
# FLAT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# FLAT is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Minimum CMake version required
cmake_minimum_required(VERSION 2.8.11)
# Project information
project (FLAT)
# Version data and header file
set (CT_VERSION_MAJOR 1)
set (CT_VERSION_MINOR 0)
set (CT_VERSION_PATCH 0)
set (CT_VERSION "${CT_VERSION_MAJOR}.${CT_VERSION_MINOR}.${CT_VERSION_PATCH}")
configure_file (
"${PROJECT_SOURCE_DIR}/version.h.in"
"${PROJECT_BINARY_DIR}/version.h"
)
include_directories("${PROJECT_BINARY_DIR}")
# Default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
endif()
# Qt configuration
set(CMAKE_INCLUDE_CURRENT_DIR ON) # Find includes in corresponding build directories
set(CMAKE_AUTOMOC ON) # Instruct CMake to run moc automatically when needed
set(CMAKE_AUTORCC ON) # Instruct CMake to run rcc automatically when needed
set(CMAKE_AUTOUIC ON) # Instruct CMake to run uic automatically when needed
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Xml REQUIRED)
# Add all source and resource files
file(GLOB SRC src/*.cpp src/*.h)
file(GLOB RSC src/*.qrc)
# Add the executable
if(WIN32)
add_executable(FLAT WIN32 ${SRC} ${RSC})
else()
add_executable(FLAT ${SRC} ${RSC})
endif()
set_target_properties(FLAT PROPERTIES OUTPUT_NAME flat)
set_target_properties(FLAT PROPERTIES OUTPUT_NAME_DEBUG flatd)
# Set up the required libraries
target_link_libraries(FLAT Qt5::Core Qt5::Widgets Qt5::Xml)
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
================================================
FILE: README.md
================================================
# FLAT - Facial Landmarks Annotation Tool
A visual editor for manually annotating facial landmarks in images of human faces.

## Usage
Create a new face annotation dataset (files with extension `.fad`) and add the face images. Then, add the facial features and connect then as desired using either the program menus or the context menu. The zoom level can be controlled either from the widget control on the image properties tool window or by holding CTRL and scrolling the mouse wheel. While zoomed, an image can also be side scrolled by holding SHIFT and scrolling the mouse wheel. All images in the same face annotation dataset share the same model, that is they have the same amount of face landmarks (even though they can be differently positioned for each image). Automatically fitting of 66 face landmarks can be performed via the "Fit Landmarks" option if the utility is available (see details bellow). If the automatic fitting succeeds, the 66 landmarks will be positioned as best as possible in the face image. Otherwise, a status bar message will indicate the error.
## Dependences
The application has been developed and tested with:
- [CMake](https://cmake.org/) 3.5.0-rc3
- [Qt](http://www.qt.io/) 5.5.1 32-bit
The "Fit Landmarks" menu option (in "Tools/CSIRO Face Analysis SDK" menu) requires an external executable called `fit-fit(.exe)` - even though its absence does not prevent the FLAT tool from being compiled and used. Please check the [SDK web site](http://face.ci2cv.net/) and [the source code of my port to Windows/Linux](https://github.com/luigivieira/face-analysis-sdk). The option for an external dependence (instead of source code integration) is only to make the compilation of this project simpler and its usage broader.
## Building
1. Use CMake to configure and generate the environment. I suggest using the folder `build`, since it is the one ignored by gitignore.
2. In Windows, open the Visual Studio solution and build with the desired build type (*debug*, *release*, etc).
3. In Linux, use type `make` to let the Makefile produce the binary in the build type configured by CMake.
4. The code produces only a single executable named `flat(.exe)`, that depends only on Qt. If you want to use the "Fit Landmarks" option mentioned before, go to the CSIRO Face Analysis SDK page, download and build its libraries and executables. Then, configure in FLAT the path for the `face-fit(.exe)` executable.
## Credits
Copyright (C) 2016 [Luiz Carlos Vieira](http://www.luiz.vieira.nom.br). Available under GPL (see details in the license file).
The application icons and images are either from or based on the Oxygen Icons Set, downloaded as [PNGs from Felipe Azevedo (pasnox)](https://github.com/pasnox/oxygen-icons-png) and [licensed under LGPL from KDE](https://techbase.kde.org/Projects/Oxygen/Licensing), and the [Farm-Fresh Web Icons Set](http://www.fatcow.com/free-icons), licensed under [Creative Commons (CC BY 4.0)](http://creativecommons.org/licenses/by/4.0/).
================================================
FILE: example/example.fad
================================================
<?xml version='1.0' encoding='UTF-8'?>
<FaceDataset xmlns="https://github.com/luigivieira/Facial-Landmarks-Annotation-Tool" numberOfFeatures="66">
<Samples>
<Sample fileName="images/Angelina.jpg">
<Features>
<Feature id="0" y="277" x="266">
<Connections>
<Target id="1"/>
</Connections>
</Feature>
<Feature id="1" y="327" x="270">
<Connections/>
</Feature>
<Feature id="2" y="376" x="276">
<Connections>
<Target id="1"/>
<Target id="3"/>
</Connections>
</Feature>
<Feature id="3" y="425" x="284">
<Connections>
<Target id="4"/>
</Connections>
</Feature>
<Feature id="4" y="472" x="299">
<Connections/>
</Feature>
<Feature id="5" y="512" x="328">
<Connections>
<Target id="4"/>
<Target id="6"/>
</Connections>
</Feature>
<Feature id="6" y="541" x="367">
<Connections/>
</Feature>
<Feature id="7" y="561" x="411">
<Connections>
<Target id="6"/>
<Target id="8"/>
</Connections>
</Feature>
<Feature id="8" y="568" x="460">
<Connections/>
</Feature>
<Feature id="9" y="561" x="506">
<Connections>
<Target id="8"/>
<Target id="10"/>
</Connections>
</Feature>
<Feature id="10" y="538" x="548">
<Connections>
<Target id="11"/>
</Connections>
</Feature>
<Feature id="11" y="507" x="583">
<Connections/>
</Feature>
<Feature id="12" y="467" x="608">
<Connections>
<Target id="11"/>
<Target id="13"/>
</Connections>
</Feature>
<Feature id="13" y="421" x="622">
<Connections/>
</Feature>
<Feature id="14" y="374" x="629">
<Connections>
<Target id="13"/>
</Connections>
</Feature>
<Feature id="15" y="327" x="635">
<Connections>
<Target id="14"/>
<Target id="16"/>
</Connections>
</Feature>
<Feature id="16" y="280" x="637">
<Connections/>
</Feature>
<Feature id="17" y="217" x="304">
<Connections>
<Target id="18"/>
</Connections>
</Feature>
<Feature id="18" y="199" x="330">
<Connections>
<Target id="19"/>
</Connections>
</Feature>
<Feature id="19" y="193" x="361">
<Connections/>
</Feature>
<Feature id="20" y="196" x="392">
<Connections>
<Target id="19"/>
</Connections>
</Feature>
<Feature id="21" y="206" x="422">
<Connections>
<Target id="20"/>
</Connections>
</Feature>
<Feature id="22" y="208" x="503">
<Connections>
<Target id="23"/>
</Connections>
</Feature>
<Feature id="23" y="199" x="531">
<Connections>
<Target id="24"/>
</Connections>
</Feature>
<Feature id="24" y="196" x="560">
<Connections/>
</Feature>
<Feature id="25" y="202" x="588">
<Connections>
<Target id="24"/>
</Connections>
</Feature>
<Feature id="26" y="219" x="611">
<Connections>
<Target id="25"/>
</Connections>
</Feature>
<Feature id="27" y="258" x="464">
<Connections>
<Target id="28"/>
</Connections>
</Feature>
<Feature id="28" y="290" x="465">
<Connections/>
</Feature>
<Feature id="29" y="321" x="466">
<Connections>
<Target id="28"/>
<Target id="30"/>
</Connections>
</Feature>
<Feature id="30" y="352" x="466">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="31" y="375" x="434">
<Connections>
<Target id="32"/>
</Connections>
</Feature>
<Feature id="32" y="379" x="449">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="33" y="381" x="465">
<Connections/>
</Feature>
<Feature id="34" y="379" x="480">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="35" y="375" x="494">
<Connections>
<Target id="34"/>
</Connections>
</Feature>
<Feature id="36" y="268.072" x="330.688">
<Connections>
<Target id="37"/>
</Connections>
</Feature>
<Feature id="37" y="253.512" x="352.736">
<Connections/>
</Feature>
<Feature id="38" y="250.44" x="384.952">
<Connections>
<Target id="37"/>
</Connections>
</Feature>
<Feature id="39" y="268.56" x="411.12">
<Connections>
<Target id="38"/>
</Connections>
</Feature>
<Feature id="40" y="275.096" x="387.56">
<Connections>
<Target id="39"/>
<Target id="41"/>
</Connections>
</Feature>
<Feature id="41" y="277.632" x="355.296">
<Connections>
<Target id="36"/>
</Connections>
</Feature>
<Feature id="42" y="268" x="514">
<Connections/>
</Feature>
<Feature id="43" y="255" x="533.024">
<Connections>
<Target id="42"/>
<Target id="44"/>
</Connections>
</Feature>
<Feature id="44" y="253.976" x="561.144">
<Connections/>
</Feature>
<Feature id="45" y="272.12" x="585.776">
<Connections>
<Target id="44"/>
<Target id="46"/>
</Connections>
</Feature>
<Feature id="46" y="281.168" x="566.264">
<Connections/>
</Feature>
<Feature id="47" y="280.168" x="535.024">
<Connections>
<Target id="46"/>
<Target id="42"/>
</Connections>
</Feature>
<Feature id="48" y="438" x="389">
<Connections/>
</Feature>
<Feature id="49" y="425" x="413">
<Connections>
<Target id="48"/>
</Connections>
</Feature>
<Feature id="50" y="408.96" x="438">
<Connections>
<Target id="49"/>
<Target id="51"/>
</Connections>
</Feature>
<Feature id="51" y="411.96" x="464">
<Connections/>
</Feature>
<Feature id="52" y="408.96" x="489">
<Connections>
<Target id="51"/>
</Connections>
</Feature>
<Feature id="53" y="425" x="513">
<Connections>
<Target id="52"/>
<Target id="54"/>
</Connections>
</Feature>
<Feature id="54" y="439" x="533">
<Connections/>
</Feature>
<Feature id="55" y="463.6" x="513">
<Connections>
<Target id="54"/>
</Connections>
</Feature>
<Feature id="56" y="470.6" x="489">
<Connections>
<Target id="55"/>
<Target id="57"/>
</Connections>
</Feature>
<Feature id="57" y="472.6" x="464">
<Connections>
<Target id="58"/>
</Connections>
</Feature>
<Feature id="58" y="470.6" x="437">
<Connections/>
</Feature>
<Feature id="59" y="462.6" x="411">
<Connections>
<Target id="58"/>
<Target id="48"/>
</Connections>
</Feature>
<Feature id="60" y="434" x="434">
<Connections>
<Target id="61"/>
<Target id="65"/>
</Connections>
</Feature>
<Feature id="61" y="436" x="464">
<Connections/>
</Feature>
<Feature id="62" y="435" x="492">
<Connections>
<Target id="61"/>
</Connections>
</Feature>
<Feature id="63" y="438" x="492">
<Connections>
<Target id="64"/>
<Target id="62"/>
</Connections>
</Feature>
<Feature id="64" y="438" x="463.488">
<Connections/>
</Feature>
<Feature id="65" y="437" x="434">
<Connections>
<Target id="64"/>
</Connections>
</Feature>
</Features>
</Sample>
<Sample fileName="images/Chris.jpg">
<Features>
<Feature id="0" y="188" x="81">
<Connections>
<Target id="1"/>
</Connections>
</Feature>
<Feature id="1" y="225.024" x="78.416">
<Connections/>
</Feature>
<Feature id="2" y="260.024" x="81.416">
<Connections>
<Target id="1"/>
<Target id="3"/>
</Connections>
</Feature>
<Feature id="3" y="303.656" x="84.928">
<Connections>
<Target id="4"/>
</Connections>
</Feature>
<Feature id="4" y="344.656" x="91.928">
<Connections/>
</Feature>
<Feature id="5" y="382.656" x="106.928">
<Connections>
<Target id="4"/>
<Target id="6"/>
</Connections>
</Feature>
<Feature id="6" y="420.288" x="128.928">
<Connections/>
</Feature>
<Feature id="7" y="437.632" x="159">
<Connections>
<Target id="6"/>
<Target id="8"/>
</Connections>
</Feature>
<Feature id="8" y="451.632" x="191">
<Connections/>
</Feature>
<Feature id="9" y="443.216" x="233.704">
<Connections>
<Target id="8"/>
<Target id="10"/>
</Connections>
</Feature>
<Feature id="10" y="418.216" x="263.704">
<Connections>
<Target id="11"/>
</Connections>
</Feature>
<Feature id="11" y="393.384" x="288.192">
<Connections/>
</Feature>
<Feature id="12" y="357.384" x="308.192">
<Connections>
<Target id="11"/>
<Target id="13"/>
</Connections>
</Feature>
<Feature id="13" y="318.36" x="321.68">
<Connections/>
</Feature>
<Feature id="14" y="276.656" x="328.584">
<Connections>
<Target id="13"/>
</Connections>
</Feature>
<Feature id="15" y="240" x="333">
<Connections>
<Target id="14"/>
<Target id="16"/>
</Connections>
</Feature>
<Feature id="16" y="209" x="337">
<Connections/>
</Feature>
<Feature id="17" y="190" x="106">
<Connections>
<Target id="18"/>
</Connections>
</Feature>
<Feature id="18" y="182" x="125">
<Connections>
<Target id="19"/>
</Connections>
</Feature>
<Feature id="19" y="180" x="146">
<Connections/>
</Feature>
<Feature id="20" y="184" x="169">
<Connections>
<Target id="19"/>
</Connections>
</Feature>
<Feature id="21" y="193" x="191">
<Connections>
<Target id="20"/>
</Connections>
</Feature>
<Feature id="22" y="200" x="236">
<Connections>
<Target id="23"/>
</Connections>
</Feature>
<Feature id="23" y="196" x="256">
<Connections>
<Target id="24"/>
</Connections>
</Feature>
<Feature id="24" y="195" x="277">
<Connections/>
</Feature>
<Feature id="25" y="200" x="296">
<Connections>
<Target id="24"/>
</Connections>
</Feature>
<Feature id="26" y="209" x="311">
<Connections>
<Target id="25"/>
</Connections>
</Feature>
<Feature id="27" y="224" x="213">
<Connections>
<Target id="28"/>
</Connections>
</Feature>
<Feature id="28" y="252" x="210">
<Connections/>
</Feature>
<Feature id="29" y="279" x="207">
<Connections>
<Target id="28"/>
<Target id="30"/>
</Connections>
</Feature>
<Feature id="30" y="305" x="204">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="31" y="305.362" x="177.017">
<Connections>
<Target id="32"/>
</Connections>
</Feature>
<Feature id="32" y="309.74" x="190.655">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="33" y="315.051" x="204">
<Connections/>
</Feature>
<Feature id="34" y="309.791" x="222.243">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="35" y="306.429" x="234.571">
<Connections>
<Target id="34"/>
</Connections>
</Feature>
<Feature id="36" y="218.949" x="128.068">
<Connections>
<Target id="37"/>
</Connections>
</Feature>
<Feature id="37" y="210.051" x="147.328">
<Connections/>
</Feature>
<Feature id="38" y="211.068" x="166.277">
<Connections>
<Target id="37"/>
</Connections>
</Feature>
<Feature id="39" y="228.537" x="181.915">
<Connections>
<Target id="38"/>
</Connections>
</Feature>
<Feature id="40" y="227.192" x="161">
<Connections>
<Target id="39"/>
<Target id="41"/>
</Connections>
</Feature>
<Feature id="41" y="225.537" x="144.034">
<Connections>
<Target id="36"/>
</Connections>
</Feature>
<Feature id="42" y="234.898" x="240.723">
<Connections/>
</Feature>
<Feature id="43" y="222.723" x="254.723">
<Connections>
<Target id="42"/>
<Target id="44"/>
</Connections>
</Feature>
<Feature id="44" y="224.379" x="276.932">
<Connections/>
</Feature>
<Feature id="45" y="236.277" x="291.915">
<Connections>
<Target id="44"/>
<Target id="46"/>
</Connections>
</Feature>
<Feature id="46" y="238.554" x="272.655">
<Connections/>
</Feature>
<Feature id="47" y="237.537" x="257.345">
<Connections>
<Target id="46"/>
<Target id="42"/>
</Connections>
</Feature>
<Feature id="48" y="338" x="147">
<Connections/>
</Feature>
<Feature id="49" y="321" x="157">
<Connections>
<Target id="48"/>
</Connections>
</Feature>
<Feature id="50" y="320.192" x="176.689">
<Connections>
<Target id="49"/>
<Target id="51"/>
</Connections>
</Feature>
<Feature id="51" y="325.175" x="202">
<Connections/>
</Feature>
<Feature id="52" y="324.192" x="224.689">
<Connections>
<Target id="51"/>
</Connections>
</Feature>
<Feature id="53" y="328" x="244">
<Connections>
<Target id="52"/>
<Target id="54"/>
</Connections>
</Feature>
<Feature id="54" y="348" x="249">
<Connections/>
</Feature>
<Feature id="55" y="366" x="237">
<Connections>
<Target id="54"/>
</Connections>
</Feature>
<Feature id="56" y="380" x="219">
<Connections>
<Target id="55"/>
<Target id="57"/>
</Connections>
</Feature>
<Feature id="57" y="385" x="196">
<Connections>
<Target id="58"/>
</Connections>
</Feature>
<Feature id="58" y="376" x="174">
<Connections/>
</Feature>
<Feature id="59" y="359" x="158">
<Connections>
<Target id="58"/>
<Target id="48"/>
</Connections>
</Feature>
<Feature id="60" y="340.763" x="170.379">
<Connections>
<Target id="61"/>
<Target id="65"/>
</Connections>
</Feature>
<Feature id="61" y="340.813" x="199.034">
<Connections/>
</Feature>
<Feature id="62" y="340.83" x="227.345">
<Connections>
<Target id="61"/>
</Connections>
</Feature>
<Feature id="63" y="358" x="226">
<Connections>
<Target id="64"/>
<Target id="62"/>
</Connections>
</Feature>
<Feature id="64" y="365" x="199">
<Connections/>
</Feature>
<Feature id="65" y="354" x="172">
<Connections>
<Target id="64"/>
</Connections>
</Feature>
</Features>
</Sample>
<Sample fileName="images/Hayley.jpg">
<Features>
<Feature id="0" y="259.76" x="226.36">
<Connections>
<Target id="1"/>
</Connections>
</Feature>
<Feature id="1" y="298.76" x="227.36">
<Connections/>
</Feature>
<Feature id="2" y="338.76" x="232.36">
<Connections>
<Target id="1"/>
<Target id="3"/>
</Connections>
</Feature>
<Feature id="3" y="376.76" x="240.36">
<Connections>
<Target id="4"/>
</Connections>
</Feature>
<Feature id="4" y="414.76" x="254.36">
<Connections/>
</Feature>
<Feature id="5" y="450.76" x="277.36">
<Connections>
<Target id="4"/>
<Target id="6"/>
</Connections>
</Feature>
<Feature id="6" y="480.76" x="308.36">
<Connections/>
</Feature>
<Feature id="7" y="503.76" x="346.36">
<Connections>
<Target id="6"/>
<Target id="8"/>
</Connections>
</Feature>
<Feature id="8" y="516.52" x="376.28">
<Connections/>
</Feature>
<Feature id="9" y="514.52" x="416.28">
<Connections>
<Target id="8"/>
<Target id="10"/>
</Connections>
</Feature>
<Feature id="10" y="498.52" x="454.28">
<Connections>
<Target id="11"/>
</Connections>
</Feature>
<Feature id="11" y="480" x="485">
<Connections/>
</Feature>
<Feature id="12" y="447" x="508">
<Connections>
<Target id="11"/>
<Target id="13"/>
</Connections>
</Feature>
<Feature id="13" y="411.48" x="526.32">
<Connections/>
</Feature>
<Feature id="14" y="366.48" x="533.32">
<Connections>
<Target id="13"/>
</Connections>
</Feature>
<Feature id="15" y="319.48" x="534.48">
<Connections>
<Target id="14"/>
<Target id="16"/>
</Connections>
</Feature>
<Feature id="16" y="269.64" x="535.28">
<Connections/>
</Feature>
<Feature id="17" y="225.16" x="243.28">
<Connections>
<Target id="18"/>
</Connections>
</Feature>
<Feature id="18" y="215.16" x="259.28">
<Connections>
<Target id="19"/>
</Connections>
</Feature>
<Feature id="19" y="212.16" x="277.28">
<Connections/>
</Feature>
<Feature id="20" y="214.16" x="296.28">
<Connections>
<Target id="19"/>
</Connections>
</Feature>
<Feature id="21" y="218.16" x="314.28">
<Connections>
<Target id="20"/>
</Connections>
</Feature>
<Feature id="22" y="210.32" x="422">
<Connections>
<Target id="23"/>
</Connections>
</Feature>
<Feature id="23" y="202.32" x="444">
<Connections>
<Target id="24"/>
</Connections>
</Feature>
<Feature id="24" y="198.32" x="468">
<Connections/>
</Feature>
<Feature id="25" y="201.32" x="491">
<Connections>
<Target id="24"/>
</Connections>
</Feature>
<Feature id="26" y="213.32" x="511">
<Connections>
<Target id="25"/>
</Connections>
</Feature>
<Feature id="27" y="257" x="367">
<Connections>
<Target id="28"/>
</Connections>
</Feature>
<Feature id="28" y="284" x="369">
<Connections/>
</Feature>
<Feature id="29" y="311" x="371">
<Connections>
<Target id="28"/>
<Target id="30"/>
</Connections>
</Feature>
<Feature id="30" y="338" x="373">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="31" y="361" x="341">
<Connections>
<Target id="32"/>
</Connections>
</Feature>
<Feature id="32" y="366" x="356">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="33" y="368" x="371">
<Connections/>
</Feature>
<Feature id="34" y="365" x="388">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="35" y="359" x="404">
<Connections>
<Target id="34"/>
</Connections>
</Feature>
<Feature id="36" y="254" x="269">
<Connections>
<Target id="37"/>
</Connections>
</Feature>
<Feature id="37" y="240" x="284">
<Connections/>
</Feature>
<Feature id="38" y="241" x="304">
<Connections>
<Target id="37"/>
</Connections>
</Feature>
<Feature id="39" y="254" x="319">
<Connections>
<Target id="38"/>
</Connections>
</Feature>
<Feature id="40" y="261" x="303">
<Connections>
<Target id="39"/>
<Target id="41"/>
</Connections>
</Feature>
<Feature id="41" y="262" x="285">
<Connections>
<Target id="36"/>
</Connections>
</Feature>
<Feature id="42" y="249" x="427">
<Connections/>
</Feature>
<Feature id="43" y="234" x="442">
<Connections>
<Target id="42"/>
<Target id="44"/>
</Connections>
</Feature>
<Feature id="44" y="233" x="463">
<Connections/>
</Feature>
<Feature id="45" y="244" x="480">
<Connections>
<Target id="44"/>
<Target id="46"/>
</Connections>
</Feature>
<Feature id="46" y="254" x="464">
<Connections/>
</Feature>
<Feature id="47" y="255" x="445">
<Connections>
<Target id="46"/>
<Target id="42"/>
</Connections>
</Feature>
<Feature id="48" y="420" x="328">
<Connections/>
</Feature>
<Feature id="49" y="409" x="343">
<Connections>
<Target id="48"/>
</Connections>
</Feature>
<Feature id="50" y="401" x="359">
<Connections>
<Target id="49"/>
<Target id="51"/>
</Connections>
</Feature>
<Feature id="51" y="402.72" x="383.68">
<Connections/>
</Feature>
<Feature id="52" y="396.8" x="412.56">
<Connections>
<Target id="51"/>
</Connections>
</Feature>
<Feature id="53" y="402.8" x="429.56">
<Connections>
<Target id="52"/>
<Target id="54"/>
</Connections>
</Feature>
<Feature id="54" y="411.8" x="447.56">
<Connections/>
</Feature>
<Feature id="55" y="425.8" x="432.56">
<Connections>
<Target id="54"/>
</Connections>
</Feature>
<Feature id="56" y="439.56" x="415.2">
<Connections>
<Target id="55"/>
<Target id="57"/>
</Connections>
</Feature>
<Feature id="57" y="445.4" x="386.6">
<Connections>
<Target id="58"/>
</Connections>
</Feature>
<Feature id="58" y="439" x="358">
<Connections/>
</Feature>
<Feature id="59" y="433" x="341">
<Connections>
<Target id="58"/>
<Target id="48"/>
</Connections>
</Feature>
<Feature id="60" y="418" x="360">
<Connections>
<Target id="61"/>
<Target id="65"/>
</Connections>
</Feature>
<Feature id="61" y="420.92" x="386.24">
<Connections/>
</Feature>
<Feature id="62" y="414.72" x="418.88">
<Connections>
<Target id="61"/>
</Connections>
</Feature>
<Feature id="63" y="412.72" x="417.88">
<Connections>
<Target id="64"/>
<Target id="62"/>
</Connections>
</Feature>
<Feature id="64" y="416.92" x="385.24">
<Connections/>
</Feature>
<Feature id="65" y="415" x="360">
<Connections>
<Target id="64"/>
</Connections>
</Feature>
</Features>
</Sample>
<Sample fileName="images/Johnny.jpg">
<Features>
<Feature id="0" y="361" x="136">
<Connections>
<Target id="1"/>
</Connections>
</Feature>
<Feature id="1" y="406" x="142">
<Connections/>
</Feature>
<Feature id="2" y="451" x="151">
<Connections>
<Target id="1"/>
<Target id="3"/>
</Connections>
</Feature>
<Feature id="3" y="495" x="162">
<Connections>
<Target id="4"/>
</Connections>
</Feature>
<Feature id="4" y="536" x="179">
<Connections/>
</Feature>
<Feature id="5" y="569" x="206">
<Connections>
<Target id="4"/>
<Target id="6"/>
</Connections>
</Feature>
<Feature id="6" y="594" x="241">
<Connections/>
</Feature>
<Feature id="7" y="611" x="279">
<Connections>
<Target id="6"/>
<Target id="8"/>
</Connections>
</Feature>
<Feature id="8" y="614" x="322">
<Connections/>
</Feature>
<Feature id="9" y="604" x="366">
<Connections>
<Target id="8"/>
<Target id="10"/>
</Connections>
</Feature>
<Feature id="10" y="580" x="404">
<Connections>
<Target id="11"/>
</Connections>
</Feature>
<Feature id="11" y="548" x="435">
<Connections/>
</Feature>
<Feature id="12" y="510" x="458">
<Connections>
<Target id="11"/>
<Target id="13"/>
</Connections>
</Feature>
<Feature id="13" y="469" x="471">
<Connections/>
</Feature>
<Feature id="14" y="426" x="477">
<Connections>
<Target id="13"/>
</Connections>
</Feature>
<Feature id="15" y="382" x="478">
<Connections>
<Target id="14"/>
<Target id="16"/>
</Connections>
</Feature>
<Feature id="16" y="339" x="476">
<Connections/>
</Feature>
<Feature id="17" y="311" x="164">
<Connections>
<Target id="18"/>
</Connections>
</Feature>
<Feature id="18" y="297" x="185">
<Connections>
<Target id="19"/>
</Connections>
</Feature>
<Feature id="19" y="291" x="211">
<Connections/>
</Feature>
<Feature id="20" y="292" x="237">
<Connections>
<Target id="19"/>
</Connections>
</Feature>
<Feature id="21" y="298" x="262">
<Connections>
<Target id="20"/>
</Connections>
</Feature>
<Feature id="22" y="295" x="332">
<Connections>
<Target id="23"/>
</Connections>
</Feature>
<Feature id="23" y="287" x="355">
<Connections>
<Target id="24"/>
</Connections>
</Feature>
<Feature id="24" y="283" x="380">
<Connections/>
</Feature>
<Feature id="25" y="284" x="405">
<Connections>
<Target id="24"/>
</Connections>
</Feature>
<Feature id="26" y="294" x="428">
<Connections>
<Target id="25"/>
</Connections>
</Feature>
<Feature id="27" y="329" x="302">
<Connections>
<Target id="28"/>
</Connections>
</Feature>
<Feature id="28" y="359" x="304">
<Connections/>
</Feature>
<Feature id="29" y="388" x="305">
<Connections>
<Target id="28"/>
<Target id="30"/>
</Connections>
</Feature>
<Feature id="30" y="418" x="307">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="31" y="434" x="283">
<Connections>
<Target id="32"/>
</Connections>
</Feature>
<Feature id="32" y="438" x="296">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="33" y="439" x="310">
<Connections/>
</Feature>
<Feature id="34" y="436" x="323">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="35" y="430" x="336">
<Connections>
<Target id="34"/>
</Connections>
</Feature>
<Feature id="36" y="337" x="201">
<Connections>
<Target id="37"/>
</Connections>
</Feature>
<Feature id="37" y="327" x="218">
<Connections/>
</Feature>
<Feature id="38" y="326" x="238">
<Connections>
<Target id="37"/>
</Connections>
</Feature>
<Feature id="39" y="336" x="255">
<Connections>
<Target id="38"/>
</Connections>
</Feature>
<Feature id="40" y="339" x="237">
<Connections>
<Target id="39"/>
<Target id="41"/>
</Connections>
</Feature>
<Feature id="41" y="341" x="219">
<Connections>
<Target id="36"/>
</Connections>
</Feature>
<Feature id="42" y="331" x="345">
<Connections/>
</Feature>
<Feature id="43" y="320" x="360">
<Connections>
<Target id="42"/>
<Target id="44"/>
</Connections>
</Feature>
<Feature id="44" y="318" x="380">
<Connections/>
</Feature>
<Feature id="45" y="326" x="398">
<Connections>
<Target id="44"/>
<Target id="46"/>
</Connections>
</Feature>
<Feature id="46" y="332" x="381">
<Connections/>
</Feature>
<Feature id="47" y="332" x="363">
<Connections>
<Target id="46"/>
<Target id="42"/>
</Connections>
</Feature>
<Feature id="48" y="508.92" x="244.416">
<Connections/>
</Feature>
<Feature id="49" y="494.6" x="268.68">
<Connections>
<Target id="48"/>
</Connections>
</Feature>
<Feature id="50" y="483.184" x="290.68">
<Connections>
<Target id="49"/>
<Target id="51"/>
</Connections>
</Feature>
<Feature id="51" y="485.256" x="311.048">
<Connections/>
</Feature>
<Feature id="52" y="478.648" x="330.856">
<Connections>
<Target id="51"/>
</Connections>
</Feature>
<Feature id="53" y="482.48" x="349.224">
<Connections>
<Target id="52"/>
<Target id="54"/>
</Connections>
</Feature>
<Feature id="54" y="491.192" x="364.2">
<Connections/>
</Feature>
<Feature id="55" y="501.44" x="373.752">
<Connections>
<Target id="54"/>
</Connections>
</Feature>
<Feature id="56" y="519" x="342">
<Connections>
<Target id="55"/>
<Target id="57"/>
</Connections>
</Feature>
<Feature id="57" y="524" x="315">
<Connections>
<Target id="58"/>
</Connections>
</Feature>
<Feature id="58" y="522" x="288">
<Connections/>
</Feature>
<Feature id="59" y="516.144" x="265.512">
<Connections>
<Target id="58"/>
<Target id="48"/>
</Connections>
</Feature>
<Feature id="60" y="498.088" x="280.952">
<Connections>
<Target id="61"/>
<Target id="65"/>
</Connections>
</Feature>
<Feature id="61" y="494.6" x="313.56">
<Connections/>
</Feature>
<Feature id="62" y="493.064" x="338.976">
<Connections>
<Target id="61"/>
</Connections>
</Feature>
<Feature id="63" y="499.632" x="345.072">
<Connections>
<Target id="64"/>
<Target id="62"/>
</Connections>
</Feature>
<Feature id="64" y="500" x="314">
<Connections/>
</Feature>
<Feature id="65" y="503.656" x="281.928">
<Connections>
<Target id="64"/>
</Connections>
</Feature>
</Features>
</Sample>
<Sample fileName="images/Natalie.jpg">
<Features>
<Feature id="0" y="210" x="186">
<Connections>
<Target id="1"/>
</Connections>
</Feature>
<Feature id="1" y="250" x="185">
<Connections/>
</Feature>
<Feature id="2" y="290" x="187">
<Connections>
<Target id="1"/>
<Target id="3"/>
</Connections>
</Feature>
<Feature id="3" y="332" x="191">
<Connections>
<Target id="4"/>
</Connections>
</Feature>
<Feature id="4" y="377" x="205">
<Connections/>
</Feature>
<Feature id="5" y="419" x="229">
<Connections>
<Target id="4"/>
<Target id="6"/>
</Connections>
</Feature>
<Feature id="6" y="453" x="261">
<Connections/>
</Feature>
<Feature id="7" y="481" x="300">
<Connections>
<Target id="6"/>
<Target id="8"/>
</Connections>
</Feature>
<Feature id="8" y="494" x="344">
<Connections/>
</Feature>
<Feature id="9" y="488" x="379">
<Connections>
<Target id="8"/>
<Target id="10"/>
</Connections>
</Feature>
<Feature id="10" y="469" x="412">
<Connections>
<Target id="11"/>
</Connections>
</Feature>
<Feature id="11" y="441" x="440">
<Connections/>
</Feature>
<Feature id="12" y="405" x="461">
<Connections>
<Target id="11"/>
<Target id="13"/>
</Connections>
</Feature>
<Feature id="13" y="362" x="471">
<Connections/>
</Feature>
<Feature id="14" y="321" x="481">
<Connections>
<Target id="13"/>
</Connections>
</Feature>
<Feature id="15" y="282" x="492">
<Connections>
<Target id="14"/>
<Target id="16"/>
</Connections>
</Feature>
<Feature id="16" y="242" x="501">
<Connections/>
</Feature>
<Feature id="17" y="208" x="232">
<Connections>
<Target id="18"/>
</Connections>
</Feature>
<Feature id="18" y="196" x="256">
<Connections>
<Target id="19"/>
</Connections>
</Feature>
<Feature id="19" y="195" x="283">
<Connections/>
</Feature>
<Feature id="20" y="202" x="310">
<Connections>
<Target id="19"/>
</Connections>
</Feature>
<Feature id="21" y="212" x="335">
<Connections>
<Target id="20"/>
</Connections>
</Feature>
<Feature id="22" y="218" x="427">
<Connections>
<Target id="23"/>
</Connections>
</Feature>
<Feature id="23" y="211" x="450">
<Connections>
<Target id="24"/>
</Connections>
</Feature>
<Feature id="24" y="208" x="474">
<Connections/>
</Feature>
<Feature id="25" y="212" x="497">
<Connections>
<Target id="24"/>
</Connections>
</Feature>
<Feature id="26" y="225" x="513">
<Connections>
<Target id="25"/>
</Connections>
</Feature>
<Feature id="27" y="252" x="375">
<Connections>
<Target id="28"/>
</Connections>
</Feature>
<Feature id="28" y="284" x="375">
<Connections/>
</Feature>
<Feature id="29" y="316" x="376">
<Connections>
<Target id="28"/>
<Target id="30"/>
</Connections>
</Feature>
<Feature id="30" y="347" x="376">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="31" y="354" x="337">
<Connections>
<Target id="32"/>
</Connections>
</Feature>
<Feature id="32" y="361" x="350">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="33" y="366" x="365">
<Connections/>
</Feature>
<Feature id="34" y="364" x="379">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="35" y="359" x="392">
<Connections>
<Target id="34"/>
</Connections>
</Feature>
<Feature id="36" y="241" x="269">
<Connections>
<Target id="37"/>
</Connections>
</Feature>
<Feature id="37" y="232" x="288">
<Connections/>
</Feature>
<Feature id="38" y="235" x="309">
<Connections>
<Target id="37"/>
</Connections>
</Feature>
<Feature id="39" y="248" x="323">
<Connections>
<Target id="38"/>
</Connections>
</Feature>
<Feature id="40" y="250" x="305">
<Connections>
<Target id="39"/>
<Target id="41"/>
</Connections>
</Feature>
<Feature id="41" y="249" x="286">
<Connections>
<Target id="36"/>
</Connections>
</Feature>
<Feature id="42" y="254" x="418">
<Connections/>
</Feature>
<Feature id="43" y="243" x="436">
<Connections>
<Target id="42"/>
<Target id="44"/>
</Connections>
</Feature>
<Feature id="44" y="244" x="456">
<Connections/>
</Feature>
<Feature id="45" y="255" x="472">
<Connections>
<Target id="44"/>
<Target id="46"/>
</Connections>
</Feature>
<Feature id="46" y="260" x="454">
<Connections/>
</Feature>
<Feature id="47" y="259" x="435">
<Connections>
<Target id="46"/>
<Target id="42"/>
</Connections>
</Feature>
<Feature id="48" y="386" x="291">
<Connections/>
</Feature>
<Feature id="49" y="383" x="316">
<Connections>
<Target id="48"/>
</Connections>
</Feature>
<Feature id="50" y="383" x="340">
<Connections>
<Target id="49"/>
<Target id="51"/>
</Connections>
</Feature>
<Feature id="51" y="391" x="363">
<Connections/>
</Feature>
<Feature id="52" y="387" x="382">
<Connections>
<Target id="51"/>
</Connections>
</Feature>
<Feature id="53" y="390" x="401">
<Connections>
<Target id="52"/>
<Target id="54"/>
</Connections>
</Feature>
<Feature id="54" y="396" x="419">
<Connections/>
</Feature>
<Feature id="55" y="410" x="400">
<Connections>
<Target id="54"/>
</Connections>
</Feature>
<Feature id="56" y="418" x="378">
<Connections>
<Target id="55"/>
<Target id="57"/>
</Connections>
</Feature>
<Feature id="57" y="419" x="356">
<Connections>
<Target id="58"/>
</Connections>
</Feature>
<Feature id="58" y="414" x="332">
<Connections/>
</Feature>
<Feature id="59" y="403" x="309">
<Connections>
<Target id="58"/>
<Target id="48"/>
</Connections>
</Feature>
<Feature id="60" y="396" x="333">
<Connections>
<Target id="61"/>
<Target id="65"/>
</Connections>
</Feature>
<Feature id="61" y="403" x="360">
<Connections/>
</Feature>
<Feature id="62" y="400" x="382">
<Connections>
<Target id="61"/>
</Connections>
</Feature>
<Feature id="63" y="397" x="382">
<Connections>
<Target id="64"/>
<Target id="62"/>
</Connections>
</Feature>
<Feature id="64" y="397" x="359">
<Connections/>
</Feature>
<Feature id="65" y="392" x="331">
<Connections>
<Target id="64"/>
</Connections>
</Feature>
</Features>
</Sample>
<Sample fileName="images/Robert.jpg">
<Features>
<Feature id="0" y="280" x="156">
<Connections>
<Target id="1"/>
</Connections>
</Feature>
<Feature id="1" y="315" x="154">
<Connections/>
</Feature>
<Feature id="2" y="349" x="155">
<Connections>
<Target id="1"/>
<Target id="3"/>
</Connections>
</Feature>
<Feature id="3" y="384" x="160">
<Connections>
<Target id="4"/>
</Connections>
</Feature>
<Feature id="4" y="420" x="172">
<Connections/>
</Feature>
<Feature id="5" y="452" x="193">
<Connections>
<Target id="4"/>
<Target id="6"/>
</Connections>
</Feature>
<Feature id="6" y="480" x="219">
<Connections/>
</Feature>
<Feature id="7" y="501" x="250">
<Connections>
<Target id="6"/>
<Target id="8"/>
</Connections>
</Feature>
<Feature id="8" y="513" x="286">
<Connections/>
</Feature>
<Feature id="9" y="508" x="317">
<Connections>
<Target id="8"/>
<Target id="10"/>
</Connections>
</Feature>
<Feature id="10" y="492" x="346">
<Connections>
<Target id="11"/>
</Connections>
</Feature>
<Feature id="11" y="469" x="370">
<Connections/>
</Feature>
<Feature id="12" y="439" x="388">
<Connections>
<Target id="11"/>
<Target id="13"/>
</Connections>
</Feature>
<Feature id="13" y="405" x="400">
<Connections/>
</Feature>
<Feature id="14" y="371" x="409">
<Connections>
<Target id="13"/>
</Connections>
</Feature>
<Feature id="15" y="336" x="416">
<Connections>
<Target id="14"/>
<Target id="16"/>
</Connections>
</Feature>
<Feature id="16" y="302" x="420">
<Connections/>
</Feature>
<Feature id="17" y="244" x="210">
<Connections>
<Target id="18"/>
</Connections>
</Feature>
<Feature id="18" y="236" x="227">
<Connections>
<Target id="19"/>
</Connections>
</Feature>
<Feature id="19" y="234" x="247">
<Connections/>
</Feature>
<Feature id="20" y="237" x="266">
<Connections>
<Target id="19"/>
</Connections>
</Feature>
<Feature id="21" y="244" x="285">
<Connections>
<Target id="20"/>
</Connections>
</Feature>
<Feature id="22" y="250" x="343">
<Connections>
<Target id="23"/>
</Connections>
</Feature>
<Feature id="23" y="246" x="361">
<Connections>
<Target id="24"/>
</Connections>
</Feature>
<Feature id="24" y="245" x="380">
<Connections/>
</Feature>
<Feature id="25" y="250" x="397">
<Connections>
<Target id="24"/>
</Connections>
</Feature>
<Feature id="26" y="261" x="410">
<Connections>
<Target id="25"/>
</Connections>
</Feature>
<Feature id="27" y="283" x="312">
<Connections>
<Target id="28"/>
</Connections>
</Feature>
<Feature id="28" y="306" x="313">
<Connections/>
</Feature>
<Feature id="29" y="328" x="313">
<Connections>
<Target id="28"/>
<Target id="30"/>
</Connections>
</Feature>
<Feature id="30" y="351" x="314">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="31" y="365" x="286">
<Connections>
<Target id="32"/>
</Connections>
</Feature>
<Feature id="32" y="369" x="297">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="33" y="371" x="307">
<Connections/>
</Feature>
<Feature id="34" y="370" x="317">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="35" y="368" x="326">
<Connections>
<Target id="34"/>
</Connections>
</Feature>
<Feature id="36" y="279" x="230">
<Connections>
<Target id="37"/>
</Connections>
</Feature>
<Feature id="37" y="271" x="244">
<Connections/>
</Feature>
<Feature id="38" y="273" x="259">
<Connections>
<Target id="37"/>
</Connections>
</Feature>
<Feature id="39" y="282" x="271">
<Connections>
<Target id="38"/>
</Connections>
</Feature>
<Feature id="40" y="286" x="257">
<Connections>
<Target id="39"/>
<Target id="41"/>
</Connections>
</Feature>
<Feature id="41" y="285" x="243">
<Connections>
<Target id="36"/>
</Connections>
</Feature>
<Feature id="42" y="288" x="345">
<Connections/>
</Feature>
<Feature id="43" y="281" x="358">
<Connections>
<Target id="42"/>
<Target id="44"/>
</Connections>
</Feature>
<Feature id="44" y="282" x="373">
<Connections/>
</Feature>
<Feature id="45" y="292" x="385">
<Connections>
<Target id="44"/>
<Target id="46"/>
</Connections>
</Feature>
<Feature id="46" y="296" x="371">
<Connections/>
</Feature>
<Feature id="47" y="294" x="357">
<Connections>
<Target id="46"/>
<Target id="42"/>
</Connections>
</Feature>
<Feature id="48" y="410" x="252">
<Connections/>
</Feature>
<Feature id="49" y="403" x="269">
<Connections>
<Target id="48"/>
</Connections>
</Feature>
<Feature id="50" y="399" x="287">
<Connections>
<Target id="49"/>
<Target id="51"/>
</Connections>
</Feature>
<Feature id="51" y="404" x="305">
<Connections/>
</Feature>
<Feature id="52" y="402" x="320">
<Connections>
<Target id="51"/>
</Connections>
</Feature>
<Feature id="53" y="408" x="334">
<Connections>
<Target id="52"/>
<Target id="54"/>
</Connections>
</Feature>
<Feature id="54" y="417" x="345">
<Connections/>
</Feature>
<Feature id="55" y="428" x="333">
<Connections>
<Target id="54"/>
</Connections>
</Feature>
<Feature id="56" y="434" x="317">
<Connections>
<Target id="55"/>
<Target id="57"/>
</Connections>
</Feature>
<Feature id="57" y="436" x="300">
<Connections>
<Target id="58"/>
</Connections>
</Feature>
<Feature id="58" y="431" x="281">
<Connections/>
</Feature>
<Feature id="59" y="423" x="265">
<Connections>
<Target id="58"/>
<Target id="48"/>
</Connections>
</Feature>
<Feature id="60" y="411" x="284">
<Connections>
<Target id="61"/>
<Target id="65"/>
</Connections>
</Feature>
<Feature id="61" y="415" x="303">
<Connections/>
</Feature>
<Feature id="62" y="414" x="318">
<Connections>
<Target id="61"/>
</Connections>
</Feature>
<Feature id="63" y="417" x="318">
<Connections>
<Target id="64"/>
<Target id="62"/>
</Connections>
</Feature>
<Feature id="64" y="418" x="301">
<Connections/>
</Feature>
<Feature id="65" y="414" x="282">
<Connections>
<Target id="64"/>
</Connections>
</Feature>
</Features>
</Sample>
<Sample fileName="images/Scarlett.jpg">
<Features>
<Feature id="0" y="348" x="206">
<Connections>
<Target id="1"/>
</Connections>
</Feature>
<Feature id="1" y="392" x="217">
<Connections/>
</Feature>
<Feature id="2" y="435" x="232">
<Connections>
<Target id="1"/>
<Target id="3"/>
</Connections>
</Feature>
<Feature id="3" y="478" x="249">
<Connections>
<Target id="4"/>
</Connections>
</Feature>
<Feature id="4" y="519" x="270">
<Connections/>
</Feature>
<Feature id="5" y="555" x="299">
<Connections>
<Target id="4"/>
<Target id="6"/>
</Connections>
</Feature>
<Feature id="6" y="586" x="333">
<Connections/>
</Feature>
<Feature id="7" y="608" x="373">
<Connections>
<Target id="6"/>
<Target id="8"/>
</Connections>
</Feature>
<Feature id="8" y="610" x="417">
<Connections/>
</Feature>
<Feature id="9" y="594" x="461">
<Connections>
<Target id="8"/>
<Target id="10"/>
</Connections>
</Feature>
<Feature id="10" y="562" x="497">
<Connections>
<Target id="11"/>
</Connections>
</Feature>
<Feature id="11" y="524" x="527">
<Connections/>
</Feature>
<Feature id="12" y="481" x="549">
<Connections>
<Target id="11"/>
<Target id="13"/>
</Connections>
</Feature>
<Feature id="13" y="434" x="561">
<Connections/>
</Feature>
<Feature id="14" y="386" x="565">
<Connections>
<Target id="13"/>
</Connections>
</Feature>
<Feature id="15" y="339" x="566">
<Connections>
<Target id="14"/>
<Target id="16"/>
</Connections>
</Feature>
<Feature id="16" y="291" x="564">
<Connections/>
</Feature>
<Feature id="17" y="282" x="214">
<Connections>
<Target id="18"/>
</Connections>
</Feature>
<Feature id="18" y="265" x="232">
<Connections>
<Target id="19"/>
</Connections>
</Feature>
<Feature id="19" y="257" x="256">
<Connections/>
</Feature>
<Feature id="20" y="256" x="282">
<Connections>
<Target id="19"/>
</Connections>
</Feature>
<Feature id="21" y="261" x="308">
<Connections>
<Target id="20"/>
</Connections>
</Feature>
<Feature id="22" y="245" x="401">
<Connections>
<Target id="23"/>
</Connections>
</Feature>
<Feature id="23" y="232" x="427">
<Connections>
<Target id="24"/>
</Connections>
</Feature>
<Feature id="24" y="224" x="456">
<Connections/>
</Feature>
<Feature id="25" y="225" x="486">
<Connections>
<Target id="24"/>
</Connections>
</Feature>
<Feature id="26" y="237" x="512">
<Connections>
<Target id="25"/>
</Connections>
</Feature>
<Feature id="27" y="302" x="360">
<Connections>
<Target id="28"/>
</Connections>
</Feature>
<Feature id="28" y="335" x="364">
<Connections/>
</Feature>
<Feature id="29" y="367" x="367">
<Connections>
<Target id="28"/>
<Target id="30"/>
</Connections>
</Feature>
<Feature id="30" y="399" x="371">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="31" y="420" x="346">
<Connections>
<Target id="32"/>
</Connections>
</Feature>
<Feature id="32" y="424" x="362">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="33" y="425" x="378">
<Connections/>
</Feature>
<Feature id="34" y="419" x="395">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="35" y="410" x="410">
<Connections>
<Target id="34"/>
</Connections>
</Feature>
<Feature id="36" y="322" x="253">
<Connections>
<Target id="37"/>
</Connections>
</Feature>
<Feature id="37" y="309" x="270">
<Connections/>
</Feature>
<Feature id="38" y="306" x="293">
<Connections>
<Target id="37"/>
</Connections>
</Feature>
<Feature id="39" y="313" x="313">
<Connections>
<Target id="38"/>
</Connections>
</Feature>
<Feature id="40" y="320" x="293">
<Connections>
<Target id="39"/>
<Target id="41"/>
</Connections>
</Feature>
<Feature id="41" y="324" x="273">
<Connections>
<Target id="36"/>
</Connections>
</Feature>
<Feature id="42" y="295" x="421">
<Connections/>
</Feature>
<Feature id="43" y="281" x="438">
<Connections>
<Target id="42"/>
<Target id="44"/>
</Connections>
</Feature>
<Feature id="44" y="278" x="461">
<Connections/>
</Feature>
<Feature id="45" y="285" x="482">
<Connections>
<Target id="44"/>
<Target id="46"/>
</Connections>
</Feature>
<Feature id="46" y="293" x="463">
<Connections/>
</Feature>
<Feature id="47" y="296" x="442">
<Connections>
<Target id="46"/>
<Target id="42"/>
</Connections>
</Feature>
<Feature id="48" y="477" x="319">
<Connections/>
</Feature>
<Feature id="49" y="463" x="336">
<Connections>
<Target id="48"/>
</Connections>
</Feature>
<Feature id="50" y="454" x="360">
<Connections>
<Target id="49"/>
<Target id="51"/>
</Connections>
</Feature>
<Feature id="51" y="454" x="384">
<Connections/>
</Feature>
<Feature id="52" y="446" x="411">
<Connections>
<Target id="51"/>
</Connections>
</Feature>
<Feature id="53" y="446" x="439">
<Connections>
<Target id="52"/>
<Target id="54"/>
</Connections>
</Feature>
<Feature id="54" y="453" x="465">
<Connections/>
</Feature>
<Feature id="55" y="483" x="451">
<Connections>
<Target id="54"/>
</Connections>
</Feature>
<Feature id="56" y="506" x="428">
<Connections>
<Target id="55"/>
<Target id="57"/>
</Connections>
</Feature>
<Feature id="57" y="517" x="397">
<Connections>
<Target id="58"/>
</Connections>
</Feature>
<Feature id="58" y="516" x="366">
<Connections/>
</Feature>
<Feature id="59" y="501" x="338">
<Connections>
<Target id="58"/>
<Target id="48"/>
</Connections>
</Feature>
<Feature id="60" y="470" x="356">
<Connections>
<Target id="61"/>
<Target id="65"/>
</Connections>
</Feature>
<Feature id="61" y="467" x="387">
<Connections/>
</Feature>
<Feature id="62" y="459" x="421">
<Connections>
<Target id="61"/>
</Connections>
</Feature>
<Feature id="63" y="480" x="427">
<Connections>
<Target id="64"/>
<Target id="62"/>
</Connections>
</Feature>
<Feature id="64" y="493" x="392">
<Connections/>
</Feature>
<Feature id="65" y="491" x="358">
<Connections>
<Target id="64"/>
</Connections>
</Feature>
</Features>
</Sample>
<Sample fileName="images/Tom.jpg">
<Features>
<Feature id="0" y="271" x="174">
<Connections>
<Target id="1"/>
</Connections>
</Feature>
<Feature id="1" y="308" x="174">
<Connections/>
</Feature>
<Feature id="2" y="345" x="176">
<Connections>
<Target id="1"/>
<Target id="3"/>
</Connections>
</Feature>
<Feature id="3" y="383" x="179">
<Connections>
<Target id="4"/>
</Connections>
</Feature>
<Feature id="4" y="423" x="186">
<Connections/>
</Feature>
<Feature id="5" y="461" x="201">
<Connections>
<Target id="4"/>
<Target id="6"/>
</Connections>
</Feature>
<Feature id="6" y="494" x="224">
<Connections/>
</Feature>
<Feature id="7" y="519" x="252">
<Connections>
<Target id="6"/>
<Target id="8"/>
</Connections>
</Feature>
<Feature id="8" y="532" x="287">
<Connections/>
</Feature>
<Feature id="9" y="526" x="325">
<Connections>
<Target id="8"/>
<Target id="10"/>
</Connections>
</Feature>
<Feature id="10" y="506" x="360">
<Connections>
<Target id="11"/>
</Connections>
</Feature>
<Feature id="11" y="478" x="390">
<Connections/>
</Feature>
<Feature id="12" y="444" x="414">
<Connections>
<Target id="11"/>
<Target id="13"/>
</Connections>
</Feature>
<Feature id="13" y="405" x="429">
<Connections/>
</Feature>
<Feature id="14" y="368" x="438">
<Connections>
<Target id="13"/>
</Connections>
</Feature>
<Feature id="15" y="331" x="444">
<Connections>
<Target id="14"/>
<Target id="16"/>
</Connections>
</Feature>
<Feature id="16" y="293" x="449">
<Connections/>
</Feature>
<Feature id="17" y="261" x="191">
<Connections>
<Target id="18"/>
</Connections>
</Feature>
<Feature id="18" y="252" x="209">
<Connections>
<Target id="19"/>
</Connections>
</Feature>
<Feature id="19" y="251" x="229">
<Connections/>
</Feature>
<Feature id="20" y="256" x="250">
<Connections>
<Target id="19"/>
</Connections>
</Feature>
<Feature id="21" y="264" x="269">
<Connections>
<Target id="20"/>
</Connections>
</Feature>
<Feature id="22" y="269" x="328">
<Connections>
<Target id="23"/>
</Connections>
</Feature>
<Feature id="23" y="263" x="351">
<Connections>
<Target id="24"/>
</Connections>
</Feature>
<Feature id="24" y="262" x="374">
<Connections/>
</Feature>
<Feature id="25" y="266" x="396">
<Connections>
<Target id="24"/>
</Connections>
</Feature>
<Feature id="26" y="278" x="415">
<Connections>
<Target id="25"/>
</Connections>
</Feature>
<Feature id="27" y="293" x="298">
<Connections>
<Target id="28"/>
</Connections>
</Feature>
<Feature id="28" y="320" x="296">
<Connections/>
</Feature>
<Feature id="29" y="346" x="293">
<Connections>
<Target id="28"/>
<Target id="30"/>
</Connections>
</Feature>
<Feature id="30" y="372" x="291">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="31" y="380" x="269">
<Connections>
<Target id="32"/>
</Connections>
</Feature>
<Feature id="32" y="387" x="280">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="33" y="390" x="292">
<Connections/>
</Feature>
<Feature id="34" y="388" x="305">
<Connections>
<Target id="33"/>
</Connections>
</Feature>
<Feature id="35" y="383" x="318">
<Connections>
<Target id="34"/>
</Connections>
</Feature>
<Feature id="36" y="286" x="220">
<Connections>
<Target id="37"/>
</Connections>
</Feature>
<Feature id="37" y="280" x="234">
<Connections/>
</Feature>
<Feature id="38" y="282" x="249">
<Connections>
<Target id="37"/>
</Connections>
</Feature>
<Feature id="39" y="290" x="262">
<Connections>
<Target id="38"/>
</Connections>
</Feature>
<Feature id="40" y="291" x="248">
<Connections>
<Target id="39"/>
<Target id="41"/>
</Connections>
</Feature>
<Feature id="41" y="290" x="233">
<Connections>
<Target id="36"/>
</Connections>
</Feature>
<Feature id="42" y="295" x="340">
<Connections/>
</Feature>
<Feature id="43" y="289" x="354">
<Connections>
<Target id="42"/>
<Target id="44"/>
</Connections>
</Feature>
<Feature id="44" y="290" x="369">
<Connections/>
</Feature>
<Feature id="45" y="298" x="383">
<Connections>
<Target id="44"/>
<Target id="46"/>
</Connections>
</Feature>
<Feature id="46" y="299" x="369">
<Connections/>
</Feature>
<Feature id="47" y="298" x="354">
<Connections>
<Target id="46"/>
<Target id="42"/>
</Connections>
</Feature>
<Feature id="48" y="418" x="238">
<Connections/>
</Feature>
<Feature id="49" y="409" x="253">
<Connections>
<Target id="48"/>
</Connections>
</Feature>
<Feature id="50" y="407" x="272">
<Connections>
<Target id="49"/>
<Target id="51"/>
</Connections>
</Feature>
<Feature id="51" y="411" x="292">
<Connections/>
</Feature>
<Feature id="52" y="409" x="314">
<Connections>
<Target id="51"/>
</Connections>
</Feature>
<Feature id="53" y="415" x="335">
<Connections>
<Target id="52"/>
<Target id="54"/>
</Connections>
</Feature>
<Feature id="54" y="425" x="351">
<Connections/>
</Feature>
<Feature id="55" y="442" x="336">
<Connections>
<Target id="54"/>
</Connections>
</Feature>
<Feature id="56" y="454" x="315">
<Connections>
<Target id="55"/>
<Target id="57"/>
</Connections>
</Feature>
<Feature id="57" y="457" x="291">
<Connections>
<Target id="58"/>
</Connections>
</Feature>
<Feature id="58" y="451" x="268">
<Connections/>
</Feature>
<Feature id="59" y="437" x="250">
<Connections>
<Target id="58"/>
<Target id="48"/>
</Connections>
</Feature>
<Feature id="60" y="417" x="268">
<Connections>
<Target id="61"/>
<Target id="65"/>
</Connections>
</Feature>
<Feature id="61" y="421" x="292">
<Connections/>
</Feature>
<Feature id="62" y="421" x="318">
<Connections>
<Target id="61"/>
</Connections>
</Feature>
<Feature id="63" y="435" x="319">
<Connections>
<Target id="64"/>
<Target id="62"/>
</Connections>
</Feature>
<Feature id="64" y="439" x="291">
<Connections/>
</Feature>
<Feature id="65" y="432" x="267">
<Connections>
<Target id="64"/>
</Connections>
</Feature>
</Features>
</Sample>
</Samples>
</FaceDataset>
================================================
FILE: src/aboutwindow.cpp
================================================
/*
* Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)
*
* This file is part of FLAT.
*
* FLAT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FLAT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "aboutwindow.h"
#include "ui_aboutwindow.h"
#include "version.h"
#include <QScrollArea>
#include <QLabel>
// +-----------------------------------------------------------
ft::AboutWindow::AboutWindow(QWidget *pParent) :
QDialog(pParent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint),
ui(new Ui::AboutWindow)
{
ui->setupUi(this);
ui->label->setText(ui->label->text().arg(FLAT_VERSION));
ui->label->setOpenExternalLinks(true);
setFixedSize(425, 268);
}
// +-----------------------------------------------------------
ft::AboutWindow::~AboutWindow()
{
delete ui;
}
================================================
FILE: src/aboutwindow.h
================================================
/*
* Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)
*
* This file is part of FLAT.
*
* FLAT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FLAT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ABOUTWINDOW_H
#define ABOUTWINDOW_H
#include <QDialog>
namespace Ui
{
class AboutWindow;
}
namespace ft
{
/**
* Form class used to display the about dialog box.
*/
class AboutWindow : public QDialog
{
Q_OBJECT
public:
/**
* Class constructor.
* @param pParent QWidget with the window parent.
*/
explicit AboutWindow(QWidget *pParent = 0);
/**
* Class destructor
*/
virtual ~AboutWindow();
private:
/** Instance of the ui for GUI element access. */
Ui::AboutWindow *ui;
};
}
#endif // ABOUTWINDOW_H
================================================
FILE: src/aboutwindow.ui
================================================
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AboutWindow</class>
<widget class="QDialog" name="AboutWindow">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>425</width>
<height>268</height>
</rect>
</property>
<property name="windowTitle">
<string>About...</string>
</property>
<property name="locale">
<locale language="English" country="UnitedKingdom"/>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>5</number>
</property>
<property name="topMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<number>5</number>
</property>
<property name="spacing">
<number>5</number>
</property>
<item row="0" column="0">
<layout class="QVBoxLayout" name="vLayout">
<property name="spacing">
<number>10</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>394</width>
<height>331</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string><html><head/><body><p><span style=" font-weight:600;">FLAT - Facial Landmarks Annotation Tool (version %1)</span></p><p>Copyright (C) 2016 <a href="http://www.luiz.vieira.nom.br/"><span style=" text-decoration: underline; color:#0000ff;">Luiz Carlos Vieira</span></a></p><p>This is a visual editor to help annotating face images with facial landmarks required for the implementation of deformable fit algorithms or avatar transposition. The source code is available <a href="https://github.com/luigivieira/Facial-Landmarks-Annotation-Tool"><span style=" text-decoration: underline; color:#0000ff;">at Github</span></a>.</p><p>The application icons and images are either from or based on the Oxygen Icons Set, downloaded as <a href="https://github.com/pasnox/oxygen-icons-png"><span style=" text-decoration: underline; color:#0000ff;">PNGs from Felipe Azevedo (pasnox)</span></a> and <a href="https://techbase.kde.org/Projects/Oxygen/Licensing"><span style=" text-decoration: underline; color:#0000ff;">licensed under LGPL from KDE</span></a>, and the <a href="http://www.fatcow.com/free-icons"><span style=" text-decoration: underline; color:#0000ff;">Farm-Fresh Web Icons Set</span></a>, licensed under <a href="http://creativecommons.org/licenses/by/4.0/"><span style=" text-decoration: underline; color:#0000ff;">Creative Commons (CC BY 4.0)</span></a>.</p><p>LICENSE</p><p>This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p><p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p><p>You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/"><span style=" text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses/</span></a>.</p></body></html></string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="hLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="closeButton">
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>&Close</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>closeButton</sender>
<signal>clicked()</signal>
<receiver>AboutWindow</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>380</x>
<y>249</y>
</hint>
<hint type="destinationlabel">
<x>212</x>
<y>133</y>
</hint>
</hints>
</connection>
</connections>
</ui>
================================================
FILE: src/application.cpp
================================================
/*
* Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)
*
* This file is part of FLAT.
*
* FLAT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FLAT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "application.h"
#include <typeinfo>
#include <QtGlobal>
#include <QDateTime>
#include <QFileInfo>
#include <QDebug>
#include <QMessageBox>
#include <QSettings>
#include <QDir>
#include <QStandardPaths>
#include <QFileInfo>
#include <iostream>
#include <stdexcept>
using namespace std;
// +-----------------------------------------------------------
ft::FtApplication::FtApplication(int argc, char* argv[]): QApplication(argc, argv)
{
m_pMainWindow = NULL;
// Information used to store the program settings
QCoreApplication::setOrganizationName("Flat");
QCoreApplication::setOrganizationDomain("https://github.com/luigivieira/Facial-Landmarks-Annotation-Tool.git");
QCoreApplication::setApplicationName("Data");
QString sAppFile = QCoreApplication::applicationFilePath();
QString sDocPath = QDir::toNativeSeparators(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)) + QDir::separator();
QFileInfo oFile = QFileInfo(sAppFile);
QString sLogFile = QString("%1%2.log").arg(sDocPath).arg(oFile.baseName());
m_oLogFile.open(qPrintable(sLogFile), ios::app);
if (!m_oLogFile.is_open())
{
cerr << QString("Could not open the file [%1] for writing. No log will be created.").arg(sLogFile).toStdString();
exit(-1);
}
qInstallMessageHandler(&ft::FtApplication::handleLogOutput);
qDebug() << QCoreApplication::applicationFilePath().toStdString().c_str() << "started.";
}
// +-----------------------------------------------------------
ft::FtApplication::~FtApplication()
{
qDebug() << QCoreApplication::applicationFilePath().toStdString().c_str() << "ended.";
if (m_oLogFile.is_open())
{
m_oLogFile.flush();
m_oLogFile.close();
}
}
// +-----------------------------------------------------------
bool ft::FtApplication::notify(QObject* pReceiver, QEvent* pEvent)
{
try
{
// Retransmit the event notification
return QApplication::notify(pReceiver, pEvent);
}
catch (std::exception &e)
{
qFatal("Exception %s sending event [%s] to object [%s] (%s)",
e.what(), typeid(*pEvent).name(), qPrintable(pReceiver->objectName()), typeid(*pReceiver).name());
}
catch (...)
{
qFatal("Exception sending event [%s] to object [%s] (%s)",
typeid(*pEvent).name(), qPrintable(pReceiver->objectName()), typeid(*pReceiver).name());
}
return false;
}
// +-----------------------------------------------------------
void ft::FtApplication::handleLogOutput(QtMsgType eType, const QMessageLogContext &oContext, const QString &sMsg) {
QString sNow = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz");
// Only include context information if it exists (when compiled in debug)
QString sDebugInfo;
if(oContext.line != 0)
{
QString sSource = QFileInfo(QFile(oContext.file).fileName()).fileName();
sDebugInfo = QString(" [%1:%2, %3] ").arg(sSource).arg(oContext.line).arg(oContext.function);
}
else
sDebugInfo = " ";
switch (eType)
{
case QtDebugMsg:
FtApplication::instance()->m_oLogFile << qPrintable(sNow) << qPrintable(sDebugInfo) << "DEBUG: " << qPrintable(sMsg) << endl;
FtApplication::instance()->m_oLogFile.flush();
break;
case QtWarningMsg:
FtApplication::instance()->m_oLogFile << qPrintable(sNow) << qPrintable(sDebugInfo) << "WARNING: " << qPrintable(sMsg) << endl;
FtApplication::instance()->m_oLogFile.flush();
break;
case QtCriticalMsg:
FtApplication::instance()->m_oLogFile << qPrintable(sNow) << qPrintable(sDebugInfo) << "CRITICAL: " << qPrintable(sMsg) << endl;
FtApplication::instance()->m_oLogFile.flush();
break;
case QtFatalMsg:
QApplication::beep();
QMessageBox::critical(NULL, qApp->translate("Main", "Runtime Error"), qApp->translate("Main", "A severe exception happened and the application must terminate."), QMessageBox::Ok);
cerr << qPrintable(sNow) << qPrintable(sDebugInfo) << "FATAL: " << qPrintable(sMsg) << endl;
FtApplication::instance()->m_oLogFile << qPrintable(sNow) << qPrintable(sDebugInfo) << "FATAL:" << qPrintable(sMsg) << endl;
exit(-2);
}
}
// +-----------------------------------------------------------
ft::FtApplication* ft::FtApplication::instance()
{
return (FtApplication *) qApp;
}
// +-----------------------------------------------------------
void ft::FtApplication::showStatusMessage(const QString &sMsg, const int iTimeout)
{
FtApplication::instance()->emit statusMessageShown(sMsg, iTimeout);
}
================================================
FILE: src/application.h
================================================
/*
* Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)
*
* This file is part of FLAT.
*
* FLAT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FLAT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef APPLICATION_H
#define APPLICATION_H
#include <QApplication>
#include <QMainWindow>
#include <QObject>
#include <fstream>
namespace ft
{
/**
* Custom application class, used to intercept message notifications in the project applications.
*/
class FtApplication: public QApplication
{
Q_OBJECT
public:
/**
* Class constructor.
* @param argc Number of arguments received from the command line.
* @param argv Array of char pointers with the arguments received from the command line.
*/
FtApplication(int argc, char* argv[]);
/**
* Class destructor.
*/
virtual ~FtApplication();
/**
* Displays a text message in the main window status bar.
* @param sMsg QString with the message to be displayed.
* @param iTimeout Integer with the number of miliseconds
* by which the message will be displayed. The default is 5000
* (i.e. 5 seconds).
*/
static void showStatusMessage(const QString &sMsg, const int iTimeout = 5000);
/**
* Handles the notification of messages in the application event loop.
* @param pReceiver Pointer to the QObject that shall receive the message.
* @param pEvent Pointer to the QEvent with the message information.
*/
bool notify(QObject* pReceiver, QEvent* pEvent);
/**
* Gets the default instance for this application (from the qApp variable simply type-casted).
* @return Pointer to the default instance of the FtApplication.
*/
static FtApplication* instance();
signals:
/**
* Signal indicating that a status message was requested to be displayed on the
* application main window.
* @param sMsg QString with the message to be displayed.
* @param iTimeout Integer with the number of miliseconds
* by which the message will be displayed.
*/
void statusMessageShown(const QString &sMsg, const int iTimeout);
protected:
/**
* Log and exception message handler for application events.
* @param eType QtMsgType enum value with the type of the log event.
* @param oContext QMessageLogContext instance with information on where the event happened (function, line, etc)
* @param sMsg QString instance with the event message.
*/
static void handleLogOutput(QtMsgType eType, const QMessageLogContext& oContext, const QString& sMsg);
private:
/** File stream used to log application messages. */
std::ofstream m_oLogFile;
/** Instance of the main window used with this application. */
QMainWindow *m_pMainWindow;
};
}
#endif // APPLICATION_H
================================================
FILE: src/childwindow.cpp
================================================
/*
* Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)
*
* This file is part of FLAT.
*
* FLAT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FLAT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "childwindow.h"
#include "mainwindow.h"
#include "application.h"
#include <QMessageBox>
#include <QGridLayout>
#include <QApplication>
#include <QtMath>
#include <QDebug>
#include <vector>
using namespace std;
// +-----------------------------------------------------------
ft::ChildWindow::ChildWindow(QWidget *pParent) :
QWidget(pParent)
{
setAutoFillBackground(true);
setBackgroundRole(QPalette::Dark);
setAttribute(Qt::WA_DeleteOnClose);
QGridLayout *pLayout = new QGridLayout(this);
pLayout->setMargin(0);
setLayout(pLayout);
m_pFaceWidget = new FaceWidget(this);
pLayout->addWidget(m_pFaceWidget);
m_pFaceWidget->setPixmap(QPixmap(":/images/noface"));
m_pFaceDatasetModel = new FaceDatasetModel();
m_pFaceSelectionModel = new QItemSelectionModel(m_pFaceDatasetModel);
// Capture of relevant signals
connect(m_pFaceWidget, SIGNAL(onScaleFactorChanged(const double)), this, SLOT(onScaleFactorChanged(const double)));
connect(m_pFaceWidget, SIGNAL(onFaceFeaturesSelectionChanged()), this, SLOT(onFaceFeaturesSelectionChanged()));
connect(m_pFaceWidget, SIGNAL(onFaceFeaturesChanged()), this, SLOT(onDataChanged()));
connect(m_pFaceDatasetModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&, const QVector<int>&)), this, SLOT(onDataChanged()));
connect(m_pFaceSelectionModel, SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(onCurrentChanged(const QModelIndex &, const QModelIndex &)));
// Indicate that it is a brand new dataset (i.e. not yet saved to a file)
setProperty("new", true);
m_iCurrentImage = -1;
}
// +-----------------------------------------------------------
ft::ChildWindow::~ChildWindow()
{
delete m_pFaceSelectionModel;
delete m_pFaceDatasetModel;
}
// +-----------------------------------------------------------
ft::FaceDatasetModel* ft::ChildWindow::dataModel() const
{
return m_pFaceDatasetModel;
}
// +-----------------------------------------------------------
QItemSelectionModel* ft::ChildWindow::selectionModel() const
{
return m_pFaceSelectionModel;
}
// +-----------------------------------------------------------
bool ft::ChildWindow::save(QString &sMsgError)
{
if(!m_pFaceDatasetModel->saveToFile(windowFilePath(), sMsgError))
return false;
onDataChanged(false);
setProperty("new", QVariant()); // No longer a new dataset
return true;
}
// +-----------------------------------------------------------
bool ft::ChildWindow::saveToFile(const QString &sFileName, QString &sMsgError)
{
if(!m_pFaceDatasetModel->saveToFile(sFileName, sMsgError))
return false;
setWindowFilePath(sFileName);
onDataChanged(false);
setProperty("new", QVariant()); // No longer a new dataset
return true;
}
// +-----------------------------------------------------------
bool ft::ChildWindow::loadFromFile(const QString &sFileName, QString &sMsgError)
{
if(!m_pFaceDatasetModel->loadFromFile(qPrintable(sFileName), sMsgError))
return false;
setWindowFilePath(sFileName);
onDataChanged(false);
setProperty("new", QVariant()); // No longer a new dataset
return true;
}
// +-----------------------------------------------------------
void ft::ChildWindow::setZoomLevel(const int iLevel)
{
int iSteps = iLevel - 11; // Because 11 is the middle slider value, equivalent to the scale of 1.0 (100%)
double dBase = iSteps < 0 ? FaceWidget::ZOOM_OUT_STEP : FaceWidget::ZOOM_IN_STEP;
double dFactor = 1.0 * qPow(dBase, abs(iSteps));
m_pFaceWidget->setScaleFactor(dFactor);
}
// +-----------------------------------------------------------
int ft::ChildWindow::getZoomLevel() const
{
double dFactor = m_pFaceWidget->getScaleFactor();
double dBase = dFactor < 1.0 ? FaceWidget::ZOOM_OUT_STEP : FaceWidget::ZOOM_IN_STEP;
int iSteps = qCeil(qLn(abs(dFactor)) / qLn(dBase));
if(dFactor > 1.0)
return iSteps + 11;
else
return 11 - iSteps;
}
// +-----------------------------------------------------------
void ft::ChildWindow::zoomIn()
{
m_pFaceWidget->zoomIn();
}
// +-----------------------------------------------------------
void ft::ChildWindow::zoomOut()
{
m_pFaceWidget->zoomOut();
}
// +-----------------------------------------------------------
void ft::ChildWindow::onScaleFactorChanged(const double dScaleFactor)
{
Q_UNUSED(dScaleFactor);
QModelIndex oCurrent = m_pFaceSelectionModel->currentIndex();
QString sImageName = m_pFaceDatasetModel->data(m_pFaceDatasetModel->index(oCurrent.row(), 0), Qt::UserRole).toString();
emit onUIUpdated(sImageName, getZoomLevel());
}
// +-----------------------------------------------------------
void ft::ChildWindow::onDataChanged(const bool bModified)
{
if(bModified)
updateFeaturesInDataset();
setWindowModified(bModified);
emit onDataModified();
}
// +-----------------------------------------------------------
void ft::ChildWindow::onCurrentChanged(const QModelIndex &oCurrent, const QModelIndex &oPrevious)
{
Q_UNUSED(oPrevious);
if(!oCurrent.isValid())
{
m_iCurrentImage = -1;
m_pFaceWidget->setPixmap(QPixmap(":/images/noface"));
emit onUIUpdated("", 0);
}
else
{
m_iCurrentImage = oCurrent.row();
QVariant oData = m_pFaceDatasetModel->data(m_pFaceDatasetModel->index(m_iCurrentImage, 2), Qt::UserRole);
if(oData.isValid())
m_pFaceWidget->setPixmap(oData.value<QPixmap>());
else
m_pFaceWidget->setPixmap(QPixmap(":/images/brokenimage"));
QString sImageName = oCurrent.data(Qt::UserRole).toString();
emit onUIUpdated(sImageName, getZoomLevel());
refreshFeaturesInWidget();
}
}
// +-----------------------------------------------------------
void ft::ChildWindow::refreshFeaturesInWidget()
{
vector<FaceFeature*> vFeats = m_pFaceDatasetModel->getFeatures(m_iCurrentImage);
QList<FaceFeatureNode*> lsNodes = m_pFaceWidget->getFaceFeatures(m_pFaceDatasetModel->numFeatures()); // This call automatically guarantees that there are "m_pFaceDatasetModel->numFeatures()" features in the editor
for(int i = 0; i < (int) vFeats.size(); i++)
{
lsNodes[i]->setData(0, true); // Indication to avoid emitting position change event
// Refresh the feature visual in the widget:
// - (re)position the feature
// - (re)do any connections
lsNodes[i]->setPos(vFeats[i]->x(), vFeats[i]->y());
foreach(int iID, vFeats[i]->getConnections())
m_pFaceWidget->connectFaceFeatures(vFeats[i]->getID(), iID);
lsNodes[i]->setData(0, false);
}
}
// +-----------------------------------------------------------
void ft::ChildWindow::updateFeaturesInDataset()
{
QList<FaceFeatureNode*> lsNodes = m_pFaceWidget->getFaceFeatures();
vector<FaceFeature*> vFeats = m_pFaceDatasetModel->getFeatures(m_iCurrentImage);
FaceFeatureNode* pNode;
for(int i = 0; i < (int) vFeats.size(); i++)
{
if(i >= lsNodes.size()) // Sanity check (vFeats and lsNodes are supposed to have the same size, but who knows?)
{
qCritical() << tr("An update of face features in dataset was not performed due to inconsistences.");
continue;
}
pNode = lsNodes.at(i);
vFeats[i]->setID(pNode->getID());
vFeats[i]->setX(pNode->x());
vFeats[i]->setY(pNode->y());
}
}
// +-----------------------------------------------------------
void ft::ChildWindow::onFaceFeaturesSelectionChanged()
{
emit onFeaturesSelectionChanged();
}
// +-----------------------------------------------------------
bool ft::ChildWindow::displayFaceFeatures() const
{
return m_pFaceWidget->displayFaceFeatures();
}
// +-----------------------------------------------------------
void ft::ChildWindow::setDisplayFaceFeatures(const bool bValue)
{
m_pFaceWidget->setDisplayFaceFeatures(bValue);
}
// +-----------------------------------------------------------
bool ft::ChildWindow::displayConnections() const
{
return m_pFaceWidget->displayConnections();
}
// +-----------------------------------------------------------
void ft::ChildWindow::setDisplayConnections(const bool bValue)
{
m_pFaceWidget->setDisplayConnections(bValue);
}
// +-----------------------------------------------------------
bool ft::ChildWindow::displayFeatureIDs() const
{
return m_pFaceWidget->displayFeatureIDs();
}
// +-----------------------------------------------------------
void ft::ChildWindow::setDisplayFeatureIDs(const bool bValue)
{
m_pFaceWidget->setDisplayFeatureIDs(bValue);
}
// +-----------------------------------------------------------
const QList<ft::FaceFeatureNode*>& ft::ChildWindow::getFaceFeatures() const
{
return m_pFaceWidget->getFaceFeatures();
}
// +-----------------------------------------------------------
QList<ft::FaceFeatureNode*> ft::ChildWindow::getSelectedFeatures() const
{
return m_pFaceWidget->getSelectedFeatures();
}
// +-----------------------------------------------------------
QList<ft::FaceFeatureEdge*> ft::ChildWindow::getSelectedConnections() const
{
return m_pFaceWidget->getSelectedConnections();
}
// +-----------------------------------------------------------
void ft::ChildWindow::setContextMenu(QMenu *pMenu)
{
m_pFaceWidget->setContextMenu(pMenu);
}
// +-----------------------------------------------------------
void ft::ChildWindow::addFeature(const QPoint &oPos)
{
FaceFeatureNode *pNode = m_pFaceWidget->addFaceFeature(oPos, true);
m_pFaceDatasetModel->addFeature(pNode->getID(), pNode->x(), pNode->y());
onDataChanged();
}
// +-----------------------------------------------------------
void ft::ChildWindow::removeSelectedFeatures()
{
bool bUpdated = false;
QList<FaceFeatureNode*> lsFeats = m_pFaceWidget->getSelectedFeatures();
foreach(FaceFeatureNode *pNode, lsFeats)
{
m_pFaceDatasetModel->removeFeature(pNode->getID());
m_pFaceWidget->removeFaceFeature(pNode);
bUpdated = true;
}
if(bUpdated)
{
updateFeaturesInDataset();
onDataChanged();
}
}
// +-----------------------------------------------------------
void ft::ChildWindow::connectFeatures()
{
bool bUpdated = false;
QList<FaceFeatureNode*> lsFeats = m_pFaceWidget->getSelectedFeatures();
QList<FaceFeatureNode*>::iterator oFirst, oSecond;
for(oFirst = lsFeats.begin(); oFirst != lsFeats.end(); oFirst++)
{
for(oSecond = oFirst + 1; oSecond != lsFeats.end(); oSecond++)
{
m_pFaceWidget->connectFaceFeatures(*oFirst, *oSecond);
m_pFaceDatasetModel->connectFeatures((*oFirst)->getID(), (*oSecond)->getID());
bUpdated = true;
}
}
if(bUpdated)
onDataChanged();
}
// +-----------------------------------------------------------
void ft::ChildWindow::disconnectFeatures()
{
bool bUpdated = false;
QList<FaceFeatureNode*> lsFeats = m_pFaceWidget->getSelectedFeatures();
QList<FaceFeatureNode*>::iterator oFirst, oSecond;
for(oFirst = lsFeats.begin(); oFirst != lsFeats.end(); oFirst++)
{
for(oSecond = oFirst + 1; oSecond != lsFeats.end(); oSecond++)
{
m_pFaceWidget->disconnectFaceFeatures(*oFirst, *oSecond);
m_pFaceDatasetModel->disconnectFeatures((*oFirst)->getID(), (*oSecond)->getID());
bUpdated = true;
}
}
if(bUpdated)
onDataChanged();
}
// +-----------------------------------------------------------
bool ft::ChildWindow::positionFeatures(std::vector<QPoint> vPoints)
{
QList<FaceFeatureNode *> lFeats = m_pFaceWidget->getFaceFeatures(vPoints.size()); // this call automatically adds or removes features to match vPoints.size()
// Adjust the dataset so it has the same amount of features as the widget
vector<FaceFeature*> vFeats = m_pFaceDatasetModel->getFeatures(m_iCurrentImage);
int iDiff = lFeats.size() - vFeats.size();
// If the widget has more features than the dataset, add the difference
if (iDiff > 0)
{
for (int i = 0; i < iDiff; i++)
m_pFaceDatasetModel->addFeature(lFeats.size() + i - 1, 0, 0);
}
// Else, if the widget has less features than the dataset, remove the difference
else if (iDiff < 0)
{
for (int i = 0; i < abs(iDiff); i++)
m_pFaceDatasetModel->removeFeature(lFeats.size() - i - 1);
}
// Move the features
FaceFeatureNode *pFeat;
for (unsigned int i = 0; i < vPoints.size(); i++)
{
pFeat = lFeats.at(i);
pFeat->setPos(vPoints[i]);
}
updateFeaturesInDataset();
setWindowModified(true);
emit onDataModified();
return true;
}
================================================
FILE: src/childwindow.h
================================================
/*
* Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)
*
* This file is part of FLAT.
*
* FLAT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FLAT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CHILDWINDOW_H
#define CHILDWINDOW_H
#include "facedatasetmodel.h"
#include "facewidget.h"
#include <QtGui>
#include <QWidget>
namespace ft
{
/**
* MDI-child window class used to display and edit the face annotation datasets.
*/
class ChildWindow : public QWidget
{
Q_OBJECT
public:
/**
* Class constructor.
* @param pParent Instance of the widget that will be the parent of this window.
*/
explicit ChildWindow(QWidget* pParent = 0);
/**
* Class destructor.
*/
virtual ~ChildWindow();
/**
* Gets the list model used to display information about the contents of the
* face annotation dataset handled by this window.
* @return An instance of a QAbstractListModel that can be used with any subclass of QAbstractItemView
* to display lists, icons or trees with the face annotation dataset contents.
*/
FaceDatasetModel* dataModel() const;
/**
* Gets the list selection model used to display selection information about the contents of the
* face annotation dataset handled by this window.
* @return An instance of a QItemSelectionModel that can be used with any subclass of QAbstractItemView
* to display lists, icons or tress with the face annotation dataset contents.
*/
QItemSelectionModel* selectionModel() const;
/**
* Saves the contents of the face annotation dataset in this window to the current file
* (stored in the windowFilePath property). The file is saved in the YAML format, as defined
* in the FaceDataset class.
*/
bool save(QString &sMsgError);
/**
* Saves the contents of the face annotation dataset in this window to the given file.
* The file is saved in the YAML format, as defined in the FaceDataset class.
* @param sFileName QString with the path and name of the file to save the dataset to.
*/
bool saveToFile(const QString &sFileName, QString &sMsgError);
/**
* Loads the contents of the face annotation dataset from the given file into this window.
* The file must be in the YAML format, as defined in the FaceDataset class.
* @param sFileName QString with the path and name of the file to load the dataset from.
*/
bool loadFromFile(const QString &sFileName, QString &sMsgError);
/**
* Sets the zoom level of the image in display in terms of the steps defined in the zoom
* slider from 1 to 21, with 11 (the middle value) as "no zoom" (i.e. 100% view).
* @param iLevel Integer with the zoom level to set.
*/
void setZoomLevel(const int iLevel);
/**
* Gets the current zoom level of the image in display in terms of the steps defined in the zoom
* slider from 1 to 21, with 11 (the middle value) as "no zoom" (i.e. 100% view).
* @return Integer with the current zoom level.
*/
int getZoomLevel() const;
/**
* Performs one step of zoom in.
*/
void zoomIn();
/**
* Performs one step of zoom out.
*/
void zoomOut();
/**
* Indicates if the face feature nodes are on display.
* @return Boolean indicating if the face feature nodes are being displayed or not.
*/
bool displayFaceFeatures() const;
/**
* Updates the indication on if the face feature nodes shall be displayed or not.
* @param bValue Boolean with the new value (true means show, false means hide).
*/
void setDisplayFaceFeatures(const bool bValue);
/**
* Indicates if the face feature edges are on display.
* @return Boolean indicating if the face feature edges are being displayed or not.
*/
bool displayConnections() const;
/**
* Updates the indication on if the face feature edges shall be displayed or not.
* @param bValue Boolean with the new value (true means show, false means hide).
*/
void setDisplayConnections(const bool bValue);
/**
* Indicates if the identifiers of the face feature nodes are on display.
* @return Boolean indicating if the identifiers of the face feature nodes are being displayed or not.
*/
bool displayFeatureIDs() const;
/**
* Updates the indication on if the identifiers of the face feature nodes shall be displayed or not.
* @param bValue Boolean with the new value (true means show, false means hide).
*/
void setDisplayFeatureIDs(const bool bValue);
/**
* Queries the list of existing face feature nodes.
* @param Const reference to the QList of existing nodes.
*/
const QList<FaceFeatureNode*>& getFaceFeatures() const;
/**
* Queries the selected face feature nodes.
* @return QList with the pointers to the selected face feature nodes.
*/
QList<FaceFeatureNode*> getSelectedFeatures() const;
/**
* Queries the selected face feature edges.
* @return QList with the pointers to the selected face feature edges.
*/
QList<FaceFeatureEdge*> getSelectedConnections() const;
/**
* Sets the menu to be displayed upon events of context menu on the face features editor.
* The actions used in the menu must be controlled by the caller.
* @param pMenu Instance of the QMenu to be used for the context of the editor.
*/
void setContextMenu(QMenu *pMenu);
/**
* Adds a new feature to the face feature editor, in the given position.
* @param oPos QPoint with the position (x, y) of the new feature.
*/
void addFeature(const QPoint &oPos);
/**
* Removes the selected features and all their connections.
*/
void removeSelectedFeatures();
/**
* Connects the selected features among themselves.
*/
void connectFeatures();
/**
* Disconnects the selected features.
*/
void disconnectFeatures();
/**
* Moves the face features in the image currently on display according to the given
* list of positions. If the number of face features is different than the number of
* points, the model is updated accordingly (with features added or removed to match
* the number of points).
* @param vPoints A std::vector with the list of QPoint instances with the new
* features' positions.
* @return Boolean indicating if the reposition was successfully done or not.
*/
bool positionFeatures(std::vector<QPoint> vPoints);
protected:
/**
* Refreshes the positions of face features in the editor based on the values in the dataset.
*/
void refreshFeaturesInWidget();
/**
* Updates the positions of face features in the dataset based on the values in the editor.
*/
void updateFeaturesInDataset();
protected slots:
/**
* Captures the indication of changes in the image scale factor (zoom).
* @param dScaleFactor Double with the new scale factor for the image.
*/
void onScaleFactorChanged(const double dScaleFactor);
/**
* Captures the indication that face features were selected or unselected in the editor.
*/
void onFaceFeaturesSelectionChanged();
/**
* Captures indications of changes in the data model or the face widget
* (so the UI can be updated accordingly).
* @param bModified Boolean indicating if the child window shall be marked as modified or not.
* The default is true.
*/
void onDataChanged(const bool bModified = true);
/**
* Captures indication of changes in the current selected image on the selection model.
*/
void onCurrentChanged(const QModelIndex &oCurrent, const QModelIndex &oPrevious);
signals:
/**
* Signal to indicate changes in the data model (so the UI can be updated accordingly).
*/
void onDataModified();
/**
* Signal to indicate that the selection of face features changed in the editor.
* The selection can be queried through getSelectedFeatures() and getSelectedConnections().
*/
void onFeaturesSelectionChanged();
/**
* Signal to indicate an update in the UI due to changes in the selection model.
* @param sImageName QString with the name of the current selected face image.
* @param iZoomLevel Current level of zoom in the face image widget.
*/
void onUIUpdated(const QString sImageName, const int iZoomLevel);
private:
/** Index of the current displayed face image. */
int m_iCurrentImage;
/** Widget used to display face images and edit facial features. */
FaceWidget *m_pFaceWidget;
/** Instance of the model used to encapsulate the access of the face dataset to Qt view components such as QListView. */
FaceDatasetModel *m_pFaceDatasetModel;
/** Selection model used to represent the selection of items in Qt view components such as QListView. */
QItemSelectionModel *m_pFaceSelectionModel;
};
}
#endif // CHILDWINDOW_H
================================================
FILE: src/facedataset.cpp
================================================
/*
* Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)
*
* This file is part of FLAT.
*
* FLAT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FLAT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "facedataset.h"
#include <QDebug>
#include <QFileInfo>
#include <QDir>
#include <QApplication>
using namespace std;
// +-----------------------------------------------------------
ft::FaceDataset::FaceDataset()
{
m_iNumFeatures = 0;
}
// +-----------------------------------------------------------
ft::FaceDataset::~FaceDataset()
{
clear();
}
// +-----------------------------------------------------------
int ft::FaceDataset::size() const
{
return m_vSamples.size();
}
// +-----------------------------------------------------------
bool ft::FaceDataset::loadFromFile(const QString &sFileName, QString &sMsgError)
{
/******************************************************
* Open and read the file
******************************************************/
QFile oFile(sFileName);
if (!oFile.open(QFile::ReadOnly))
{
sMsgError = QString(QApplication::translate("FaceDataset", "it was not possible to read from file [%1]")).arg(sFileName);
return false;
}
// Used to resolve the image file names relative to the saved file path
QDir oBase(QFileInfo(sFileName).absolutePath());
QTextStream oData(&oFile);
QString sData = oData.readAll();
oFile.close();
/******************************************************
* Parse the xml document
******************************************************/
QDomDocument oDoc;
QString sError;
int iLine, iColumn;
if(!oDoc.setContent(sData, true, &sError, &iLine, &iColumn))
{
sMsgError = QString(QApplication::translate("FaceDataset", "there is an error in the contents of the file [%1]: error [%2], line [%3], column [%4]")).arg(sFileName, sError, QString::number(iLine), QString::number(iColumn));
return false;
}
// Root node
QDomElement oRoot = oDoc.firstChildElement("FaceDataset");
if(oRoot.isNull())
{
sMsgError = QString(QApplication::translate("FaceDataset", "there is an error in the contents of the file [%1]: the node '%2' does not exist")).arg(sFileName, "FaceDataset");
return false;
}
int iNumFeats = oRoot.attribute("numberOfFeatures", "-1").toInt();
if(iNumFeats < 0)
{
sMsgError = QString(QApplication::translate("FaceDataset", "there is an error in the contents of the file [%1]: the attribute '%2' does not exist or it contains an invalid value")).arg(sFileName, "numberOfFeatures");
return false;
}
// Sample images
QDomElement oSamples = oRoot.firstChildElement("Samples");
if(oSamples.isNull())
{
sMsgError = QString(QApplication::translate("FaceDataset", "there is an error in the contents of the file [%1]: the node '%2' does not exist")).arg(sFileName, "Samples");
return false;
}
vector<FaceImage*> vSamples;
for(QDomElement oElement = oSamples.firstChildElement(); !oElement.isNull(); oElement = oElement.nextSiblingElement())
{
FaceImage *pSample = new FaceImage();
if(!pSample->loadFromXML(oElement, sError, iNumFeats))
{
foreach(FaceImage *pSamp, vSamples)
delete(pSamp);
delete pSample;
sMsgError = QString(QApplication::translate("FaceDataset", "there is an error in the contents of the file [%1]: %2")).arg(sFileName, sError);
return false;
}
pSample->setFileName(oBase.absoluteFilePath(pSample->fileName()));
vSamples.push_back(pSample);
}
clear();
m_iNumFeatures = iNumFeats;
m_vSamples = vSamples;
return true;
}
// +-----------------------------------------------------------
bool ft::FaceDataset::saveToFile(const QString &sFileName, QString &sMsgError) const
{
/******************************************************
* Create the xml document
******************************************************/
QDomDocument oDoc;
// Processing instruction
QDomProcessingInstruction oInstr = oDoc.createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'");
oDoc.appendChild(oInstr);
// Root node
QDomElement oRoot = oDoc.createElementNS("https://github.com/luigivieira/Facial-Landmarks-Annotation-Tool", "FaceDataset");
oDoc.appendChild(oRoot);
oRoot.setAttribute("numberOfFeatures", m_iNumFeatures);
// Sample images
QDomElement oSamples = oDoc.createElement("Samples");
oRoot.appendChild(oSamples);
// Used to make the image file names relative to the saved file path
QDir oBase(QFileInfo(sFileName).absolutePath());
QString sSave;
foreach(FaceImage *pImage, m_vSamples)
{
sSave = pImage->fileName(); // Save the absolute path (it is still used in the editor)
pImage->setFileName(oBase.relativeFilePath(pImage->fileName()));
pImage->saveToXML(oSamples);
pImage->setFileName(sSave);
}
/******************************************************
* Save the file
******************************************************/
QFile oFile(sFileName);
if (!oFile.open(QFile::WriteOnly | QFile::Truncate))
{
sMsgError = QString(QApplication::translate("FaceDataset", "it was not possible to write to file [%1]")).arg(sFileName);
return false;
}
QTextStream oData(&oFile);
oDoc.save(oData, 4);
oFile.close();
return true;
}
// +-----------------------------------------------------------
void ft::FaceDataset::clear()
{
foreach(FaceImage *pImage, m_vSamples)
delete pImage;
m_vSamples.clear();
m_iNumFeatures = 0;
}
// +-----------------------------------------------------------
ft::FaceImage* ft::FaceDataset::getImage(const int iIndex) const
{
if(iIndex < 0 || iIndex >= size())
return NULL;
return m_vSamples[iIndex];
}
// +-----------------------------------------------------------
ft::FaceImage* ft::FaceDataset::addImage(const QString &sFileName)
{
foreach(FaceImage *pImage, m_vSamples)
if(pImage->fileName() == sFileName)
return pImage;
FaceImage *pRet = new FaceImage(sFileName);
m_vSamples.push_back(pRet);
return pRet;
}
// +-----------------------------------------------------------
bool ft::FaceDataset::removeImage(const int iIndex)
{
if(iIndex < 0 || iIndex >= size())
return false;
FaceImage *pImage = m_vSamples[iIndex];
m_vSamples.erase(m_vSamples.begin() + iIndex);
delete pImage;
return true;
}
// +-----------------------------------------------------------
int ft::FaceDataset::numFeatures() const
{
return m_iNumFeatures;
}
// +-----------------------------------------------------------
void ft::FaceDataset::setNumFeatures(int iNumFeats)
{
m_iNumFeatures = iNumFeats;
}
// +-----------------------------------------------------------
void ft::FaceDataset::addFeature(int iID, float x, float y)
{
FaceFeature *pFeat;
foreach(FaceImage *pSample, m_vSamples)
pFeat = pSample->addFeature(iID, x, y);
m_iNumFeatures++;
}
// +-----------------------------------------------------------
bool ft::FaceDataset::removeFeature(const int iIndex)
{
if(iIndex < 0 || iIndex >= m_iNumFeatures)
return false;
foreach(FaceImage *pSample, m_vSamples)
pSample->removeFeature(iIndex);
m_iNumFeatures--;
return true;
}
// +-----------------------------------------------------------
bool ft::FaceDataset::connectFeatures(int iIDSource, int iIDTarget)
{
foreach(FaceImage *pSample, m_vSamples)
pSample->connectFeatures(iIDSource, iIDTarget);
return true;
}
// +-----------------------------------------------------------
bool ft::FaceDataset::disconnectFeatures(int iIDSource, int iIDTarget)
{
foreach(FaceImage *pSample, m_vSamples)
pSample->disconnectFeatures(iIDSource, iIDTarget);
return true;
}
// +-----------------------------------------------------------
vector<ft::FaceFeature*> ft::FaceDataset::getImageFeatures(const int iIndex)
{
if(iIndex < 0 || iIndex >= (int) m_vSamples.size())
return vector<FaceFeature*>();
return m_vSamples[iIndex]->getFeatures();
}
================================================
FILE: src/facedataset.h
================================================
/*
* Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)
*
* This file is part of FLAT.
*
* FLAT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FLAT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FACEDATASET_H
#define FACEDATASET_H
#include "faceimage.h"
#include "facefeature.h"
#include <QDomDocument>
#include <vector>
namespace ft
{
/**
* Represents a dataset of facial images that can be annotated with facial landmarks and
* prototypical emotional labels.
*/
class FaceDataset
{
public:
/**
* Class constructor.
*/
FaceDataset();
/**
* Class destructor.
*/
virtual ~FaceDataset();
/**
* Returns the number of face samples in the dataset.
* @return Integer with the number of face samples in this dataset.
*/
int size() const;
/**
* Loads (unserializes) the instance from the given text file in the YAML format
* (YAML Ain't Markup Language - http://en.wikipedia.org/wiki/YAML).
* @param sFileName QString with the name of the file to read the data from.
* @param sMsgError QString to receive the error message in case the method fails.
* @return Boolean indicating if the loading was successful (true) of failed (false).
*/
bool loadFromFile(const QString &sFileName, QString &sMsgError);
/**
* Saves (serializes) the instance to the given file in the YAML format
* (YAML Ain't Markup Language - http://en.wikipedia.org/wiki/YAML).
* @param sFileName QString with the name of the file to write the data to.
* @param sMsgError QString to receive the error message in case the method fails.
* @return Boolean indicating if the saving was successful (true) of failed (false).
*/
bool saveToFile(const QString &sFileName, QString &sMsgError) const;
/**
* Clear the face annotation dataset.
*/
void clear();
/**
* Gets the face image for the given index. The index must be in the range [0, count - 1],
* where count is the number of face images in the dataset.
* @param iIndex Integer with the index of the image file to load.
* @return Pointer to a FaceImage with the face image data. If the method fails, NULL is returned.
*/
FaceImage* getImage(const int iIndex) const;
/**
* Adds a new image to the face annotation dataset. All other data (landmarks, connections, etc)
* are created with default values.
* @param sFileName QString with the path and filename of the image file to be added to the dataset.
* @return Pointer to a FaceImage with the new image added to the dataset or NULL if failed.
*/
FaceImage* addImage(const QString &sFileName);
/**
* Removes an image from the face annotation dataset. All other data (landmarks, connections, etc)
* are also removed.
* @param iIndex Integer with the index of the image to remove.
* @return Boolean indicating if the image was removed (true) or not (false, in case
* the given index is out of range).
*/
bool removeImage(const int iIndex);
/**
* Queries the number of facial features in the dataset (applicable to all images).
* @return Integer with the number of face features in the dataset.
*/
int numFeatures() const;
/**
* Updates the number of facial features in the dataset (applicable to all images).
* @param iNumFeats Integer with the new number of facial features for the dataset.
*/
void setNumFeatures(int iNumFeats);
/**
* Adds a new feature to the face dataset. A new feature is added to all
* face images in the dataset in the same coordinates.
* @param iID Integer with the identifier of the face feature.
* @param x Float with the x coordinate for the face features.
* @param y Float with the y coordinate for the face features.
*/
void addFeature(int iID, float x = 0.0f, float y = 0.0f);
/**
* Removes an existing feature from the face dataset. The feature is removed from all
* face images in the dataset.
* @param iIndex Integer with the index of the feature to remove.
* @return Boolean indicating if the feature was successfully removed (true) or not (false).
*/
bool removeFeature(const int iIndex);
/**
* Connects the two given features.
* @param iIDSource Integer with the ID of the source feature.
* @param iIDTarget Integer with the ID of the target feature.
* @return Boolean indicating if the connection was successfully created.
*/
bool connectFeatures(int iIDSource, int iIDTarget);
/**
* Disconnects the two given features.
* @param iIDSource Integer with the ID of the source feature.
* @param iIDTarget Integer with the ID of the target feature.
* @return Boolean indicating if the connection was successfully removed.
*/
bool disconnectFeatures(int iIDSource, int iIDTarget);
/**
* Gets the list of face features in the given image index.
* @param iIndex Integer with the index of the image to query the face features.
* @param A vector of FaceFeature instances with the face features in the image. It returns
* an empty vector if the given index is invalid.
*/
std::vector<FaceFeature*> getImageFeatures(const int iIndex);
private:
/** Vector of sample face images. */
std::vector<FaceImage*> m_vSamples;
/** Number of face features in the dataset (i.e. applicable to all images). */
int m_iNumFeatures;
};
}
#endif // FACEDATASET_H
================================================
FILE: src/facedatasetmodel.cpp
================================================
/*
* Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)
*
* This file is part of FLAT.
*
* FLAT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FLAT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "facedatasetmodel.h"
#include <assert.h>
#include <QFileInfo>
#include <QApplication>
#include <QDebug>
// +-----------------------------------------------------------
ft::FaceDatasetModel::FaceDatasetModel(QObject *pParent):
QAbstractListModel(pParent)
{
m_pFaceDataset = new FaceDataset();
}
// +-----------------------------------------------------------
ft::FaceDatasetModel::~FaceDatasetModel()
{
delete m_pFaceDataset;
}
// +-----------------------------------------------------------
int ft::FaceDatasetModel::rowCount(const QModelIndex &oParent) const
{
Q_UNUSED(oParent);
return m_pFaceDataset->size();
}
// +-----------------------------------------------------------
int ft::FaceDatasetModel::columnCount(const QModelIndex &oParent) const
{
Q_UNUSED(oParent);
return 4; // There are four columns of data: [Image Name]
}
// +-----------------------------------------------------------
QVariant ft::FaceDatasetModel::headerData(int iSection, Qt::Orientation eOrientation, int iRole) const
{
Q_UNUSED(eOrientation);
switch(iRole)
{
// Display data (the dataset contents)
case Qt::DisplayRole:
switch(iSection)
{
case 0: // [Image Name]
return QApplication::translate("FaceDatasetModel", "Image Name");
case 1: // [File Path]
return QApplication::translate("FaceDatasetModel", "File Path");
default:
return QVariant();
}
case Qt::DecorationRole:
if(iSection == 0)
return QApplication::translate("FaceDatasetModel", "Thumbnail");
else
return QVariant();
default:
return QVariant();
}
}
// +-----------------------------------------------------------
QVariant ft::FaceDatasetModel::data(const QModelIndex &oIndex, int iRole) const
{
FaceImage *pImage = m_pFaceDataset->getImage(oIndex.row());
if(!pImage)
return QVariant();
QPixmap oPixmap;
switch(iRole)
{
// Data to be displayed on ModelViews
case Qt::DisplayRole:
switch(oIndex.column())
{
case 0: // [Image Name]
return QFileInfo(pImage->fileName()).baseName();
case 1: // [File Path]
return pImage->fileName();
default:
return QVariant();
}
// Decoration data (image thumbnails for the first column)
case Qt::DecorationRole:
if(oIndex.column() == 0)
return m_lCachedThumbnails[oIndex.row()];
else
return QVariant();
// Raw data from the face dataset
case Qt::UserRole:
switch(oIndex.column())
{
case 0: // The complete image file name+path
return pImage->fileName();
case 2: // The image data
oPixmap = pImage->pixMap();
if(oPixmap.isNull())
oPixmap = QPixmap(":/images/brokenimage");
return oPixmap;
default:
return QVariant();
}
// Any other role, return invalid
default:
return QVariant();
}
}
// +-----------------------------------------------------------
bool ft::FaceDatasetModel::setData(const QModelIndex &oIndex, const QVariant &oValue, int iRole)
{
FaceImage *pImage = m_pFaceDataset->getImage(oIndex.row());
if(!pImage)
return false;
if(iRole == Qt::UserRole)
{
switch(oIndex.column())
{
case 0: // [Image Name]
return false;
default:
return false;
}
}
else
return false;
}
// +-----------------------------------------------------------
bool ft::FaceDatasetModel::loadFromFile(const QString &sFileName, QString &sMsgError)
{
beginResetModel();
bool bRet = m_pFaceDataset->loadFromFile(sFileName, sMsgError);
// Rebuild the thumbnails cache
if(bRet)
{
m_lCachedThumbnails.clear();
for(int i = 0; i < m_pFaceDataset->size(); i++)
m_lCachedThumbnails.append(buildThumbnail(i));
}
endResetModel();
return bRet;
}
// +-----------------------------------------------------------
bool ft::FaceDatasetModel::saveToFile(const QString &sFileName, QString &sMsgError) const
{
return m_pFaceDataset->saveToFile(sFileName, sMsgError);
}
// +-----------------------------------------------------------
bool ft::FaceDatasetModel::addImages(const QStringList &lImageFiles)
{
int iFirst = m_pFaceDataset->size();
int iLast = iFirst + lImageFiles.size() - 1;
beginInsertRows(QModelIndex(), iFirst, iLast);
for(int i = 0; i < lImageFiles.size(); i++)
{
m_pFaceDataset->addImage(lImageFiles[i]);
m_lCachedThumbnails.append(buildThumbnail(m_pFaceDataset->size() - 1));
}
endInsertRows();
emit dataChanged(index(iFirst), index(iLast));
return true;
}
// +-----------------------------------------------------------
bool ft::FaceDatasetModel::removeImages(const QList<int> &lImageIndexes)
{
int iFirst = lImageIndexes.first();
int iLast = lImageIndexes.last();
beginRemoveRows(QModelIndex(), iFirst, iLast);
for(int i = lImageIndexes.size() - 1; i >= 0; i--)
{
m_pFaceDataset->removeImage(lImageIndexes[i]);
m_lCachedThumbnails.removeAt(lImageIndexes[i]);
}
endRemoveRows();
emit dataChanged(index(0), index(lImageIndexes.size() - 1));
return true;
}
// +-----------------------------------------------------------
void ft::FaceDatasetModel::addFeature(int iID, float x, float y)
{
m_pFaceDataset->addFeature(iID, x, y);
}
// +-----------------------------------------------------------
void ft::FaceDatasetModel::removeFeature(const int iIndex)
{
m_pFaceDataset->removeFeature(iIndex);
}
// +-----------------------------------------------------------
void ft::FaceDatasetModel::connectFeatures(int iIDSource, int iIDTarget)
{
m_pFaceDataset->connectFeatures(iIDSource, iIDTarget);
}
// +-----------------------------------------------------------
void ft::FaceDatasetModel::disconnectFeatures(int iIDSource, int iIDTarget)
{
m_pFaceDataset->disconnectFeatures(iIDSource, iIDTarget);
}
// +-----------------------------------------------------------
std::vector<ft::FaceFeature*> ft::FaceDatasetModel::getFeatures(const int iIndex)
{
return m_pFaceDataset->getImageFeatures(iIndex);
}
// +-----------------------------------------------------------
int ft::FaceDatasetModel::numFeatures() const
{
return m_pFaceDataset->numFeatures();
}
// +-----------------------------------------------------------
QPixmap ft::FaceDatasetModel::buildThumbnail(const int iIndex)
{
QPixmap oImage;
FaceImage *pImage = m_pFaceDataset->getImage(iIndex);
if(!pImage)
oImage = QPixmap(":/images/imagemissing");
else
{
oImage = pImage->pixMap();
if(oImage.isNull())
oImage = QPixmap(":/images/imagemissing");
}
oImage = oImage.scaled(50, 50, Qt::IgnoreAspectRatio);
return oImage;
}
// +-----------------------------------------------------------
Qt::ItemFlags ft::FaceDatasetModel::flags(const QModelIndex &oIndex) const
{
switch(oIndex.column())
{
case 0: // [Image Name]
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
default:
return Qt::NoItemFlags;
}
}
================================================
FILE: src/facedatasetmodel.h
================================================
/*
* Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)
*
* This file is part of FLAT.
*
* FLAT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FLAT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FACEDATASETMODEL_H
#define FACEDATASETMODEL_H
#include "facedataset.h"
#include <QAbstractListModel>
#include <QList>
#include <QPixmap>
namespace ft
{
/**
* Model class that encapsulates the access to the FaceDataset in order to provide data for
* the view classes in Qt (such as QListView).
*/
class FaceDatasetModel : public QAbstractListModel
{
public:
/**
* Class constructor.
* @param pParent Instance of a QObject with the parent of the model. Default is NULL.
*/
FaceDatasetModel(QObject *pParent = NULL);
/**
* Virtual class destructor.
*/
virtual ~FaceDatasetModel();
/**
* Returns the number of rows under the given parent. When the parent is valid
* it means that rowCount is returning the number of children of parent.
* @param oParent A QModelIndex with the parent to be used in the query.
* @return Integer with the number of rows under the given parent.
*/
int rowCount(const QModelIndex &oParent = QModelIndex()) const;
/**
* Returns the number of columns for the children of the given parent.
* @param oParent A QModelIndex with the parent to be used in the query.
* @return Integer with the number of columns for t
gitextract_91x_51e_/ ├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── example/ │ └── example.fad ├── src/ │ ├── aboutwindow.cpp │ ├── aboutwindow.h │ ├── aboutwindow.ui │ ├── application.cpp │ ├── application.h │ ├── childwindow.cpp │ ├── childwindow.h │ ├── facedataset.cpp │ ├── facedataset.h │ ├── facedatasetmodel.cpp │ ├── facedatasetmodel.h │ ├── facefeature.cpp │ ├── facefeature.h │ ├── facefeatureedge.cpp │ ├── facefeatureedge.h │ ├── facefeaturenode.cpp │ ├── facefeaturenode.h │ ├── facefitconfig.cpp │ ├── facefitconfig.h │ ├── facefitconfig.ui │ ├── faceimage.cpp │ ├── faceimage.h │ ├── facewidget.cpp │ ├── facewidget.h │ ├── facewidgetscene.cpp │ ├── facewidgetscene.h │ ├── main.cpp │ ├── mainwindow.cpp │ ├── mainwindow.h │ ├── mainwindow.ui │ ├── resources/ │ │ └── images/ │ │ ├── brokenimage.xcf │ │ └── noface.xcf │ ├── resources.qrc │ ├── utils.cpp │ └── utils.h └── version.h.in
SYMBOL INDEX (36 symbols across 26 files)
FILE: src/aboutwindow.h
function namespace (line 25) | namespace Ui
function namespace (line 30) | namespace ft
FILE: src/application.h
function namespace (line 29) | namespace ft
FILE: src/childwindow.cpp
function QItemSelectionModel (line 80) | QItemSelectionModel* ft::ChildWindow::selectionModel() const
function foreach (line 320) | foreach(FaceFeatureNode *pNode, lsFeats)
FILE: src/childwindow.h
function namespace (line 29) | namespace ft
FILE: src/facedataset.cpp
function foreach (line 153) | foreach(FaceImage *pImage, m_vSamples)
FILE: src/facedataset.h
function namespace (line 30) | namespace ft
FILE: src/facedatasetmodel.cpp
function QVariant (line 56) | QVariant ft::FaceDatasetModel::headerData(int iSection, Qt::Orientation ...
function QVariant (line 88) | QVariant ft::FaceDatasetModel::data(const QModelIndex &oIndex, int iRole...
function QPixmap (line 257) | QPixmap ft::FaceDatasetModel::buildThumbnail(const int iIndex)
FILE: src/facedatasetmodel.h
function namespace (line 29) | namespace ft
FILE: src/facefeature.cpp
function foreach (line 149) | foreach(int iID, m_vConnections)
FILE: src/facefeature.h
function namespace (line 27) | namespace ft
FILE: src/facefeatureedge.cpp
function QRectF (line 75) | QRectF ft::FaceFeatureEdge::boundingRect() const
FILE: src/facefeatureedge.h
function namespace (line 25) | namespace ft
FILE: src/facefeaturenode.cpp
function foreach (line 70) | foreach(FaceFeatureEdge *pEdge, m_lEdges)
function QRectF (line 82) | QRectF ft::FaceFeatureNode::boundingRect() const
function QVariant (line 133) | QVariant ft::FaceFeatureNode::itemChange(GraphicsItemChange eChange, con...
FILE: src/facefeaturenode.h
function namespace (line 26) | namespace ft
FILE: src/facefitconfig.cpp
function QString (line 68) | QString ft::FaceFitConfig::getFaceFitPath()
FILE: src/facefitconfig.h
function namespace (line 25) | namespace Ui
function namespace (line 30) | namespace ft
FILE: src/faceimage.cpp
function QString (line 50) | QString ft::FaceImage::fileName() const
function QPixmap (line 129) | QPixmap ft::FaceImage::pixMap() const
FILE: src/faceimage.h
function namespace (line 33) | namespace ft
FILE: src/facewidget.cpp
function foreach (line 415) | foreach(FaceFeatureNode *pFeat, lFeats)
FILE: src/facewidget.h
function namespace (line 32) | namespace Ui {
function namespace (line 36) | namespace ft
FILE: src/facewidgetscene.h
function namespace (line 26) | namespace ft
FILE: src/main.cpp
function main (line 26) | int main(int argc, char *argv[])
FILE: src/mainwindow.cpp
function foreach (line 417) | foreach(FaceFeatureNode *pFeat, lFeats)
FILE: src/mainwindow.h
function namespace (line 29) | namespace Ui {
function namespace (line 33) | namespace ft
FILE: src/utils.cpp
function QString (line 36) | QString ft::Utils::shortenPath(const QString &sPath, int iMaxLen)
FILE: src/utils.h
function namespace (line 27) | namespace ft
Condensed preview — 41 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (372K chars).
[
{
"path": ".gitignore",
"chars": 38,
"preview": "# Ignore the build directory\n**/build/"
},
{
"path": "CMakeLists.txt",
"chars": 2378,
"preview": "# Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n#\n# This file is part of FLAT.\n#\n# FLAT is free "
},
{
"path": "LICENSE",
"chars": 35147,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "README.md",
"chars": 3037,
"preview": "# FLAT - Facial Landmarks Annotation Tool\n\nA visual editor for manually annotating facial landmarks in images of human f"
},
{
"path": "example/example.fad",
"chars": 93799,
"preview": "<?xml version='1.0' encoding='UTF-8'?>\n<FaceDataset xmlns=\"https://github.com/luigivieira/Facial-Landmarks-Annotation-To"
},
{
"path": "src/aboutwindow.cpp",
"chars": 1334,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/aboutwindow.h",
"chars": 1397,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/aboutwindow.ui",
"chars": 6587,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>AboutWindow</class>\n <widget class=\"QDialog\" name=\"Abo"
},
{
"path": "src/application.cpp",
"chars": 5207,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/application.h",
"chars": 3256,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/childwindow.cpp",
"chars": 12837,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/childwindow.h",
"chars": 9255,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/facedataset.cpp",
"chars": 8352,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/facedataset.h",
"chars": 5944,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/facedatasetmodel.cpp",
"chars": 7499,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/facedatasetmodel.h",
"chars": 7518,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/facefeature.cpp",
"chars": 4680,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/facefeature.h",
"chars": 2978,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/facefeatureedge.cpp",
"chars": 2958,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/facefeatureedge.h",
"chars": 3079,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/facefeaturenode.cpp",
"chars": 5372,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/facefeaturenode.h",
"chars": 4333,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/facefitconfig.cpp",
"chars": 2702,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/facefitconfig.h",
"chars": 1950,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/facefitconfig.ui",
"chars": 2508,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>FaceFitConfig</class>\n <widget class=\"QDialog\" name=\"F"
},
{
"path": "src/faceimage.cpp",
"chars": 5666,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/faceimage.h",
"chars": 5095,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/facewidget.cpp",
"chars": 14907,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/facewidget.h",
"chars": 10557,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/facewidgetscene.cpp",
"chars": 1205,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/facewidgetscene.h",
"chars": 1449,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/main.cpp",
"chars": 1190,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/mainwindow.cpp",
"chars": 27367,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/mainwindow.h",
"chars": 9075,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/mainwindow.ui",
"chars": 29525,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>MainWindow</class>\n <widget class=\"QMainWindow\" name=\""
},
{
"path": "src/resources.qrc",
"chars": 1422,
"preview": "<RCC>\n <qresource prefix=\"/icons\">\n <file alias=\"fat\">resources/icons/fat.png</file>\n <file>resources/i"
},
{
"path": "src/utils.cpp",
"chars": 3975,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "src/utils.h",
"chars": 2324,
"preview": "/*\n * Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT "
},
{
"path": "version.h.in",
"chars": 924,
"preview": "/* Copyright (C) 2016 Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)\n *\n * This file is part of FLAT.\n *\n * FLAT is "
}
]
// ... and 2 more files (download for full content)
About this extraction
This page contains the full source code of the luigivieira/Facial-Landmarks-Annotation-Tool GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 41 files (340.7 KB), approximately 80.3k tokens, and a symbol index with 36 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.