Recently, a smart pharmacy that employ robotics for delivering medical recipe to the patients is invested widely. Hence, building an automation system that controlled by robotics requires robust technologies that rely on regressions and detections mostly. Literature and related works has invoked drugs detection by support vector machine and other deep learning algorithm to extract and detect the desired object. They demonstrated real time application, where these theories do not perform positively in a limited resource. Ably, the proposed work introduces transfer learning to build a model that detect pills and drugs. transfer learning is one of these technologies that achieved high accuracy in the area of detection and classification. and since, robotics and selling systems in pharmacies are deemed as a real time application. Hence, YOLOv5s operates a new launched technology based on transfer learning supported with frozen layers to identify the pills effectively. Applying frozen layer in retrained model rely on freezing the backbone layers in YOLO. Thus the necessity to retrain the detector was terminated. Our study reveals that integrated YOLO with transfer learning led to high efficiency in the limited resources and reduced time consuming.