| Modifier and Type | Method and Description |
|---|---|
Session.ResultSetReader |
DMLTransformer.Factory.create(Table table)
Creates transformer (as
Session.ResultSetReader which
transforms rows of a given table into an external representation. |
Session.ResultSetReader |
DeletionTransformer.Factory.create(Table table)
Creates transformer (as
Session.ResultSetReader which
transforms rows of a given table into an external representation. |
protected String |
DMLTransformer.qualifiedTableName(Table t)
Gets qualified table name.
|
| Constructor and Description |
|---|
DMLTransformer(Table table,
OutputStreamWriter scriptFileWriter,
boolean upsertOnly,
int maxBodySize,
Session session,
DBMS targetDBMSConfiguration,
ImportFilterTransformer importFilterTransformer,
ExecutionContext executionContext)
Constructor.
|
UpdateTransformer(Table table,
Set<Column> columns,
OutputStreamWriter scriptFileWriter,
int maxBodySize,
Session session,
DBMS targetDBMSConfiguration,
ImportFilterTransformer importFilterTransformer,
ExecutionContext executionContext)
Constructor.
|
| Modifier and Type | Field and Description |
|---|---|
Table |
Association.destination
The destination table.
|
Table |
RestrictionDefinition.from
Source table.
|
Table |
Association.source
The source table.
|
Table |
PKColumnFilterSource.table |
Table |
DataModel.NoPrimaryKeyException.table |
Table |
RestrictionDefinition.to
Destination table.
|
| Modifier and Type | Method and Description |
|---|---|
Table |
DataModel.getTable(String name)
Gets a table by name.
|
Table |
DataModel.getTableByDisplayName(String displayName)
Gets a table by display name.
|
Table |
DataModel.getTableByOrdinal(int ordinal)
Gets table by
getOrdinal() . |
| Modifier and Type | Method and Description |
|---|---|
Set<Table> |
Table.closure(boolean directed)
Gets the closure of the table.
|
Set<Table> |
Table.closure(Set<Table> tablesToIgnore,
boolean directed)
Gets the closure of the table.
|
Set<Table> |
DataModel.getIndependentTables(Set<Table> tableSet)
Gets all independent tables
(i.e. tables which don't depend on other tables in the set)
of a given table-set.
|
Set<Table> |
DataModel.getIndependentTables(Set<Table> tableSet,
Set<Association> associations)
Gets all independent tables
(i.e. tables which don't depend on other tables in the set)
of a given table-set.
|
List<Table> |
DataModel.getSortedTables()
Gets list of tables sorted by name.
|
Collection<Table> |
DataModel.getTables()
Gets all tables.
|
Set<Table> |
DataModel.normalize(Set<Table> tables)
Normalizes a set of tables.
|
Set<Table> |
Table.unrestrictedClosure(Set<Table> tables)
Gets the closure of the table, ignoring restrictions.
|
| Modifier and Type | Method and Description |
|---|---|
int |
Table.compareTo(Table o) |
List<Column> |
RowIdSupport.getColumns(Table table)
Gets the columns with additional rowid-column of a table
|
String |
DataModel.getDisplayName(Table table)
Gets display name of a table
|
PrimaryKey |
RowIdSupport.getPrimaryKey(Table table)
Gets the primary key of a table.
|
void |
DataModel.save(String file,
Table stable,
String subjectCondition,
ScriptFormat scriptFormat,
List<RestrictionDefinition> restrictionDefinitions,
Map<String,Map<String,double[]>> positions,
List<ExtractionModel.AdditionalSubject> additionalSubjects,
String currentModelSubfolder)
Saves the data model.
|
| Modifier and Type | Method and Description |
|---|---|
void |
DataModel.checkForPrimaryKey(Set<Table> subjects,
boolean forDeletion)
Checks whether all tables in the closure of a given subject have primary keys.
|
Set<Table> |
Table.closure(Set<Table> tablesToIgnore,
boolean directed)
Gets the closure of the table.
|
Set<Table> |
DataModel.getIndependentTables(Set<Table> tableSet)
Gets all independent tables
(i.e. tables which don't depend on other tables in the set)
of a given table-set.
|
Set<Table> |
DataModel.getIndependentTables(Set<Table> tableSet,
Set<Association> associations)
Gets all independent tables
(i.e. tables which don't depend on other tables in the set)
of a given table-set.
|
Set<Table> |
DataModel.normalize(Set<Table> tables)
Normalizes a set of tables.
|
Set<Table> |
Table.unrestrictedClosure(Set<Table> tables)
Gets the closure of the table, ignoring restrictions.
|
| Constructor and Description |
|---|
Association(Table source,
Table destination,
boolean insertSourceBeforeDestination,
boolean insertDestinationBeforeSource,
String joinCondition,
DataModel dataModel,
boolean reversed,
Cardinality cardinality)
Constructor.
|
Association(Table source,
Table destination,
boolean insertSourceBeforeDestination,
boolean insertDestinationBeforeSource,
String joinCondition,
DataModel dataModel,
boolean reversed,
Cardinality cardinality,
String author)
Constructor.
|
DataModel.NoPrimaryKeyException(Table table) |
PKColumnFilterSource(Table table,
Column column)
Constructor.
|
RestrictionDefinition(Table from,
Table to,
String name,
String condition,
boolean isIgnored)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
Clause.eval(Table table,
Column column)
Evaluates the clause for a given column.
|
abstract Object |
Clause.Subject.getSubject(Table table,
Column column) |
boolean |
FilterTemplate.matches(Table table,
Column column)
Checks if the template matches a given column.
|
| Modifier and Type | Method and Description |
|---|---|
Session.ResultSetReader |
FlatXMLTransformer.Factory.create(Table table)
Creates transformer (as
Session.ResultSetReader which
transforms rows of a given table into an external representation. |
| Modifier and Type | Field and Description |
|---|---|
Table |
Composite.mainTable
The main table representing the entire composite.
|
| Modifier and Type | Field and Description |
|---|---|
List<Table> |
Composite.componentTables
The component tables.
|
Map<Table,Composite> |
DomainModel.composites
Maps each table to the composite where the table is the main table.
|
Set<Table> |
Domain.tables
Set of tables in this domain.
|
| Modifier and Type | Method and Description |
|---|---|
Composite |
DomainModel.getComposite(Table table)
Gets composite in which a given table is contained.
|
Domain |
DomainModel.getDomain(Table table)
Gets domain of table.
|
| Constructor and Description |
|---|
Composite(Table mainTable,
List<Table> componentTables)
Constructor.
|
| Constructor and Description |
|---|
Composite(Table mainTable,
List<Table> componentTables)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
HelperTableEnhancer.addComments(Writer script,
ScriptType scriptType,
Session session,
DBMS targetDBMSConfiguration,
EntityGraph entityGraph,
Set<Table> progress,
ExecutionContext executionContext) |
void |
FileBasedScriptEnhancer.addComments(Writer script,
ScriptType scriptType,
Session session,
DBMS targetDBMSConfiguration,
EntityGraph entityGraph,
Set<Table> progress,
ExecutionContext executionContext)
Adds nothing.
|
void |
ScriptEnhancer.addComments(Writer script,
ScriptType scriptType,
Session session,
DBMS targetDBMSConfiguration,
EntityGraph entityGraph,
Set<Table> progress,
ExecutionContext executionContext)
Adds comments to the script.
|
void |
HelperTableEnhancer.addEpilog(Writer script,
ScriptType scriptType,
Session session,
DBMS targetDBMSConfiguration,
EntityGraph entityGraph,
Set<Table> progress,
ExecutionContext executionContext) |
void |
FileBasedScriptEnhancer.addEpilog(Writer script,
ScriptType scriptType,
Session session,
DBMS targetDBMSConfiguration,
EntityGraph entityGraph,
Set<Table> progress,
ExecutionContext executionContext)
Adds epilogs.
|
void |
ScriptEnhancer.addEpilog(Writer script,
ScriptType scriptType,
Session session,
DBMS targetDBMSConfiguration,
EntityGraph entityGraph,
Set<Table> progress,
ExecutionContext executionContext)
Adds comments at bottom of the script.
|
void |
HelperTableEnhancer.addProlog(Writer script,
ScriptType scriptType,
Session session,
DBMS targetDBMSConfiguration,
EntityGraph entityGraph,
Set<Table> progress,
ExecutionContext executionContext) |
void |
FileBasedScriptEnhancer.addProlog(Writer script,
ScriptType scriptType,
Session session,
DBMS targetDBMSConfiguration,
EntityGraph entityGraph,
Set<Table> progress,
ExecutionContext executionContext)
Adds prologs.
|
void |
ScriptEnhancer.addProlog(Writer script,
ScriptType scriptType,
Session session,
DBMS targetDBMSConfiguration,
EntityGraph entityGraph,
Set<Table> progress,
ExecutionContext executionContext)
Adds statements at top of the script.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
EntityGraph.addDependencies(Table from,
String fromAlias,
Table to,
String toAlias,
String condition,
int aggregationId,
int dependencyId,
boolean isAssociationReversed)
Adds dependencies.
|
abstract long |
EntityGraph.addEntities(Table table,
String condition,
int today)
Adds entities to the graph.
|
abstract long |
EntityGraph.countEntities(Table table)
Counts the entities of a given table in this graph.
|
abstract long |
EntityGraph.deleteEntities(Table table)
Deletes all entities from a given table.
|
abstract void |
EntityGraph.deleteIndependentEntities(Table table)
Deletes all entities which are marked as independent.
|
abstract void |
EntityGraph.markIndependentEntities(Table table)
Marks all entities of a given table which don't dependent on other entities,
s.t. they can be read and deleted.
|
abstract void |
EntityGraph.markRoots(Table table)
Marks all rows which are not target of a dependency.
|
abstract void |
EntityGraph.readDependentEntities(Table table,
Association association,
ResultSet resultSet,
ResultSetMetaData resultSetMetaData,
Session.ResultSetReader reader,
Map<String,Integer> typeCache,
String selectionSchema,
String originalPKAliasPrefix)
Reads all entities which depends on given entity.
|
abstract void |
EntityGraph.readEntities(Table table,
boolean orderByPK)
Reads all entities of a given table.
|
abstract void |
EntityGraph.readMarkedEntities(Table table,
boolean orderByPK)
Reads all entities of a given table which are marked as independent or as roots.
|
abstract void |
EntityGraph.readMarkedEntities(Table table,
Session.ResultSetReader reader,
String selectionSchema,
String originalPKAliasPrefix,
boolean orderByPK)
Reads all entities of a given table which are marked as independent or as roots.
|
abstract void |
EntityGraph.readNonTraversedDependencies(Table table,
Session.ResultSetReader reader)
Reads all non-traversed dependencies.
|
abstract long |
EntityGraph.readUnfilteredEntityColumns(Table table,
List<Column> columns,
Session.ResultSetReader reader)
Reads some columns of all entities of a given table without using filters.
|
abstract void |
EntityGraph.removeReflexiveDependencies(Table table)
Removes all reflexive dependencies of given table.
|
abstract long |
EntityGraph.resolveAssociation(Table table,
Association association,
int today)
Resolves an association.
|
protected int |
EntityGraph.typeName(Table table) |
abstract void |
EntityGraph.updateEntities(Table table,
Set<Column> columns,
OutputStreamWriter scriptFileWriter,
DBMS targetConfiguration)
Updates columns of a table.
|
| Modifier and Type | Method and Description |
|---|---|
long |
EntityGraph.getSize(Set<Table> tables)
Gets the number of entities form given tables in the graph.
|
| Modifier and Type | Method and Description |
|---|---|
void |
IntraDatabaseEntityGraph.readEntities(Table table,
boolean orderByPK)
Reads all entities of a given table.
|
void |
IntraDatabaseEntityGraph.readMarkedEntities(Table table,
boolean orderByPK)
Reads all entities of a given table which are marked as independent or as
roots.
|
void |
IntraDatabaseEntityGraph.updateEntities(Table table,
Set<Column> columns,
OutputStreamWriter scriptFileWriter,
DBMS targetConfiguration)
Updates columns of a table.
|
| Modifier and Type | Method and Description |
|---|---|
void |
LocalEntityGraph.addDependencies(Table from,
String fromAlias,
Table to,
String toAlias,
String condition,
int aggregationId,
int dependencyId,
boolean isAssociationReversed)
Adds dependencies.
|
long |
LocalEntityGraph.addEntities(Table table,
String condition,
int today)
Adds entities to the graph.
|
long |
LocalEntityGraph.countEntities(Table table)
Counts the entities of a given table in this graph.
|
long |
LocalEntityGraph.deleteEntities(Table table)
Deletes all entities from a given table.
|
void |
LocalEntityGraph.deleteIndependentEntities(Table table)
Deletes all entities which are marked as independent.
|
void |
LocalEntityGraph.markIndependentEntities(Table table)
Marks all entities of a given table which don't dependent on other entities,
s.t. they can be read and deleted.
|
void |
LocalEntityGraph.markRoots(Table table)
Marks all rows which are not target of a dependency.
|
void |
LocalEntityGraph.readDependentEntities(Table table,
Association association,
ResultSet resultSet,
ResultSetMetaData resultSetMetaData,
Session.ResultSetReader reader,
Map<String,Integer> theTypeCache,
String selectionSchema,
String originalPKAliasPrefix)
Reads all entities which depends on given entity.
|
void |
LocalEntityGraph.readEntities(Table table,
boolean orderByPK)
Reads all entities of a given table.
|
void |
LocalEntityGraph.readMarkedEntities(Table table,
boolean orderByPK)
Reads all entities of a given table which are marked as independent or as roots.
|
void |
LocalEntityGraph.readMarkedEntities(Table table,
Session.ResultSetReader reader,
String selectionSchema,
String originalPKAliasPrefix,
boolean orderByPK)
Reads all entities of a given table which are marked as independent or as roots.
|
void |
LocalEntityGraph.readNonTraversedDependencies(Table table,
Session.ResultSetReader reader)
Reads all non-traversed dependencies.
|
long |
LocalEntityGraph.readUnfilteredEntityColumns(Table table,
List<Column> columns,
Session.ResultSetReader reader)
Reads some columns of all entities of a given table without using filters.
|
void |
LocalEntityGraph.removeReflexiveDependencies(Table table)
Removes all reflexive dependencies of given table.
|
long |
LocalEntityGraph.resolveAssociation(Table table,
Association association,
int today)
Resolves an association.
|
void |
LocalEntityGraph.updateEntities(Table table,
Set<Column> columns,
OutputStreamWriter scriptFileWriter,
DBMS targetConfiguration)
Updates columns of a table.
|
| Modifier and Type | Method and Description |
|---|---|
void |
RemoteEntityGraph.addDependencies(Table from,
String fromAlias,
Table to,
String toAlias,
String condition,
int aggregationId,
int dependencyId,
boolean isAssociationReversed)
Adds dependencies.
|
long |
RemoteEntityGraph.addEntities(Table table,
String condition,
int today)
Adds entities to the graph.
|
long |
RemoteEntityGraph.countEntities(Table table)
Counts the entities of a given table in this graph.
|
long |
RemoteEntityGraph.deleteEntities(Table table)
Deletes all entities from a given table.
|
void |
RemoteEntityGraph.deleteIndependentEntities(Table table)
Deletes all entities which are marked as independent.
|
protected String |
RemoteEntityGraph.filteredSelectionClause(Table table,
boolean appylImportFilter)
Gets select clause for reading rows of given type
with respect of the column filters.
|
protected String |
RemoteEntityGraph.filteredSelectionClause(Table table,
String columnPrefix,
Quoting quoting,
boolean appylImportFilter)
Gets select clause for reading rows of given type
with respect of the column filters.
|
void |
RemoteEntityGraph.markIndependentEntities(Table table)
Marks all entities of a given table which don't dependent on other entities,
s.t. they can be read and deleted.
|
void |
RemoteEntityGraph.markRoots(Table table)
Marks all rows which are not target of a dependency.
|
protected String |
RemoteEntityGraph.pkEqualsEntityID(Table table,
String tableAlias,
String entityAlias)
Gets a SQL comparition expression for comparing rows with entities.
|
void |
RemoteEntityGraph.readDependentEntities(Table table,
Association association,
ResultSet resultSet,
ResultSetMetaData resultSetMetaData,
Session.ResultSetReader reader,
Map<String,Integer> typeCache,
String selectionSchema,
String originalPKAliasPrefix)
Reads all entities which depends on given entity.
|
void |
RemoteEntityGraph.readEntities(Table table,
boolean orderByPK)
Reads all entities of a given table.
|
protected long |
RemoteEntityGraph.readEntities(Table table,
boolean orderByPK,
Session.ResultSetReader reader)
Reads all entities of a given table.
|
void |
RemoteEntityGraph.readMarkedEntities(Table table,
boolean orderByPK)
Reads all entities of a given table which are marked as independent or as roots.
|
void |
RemoteEntityGraph.readMarkedEntities(Table table,
Session.ResultSetReader reader,
String selectionSchema,
String originalPKAliasPrefix,
boolean orderByPK)
Reads all entities of a given table which are marked as independent or as roots.
|
void |
RemoteEntityGraph.readNonTraversedDependencies(Table table,
Session.ResultSetReader reader)
Reads all non-traversed dependencies.
|
long |
RemoteEntityGraph.readUnfilteredEntityColumns(Table table,
List<Column> columns,
Session.ResultSetReader reader)
Reads some columns of all entities of a given table without using filters.
|
void |
RemoteEntityGraph.removeReflexiveDependencies(Table table)
Removes all reflexive dependencies of given table.
|
long |
RemoteEntityGraph.resolveAssociation(Table table,
Association association,
int today)
Resolves an association.
|
void |
RemoteEntityGraph.updateEntities(Table table,
Set<Column> columns,
OutputStreamWriter scriptFileWriter,
DBMS targetConfiguration)
Updates columns of a table.
|
| Modifier and Type | Method and Description |
|---|---|
long |
RemoteEntityGraph.getSize(Set<Table> tables)
Gets the number of entities form given tables in the graph.
|
| Modifier and Type | Field and Description |
|---|---|
Table |
ExtractionModel.subject
The table to read from.
|
| Modifier and Type | Method and Description |
|---|---|
Table |
ExtractionModel.AdditionalSubject.getSubject() |
| Modifier and Type | Method and Description |
|---|---|
void |
ExtractionModel.AdditionalSubject.setSubject(Table subject) |
| Constructor and Description |
|---|
ExtractionModel.AdditionalSubject(Table subject,
String condition) |
| Constructor and Description |
|---|
ImportFilterManager(Session localSession,
OutputStreamWriter result,
Set<Table> progress,
Quoting targetQuoting,
ExecutionContext executionContext)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Session.ResultSetReader |
LiquibaseXMLTransformer.Factory.create(Table table)
Creates transformer (as
Session.ResultSetReader which
transforms rows of a given table into an external representation. |
| Modifier and Type | Method and Description |
|---|---|
Set<Table> |
JDBCMetaDataBasedModelElementFinder.findTables(Session session,
ExecutionContext executionContext)
Finds all tables in DB schema.
|
Collection<Table> |
ModelElementFinder.findTables(Session session,
ExecutionContext executionContext)
Finds a set of
Table s. |
| Modifier and Type | Method and Description |
|---|---|
List<Column> |
JDBCMetaDataBasedModelElementFinder.findColumns(Table table,
Session session,
ExecutionContext executionContext)
|
List<Column> |
ModelElementFinder.findColumns(Table table,
Session session,
ExecutionContext executionContext)
|
| Modifier and Type | Method and Description |
|---|---|
void |
ProgressListener.exported(Table table,
long rc)
Rows have been exported.
|
void |
ProgressListenerRegistry.fireExported(Table table,
long rc) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
HtmlDataModelRenderer.excludeFromClosure(Table table) |
protected boolean |
HtmlDataModelRenderer.excludeFromNeighborhood(Table table) |
static String |
HtmlDataModelRenderer.toFileName(Table table)
Gets name of the file containing the HTML render of a given table.
|
| Modifier and Type | Method and Description |
|---|---|
void |
RestrictionModel.addRestriction(Table source,
Association association,
String condition,
String location,
boolean removePreviousRestriction,
Map<String,String> parameters)
Adds a restriction to a association.
|
void |
RestrictionModel.addRestriction(Table source,
Association association,
String condition,
String location,
Map<String,String> parameters)
Adds a restriction to a association.
|
| Modifier and Type | Method and Description |
|---|---|
Map<Table,Long> |
CollectedRowsCounter.getCollectedRowsCount() |
Map<Table,Long> |
CollectedRowsCounter.getDeletedRowsCount() |
| Modifier and Type | Method and Description |
|---|---|
Session.ResultSetReader |
TransformerFactory.create(Table table)
Creates transformer (as
Session.ResultSetReader which
transforms rows of a given table into an external representation. |
void |
CollectedRowsCounter.exported(Table table,
long rc) |
| Modifier and Type | Method and Description |
|---|---|
static String |
SubsettingEngine.asString(Set<Table> progress)
Stringifies progress-set.
|
| Modifier and Type | Method and Description |
|---|---|
static Set<Table> |
CycleFinder.getCycle(Collection<Table> tables)
Gets set of all tables involved in a cycle.
|
static Set<Table> |
SqlUtil.readTableList(CsvFile tableFile,
DataModel dataModel,
Map<String,String> sourceSchemaMapping)
Reads a table-list from CSV-file.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
Quoting.unquotedTableName(Table t,
ExecutionContext executionContext)
Gets unquoted qualified table name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
CycleFinder.Path.fillPath(List<Table> path) |
static Collection<CycleFinder.Path> |
CycleFinder.findCycle(DataModel dataModel,
Collection<Table> tables)
Finds all dependency cycles in a data model.
|
static Set<Table> |
CycleFinder.getCycle(Collection<Table> tables)
Gets set of all tables involved in a cycle.
|
String |
PrintUtil.tableSetAsString(Set<Table> tables)
Converts a set of tables into a string.
|
String |
PrintUtil.tableSetAsString(Set<Table> tables,
String linePrefix)
Converts a set of tables into a string.
|
| Modifier and Type | Method and Description |
|---|---|
XmlExportTransformer.TableMapping |
XmlExportTransformer.getTableMapping(Table table)
Gets the xml mapping for a table.
|
void |
XmlExportTransformer.setTable(Table table)
Sets the table to read from.
|
| Constructor and Description |
|---|
XmlRowWriter.XmlWritingNodeVisitor(ResultSet resultSet,
ResultSetMetaData resultSetMetaData,
Table table,
Association association,
Session session)
Constructor.
|
| Constructor and Description |
|---|
XmlExportTransformer(OutputStream out,
String commentHeader,
EntityGraph entityGraph,
Set<Table> totalProgress,
Set<Table> cyclicAggregatedTables,
String rootTag,
String datePattern,
String timestampPattern,
Session session,
Charset charset,
ExecutionContext executionContext)
Constructor.
|
XmlExportTransformer(OutputStream out,
String commentHeader,
EntityGraph entityGraph,
Set<Table> totalProgress,
Set<Table> cyclicAggregatedTables,
String rootTag,
String datePattern,
String timestampPattern,
Session session,
Charset charset,
ExecutionContext executionContext)
Constructor.
|


Shop
Winter 2021
Process
About us
Clothes as natural as you are
Do one thing well.
We make clothes. That’s it. Nothing else. No distractions. Nothing to steal our focus.
View lookbooks


Maria Valdes has been critically acclaimed by the New York Times as a “first-rate singing actress” and brings experience as a storyteller into the Data Science realm. Recent graduate of the esteemed Georgia Tech Data Science and Analytics Boot Camp ready to tackle complex problems with data-driven analysis. Thrives on team settings, with extensive experience collaborating remotely. Approaches troubleshooting with patience and curiosity. Unique ability to quickly grasp complex concepts and systems, and a drive to continually evolve technical skills to meet the demands of emerging technologies.
This repository contains an interactive dashboard that explores various aspects of female participation in the workforce, internationally and within the United States.
Tools / languages utilized:
Back-end: Python, Pandas, API, Jupyter notebook, Flask, PostgreSQL, Machine Learning, Graphviz, Joblib, Pickle
Front-end: HTML, CSS, Javascript,Tableau, Leaflet, Heroku
This repository contains an interactive dashboard that analyzes historical data to better understand gas price trends in the United States.
Tools / languages utilized:
Back-end: Python, Pandas, API, Jupyter notebook, Flask, MongoDB
Front-end: HTML, CSS, Javascript, Chart.js, Leaflet, Plotly
This repository contains an interactive dashboard visualizing the Belly Button Biodiversity dataset, which catalogs the microbes that colonize human navels.
Tools/languages utilized: D3, plotly.js, JavaScript, HTML
This repository contains a web application that scrapes several websites for data related to the Mission to Mars and shows the information in a single HTML page.
Tools/languages utilized: Jupyter, Python, Pandas, BeautifulSoup, Splinter, MongoDB, Flask, HTML, CSS
This repository uses Python, SQLAlchemy, ORM queries, Pandas, and Matplotlib to perform climate analysis of a database of Hawaii Weather.
Tools/languages utilized: Python, Flask API, SQL
This study analyzes the effects of pharmaceuticals on mice being treated for squamous cell carcinoma over the course of 45 days.
Tools/languages utilized: Jupyter Notebook, Python, Pandas, Scipy, Numpy


001package org.javasimon; 002 003import java.util.List; 004 005/** 006 * Simon interface contains common functions related to Simon management - enable/disable and hierarchy. 007 * It does not contain any real action method - these are in specific interfaces that describes 008 * purpose of the particular type of monitor. 009 * 010 * @author <a<EMAIL_ADDRESS>"Virgo" Richter 011 * @see Manager 012 * @see Counter for Simon counting some events 013 * @see Stopwatch for Simon measuring time spans 014 */ 015public interface Simon extends HasAttributes { 016 017 /** 018 * Returns Simon name. Simon name is always fully qualified 019 * and determines also position of the Simon in the monitor hierarchy. 020 * Simon name can be {@code null} for anonymous Simons. 021 * 022 * @return name of the Simon 023 */ 024 String getName(); 025 026 /** 027 * Returns parent Simon. 028 * 029 * @return parent Simon 030 */ 031 Simon getParent(); 032 033 /** 034 * Returns list of children - direct sub-simons. 035 * 036 * @return list of children 037 */ 038 List<Simon> getChildren(); 039 040 /** 041 * Returns Simon's {@link Manager}. 042 * 043 * @return Simon's {@link Manager} 044 * @since 3.5 045 */ 046 Manager getManager(); 047 048 /** 049 * Returns state of the Simon that can be enabled, disabled or inherited. 050 * 051 * @return state of the Simon 052 */ 053 SimonState getState(); 054 055 /** 056 * Sets the state of the Simon. It must be specified whether to propagate the change 057 * and overrule states of all sub-simons which effectively sets the same state to the whole 058 * subtree. If subtree is not overruled, some Simons (with their subtrees) may not be affected 059 * by this change. 060 * 061 * @param state a new state. 062 * @param overrule specifies whether this change is forced to the whole subtree. 063 * @throws IllegalArgumentException if {@code state} is {@code null}. 064 */ 065 void setState(SimonState state, boolean overrule); 066 067 /** 068 * Returns true, if the Simon is enabled or if the enabled state is inherited. 069 * 070 * @return true, if the Simon is effectively enabled 071 */ 072 boolean isEnabled(); 073 074 /** 075 * Returns note for the Simon. Note enables Simon with an additional information in human 076 * readable form. 077 * 078 * @return note for the Simon. 079 */ 080 String getNote(); 081 082 /** 083 * Sets note for the Simon. Note enables Simon with an additional information in human 084 * readable form. 085 * 086 * @param note note for the Simon. 087 */ 088 void setNote(String note); 089 090 /** 091 * Returns ms timestamp of the first usage of this Simon. First and last usage 092 * are updated when monitor performs the measuring (start/stop/count/etc). They 093 * are not updated when values are obtained from the monitor. 094 * 095 * @return ms timestamp of the first usage 096 */ 097 long getFirstUsage(); 098 099 /** 100 * Returns ms timestamp of the last usage of this Simon. First and last usage 101 * are updated when monitor performs the measuring (start/stop/count/etc). They 102 * are not updated when values are obtained from the monitor. 103 * 104 * @return ms timestamp of the last usage 105 */ 106 long getLastUsage(); 107 108 /** 109 * Samples Simon values and returns them in a Java Bean derived from Sample interface. 110 * 111 * @return sample containing all Simon values 112 */ 113 Sample sample(); 114 115 /** 116 * Samples increment in Simon values since the previous call of this method with the 117 * same key. When the method is called the first time for the key, current values 118 * are returned (same like from {@link #sample()}. Any subsequent calls with the key 119 * provide increments. 120 *
 121 * Clients can use any sampling key (any Object) which enables safe access to their own increments. 122 * Using String does not guarantee this as any client can potentially guess the key. This 123 * may or may not be an issue. 124 * 125 * @param key sampling key used to access incremental sample 126 * @return {@link org.javasimon.Sample} with value increments 127 * @since 3.5 128 */ 129 Sample sampleIncrement(Object key); 130 131 /** 132 * Samples current value of incremental Simon. Works like {@link #sampleIncrement(Object)} but 133 * does not reset the incremental Simon. This method does not start incremental sampling 134 * and keeps returning values from {@link #sample()} for any key that was not used with 135 * {@link #sampleIncrement(Object)} before. 136 * 137 * @param key sampling key used to access incremental sample 138 * @return {@link org.javasimon.Sample} with value increments 139 * @see #sampleIncrement(Object) 140 * @since 4.1 141 */ 142 Sample sampleIncrementNoReset(Object key); 143 144 /** 145 * Stops incremental sampling for the key, removing any internal information for the key. 146 * Next call to {@link #sampleIncrement(Object)} for the key will be considered the first 147 * call for the key. 148 * 149 * @param key sampling key used to access incremental sample 150 * @return true if incremental information for the key existed, false otherwise 151 * @since 3.5 152 */ 153 boolean stopIncrementalSampling(Object key); 154}


The configuration database is a structured description of the entire automated system. The application included in Rapid SCADA use the information from the configuration database in conjunction with their settings.
The configuration database is edited using the Administrator application. The edited instance of the configuration database is in SDF file format of Microsoft SQL Server Compact Edition. After completing the necessary changes an administrator clicks button to convert the database in a specially designed DAT format which is used by the other applications. Such approach allows modifying the configuration database while the software is running.
The configuration database consists of tables, which in turn are composed of columns and rows. Each table belongs to one of the following groups:
The following table describes the configuration database tables.
| Table Name | Description |
|---|---|
| System Group | |
| Objects | Contains logical objects which input data and commands are related to |
| Communication lines | Describes communication lines which are used to exchange data with devices |
| Devices | Contains real or virtual devices |
| Input channels | Defines data received from the devices and data calculated on their base |
| Output channels | Specifies commands executed by the system |
| Roles | Contains roles. Each role defines a set of functions available to users |
| Users | Contains a list of users of the system and their roles |
| Interface | Contains descriptions of interface objects (views, reports and data windows) which require different access rights |
| Rights | Defines relationships between the roles and the interface objects |
| Dictionaries Group | |
| Channel types | Dictionary of input channel types |
| Command types | Dictionary of command types used by output channels |
| Event types | Dictionary of system event types which correspond to the input channel statuses |
| Device types | Dictionary of device types that can be connected to the system |
| Quantities | Dictionary of measured quantities |
| Units | Dictionary of units of input channel values and enumerable values of input channels |
| Command values | Dictionary of enumerable command values which are transmitted by output channels |
| Number formats | Dictionary of formats which are used to display input channel values |
| Formulas | Dictionary of formulas used in calculation of input channel data and command values of output channels |
The following list is a sequence of working with the configuration database in the Administrator application:
It is possible to significantly speed up a process of system configuration by using the past works. The Export and Import features allow exchanging data between different databases. These features are accessible in Database menu. Data tables are exported to DAT format files, then the information can be imported from these files into the same or another configuration database. A range of exported and imported data can be restricted by specifying the start and the final identifiers (see Figure 1). In addition, if a new start identifier is specified, identifiers of the imported data are shifted.
Figure 1. Import into the configuration database
The Create channels feature (see Figure 2), which is accessible in Service menu, allows automatic filling the Input channels and Output channels tables using information about existing objects and devices. Rules for creating channels are defined in device libraries (drivers) of Communicator. The device libraries are located in C:\SCADA\ScadaComm\KP\ by default. If a DLL file, specified in the Device types table, does not exist, the creation of channels corresponding to that device type is impossible. Channels are created according to the settings of Communicator.
To create input and output channels, tick the appropriate devices, choose or keep undefined the object for the each device, click the Calculate channel numbers button, check the calculated numbers, then click the Create button.
Figure 2. Create channels feature
The Clone channels feature (see Figure 3) is also designed to make the process of creating input and output channels faster. The objects and the devices of the cloned channels can be replaced by the specified values during cloning.
Figure 3. Clone channels feature
Editing of input channels may be done either directly in a table or by using the form that is shown in Figure 4. Right click an input channel row to show popup menu and click the menu item to open this form.
Figure 4. Editing input channel properties
The Compact database feature decreases the size of the configuration database file. Use this feature when the database editing has been completed. To execute the feature click the Database > Compact main menu item.


Signup Form
First Name
Last Name
Department
Skills
Aspirations
Willing to
Please select what you looking for :
Mentor
Mentee
Neither
Both


{{service.type_pretty}}
{{service.min_stars}}-{{service.max_stars}} {{service.star_shape}}s
{{service.star_shape}} shape
{{service.service_key}}


| Portability 可移植性 |
Historically, Spirit supported a lot of compilers, including (to some extent)
poorly conforming compilers such as VC6. Spirit v1.6.x will be the last release
that will support older poorly conforming compilers. Starting from Spirit v1.8.0,
ill conforming compilers will not be supported. If you are still using one of
these older compilers, you can still use Spirit v1.6.x.
从
历史上看，Spirit支持的编译器很多，包括（在某种程度上）对标准符合度较差的编译器，如VC6。Spirit
v1.6.x将是最后一个支持标准符合度差的编译器的版本。从Spirit
v1.8.0起，将不再支持标准符合度差的编译器。如果您仍在使用这些旧的编译器之一，您仍然可以使用Spirit v1.6.x.
The reason why Spirit v1.6.x worked on old non-conforming compilers is that
the authors laboriously took the trouble of searching for workarounds to make
these compilers happy. The process takes a lot of time and energy, especially
when one encounters the dreaded ICE or "Internal Compiler Error".
Sometimes searching for a single workaround takes days or even weeks. Sometimes,
there are no known workarounds. This stifles progress a lot. And, as the library
gets more progressive and takes on more advanced C++ techniques, the difficulty
is escalated to even new heights.
Spirit
v1.6.x能与不符合标准的编译器一起工作的原因是，作者很辛苦地寻找解决方法来使这些编译器接受。这个过程需要大量的时间和精力，尤其是当遇到可怕的
ICE或“内部编译器错误”时。有时为了一个解决办法寻找需要几天甚至几个星期。有时候甚至没有可变通的办法。这扼杀许多进步。此外，由于本库的进一步发
展以及更先进的C++技术的需要，这种困难升级到了新的高度。
Spirit v1.6.x will still be supported. Maintenance will still happen and bug
fixes will still be applied. There will still be active development for the
back-porting of new features introduced in Spirit v1.8.0 (and Spirit 1.9.0)
to lesser able compilers; hopefully, fueled by contributions from the community.
We welcome active support from the C++ community, especially those with special
expertise on compilers such as older Borland and MSVC++ compilers.
Spirit
v1.6.x仍然会得到支持。维护仍然会继续，漏洞修补仍然适用。仍然会有积极发展的Spirit v1.8.0（以及Spirit
1.9.0）中引入的新功能向后移植至能力较差的编译器；我们希望并得到了来自社会各界的捐款。我们欢迎C++社区的积极支持，尤其是在那些老的
Borland和MSVC等C++编译器方面有特殊专长的。
Spirit 1.8 has been tested to compile and run properly on these compilers:
Spirit 1.8 已在以下编译器上通过测试并正确运行：
If your compiler is sufficiently conforming, chances are, you can compile Spirit
as it is or with minimal portability fixes here and there. Please inform us
if your compiler is known to be ISO/ANSI conforming and is not in this list
above. Feel free to post feedback to Spirit-general
mailing list<EMAIL_ADDRESS>如果你的编译器充分地符合标准，你就有机会只需要在这里或那里做最少的移植修改，就可以编译Spirit。如果你的编译器已知是符合ISO/ANSI标准而没有在上面列出，请通知我们。请随时将反馈发送到 Spirit-通用邮件列表<EMAIL_ADDRESS>Copyright © 1998-2003 Joel de Guzman
Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)


@helper.form(routes.FormEditController.taskFormPost(projectId, parentId, parentType, taskForm("id").value.getOrElse("-1").toLong), 'class -> "form-horizontal") {
@text(taskForm("id"),
label = "id",
placeholder = "-1",
default = "-1",
readOnly = true
)
@text(taskForm("parent"),
label = "Parent ID",
placeholder = "-1",
default = parentId+"",
readOnly = true
)
@text(taskForm("name"),
label = "Name",
placeholder = "Task Name",
help = "Please enter the task name. (required)"
)
@textarea(taskForm("instruction"),
label = "Instruction",
rows = "5",
placeholder = "Task Instruction",
help = "Please enter the instruction for the task. (required)"
)
@text(taskForm("location"),
label = "Location",
placeholder = "Task Location",
help = "Please enter the task location. (optional)"
)
@textarea(taskForm("geometries"),
label = "GeoJSON",
rows = "5",
placeholder = "Task GeoJSON",
help = "Please enter the GeoJSON for the task. (required)"
)
@select(taskForm("status"),
label = "Status",
optionList = Task.statusMap.map(e => (e._2, e._1+"")).toList,
isMultiple = false,
help = "Please enter the status level for the task",
defaultSelected = Some(Task.STATUS_CREATED.toString)
)
@select(taskForm("priority"),
label = "Priority",
optionList = List(("High", Challenge.PRIORITY_HIGH+""), ("Medium", Challenge.PRIORITY_MEDIUM+""), ("Low", Challenge.PRIORITY_LOW+"")),
isMultiple = false,
help = "Please enter the priority level for the task",
defaultSelected = Some(Task.STATUS_CREATED.toString)
)


These are things that:
- the worker has to provide to complete this specific engagement
- aren't provided by the end client
- could place the worker at financial risk if the cost isn't regained
They don't include expenses incurred by being based away from home for the engagement.
Select all that apply


This rule applies only to a derived demonstrative form meaning '(on) this/that side'. The derived form involves reduplicating the final /CV/ of the demonstrative pronoun or adverb which serves as input. The Centripetal suffix /-ala/ is added. There is also a parallel but less common form with Centrifugal /-ali/ For further details and exx. see §7.21 (also §6.11).
Consider these input forms: /ya:-ni/ 'this (ANA class)' and adverb /ya:-ji/ 'here'. The relevant derived forms are //ya;-ni-ni-ala// → /ya:-ni-ni:-'la/ and //ya:-ji-ji-ala// → /ya:-ji-ji:-'la/
These forms present no difficulties; we just reduplicate the final /CV/ add /-ala/ and have the surface form produced regularly by VV-Contraction P-49. However, some difficulties arise in insuring that human nonsingular forms are correctly generated.
Consider input forms /ya:-wi-ni/ (MDu), /ya:-wi-r-ngi/ (FDu) and /ya:-wu-ru/ (Pl) 'these'. The derived forms are /ya:-wi-ni-ni:-'la/ /ya:-wi-r-ngi-ngi:-'la/ and /ya:-wu-ra-ra:-'la/ These forms force us to specify more precisely what gets reduplicated and also whether the -Rdp- segment precedes or follows the relevant input syllable.
In the FDu form, note that the /-r-/ morpheme is not included in the -Rdp- segment. This is a Nonsingular morpheme. Only the F morpheme (Feminine) gets reduplicated.
In the MSg form, /-ni-/ is arguably underlying //-r-ni-// with the same Nonsingular //-r-// and M //-ni-// which is related to other M morphemes in verbal and nominal morphology with /n/ not /n/ A rule //rn// → /n/ though unproductive, could possibly be recognised (see P-24, below). If so, we must argue that this contraction rule precedes Final Reduplication, since in the relevant MSg form we get /-ni-ni:-/ instead of /-ni-ni:-/
The Pl form is even more tricky. From input /ya:-wu-ru/ we might expect output //ya:-wu-ru-ru-ala// which would produce surface /ya:-wu-ru-ra:-'la/ but the attested form is /ya:-wu-ra-ra:-'la/ Note that the third morpheme /-ra-/ shares surface vowel quality with the following syllable. However, the latter in turn has acquired its surface vowel quality through VV-Contraction involving the initial vowel of the Centripetal suffix, with //ua// becoming /a:/ In generative terms, then, it is probably best to order Final Reduplication P-3 after VV-Contraction P-49. If this is done, we must locate the -Rdp- segment before the identical segment of the input, and specify that the vowel of the -Rdp- segment is short regardless of the length of the input vowel.
| (P-3) Final Reduplication |
| Rdp → -C1V1- // D- _____ -C1V1(:)- |
| where D- is a demonstrative root |
An alternative would be to take //ya:-wu-ru-ru-ala// as the underlying form after all, with P-3 followed by an ad hoc assimilation rule. This would require the assimilation rule, but not P-3 itself, to follow VV-Contraction P-49. Another alternative, for those linguists not favorable to generative rules, would be a surface-to-surface schema deriving the reduplicated form directly from the unreduplicated surface form (this would be relatively easy in this instance).


CrimPapers
Articles published on 17 May 2018
On 17 May 2018, 16 new articles were published in 9 journals.
Violence Against Child Protection Workers: A Study of Workers’ Experiences, Attributions, and Coping Strategies
Social Bonds and White-Collar Crime: A Two-Study Assessment of Informal Social Controls in White-Collar Offenders by Joost H.r. van Onna, Adriaan J.m. Denkers
How Do People Attribute Their Polydrug Use? A Mixed Methods Approach by Kati Kataja, Karoliina Karjalainen, Jenni Savonen, Pekka Hakkarainen, Sanna Hautala
Drug Trafficking, the Informal Order, and Caciques. Reflections on the Crime-Governance Nexus in Mexico by Wil G. Pansters
Violence, Bureaucracy and Intreccio in Brazil by Graham Denyer Willis
Neurobiological Intervention and Prediction of Treatment Outcome in the Juvenile Criminal Justice System
Animal Cruelty Among Children in Violent Households: Children’s Explanations of Their Behavior
Firearm Ownership in High-Conflict Families: Differences According to State Laws Restricting Firearms to Misdemeanor Crimes of Domestic Violence Offenders
The Usefulness of Past Crime Data As An Attractiveness Index For Residential Burglars by Aikohanayama
,
shumpeihaginoya
,
hirokikuraishi
,
masakazukobayashi
Federalism and Historical Voting on the U.s. Supreme Court by Christopher M. Parker
Going Public: Presidential Impact on Supreme Court Decision-Making by Natalie C. Rogol, Matthew D. Montgomery, Justin T. Kingsland
Privatizing Criminal Stigma: Experience, Intergroup Contact, and Public Views About Publicizing Arrest Records by Sarah E Lageson, Megan Denver, Justin T Pickett
From Underground Terrorism to State Terrorism and Beyond: the Question of Terrorism in the Finnish Jäger Movement During and After the First World War by Jussi Jalonen
Right-Wing Terrorism and Militancy in the Nordic Countries: A Comparative Case Study by Jacob Aasland Ravndal
Horizontal Inequality and Violent Unrest in Jerusalem by Jeremy Pressman
The 1904 Assassination of Governor General Bobrikov: Tyrannicide, Anarchism, and the Expanding Scope of “Terrorism” by Richard Bach Jensen


Blood Donation
Contact us
Support Us
About
Home
Log In
FEEDBACK
First Name
Last Name
Email
Country
India
Pakisthan
Bangladesh
Srilankha
Africa
Newyork
Australia
Canada
USA
FeedBack


{% extends "faq/base.html" %} {% block title %}{{ block.super }}: Add Question{% endblock %} {% block body %}
Back to the overview
Was your question not in the FAQ? Ask it here.


Algorithm: the counts of White, Black and Asian populations are set by the sliders, then privatized with the differential privacy Laplace mechanism. The privatized values are rounded to the nearest non-negative integer. Finally, the error between the actual count and the privatized count is randomly distributed among the three privatized variables.
| Category | Real Counts | Added Noise | Raw Privatized Counts |
Reported Counts |
Error | |
|---|---|---|---|---|---|---|
| G100: Adult Detention Centers | ||||||
| G200: Juvenile Centers | ||||||
| G300: Nursing Facilities | ||||||
| G400: Treatment Facilities | ||||||
| G500: Student Housing | ||||||
| G600: Military Quarters | ||||||
| G700: Emergency Shelters | ||||||
| G800: Group Homes for Adults | ||||||
| G900: Misc. | ||||||
| Total Group Quarters Population: | ||||||
| Epsilon: | |
Note 1: A new differentially private population is created every time any of the sliders is moved.
Note 2: The Laplace() noise operator has not been validated in this web-based demo.


What is Ratpack?
Ratpack is a simple, capable, toolkit for creating high performance web applications.
Ratpack is built on Java and the Netty event-driven networking engine. The API is optimized for Groovy and Java 8, though Java 7 can also be used.
Optional Google Guice integration provides a foundation for scaling your application in size in a managed way.
Optional Gradle build time support makes building and testing applications a breeze.


climate South change health adaptation Africa Health local Climate data response African impacts policy country research sector Africa. study review government plans weather {border-style Africa, National extreme px;} systems #ffffff;} Public policies public studies malaria Environmental Province analysis impact key role Change Health. case communication different heat interventions planning temperature Cape Department Global however, knowledge measures responses warning Africa: considerable disease efforts events including information methods occupational vulnerable Lancet Wright approach collab: effective especially evidence population preparedness students Government Limpopo actions areas capacity effects environmental factors located mortality national urban Development Environ HIV University ability developed disaster future important incidence included medical mining mitigation noted outbreaks px; range reduce reduction risk taken {font-family Adaptation Environ. Mar Research Western additional articles communities country, documents early effectiveness events, font-size given global governance identify implications infectious informant initiatives level levels literature monitoring municipal need organisations potential resilience social use used women workers Int Policy Response Science Suid-Afrikaanse action adapt adaptation. approaches civil develop development double; energy example, findings frameworks health. interviews, leadership limited little meat new number opportunities parts private programmes progress recent rises society specific stated strategy tydskrif vir vulnerability work Case Characteristics Disaster Human Infectious Integrated Integration Johannesburg, Local Malaria Mixed Narrative Performance Potential Res Rift Risk Study Valley White Ziervogel actual adaption applicable article assess attention border-color border-width changes countries country’s developing existing field gender groups groups. health, implementation include increased lessons make needed n = ), play political presented project provide provides quality reducing report security solid; steps survey systems, temporal time useful using working {font-style {font-weight (Potchefstroom, ;(). Africa) CY, Chersich Countdown Data Documents Food Indoor Information Int. International Jamba Johannesburg Level Mathee Northern Province, Republic Res. Scorgie Southern Temperatures United Warning action. adaptation, adaptation: adaptation? address ambient aspects available bold building change. change: climate-sensitive climatic concerns considerations contributors control country. courier; critical curricula draft drought em; epidemic events. example experts explore extent food funding geneeskunde grey group health: heat-related housing insights international interviews involving leading mainstream network officials officials, papers promotion pt;} related required set settings sub-Saharan supported surveillance systematic targeting technology temperatures transmission types university worldwide


Opener
Opener is a developer library for overriding link destinations. Handler packages instruct Opener whether to change the URL that’s about to be opened. For examples, refer to the source of LinkOpener and MapsOpener.
All iOS versions since 5.0 are supported, on all devices.
Documentation is available at hbang.github.io/libopener.
Creating an Opener handler
Make sure Opener is already installed on your device.
Theos includes headers and a linkable framework for Opener, so you don’t need to worry about copying files over from your device.
To develop a handler, create a bundle project. You can do this with a Theos makefile similar to this one:
INSTALL_TARGET_PROCESSES = SpringBoard
include $(THEOS)/makefiles/common.mk
BUNDLE_NAME = MyAwesomeHandler
MyAwesomeHandler_FILES = XXXMyAwesomeHandler.m
MyAwesomeHandler_INSTALL_PATH = /Library/Opener
MyAwesomeHandler_EXTRA_FRAMEWORKS = Opener
include $(THEOS_MAKE_PATH)/bundle.mk
A handler class subclasses from HBLOHandler. Here is a simple example:
#import <Opener/Opener.h>
@interface XXXMyAwesomeHandler : HBLOHandler
@end
#import "XXXMyAwesomeHandler.h"
@implementation XXXMyAwesomeHandler
- (instancetype)init {
self = [super init];
if (self) {
self.name = @"My Awesome Handler";
self.identifier = @"com.example.myawesomehandler";
}
return self;
}
- (id)openURL:(NSURL *)url sender:(NSString *)sender {
if (([url.scheme isEqualToString:@"http"] || [url.scheme isEqualToString:@"https"])
&& [url.host<EMAIL_ADDRESS>{
return [NSURL URLWithString:[NSString stringWithFormat:@"hbang://open%@", url.path]];
}
return nil;
}
@end
In this example, URLs being opened that are web pages (http:// or https:// scheme) and have a hostname of hbang.ws
will be overridden to open a hypothetical app that supports the hbang://
URI scheme. This means https://hbang.ws/apps/
turns into hbang://open/apps/
.
You must also add ws.hbang.libopener
to the Depends:
list in your control file. If Opener isn’t present on the device, your binaries will fail to load. For example:
Depends: mobilesubstrate, something-else, some-other-package, ws.hbang.libopener (>= 3.1.2)
You should specify the current version of Opener as the minimum requirement, so you can guarantee all features you use are available.
License
Licensed under the Apache License, version 2.0. Refer to LICENSE.md.


In this notebook, some template code has already been provided for you, and you will need to implement additional functionality to successfully complete this project. You will not need to modify the included code beyond what is requested. Sections that begin with '(IMPLEMENTATION)' in the header indicate that the following block of code will require additional functionality which you must provide. Instructions will be provided for each section, and the specifics of the implementation are marked in the code block with a 'TODO' statement. Please be sure to read the instructions carefully!
Note: Once you have completed all of the code implementations, you need to finalize your work by exporting the iPython Notebook as an HTML document. Before exporting the notebook to html, all of the code cells need to have been run so that reviewers can see the final implementation and output. You can then export the notebook by using the menu above and navigating to \n", "File -> Download as -> HTML (.html). Include the finished document along with this notebook as your submission.
In addition to implementing code, there will be questions that you must answer which relate to the project and your implementation. Each section where you will answer a question is preceded by a 'Question X' header. Carefully read each question and provide thorough answers in the following text boxes that begin with 'Answer:'. Your project submission will be evaluated based on your answers to each of the questions and the implementation you provide.
Note: Code and Markdown cells can be executed using the Shift + Enter keyboard shortcut. Markdown cells can be edited by double-clicking the cell to enter edit mode.
The rubric contains optional "Stand Out Suggestions" for enhancing the project beyond the minimum requirements. If you decide to pursue the "Stand Out Suggestions", you should include the code in this IPython notebook.
In this notebook, you will make the first steps towards developing an algorithm that could be used as part of a mobile or web app. At the end of this project, your code will accept any user-supplied image as input. If a dog is detected in the image, it will provide an estimate of the dog's breed. If a human is detected, it will provide an estimate of the dog breed that is most resembling. The image below displays potential sample output of your finished project (... but we expect that each student's algorithm will behave differently!).
In this real-world setting, you will need to piece together a series of models to perform different tasks; for instance, the algorithm that detects humans in an image will be different from the CNN that infers dog breed. There are many points of possible failure, and no perfect algorithm exists. Your imperfect solution will nonetheless create a fun user experience!
We break the notebook into separate steps. Feel free to use the links below to navigate the notebook.
In the code cell below, we import a dataset of dog images. We populate a few variables through the use of the load_files
function from the scikit-learn library:
train_files
, valid_files
, test_files
- numpy arrays containing file paths to imagestrain_targets
, valid_targets
, test_targets
- numpy arrays containing onehot-encoded classification labels dog_names
- list of string-valued dog breed names for translating labelsfrom sklearn.datasets import load_files
from keras.utils import np_utils
import numpy as np
from glob import glob
# define function to load train, test, and validation datasets
def load_dataset(path):
data = load_files(path)
dog_files = np.array(data['filenames'])
dog_targets = np_utils.to_categorical(np.array(data['target']), 133)
return dog_files, dog_targets
# load train, test, and validation datasets
train_files, train_targets = load_dataset('dogImages/train')
valid_files, valid_targets = load_dataset('dogImages/valid')
test_files, test_targets = load_dataset('dogImages/test')
# load list of dog names
dog_names = [item[20:-1] for item in sorted(glob("dogImages/train/*/"))]
# print statistics about the dataset
print('There are %d total dog categories.' % len(dog_names))
print('There are %s total dog images.\n' % len(np.hstack([train_files, valid_files, test_files])))
print('There are %d training dog images.' % len(train_files))
print('There are %d validation dog images.' % len(valid_files))
print('There are %d test dog images.'% len(test_files))
In the code cell below, we import a dataset of human images, where the file paths are stored in the numpy array human_files
.
import random
random.seed(8675309)
# load filenames in shuffled human dataset
human_files = np.array(glob("lfw/*/*"))
random.shuffle(human_files)
# print statistics about the dataset
print('There are %d total human images.' % len(human_files))
We use OpenCV's implementation of Haar feature-based cascade classifiers to detect human faces in images. OpenCV provides many pre-trained face detectors, stored as XML files on github. We have downloaded one of these detectors and stored it in the haarcascades
directory.
In the next code cell, we demonstrate how to use this detector to find human faces in a sample image.
# Reusable code to be use for face detection
def face_detection_helper(f_cascade, colored_img):
# convert BGR image to grayscale
gray = cv2.cvtColor(colored_img, cv2.COLOR_BGR2GRAY)
# find faces in image
faces = f_cascade.detectMultiScale(gray)
# print number of faces detected in the image
print('Number of faces detected:', len(faces))
# get bounding box for each detected face
for (x,y,w,h) in faces:
# add bounding box to color image
cv2.rectangle(colored_img,(x,y),(x+w,y+h),(255,0,0),2)
# convert BGR image to RGB for plotting
cv_rgb = cv2.cvtColor(colored_img, cv2.COLOR_BGR2RGB)
return cv_rgb
import cv2
import matplotlib.pyplot as plt
%matplotlib inline
# extract pre-trained face detector
face_cascade = cv2.CascadeClassifier('haarcascades/haarcascade_frontalface_alt.xml')
# load color (BGR) image
img = cv2.imread(human_files[0])
detect_face = face_detection_helper(face_cascade, img)
# display the image, along with bounding box
plt.imshow(detect_face)
plt.show()
Before using any of the face detectors, it is standard procedure to convert the images to grayscale. The detectMultiScale
function executes the classifier stored in face_cascade
and takes the grayscale image as a parameter.
In the above code, faces
is a numpy array of detected faces, where each row corresponds to a detected face. Each detected face is a 1D array with four entries that specifies the bounding box of the detected face. The first two entries in the array (extracted in the above code as x
and y
) specify the horizontal and vertical positions of the top left corner of the bounding box. The last two entries in the array (extracted here as w
and h
) specify the width and height of the box.
We can use this procedure to write a function that returns True
if a human face is detected in an image and False
otherwise. This function, aptly named face_detector
, takes a string-valued file path to an image as input and appears in the code block below.
# returns "True" if face is detected in image stored at img_path
def face_detector(img_path):
img = cv2.imread(img_path)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(gray)
return len(faces) > 0
Question 1: Use the code cell below to test the performance of the face_detector
function.
human_files
have a detected human face? dog_files
have a detected human face?  You will see that our algorithm falls short of this goal, but still gives acceptable performance. We extract the file paths for the first 100 images from each of the datasets and store them in the numpy arrays human_files_short
and dog_files_short
.
Answer:
human_files_short = human_files[:100]
dog_files_short = train_files[:100]
# Do NOT modify the code above this line.
## TODO: Test the performance of the face_detector algorithm
## on the images in human_files_short and dog_files_short.
humanCount = 0
total = 0
dogCount = 0
for img in human_files_short:
isHuman = face_detector(img)
if not isHuman:
humanCount += 1
total = 100 - humanCount
percentage = (total/len(human_files_short)) * 100
print('Total Percentage Of Humans Correctly Classified: ', percentage, '%')
for img in dog_files_short:
isHuman = face_detector(img)
if isHuman:
dogCount += 1
percentage = (dogCount/len(dog_files_short)) * 100
print('Total Percentage Of Dogs Wrongly Classified: ', percentage, '%')
Question 2: This algorithmic choice necessitates that we communicate to the user that we accept human images only when they provide a clear view of a face (otherwise, we risk having unneccessarily frustrated users!). In your opinion, is this a reasonable expectation to pose on the user? If not, can you think of a way to detect humans in images that does not necessitate an image with a clearly presented face?
Answer:
We suggest the face detector from OpenCV as a potential way to detect human images in your algorithm, but you are free to explore other approaches, especially approaches that make use of deep learning :). Please use the code cell below to design and test your own face detection algorithm. If you decide to pursue this optional task, report performance on each of the datasets.
## (Optional) TODO: Report the performance of another
## face detection algorithm on the LFW dataset
### Feel free to use as many code cells as needed.
#load cascade classifier training file for lbpcascade
lbp_face_cascade = cv2.CascadeClassifier('lbpcascades/lbpcascade_frontalface.xml')
# load color (BGR) image
img = cv2.imread(human_files[3])
detect_face = face_detection_helper(lbp_face_cascade, img)
# display the image, along with bounding box
plt.imshow(detect_face)
plt.show()
## lbp cascade face detector
# returns "True" if face is detected in image stored at img_path
def lbp_face_detector(img_path):
img = cv2.imread(img_path)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = lbp_face_cascade.detectMultiScale(gray)
return len(faces) > 0
human_files_short = human_files[:100]
dog_files_short = train_files[:100]
# Do NOT modify the code above this line.
## TODO: Test the performance of the face_detector algorithm
## on the images in human_files_short and dog_files_short.
humanCount = 0
total = 0
dogCount = 0
for img in human_files_short:
isHuman = lbp_face_detector(img)
if not isHuman:
humanCount += 1
total = 100 - humanCount
percentage = (total/len(human_files_short)) * 100
print('Total Percentage Of Humans Correctly Classified: ', percentage, '%')
for img in dog_files_short:
isHuman = lbp_face_detector(img)
if isHuman:
dogCount += 1
percentage = (dogCount/len(dog_files_short)) * 100
print('Total Percentage Of Dogs Wrongly Classified: ', percentage, '%')
## Obscured Face check lbp check
def obscured_check(cascade, image):
# load color (BGR) image
img = cv2.imread(image)
detect_face = face_detection_helper(cascade, img)
# display the image, along with bounding box
plt.imshow(detect_face)
plt.show()
image_url = 'images/myface1.jpg'
obscured_check(face_cascade, image_url)
image_url = 'images/myface2.jpg'
obscured_check(face_cascade, image_url)
image_url = 'images/myface1.jpg'
obscured_check(lbp_face_cascade, image_url)
image_url = 'images/myface2.jpg'
obscured_check(lbp_face_cascade, image_url)
image_url = 'images/doghumanimages/ted2image.jpg'
obscured_check(lbp_face_cascade, image_url)
obscured_check(face_cascade, image_url)
Courtesy of informramiz
LBP(Local Binary Patterns) cascade can be trained to perform similarly (or better) than the Haar cascade. Haar cascade is more efficient depending on the data itself. The increase in accuracy provided by LBP with an accuracy of 90-95% is good which makess it a good option combined with the fact that, it's fast.
If you want to detect faces on an embedded system, I think LBP is the choice, because it does all the calculations in integers. Haar uses floats, which is a killer for embedded/mobile. (As Seen On A StackOverflow comment)
Conclusion According to the questions from the review:
Question:
This algorithmic choice necessitates that we communicate to the user that we accept human images only when they provide a clear view of a face (otherwise, we risk having unneccessarily frustrated users!). In your opinion, is this a reasonable expectation to pose on the user?
Yes, it's a resonable expectation to pose if and only if we are looking at improving our software to learn and understand our users and in that case, use the user base to improve our face detection API.
I would like to say No because, we have to prevent our users from using our software unless they have a clear picture.
In this section, we use a pre-trained ResNet-50 model to detect dogs in images. Our first line of code downloads the ResNet-50 model, along with weights that have been trained on ImageNet, a very large, very popular dataset used for image classification and other vision tasks. ImageNet contains over 10 million URLs, each linking to an image containing an object from one of 1000 categories. Given an image, this pre-trained ResNet-50 model returns a prediction (derived from the available categories in ImageNet) for the object that is contained in the image.
from keras.applications.resnet50 import ResNet50
# define ResNet50 model
ResNet50_model = ResNet50(weights='imagenet')
When using TensorFlow as backend, Keras CNNs require a 4D array (which we'll also refer to as a 4D tensor) as input, with shape
$$ (\text{nb_samples}, \text{rows}, \text{columns}, \text{channels}), $$
where nb_samples
corresponds to the total number of images (or samples), and rows
, columns
, and channels
correspond to the number of rows, columns, and channels for each image, respectively.
The path_to_tensor
function below takes a string-valued file path to a color image as input and returns a 4D tensor suitable for supplying to a Keras CNN. The function first loads the image and resizes it to a square image that is $224 \times 224$ pixels. Next, the image is converted to an array, which is then resized to a 4D tensor. In this case, since we are working with color images, each image has three channels. Likewise, since we are processing a single image (or sample), the returned tensor will always have shape
$$ (1, 224, 224, 3). $$
The paths_to_tensor
function takes a numpy array of string-valued image paths as input and returns a 4D tensor with shape
$$ (\text{nb_samples}, 224, 224, 3). $$
Here, nb_samples
is the number of samples, or number of images, in the supplied array of image paths. It is best to think of nb_samples
as the number of 3D tensors (where each 3D tensor corresponds to a different image) in your dataset!
from keras.preprocessing import image
from tqdm import tqdm
def path_to_tensor(img_path):
# loads RGB image as PIL.Image.Image type
img = image.load_img(img_path, target_size=(224, 224))
# convert PIL.Image.Image type to 3D tensor with shape (224, 224, 3)
x = image.img_to_array(img)
# convert 3D tensor to 4D tensor with shape (1, 224, 224, 3) and return 4D tensor
return np.expand_dims(x, axis=0)
def paths_to_tensor(img_paths):
list_of_tensors = [path_to_tensor(img_path) for img_path in tqdm(img_paths)]
return np.vstack(list_of_tensors)
Getting the 4D tensor ready for ResNet-50, and for any other pre-trained model in Keras, requires some additional processing. First, the RGB image is converted to BGR by reordering the channels. All pre-trained models have the additional normalization step that the mean pixel (expressed in RGB as $[103.939, 116.779, 123.68]$ and calculated from all pixels in all images in ImageNet) must be subtracted from every pixel in each image. This is implemented in the imported function preprocess_input
. If you're curious, you can check the code for preprocess_input
here.
Now that we have a way to format our image for supplying to ResNet-50, we are now ready to use the model to extract the predictions. This is accomplished with the predict
method, which returns an array whose $i$-th entry is the model's predicted probability that the image belongs to the $i$-th ImageNet category. This is implemented in the ResNet50_predict_labels
function below.
By taking the argmax of the predicted probability vector, we obtain an integer corresponding to the model's predicted object class, which we can identify with an object category through the use of this dictionary.
from keras.applications.resnet50 import preprocess_input, decode_predictions
def ResNet50_predict_labels(img_path):
# returns prediction vector for image located at img_path
img = preprocess_input(path_to_tensor(img_path))
return np.argmax(ResNet50_model.predict(img))
While looking at the dictionary, you will notice that the categories corresponding to dogs appear in an uninterrupted sequence and correspond to dictionary keys 151-268, inclusive, to include all categories from 'Chihuahua'
to 'Mexican hairless'
. Thus, in order to check to see if an image is predicted to contain a dog by the pre-trained ResNet-50 model, we need only check if the ResNet50_predict_labels
function above returns a value between 151 and 268 (inclusive).
We use these ideas to complete the dog_detector
function below, which returns True
if a dog is detected in an image (and False
if not).
### returns "True" if a dog is detected in the image stored at img_path
def dog_detector(img_path):
prediction = ResNet50_predict_labels(img_path)
return ((prediction <= 268) & (prediction >= 151))
Question 3: Use the code cell below to test the performance of your dog_detector
function.
human_files_short
have a detected dog? dog_files_short
have a detected dog?Answer:
### TODO: Test the performance of the dog_detector function
### on the images in human_files_short and dog_files_short.
humanCount = 0
dogCount = 0
dog_test_files_short = test_files[:100]
for img in human_files_short:
isDog = dog_detector(img)
if isDog:
humanCount += 1
percentage = (humanCount/len(human_files_short)) * 100
print('Total Percentage Of humans Wrongly Classified: ', percentage,'%')
for img in dog_test_files_short:
isDog = dog_detector(img)
if isDog:
dogCount += 1
percentage = (dogCount/len(dog_files_short)) * 100
print('Total Percentage Of dogs accurately Classified: ', percentage,'%')
### TODO: Test the performance of the dog_detector function
### on the images in human_files_short and dog_files_short.
humanCount = 0
dogCount = 0
for img in human_files_short:
isDog = dog_detector(img)
if isDog:
humanCount += 1
percentage = (humanCount/len(human_files_short)) * 100
print('Total Percentage Of humans Wrongly Classified: ', percentage,'%')
for img in dog_files_short:
isDog = dog_detector(img)
if isDog:
dogCount += 1
percentage = (dogCount/len(dog_files_short)) * 100
print('Total Percentage Of dogs accurately Classified: ', percentage,'%')
Now that we have functions for detecting humans and dogs in images, we need a way to predict breed from images. In this step, you will create a CNN that classifies dog breeds. You must create your CNN from scratch (so, you can't use transfer learning yet!), and you must attain a test accuracy of at least 1%. In Step 5 of this notebook, you will have the opportunity to use transfer learning to create a CNN that attains greatly improved accuracy.
Be careful with adding too many trainable layers! More parameters means longer training, which means you are more likely to need a GPU to accelerate the training process. Thankfully, Keras provides a handy estimate of the time that each epoch is likely to take; you can extrapolate this estimate to figure out how long it will take for your algorithm to train.
We mention that the task of assigning breed to dogs from images is considered exceptionally challenging. To see why, consider that even a human would have great difficulty in distinguishing between a Brittany and a Welsh Springer Spaniel.
| Brittany | Welsh Springer Spaniel |
|---|---|
It is not difficult to find other dog breed pairs with minimal inter-class variation (for instance, Curly-Coated Retrievers and American Water Spaniels).
| Curly-Coated Retriever | American Water Spaniel |
|---|---|
Likewise, recall that labradors come in yellow, chocolate, and black. Your vision-based algorithm will have to conquer this high intra-class variation to determine how to classify all of these different shades as the same breed.
| Yellow Labrador | Chocolate Labrador | Black Labrador |
|---|---|---|
We also mention that random chance presents an exceptionally low bar: setting aside the fact that the classes are slightly imabalanced, a random guess will provide a correct answer roughly 1 in 133 times, which corresponds to an accuracy of less than 1%.
Remember that the practice is far ahead of the theory in deep learning. Experiment with many different architectures, and trust your intuition. And, of course, have fun!
We rescale the images by dividing every pixel in every image by 255.
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
# pre-process the data for Keras
train_tensors = paths_to_tensor(train_files).astype('float32')/255
valid_tensors = paths_to_tensor(valid_files).astype('float32')/255
test_tensors = paths_to_tensor(test_files).astype('float32')/255
Create a CNN to classify dog breed. At the end of your code cell block, summarize the layers of your model by executing the line:
model.summary()
We have imported some Python modules to get you started, but feel free to import as many modules as you need. If you end up getting stuck, here's a hint that specifies a model that trains relatively fast on CPU and attains >1% test accuracy in 5 epochs:
Question 4: Outline the steps you took to get to your final CNN architecture and your reasoning at each step. If you chose to use the hinted architecture above, describe why you think that CNN architecture should work well for the image classification task.
Answer:
In my initial run, I decided to go with the above architecture, due to it having less trainable params and running training this architecture on my local system gives me a 10% Test Accuracy. No Normalization added and no dropout.
I decided to use the Amazon instance for running my application. So, I decided to modify the provided architecture to include normalization per batch and add a Dropout to avoid overfitting and the max result I got was 7% better than the initial run and greater than 1%? Yeah. But, I think I can do better. Why not add more batch.
Remove Dropout function, and add more batches and when I got a >30% accuracy. I think I can agree with that. Why didn't I try to run 1 and 2 with more batches, I just didn't. There wasn't any reason.
from keras.layers import Conv2D, MaxPooling2D, GlobalAveragePooling2D
from keras.layers import Dropout, Flatten, Dense, Activation
from keras.models import Sequential
from keras.layers.normalization import BatchNormalization
# Define the model type as sequential
model = Sequential()
# Add a normalizer to help Normalizining the data in each mini-batch
model.add(BatchNormalization(input_shape=(224, 224, 3)))
# We add a 2D convolutional to process the input image. Layer detect major features
model.add(Conv2D(filters=16, kernel_size=3, kernel_initializer='he_normal', activation='relu'))
# Add a 2D pooling layer and specify the size of the pool helps with invariance and reduces data dimensionality
model.add(MaxPooling2D(pool_size=2))
# Add a normalizer to help Normalizining the data in each mini-batch
model.add(BatchNormalization())
# We add a 2D convolutional to process the input image. Layer detect more features
model.add(Conv2D(filters=32, kernel_size=3, kernel_initializer='he_normal', activation='relu'))
model.add(MaxPooling2D(pool_size=2))
# Add a normalizer to help Normalizining the data in each mini-batch
model.add(BatchNormalization())
# We add a 2D convolutional to process the input image. Layer detect more features
model.add(Conv2D(filters=64, kernel_size=3, kernel_initializer='he_normal', activation='relu'))
# Add a 2D pooling layer and specify the size of the pool helps with invariance and reduces data dimensionality
model.add(MaxPooling2D(pool_size=2))
# Add a normalizer to help Normalizining the data in each mini-batch
model.add(BatchNormalization())
# We add a 2D convolutional to process the input image. Layer detect more features
model.add(Conv2D(filters=128, kernel_size=3, kernel_initializer='he_normal', activation='relu'))
# Add a 2D pooling layer and specify the size of the pool helps with invariance and reduces data dimensionality
model.add(MaxPooling2D(pool_size=2))
# Add a normalizer to help Normalizining the data in each mini-batch
model.add(BatchNormalization())
# We add a 2D convolutional to process the input image. Layer detect more features
model.add(Conv2D(filters=256, kernel_size=3, kernel_initializer='he_normal', activation='relu'))
# Add a 2D pooling layer and specify the size of the pool helps with invariance and reduces data dimensionality
model.add(MaxPooling2D(pool_size=2))
# Add a normalizer to help Normalizining the data in each mini-batch
model.add(BatchNormalization())
# Take the average of each feature and feed it to the Softmax activation function
model.add(GlobalAveragePooling2D())
# Add a Dense with a units(output space) and a softmax activation function
model.add(Dense(133, activation='softmax'))
model.summary()
model.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['accuracy'])
Train your model in the code cell below. Use model checkpointing to save the model that attains the best validation loss.
You are welcome to augment the training data, but this is not a requirement.
from keras.callbacks import ModelCheckpoint
### TODO: specify the number of epochs that you would like to use to train the model.
epochs = 20
### Do NOT modify the code below this line.
checkpointer = ModelCheckpoint(filepath='saved_models/weights.best.from_scratch.hdf5',
verbose=1, save_best_only=True)
model.fit(train_tensors, train_targets,
validation_data=(valid_tensors, valid_targets),
epochs=epochs, batch_size=20, callbacks=[checkpointer], verbose=1)
model.load_weights('saved_models/weights.best.from_scratch.hdf5')
Try out your model on the test dataset of dog images. Ensure that your test accuracy is greater than 1%.
# get index of predicted dog breed for each image in test set
dog_breed_predictions = [np.argmax(model.predict(np.expand_dims(tensor, axis=0))) for tensor in test_tensors]
# report test accuracy
test_accuracy = 100*np.sum(np.array(dog_breed_predictions)==np.argmax(test_targets, axis=1))/len(dog_breed_predictions)
print('Test accuracy: %.4f%%' % test_accuracy)
bottleneck_features = np.load('bottleneck_features/DogVGG16Data.npz')
train_VGG16 = bottleneck_features['train']
valid_VGG16 = bottleneck_features['valid']
test_VGG16 = bottleneck_features['test']
The model uses the the pre-trained VGG-16 model as a fixed feature extractor, where the last convolutional output of VGG-16 is fed as input to our model. We only add a global average pooling layer and a fully connected layer, where the latter contains one node for each dog category and is equipped with a softmax.
VGG16_model = Sequential()
VGG16_model.add(GlobalAveragePooling2D(input_shape=train_VGG16.shape[1:]))
VGG16_model.add(Dense(133, activation='softmax'))
VGG16_model.summary()
VGG16_model.compile(loss='categorical_crossentropy', optimizer='rmsprop', metrics=['accuracy'])
checkpointer = ModelCheckpoint(filepath='saved_models/weights.best.VGG16.hdf5',
verbose=1, save_best_only=True)
VGG16_model.fit(train_VGG16, train_targets,
validation_data=(valid_VGG16, valid_targets),
epochs=20, batch_size=20, callbacks=[checkpointer], verbose=1)
VGG16_model.load_weights('saved_models/weights.best.VGG16.hdf5')
Now, we can use the CNN to test how well it identifies breed within our test dataset of dog images. We print the test accuracy below.
# get index of predicted dog breed for each image in test set
VGG16_predictions = [np.argmax(VGG16_model.predict(np.expand_dims(feature, axis=0))) for feature in test_VGG16]
# report test accuracy
test_accuracy = 100*np.sum(np.array(VGG16_predictions)==np.argmax(test_targets, axis=1))/len(VGG16_predictions)
print('Test accuracy: %.4f%%' % test_accuracy)
from extract_bottleneck_features import *
def VGG16_predict_breed(img_path):
# extract bottleneck features
bottleneck_feature = extract_VGG16(path_to_tensor(img_path))
# obtain predicted vector
predicted_vector = VGG16_model.predict(bottleneck_feature)
# return dog breed that is predicted by the model
return dog_names[np.argmax(predicted_vector)]
You will now use transfer learning to create a CNN that can identify dog breed from images. Your CNN must attain at least 60% accuracy on the test set.
In Step 4, we used transfer learning to create a CNN using VGG-16 bottleneck features. In this section, you must use the bottleneck features from a different pre-trained model. To make things easier for you, we have pre-computed the features for all of the networks that are currently available in Keras:
The files are encoded as such:
Dog{network}Data.npz
where {network}
, in the above filename, can be one of VGG19
, Resnet50
, InceptionV3
, or Xception
. Pick one of the above architectures, download the corresponding bottleneck features, and store the downloaded file in the bottleneck_features/
folder in the repository.
In the code block below, extract the bottleneck features corresponding to the train, test, and validation sets by running the following:
bottleneck_features = np.load('bottleneck_features/Dog{network}Data.npz')
train_{network} = bottleneck_features['train']
valid_{network} = bottleneck_features['valid']
test_{network} = bottleneck_features['test']
### TODO: Obtain bottleneck features from another pre-trained CNN.
bottleneck_features = np.load('bottleneck_features/DogResnet50Data.npz')
train_resnet = bottleneck_features['train']
valid_resnet = bottleneck_features['valid']
test_resnet = bottleneck_features['test']
Create a CNN to classify dog breed. At the end of your code cell block, summarize the layers of your model by executing the line:
<your model's name>.summary()
Question 5: Outline the steps you took to get to your final CNN architecture and your reasoning at each step. Describe why you think the architecture is suitable for the current problem.
Answer:
Here I create a CNN to classify dog breeds similar to before, but this time I am using a pre-trained network. The pre-trained model itself does most of the heavy-lifting.
### TODO: Define your architecture.
resnet_model = Sequential()
resnet_model.add(GlobalAveragePooling2D(input_shape=train_resnet.shape[1:]))
resnet_model.add(Dense(133, activation='softmax'))
resnet_model.summary()
### TODO: Compile the model. 1. rmsprop 2. adam 3. Adagrad
### Eve
resnet_model.compile(loss='categorical_crossentropy', optimizer='rmsprop', metrics=['accuracy'])
Train your model in the code cell below. Use model checkpointing to save the model that attains the best validation loss.
You are welcome to augment the training data, but this is not a requirement.
### TODO: Train the model.
checkpointer = ModelCheckpoint(filepath='saved_models/weights.best.DogResnet.hdf5',
verbose=1, save_best_only=True)
resnet_model.fit(train_VGG19, train_targets,
validation_data=(valid_resnet, valid_targets),
epochs=20, batch_size=20, callbacks=[checkpointer], verbose=1)
### TODO: Load the model weights with the best validation loss.
resnet_model.load_weights('saved_models/weights.best.DogResnet.hdf5')
Try out your model on the test dataset of dog images. Ensure that your test accuracy is greater than 60%.
### TODO: Calculate classification accuracy on the test dataset.
resnet_predictions = [np.argmax(resnet_model.predict(np.expand_dims(feature, axis=0))) for feature in test_resnet]
test_accuracy = 100*np.sum(np.array(resnet_predictions)==np.argmax(test_targets, axis=1))/len(resnet_predictions)
print('Test accuracy: %.4f%%' % test_accuracy)
Re-Training Model to check if accuracy improves
VGG19_model.fit(train_VGG19, train_targets,
validation_data=(valid_VGG19, valid_targets),
epochs=20, batch_size=20, callbacks=[checkpointer], verbose=1)
VGG19_model.fit(train_VGG19, train_targets,
validation_data=(valid_VGG19, valid_targets),
epochs=20, batch_size=20, callbacks=[checkpointer], verbose=1)
VGG19_model.fit(train_VGG19, train_targets,
validation_data=(valid_VGG19, valid_targets),
epochs=20, batch_size=20, callbacks=[checkpointer], verbose=1)
VGG19_model.load_weights('saved_models/weights.best.VGG19.hdf5')
VGG19_predictions = [np.argmax(VGG19_model.predict(np.expand_dims(feature, axis=0))) for feature in test_VGG19]
test_accuracy = 100*np.sum(np.array(VGG19_predictions)==np.argmax(test_targets, axis=1))/len(VGG19_predictions)
print('Test accuracy: %.4f%%' % test_accuracy)
My decision for choosing the VGG-19 bottleneck features wasn't something I pondered about. I just picked it, and decide to go with it and make sure to train it enough to get a 60% accuracy. At first it was, but later on it was becoming really troublesome amd somtimes get stuck in 59% so, I had to change to Resnet.
Performance, I believe the performance improves in relative to the accuracy. In my initial test, I didn't read the documentation very well and decided to just run through the implementation(using it for prediction) and it wasn't really accurate expecially when predicting the name of dogs.
Optimizers:
I tried to use adam for optimization and I need to train my model longer to get a good value and most times get stuck between 42 and 45%
I tried Adagrad and experienced the same thing stuck at 48%
rmsprop has been the only one to give me good result.
Note: Most of the comment above were about utilizing VGG19 Model.
The advantage of Resnet is that it solves the vanishing gradient problem while keeping an excellent performance. This allows to have a deeper neural network. They have many other advantages which allow good results.
Write a function that takes an image path as input and returns the dog breed (Affenpinscher
, Afghan_hound
, etc) that is predicted by your model.
Similar to the analogous function in Step 5, your function should have three steps:
dog_names
array defined in Step 0 of this notebook to return the corresponding breed.The functions to extract the bottleneck features can be found in extract_bottleneck_features.py
, and they have been imported in an earlier code cell. To obtain the bottleneck features corresponding to your chosen CNN architecture, you need to use the function
extract_{network}
where {network}
, in the above filename, should be one of VGG19
, Resnet50
, InceptionV3
, or Xception
.
### TODO: Write a function that takes a path to an image as input
### and returns the dog breed that is predicted by the model.
from extract_bottleneck_features import *
def resnet_predict_breed(img_path):
# extract bottleneck features
bottleneck_feature = extract_Resnet50(path_to_tensor(img_path))
# obtain predicted vector
predicted_vector = resnet_model.predict(bottleneck_feature)
# return dog breed that is predicted by the model
dog_breed = dog_names[np.argmax(predicted_vector)]
# image = cv2.imread(img_path)
# cv_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
# plot = plt.imshow(cv_rgb)
if dog_detector(img_path) == True:
return dog_breed
else:
return dog_breed
resnet_predict_breed('images/doghumanimages/dog2.jpeg')
Write an algorithm that accepts a file path to an image and first determines whether the image contains a human, dog, or neither. Then,
You are welcome to write your own functions for detecting humans and dogs in images, but feel free to use the face_detector
and dog_detector
functions developed above. You are required to use your CNN from Step 5 to predict dog breed.
Some sample output for our algorithm is provided below, but feel free to design your own user experience!
### TODO: Write your algorithm.
### Feel free to use as many code cells as needed.
def human_detector(imagepath):
img = cv2.imread(imagepath)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
humanfaces = face_cascade.detectMultiScale(gray)
return len(humanfaces) > 0
def dog_detector(imagepath):
prediction = ResNet50_predict_labels(imagepath)
return ((prediction <= 268) & (prediction >= 151))
def main_detector(imagepath):
isDog = dog_detector(imagepath)
isHuman = human_detector(imagepath)
if isDog:
print("Dog Face Detected")
dog_breed = resnet_predict_breed(imagepath)
img = cv2.imread(imagepath)
cv_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
plot = plt.imshow(cv_rgb)
print('The breed of the dog is ', dog_breed)
else:
if isHuman:
print("Human Face detected")
face = resnet_predict_breed(imagepath)
img = cv2.imread(imagepath)
cv_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
plot = plt.imshow(cv_rgb)
print('If the person were to be a dog, the dog would be a ', face)
else:
print("Neither Human nor Dog face was detected")
img = cv2.imread(imagepath)
cv_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
plot = plt.imshow(cv_rgb)
In this section, you will take your new algorithm for a spin! What kind of dog does the algorithm think that you look like? If you have a dog, does it predict your dog's breed accurately? If you have a cat, does it mistakenly think that your cat is a dog?
Test your algorithm at least six images on your computer. Feel free to use any images you like. Use at least two human and two dog images.
Question 6: Is the output better than you expected :) ? Or worse :( ? Provide at least three possible points of improvement for your algorithm.
Answer:
Yes. I think my output is better than I expected. And, I think the Algorithm flow is fine though.
## TODO: Execute your algorithm from Step 6 on
## at least 6 images on your computer.
## Feel free to use as many code cells as needed.
main_detector('images/doghumanimages/dog3.jpeg')
main_detector('images/doghumanimages/ted2image.jpg')
main_detector('images/doghumanimages/human4.jpeg')
main_detector('images/doghumanimages/human5.jpeg')
main_detector('images/doghumanimages/dog5.jpeg')
main_detector('images/doghumanimages/ted2.jpeg')
main_detector('images/doghumanimages/nohumannodog.jpg')
main_detector('images/sample_human_output.png')


Since the 1970s, trashing has been a great tradition to celebrate the end of exams for Oxford students. However, this can have a dangerous impact on animal life and the environment.
EcoTrash sources eco-friendly trashing equipment and delivers it to you! In a composite bag, you will receive our trash pack; biodegradable confetti, coloured powder (made from 99% corn starch), party hats and shaving foam. We also include white sashes designed to have personalised messages for your friends.

Celebrate your exams the EcoTrash way! #EcoTrash
Includes biodegradable confetti (14g), coloured powder (made from 99% cornstarch), a paper party hat, shaving foam (250ml), a white sash for you to personalise!
includes biodegradable confetti (14g), a party hat and shaving foam!
Close ProductPersonalise yourself and write a funny message for your friend to wear - you can be creative!
Close ProductClassic blue, red, purple, pink or yellow party hats - write on the order if you want a particular colour and we will try
Close Product


Back to Home Page
Guess The Number
We have Selected a Number between 1 and 100
Lets see If you can guess it....
Pick the Number:
Submit My Guess


First, the background: I'm a frequent bud smoker whith a long and generally pleasant history of Ecstacy, opium and mushroom use. I've tried a few of the speedier drugs out there only on rare occasion, but am not a habitual, or even occasional user of most of these (speed, coke, meth etc.). When my firends need an experienced tripper or sitter they call me, so when my 2 closest friends (lets call 'em Jane and John) called and said lets test out 2C-i I jumped at the chance. Now to the important stuff...
Trip one:
We prefer to trip at night, and as we were warned there would be a great sensitivity to light we waited until almost 10 PM on a Friday night (so we'd have longer to recover before work on monday). We range in weight from 130 to 250 lbs between the three of us, but were told to all try the same dose. We took 40 mg each in gel caps and waited. Onset was a long wait...almost 2 hours.
It began soon after we put in a DVD of a comedian we'd been dying to see. I've never laughed so hard in my life. Before visuals ever started a euphoria began to spread through me that I could see mirrored on the faces around me. Granted, the comedian is generally hysterical, but we litterally FELL OVER laughing. I fell off the couch...twice. Jane fell over laughing in the middle of the room. We had to pause and take a break several times. When it was over we went out for a cigarette, and upon opening the appartment door rushed to find sunglasses for the bright hall lights. The walls had begun to breathe while we were distracted by the show. The lavender hallway (typical apartment hall) looked like the magical narrowing hallway in Willy Wonka and the Chocolate factory (the original).
We went only up after that. With a speedy feeling reminiscent of speedy MDMA tabs, John and I took a walk, our favorite high past time. Everything seemed to have a rime of frost on it, trees moved like seaweed underwater, and the moon breathed and seemed to scuttle around. Lawns seemed to roll subtly like the incoming tide and if I focused too long on a group of stars they seemed to swirl like a nebulus. Pebbled pavement suddenly seemed to have been carefully laid out with rhyme and reason, the paterns complex and moving. I described it as the most ornamental ironwrok pattern I've ever seen. John called it lace like, and we spent a great deal of time silent, just watching things.
Back at the apartment, we settled in on the couch in the dark to watch movies. The best were digital animation- bright colors, simple lines and exotic landscapes. In the bathroom, I tried to look in the mirror, but my reflection collapsed into my nose, collidascope like over and over again, though I could recognize the shape ofmy eyes in the moving pattern, or my lips. Happy to be an experienced tripper who wasn't flipping out at this, I simply washed my hands and watched...for a long time.
Things kept up much like this for about 5 1/2 hours before we came down, not abruptly, but rather quickly (1/2 hour comedown). We were starving, and ate ravenously of french fries, fruit, cheese and apple juice, before sleeping for a solid and restful 8 hours.
Looking back: We could talk and think easier on 2C-i than MDMA, but speech paths were definately limited during the highest point. While I'll still used MDMA, I'll probably use it much less often than before in favor of this new substance. The after affects were general relaxation and 24 hours mildly slowed reaction time. Sensitivity to light for 24 hours. On subsequent trips we've mixed sub-cubensis mushrooms with it to great afftect.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Tuning Calculator discover your sound
Choose Your Drum Sizes:
| 18" | 16" | 14" | 13" | 12" | 10" | 8" |
|---|---|---|---|---|---|---|
Choose Your Resonance:
Pitch Adjustment:
Choose Head Tuning Style:
Choose Your Drum Sizes:
| 18" | 16" | 14" | 13" | 12" | 10" | 8" |
|---|---|---|---|---|---|---|
Choose Your Resonance:
Pitch Adjustment:
Choose Head Tuning Style:


Congratulations! You Won!
It took you
0
moves and
00:00
to complete. You have
0
stars!
Play Again
Memory Matching Game
0
Moves
Time:
00
:
00