Panicle counts (PC) provide valuable information about yield prediction in sorghum but are expensive and time-consuming to acquire via traditional manual approaches. In this thesis, high-resolution RGB imagery acquired by UAVs has been used. The proposed method based on task-aware spatial disentanglement (TSD) has been modified to improve the performance of panicle detection. TSDPC has high accuracy in comparison to state-of-the-art techniques such as CenterNet and RepPoints.