Accurate detection and counting of tomato fruits during crop growth are important for crop monitoring, yield estimation, harvesting management, and the development of automated harvesting systems in greenhouse agriculture. However, variations in fruit size, color, illumination, leaf occlusion, and complex backgrounds make reliable fruit detection challenging under practical greenhouse conditions. Therefore, this study evaluated a Mask R-CNN-based deep learning approach for tomato fruit detection, instance segmentation, and counting. A dataset comprising 120 RGB greenhouse images containing approximately 1,000 annotated tomato fruits was prepared using images acquired with an Intel RealSense camera under practical growing conditions. Only RGB images were used for model training and evaluation, while depth information was not utilized. The dataset was divided into training and testing subsets for model development and performance evaluation. Mask R-CNN was employed to detect individual tomato fruits and generate pixel-level segmentation masks for each detected fruit. Model performance was evaluated using precision, recall, F1-score, and intersection-over-union (IoU). At an IoU threshold of 0.50, the model achieved a precision of 0.85, recall of 0.90, and F1-score of 0.87. The results demonstrate the potential of Mask R-CNN for detecting and counting tomato fruits under variable illumination, occlusion, and complex greenhouse backgrounds. The proposed approach can support automated crop monitoring, yield estimation, and future robotic harvesting applications in precision greenhouse agriculture.