In the present scenario like COVID-19 pandemic, to maintain physical distance, the gait-based biometric is a must. Human gait identification is a very difficult process, but it is a suitable distance biometric that also gives good results at low resolution conditions even with face features that are not clear. This study describes the construction of a smart carpet that measures ground response force (GRF) and spatio-temporal gait parameters (STGP) using a polymer optical fiber sensor (POFS). The suggested carpet contains two light detection units for acquiring signals. Each unit obtains response from 10 nearby sensors. There are 20 intensity deviation sensors on a fiber. Light-emitting diodes (LED) are triggered successively, using the multiplexing approach that is being employed. Multiplexing is dependent on coupling among the LED and POFS sections. Results of walking experiments performed on the smart carpet suggested that certain parameters, including step length, stride length, cadence, and stance time, might be used to estimate the GRF and STGP. The results enable the detection of gait, including the swing phase, stance, stance length, and double supporting periods. The suggested carpet is dependable, reasonably priced equipment for gait acquisition in a variety of applications. Using the sensor data, gait recognition is performed using genetic algorithm (GA) and particle swarm optimization (PSO) technique. GA- and PSO-based gait template analyses are performed to extract the features with respect to the gait signals obtained from polymer optical gait sensors (POGS). The techniques used for classification of the obtained signals are random forest (RF) and support vector machine (SVM). The accuracy, sensitivity, and specificity results are obtained using SVM classifier and RF classifier. The results obtained using both classifiers are compared.