Coffee is one of the most valuable agricultural products worldwide, and it is crucial to have efficient tools to obtain reliable information about production. This study aims to estimate coffee plantation production using segmentation and deep learning techniques in RGB images. Photographs of coffee plants were taken in Tabaconas, San Ignacio-Cajamarca, to create a dataset of crops during the harvest stage. The images were segmented to detect coffee fruits. A deep learning method was developed with YOLOv5 to detect the fruits and OpenCV to count them. The results showed that YOLOv5 achieved an accuracy of 97.25%, a recall of 95.77%, and an F1-Score of 96.37%, demonstrating high reliability in detecting coffee fruits. The average detection time per image was 17.9 seconds. The metrics were evaluated using a confusion matrix, highlighting the model's good performance. In conclusion, segmentation and deep learning techniques, along with counting algorithms developed with OpenCV, proved effective for estimating coffee production. This approach provides a valuable tool for farmers, improving crop management and facilitating decision-making in precision agriculture.