(a) The court, in an action at law, if neither party requires a jury, or if the defendant has failed to appear and the plaintiff does not require a jury, shall ascertain the amount the plaintiff is entitled to recover in the action, if any, and render judgment accordingly. In any case, in which a trial by jury would be otherwise proper, the parties or their counsel, by consent entered of record, may waive the right to have a jury, and thereupon the whole matter of law and fact shall be heard and determined, and judgment given by the court. Absent such waiver, in any civil trial a jury shall consist of six members and in any criminal trial a jury shall consist of twelve members.
(b) The provisions of this section do not apply to any proceeding had pursuant to article two, chapter fifty-four of this code, the provisions of which apply to all cases involving the taking of property for a public use.