CW 16 (13th April – 19th April) Final Post… Establishing Communication Channel and Integrating the Components

The prototype of the system is now complete and the Final Delivery Documentation is written, therefore this is the last blog post.

This week the communication between client and the server has been established and all the building blocks have been integrated into a complete system.

  • The index model has been loaded into the Django server when it starts, to enable the search for IDs of similar images.
  • The mongoDB is now automatically searched for images with returned IDs from the index model.
  • The tags are extracted from the images and are analysed. The frequency of their occurrences are obtained.
  • A word cloud image is generated on the server with the extracted tags. The code is creating a unique name every time the image is generated. Currently, the word cloud images are stored on the server but ideally, it should be deleted when the session ends, or generated on the client side in real deployed system.
  • The communication channel built between the client and server enables the result to be sent back to the client
  • The client generates the pie chart and histogram and displays the result to the user.

The three design patterns used during the development of this prototype are:

  1. Model View Controller (MVC) described in CW 12.
  2. Singleton Pattern which ensures the uniqueness of the instance in the class and provides a global access to that instance. The ModelContainer.java in Model package is a singleton class to ensure data consistency and easy access.
  3. Observer and Observable is used to notify the controller (observer) of any changes in the data hold in the model (observable).

During the development of the web server, many errors have been encountered. Some of them were simple to fix, and some needed a deeper analysis. Few examples are described below.

  • ASCII Error

Some of the tags extracted from the similar images to the query image, were not in ASCII format. The word cloud could not be generated because of this. To solve the problem, these should have been decoded, but because of the time limitation, statements to ignore the characters have been written.

  • KeyError

The error shown in Figure 1, was caused because of the inconsistent name for feature values. In JSON data, the name of the feature value has been defined as ‘featureValue’ and on the server as ‘feature’.

Figure 1: Snapshot of the Key Error

Figure 1: Snapshot of the Key Error

  • Value Error

The value error as shown in Figure 2, occurred because JSON sends data as a string from the client to the server and it needs to be converted into a number. The occurrence of the squared bracket caused the problem. It had to be removed to allow the conversion to the number.

Figure 2: Snapshot of the Value Error

Figure 2: Snapshot of the Value Error

  • Argument Error

Wrong parameter has been passed to the load index function. Instead of the feature dimension, which is required, a variable ‘f’ has been passed, which has previously been defined as a file holder. The snapshot of the argument error is shown in Figure 3 below.

Figure 3: Snapshot of Argument Error

Figure 3: Snapshot of Argument Error

 

In addition to the completion of the system development, work on the Final Delivery Documentation has been continued. The rest of the sections had been written and submitted for review to my supervisor.

The document will be corrected according to my supervisor’s suggestions and submitted on the 25th April as .pdf and in the printed version.

This project has been very challenging and the experience and knowledge gained is invaluable.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: