— —

This post is written for documentation purpose. It covers the following topics of matplotlib:

  • how to plot time series?
  • how to add legend?
  • how to add title?
  • how to add labels?
  • how to add label ticks?
  • how to rotate labels?
  • how to set the font size of labels?
  • how to save plot to an image.

See code: http://compassinbabel.org/post/e77f6371-b39b-469d-820a-61e65cd2a0c2

Here is an example of the usage of this function:

Flask is a light web framework written in Python. It’s easy to learn and use and it’s a perfect tool to build website prototypes. For example: in this website
most of the content is static and with the help of Jinja library, it only takes a couple of lines to generate the table. The website does need to store the thumbs-up and thumbs-down data but for a prototype it’s not a big deal and we don’t really need a database.

My blog: https://compassinbabel.org/post/1e251080-889b-4fc8-a2fa-2458ea6fdce7

Models such as VGG-16 have huge number of parameters and it is not practical to train those models on a home computer. However, it’s a known fact that using pre-trained model can help improve the performance. A natural idea is to reduce a large pre-trained model to a reasonable size so that it becomes possible to train it on an ordinary computer.

In Fully-adaptive Feature Sharing in Multi-Task Networks with Applications in Person Attribute Classification, the authors proposed a method to build a thin network from a pre-trained network model.

First, we can have a unified way…

My Blog: http://compassinbabel.org/post/90269433-4c45-4446-ad2c-259a1c0739e6

Transfer Learning

The objective of transfer learning is to transfer the learning experience from one domain to another and it usually involve at least two tasks. The task the allow us to get learn experience is called source task and the task that we want to apply the learned experience to is called target task.

A learning task consists of four components:

  • Feature space: This is the input data.
  • Marginal distribution: This is the distribution of the input data.
  • Label space: This is the label data.
  • Prediction Distribution: This is essentially the modeling part. …

— —


This post explains the usage of is_authenticated in the Flask-login User model.

The explanation of is_authenticated in the official Flask-login documentation is confusing. It gives an impression that it indicates if a user is authenticated/validated/logged in. Following this direction, a natural question is when a user is logged in or logged out, should we set is_authenticated dynamically and do we need a database to save the value?

In the following section, we try to clarify the notion a little bit.

Reformulate the question

Let’s ask the question in a different way. If is_authenticated is always set to true when a user…

Disclaim: This post is a collection of information found online.

My blog: https://compassinbabel.org/post/eaad2a73-b282-464f-84de-36b73caba5e3


A Bean can be injected by the following methods:

  • Injecting by type: If there’s only one bean instance available to be injected to the injection target point then it will injected successfully by type.
  • Injecting by name: If there are more than on instance of the same type available for a target injection point then there’s a conflict (ambiguity). Spring doesn’t known which particular instance to be injected in that case. If the name of parameter is same as bean provider method (the factory method) name…

— —

Text version of this post can be found here.


In this post, we briefly describe some classic geometric transformation in image processing. Most of the content in this post comes from the lecture notes listed in the Related Reading section. The following topics are covered in this post:

  • Homogeneous Coordinates
  • Matrix Representation of 2D Geometric Transformation
  • Image Geometry and Perspective Transformation
  • Image Transformation
  • Opencv Code Example

Before presenting the topics, we have a quick note on the topic of “projective transformations vs perspective transformation”. Quoted from Projective Transformation:

A transformation that maps lines to lines (but does not…

— —

Text version of this post.


This post is a brief summary of three algorithms for object detection and segmentation:

  1. Fast R-CNN
  2. Faster R-CNN
  3. Mast R-CNN

All of them are region based algorithm. The following concepts are involved in the discussion and paper

  • Location proposals
  • Region of interest (ROI)
  • ROI pooling
  • Quantification
  • Bounding box adjustment
  • Multitask training

Related Reading

Fast R-CNN

The input of the fast R-CNN are

  • Image
  • Location proposals

In Fast R-CNN, the location proposals are calculated using traditional computer vision technique Selective…


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store